/* ============================================================
   Centar za odrzivi razvoj - Baza korisnika
   Boje: zelena #4BAD4F
   Font: Roboto Slab (Google Fonts)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@300;400;500;600;700&display=swap');

/* Reset i osnova */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Roboto Slab', Georgia, serif;
  font-size: 14px;
  line-height: 1.5;
  color: #1f2937;
  background: #f7faf7;
}
a { color: #4BAD4F; text-decoration: none; }
a:hover { text-decoration: underline; color: #3d9241; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Topbar */
.topbar {
  background: white;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 20px;
}
.logo { display: inline-flex; align-items: center; }
.logo-img { height: 28px; width: auto; display: block; }
.nav { display: flex; gap: 4px; flex: 1; margin-left: 24px; }
.nav a {
  padding: 8px 14px;
  color: #4b5563;
  border-radius: 6px;
  font-weight: 500;
}
.nav a:hover { background: #f0f7f0; color: #2e7c32; text-decoration: none; }
.nav a.active { background: #e8f5e9; color: #2e7c32; }
.user-menu { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.user-name { font-weight: 500; }
.user-role {
  background: #e8f5e9;
  color: #2e7c32;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  text-transform: capitalize;
  font-weight: 500;
}
.btn-logout {
  background: white;
  border: 1px solid #d1d5db;
  padding: 5px 12px;
  border-radius: 6px;
  color: #374151;
  font-family: inherit;
}
.btn-logout:hover { background: #f9fafb; text-decoration: none; }

/* Main */
.main { padding: 24px 20px 40px; }
h1 { font-size: 22px; font-weight: 600; margin: 0 0 20px; color: #111827; }
h2 { font-size: 16px; font-weight: 600; margin: 24px 0 12px; color: #1f2937; }
h3 { font-size: 14px; font-weight: 600; margin: 16px 0 8px; }

/* Toolbar (search + new) */
.toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.toolbar .grow { flex: 1; min-width: 200px; }

/* Stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.stat-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px 16px;
  transition: border-color 0.15s;
}
.stat-card:hover { border-color: #4BAD4F; }
.stat-label { font-size: 12px; color: #6b7280; margin: 0 0 4px; font-weight: 400; }
.stat-value { font-size: 22px; font-weight: 600; margin: 0; color: #111827; }
.stat-sub { font-size: 11px; color: #9ca3af; margin: 4px 0 0; }

/* Cards */
.card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}

/* Forme */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}
.form-grid .full { grid-column: 1 / -1; }
label.field {
  display: block;
  font-size: 12px;
  color: #374151;
  font-weight: 500;
  margin-bottom: 4px;
}
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: white;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #4BAD4F;
  box-shadow: 0 0 0 3px rgba(75, 173, 79, 0.15);
}
textarea { resize: vertical; min-height: 60px; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: white;
  color: #374151;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: #f9fafb; text-decoration: none; }
.btn-primary {
  background: #4BAD4F;
  color: white;
  border-color: #4BAD4F;
}
.btn-primary:hover { background: #3d9241; border-color: #3d9241; color: white; }
.btn-danger {
  background: white;
  color: #b91c1c;
  border-color: #fecaca;
}
.btn-danger:hover { background: #fef2f2; color: #991b1b; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* Tabele */
.data-table {
  width: 100%;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}
.data-table th {
  text-align: left;
  padding: 10px 14px;
  background: #f7faf7;
  border-bottom: 1px solid #e5e7eb;
  font-size: 12px;
  font-weight: 600;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: top;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr.clickable { cursor: pointer; }
.data-table tbody tr.clickable:hover { background: #f7faf7; }
.cell-main { font-weight: 500; }
.cell-sub { font-size: 12px; color: #6b7280; margin-top: 2px; }
.empty { text-align: center; padding: 40px 20px; color: #9ca3af; font-size: 14px; }

/* Pills */
.pill {
  display: inline-block;
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 10px;
  font-weight: 500;
}
.pill-novac { background: #e8f5e9; color: #2e7c32; }
.pill-roba { background: #e3f2fd; color: #1565c0; }
.pill-aktivan { background: #e8f5e9; color: #2e7c32; }
.pill-neaktivan { background: #f3f4f6; color: #6b7280; }
.pill-arhiviran { background: #fef3c7; color: #92400e; }

/* */
.profile-header {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 20px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 16px;
}
.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #e8f5e9;
  color: #2e7c32;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 18px;
  flex-shrink: 0;
}
.profile-meta h1 { margin: 0 0 4px; font-size: 20px; }
.profile-meta p { margin: 0; color: #6b7280; font-size: 13px; }

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
  padding: 16px 20px;
}
.profile-grid .label { font-size: 12px; color: #4BAD4F; text-transform: uppercase; font-weight: 600; letter-spacing: 0.05em; }
.profile-grid .value { font-size: 14px; color: #1f2937; }

.actions { display: flex; gap: 8px; margin: 16px 0; flex-wrap: wrap; }

/* Timeline */
.timeline { margin-top: 12px; }
.timeline-item {
  display: flex;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid #f3f4f6;
}
.timeline-item:last-child { border-bottom: none; }
.timeline-date {
  font-size: 12px;
  color: #6b7280;
  min-width: 90px;
  flex-shrink: 0;
  padding-top: 2px;
}
.timeline-body { flex: 1; min-width: 0; }
.timeline-row1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.timeline-desc { font-weight: 500; }
.timeline-sub { font-size: 12px; color: #6b7280; margin-top: 2px; }
.timeline-value {
  font-weight: 600;
  min-width: 120px;
  text-align: right;
  flex-shrink: 0;
  color: #2e7c32;
}

/* Login */
.login-wrap {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 32px;
  width: 100%;
  max-width: 380px;
  border-top: 4px solid #4BAD4F;
}
.login-card h1 { font-size: 18px; margin: 0 0 4px; }
.login-card .sub { color: #6b7280; font-size: 13px; margin: 0 0 24px; }
.login-card label.field { margin-top: 12px; }
.login-card .btn { width: 100%; margin-top: 16px; }

/* Flash */
.flash {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 13px;
}
.flash-success { background: #e8f5e9; color: #1b5e20; border: 1px solid #a5d6a7; }
.flash-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.flash-info { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }

/* Footer */
.footer {
  border-top: 1px solid #e5e7eb;
  padding: 20px;
  text-align: center;
  color: #9ca3af;
  font-size: 12px;
  margin-top: 40px;
}

/* Responsive */
@media (max-width: 768px) {
  .topbar-inner { flex-wrap: wrap; gap: 12px; }
  .nav { width: 100%; margin-left: 0; overflow-x: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .data-table { font-size: 13px; }
  .data-table th, .data-table td { padding: 8px 10px; }
}
