/* ============================================================
   BIS — Bolnički Informacioni Sistem — Glavni CSS
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:       #1a5f8a;
  --primary-light: #e8f4fd;
  --primary-dark:  #0d3d5c;
  --primary-hover: #1570a3;
  --success:       #1e7e4e;
  --success-light: #e8f5ee;
  --warning:       #b05e00;
  --warning-light: #fff3e0;
  --danger:        #c0392b;
  --danger-light:  #fdecea;
  --info:          #1565a0;
  --info-light:    #e3f2fd;
  --purple:        #6b21a8;
  --bg:            #f0f4f8;
  --surface:       #ffffff;
  --surface2:      #f8fafc;
  --border:        #dde3ea;
  --border2:       #c5ced8;
  --text:          #1a2332;
  --text2:         #4a5568;
  --text3:         #718096;
  --sidebar-w:     224px;
  --header-h:      56px;
  --radius:        8px;
  --radius-lg:     12px;
  --shadow:        0 1px 3px rgba(0,0,0,.08),0 1px 2px rgba(0,0,0,.05);
  --shadow-md:     0 4px 12px rgba(0,0,0,.12);
  --transition:    .15s ease;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px; line-height: 1.5;
  background: var(--bg); color: var(--text);
  overflow: hidden; height: 100vh;
}

/* ================================================================
   LOGIN
================================================================ */
#login-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #0d3d5c 0%, #1a5f8a 60%, #1570a3 100%);
}
.login-card {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 40px; width: 420px; max-width: 95vw;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo i { font-size: 48px; color: var(--primary); display: block; margin-bottom: 8px; }
.login-logo h1 { font-size: 24px; font-weight: 700; color: var(--text); }
.login-logo p  { font-size: 13px; color: var(--text3); margin-top: 2px; }

/* ================================================================
   LAYOUT
================================================================ */
#app { display: flex; height: 100vh; overflow: hidden; }

/* -- Sidebar -- */
#sidebar {
  width: var(--sidebar-w);
  background: var(--primary-dark);
  display: flex; flex-direction: column; flex-shrink: 0;
  overflow-y: auto; overflow-x: hidden;
  transition: width var(--transition);
}
#sidebar.collapsed { width: 60px; }
#sidebar.collapsed .nav-section,
#sidebar.collapsed .nav-item > span,
#sidebar.collapsed .logo-title,
#sidebar.collapsed .logo-sub,
#sidebar.collapsed #sb-name,
#sidebar.collapsed #sb-role { display: none; }
#sidebar.collapsed .nav-item { justify-content: center; padding: 10px; }

.logo {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
}
.logo i { color: #5bc8f5; font-size: 22px; flex-shrink: 0; }
.logo-title { font-size: 14px; font-weight: 700; color: #fff; }
.logo-sub   { font-size: 11px; color: rgba(255,255,255,.5); }

.nav-section {
  font-size: 10px; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase; color: rgba(255,255,255,.35);
  padding: 14px 16px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 14px; cursor: pointer;
  color: rgba(255,255,255,.7); font-size: 13px; font-weight: 500;
  border-radius: 6px; margin: 1px 8px;
  transition: all var(--transition); white-space: nowrap;
}
.nav-item:hover  { background: rgba(255,255,255,.1); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-item i { font-size: 17px; flex-shrink: 0; }

.sidebar-footer {
  margin-top: auto; padding: 12px 12px;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; gap: 8px;
}
.user-info { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.user-avatar {
  width: 32px; height: 32px; background: var(--primary);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0;
}

/* -- Header -- */
#main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
#header {
  height: var(--header-h); background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px; padding: 0 16px;
  flex-shrink: 0; box-shadow: var(--shadow);
}
.btn-icon-only {
  background: none; border: none; cursor: pointer;
  padding: 6px; border-radius: var(--radius); color: var(--text2);
  display: flex; align-items: center; font-size: 18px;
  transition: background var(--transition);
}
.btn-icon-only:hover { background: var(--surface2); }

.header-search { position: relative; flex: 1; max-width: 380px; }
.header-search i {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--text3); font-size: 16px; pointer-events: none;
}
.header-search input {
  width: 100%; padding: 7px 10px 7px 34px;
  border: 1px solid var(--border); border-radius: 20px;
  font-size: 13px; background: var(--surface2); color: var(--text);
  transition: border-color var(--transition);
}
.header-search input:focus { outline: none; border-color: var(--primary); background: var(--surface); }

.search-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  z-index: 1000; display: none; max-height: 320px; overflow-y: auto;
}
.search-dropdown.open { display: block; }
.search-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; cursor: pointer; font-size: 13px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.search-item:hover { background: var(--primary-light); }
.search-item:last-child { border-bottom: none; }

.user-avatar-sm {
  width: 32px; height: 32px; background: var(--primary);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; cursor: pointer;
}

.notif-badge {
  position: absolute; top: 2px; right: 2px;
  background: var(--danger); color: #fff;
  font-size: 9px; font-weight: 700; border-radius: 9px;
  padding: 1px 4px; min-width: 16px; text-align: center;
}

/* -- Content area -- */
#content {
  flex: 1; overflow-y: auto; padding: 20px;
}
#flash-area { position: relative; z-index: 100; }

/* ================================================================
   COMPONENTS
================================================================ */

/* -- Card -- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.card-header h3 { font-size: 14px; font-weight: 600; flex: 1; }
.card-body { padding: 16px; }
.card-body.p0 { padding: 0; }
.mb12 { margin-bottom: 12px; }
.mt8  { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; }
.m12  { margin: 12px; }

/* -- Section header -- */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 12px;
}
.section-header h2 { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }

/* -- Buttons -- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); transition: all var(--transition);
  text-decoration: none; white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--surface2); border-color: var(--border2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover:not(:disabled) { filter: brightness(1.1); }
.btn-danger  { background: var(--danger);  color: #fff; border-color: var(--danger); }
.btn-danger:hover:not(:disabled)  { filter: brightness(1.1); }
.btn-warning { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-warning:hover:not(:disabled) { filter: brightness(1.1); }

/* -- Badges -- */
.badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 12px;
  font-size: 11px; font-weight: 600; letter-spacing: .2px;
  white-space: nowrap;
}
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger  { background: var(--danger-light);  color: var(--danger); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-info    { background: var(--info-light);    color: var(--info); }
.badge-neutral { background: var(--surface2);      color: var(--text3); border: 1px solid var(--border); }
.badge-purple  { background: #f3e8ff; color: var(--purple); }

/* -- Flash messages -- */
.flash {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: var(--radius);
  font-size: 13px; margin-bottom: 8px;
  animation: slideIn .2s ease;
  box-shadow: var(--shadow-md);
}
.flash-success { background: var(--success-light); color: var(--success); border: 1px solid #a7d9b5; }
.flash-danger  { background: var(--danger-light);  color: var(--danger);  border: 1px solid #f5aba3; }
.flash-info    { background: var(--info-light);    color: var(--info);    border: 1px solid #9dc8f0; }
.flash-warning { background: var(--warning-light); color: var(--warning); border: 1px solid #f5ca8a; }
@keyframes slideIn { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:none; } }

/* -- Alerts -- */
.alert {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 14px; border-radius: var(--radius);
  font-size: 13px; margin-bottom: 12px;
}
.alert-danger  { background: var(--danger-light);  color: var(--danger);  border: 1px solid #f5aba3; }
.alert-info    { background: var(--info-light);    color: var(--info);    border: 1px solid #9dc8f0; }
.alert-warning { background: var(--warning-light); color: var(--warning); border: 1px solid #f5ca8a; }

/* -- Forms -- */
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--text2); }
.form-control {
  padding: 7px 10px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 13px;
  color: var(--text); background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
.form-control:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,95,138,.12);
}
.form-control::placeholder { color: var(--text3); }
.form-control.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(220,53,69,.12); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }
.form-hint { font-size: 11px; color: var(--text3); margin-top: 2px; }
.form-section {
  font-size: 11px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; color: var(--primary);
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: 5px; margin-bottom: 12px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

/* -- Tables -- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead { background: var(--surface2); }
th {
  padding: 9px 14px; text-align: left;
  font-size: 11px; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
td {
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  font-size: 13px; vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--primary-light); transition: background .1s; }
td.actions { white-space: nowrap; display: flex; gap: 4px; align-items: center; }

/* -- Stats grid -- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px; margin-bottom: 20px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: 10px;
}
.stat-icon.blue   { background: var(--info-light);    color: var(--info); }
.stat-icon.green  { background: var(--success-light); color: var(--success); }
.stat-icon.orange { background: var(--warning-light); color: var(--warning); }
.stat-icon.red    { background: var(--danger-light);  color: var(--danger); }
.stat-icon.purple { background: #f3e8ff; color: var(--purple); }
.stat-label { font-size: 11px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .4px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text); line-height: 1.2; }
.stat-sub   { font-size: 11px; color: var(--text3); margin-top: 4px; }

/* -- Modal -- */
#modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.45); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
#modal-box {
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  max-height: 90vh; overflow-y: auto;
  width: 640px; max-width: 100%;
  animation: modalIn .2s ease;
}
@keyframes modalIn { from { opacity:0; transform:translateY(16px) scale(.97); } to { opacity:1; transform:none; } }
.modal-header {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  background: var(--surface2); position: sticky; top: 0; z-index: 1;
}
.modal-header h3 { font-size: 15px; font-weight: 700; flex: 1; }
.modal-body { padding: 20px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 20px; border-top: 1px solid var(--border);
  background: var(--surface2); position: sticky; bottom: 0;
}

/* -- Tabs -- */
.tabs {
  display: flex; gap: 2px; border-bottom: 2px solid var(--border);
  margin-bottom: 16px; overflow-x: auto;
}
.tab-btn {
  padding: 8px 16px; font-size: 13px; font-weight: 500;
  background: none; border: none; cursor: pointer; color: var(--text3);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all var(--transition); white-space: nowrap;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* -- Loading & Empty -- */
.loading, .empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 48px 16px;
  color: var(--text3); gap: 10px;
}
.loading i, .empty-state i { font-size: 32px; opacity: .4; }
.loading i { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state p { font-size: 13px; text-align: center; }

/* -- Pagination -- */
.pagination { display: flex; align-items: center; gap: 4px; justify-content: flex-end; padding: 12px 16px; border-top: 1px solid var(--border); }

/* -- Grid layouts -- */
.two-col   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.three-col { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .three-col { grid-template-columns: repeat(2,1fr); } }

/* -- Info rows (detail view) -- */
.info-row {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 6px 0; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.info-row:last-child { border-bottom: none; }
.info-label { font-size: 11px; font-weight: 600; color: var(--text3); min-width: 120px; padding-top: 2px; }
.info-value { flex: 1; color: var(--text); }

/* -- Patient avatar -- */
.patient-avatar {
  width: 36px; height: 36px; background: var(--primary-light);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--primary); flex-shrink: 0;
}

/* -- Vital cards -- */
.vital-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px; text-align: center;
}
.vital-name  { font-size: 10px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .4px; }
.vital-val   { font-size: 22px; font-weight: 700; line-height: 1.2; margin: 3px 0; }
.vital-unit  { font-size: 10px; color: var(--text3); }
.vital-normal  { color: var(--success); }
.vital-warning { color: var(--warning); }
.vital-danger  { color: var(--danger); }

/* -- Progress bar -- */
.progress-bar  { background: var(--border); border-radius: 4px; height: 8px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 4px; transition: width .4s ease; }
.progress-fill.warning { background: var(--warning); }
.progress-fill.danger  { background: var(--danger); }

/* -- Bed cards (kreveti) -- */
.bed-card {
  padding: 12px; border-radius: var(--radius); border: 1px solid var(--border);
  cursor: pointer; transition: all var(--transition); min-height: 76px;
}
.bed-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.bed-free     { background: var(--success-light); border-color: #a7d9b5; }
.bed-occupied { background: var(--info-light);    border-color: #9dc8f0; }
.bed-cleaning { background: var(--warning-light); border-color: #f5ca8a; }
.bed-service  { background: var(--surface2);      border-color: var(--border2); }

/* ================================================================
   RADIOLOGIJA
================================================================ */

/* Prioritet highlight u worklist */
.rad-worklist-row.priority-hitan td      { border-left: 3px solid var(--warning); }
.rad-worklist-row.priority-hitan        { background: rgba(176,94,0,.03); }
.rad-worklist-row.priority-vrlo_hitan td { border-left: 3px solid var(--danger); }
.rad-worklist-row.priority-vrlo_hitan   { background: rgba(192,57,43,.05); animation: pulse 2s infinite; }
@keyframes pulse {
  0%, 100% { background: rgba(192,57,43,.05); }
  50%       { background: rgba(192,57,43,.10); }
}

/* DICOM viewer placeholder */
.dicom-viewer {
  background: #0a0a0a; color: #8af; border-radius: var(--radius);
  min-height: 220px; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-family: monospace; text-align: center; padding: 20px;
  border: 1px solid #333;
}

/* Image thumbnails */
.rad-image-thumb {
  width: 72px; height: 72px; background: #111;
  border-radius: var(--radius); display: flex; align-items: center;
  justify-content: center; cursor: pointer; border: 2px solid transparent;
  transition: border-color var(--transition); color: #8af; font-size: 24px;
}
.rad-image-thumb:hover { border-color: var(--primary); }

/* Nalaz form */
.rad-nalaz-form { font-size: 13px; }

/* ================================================================
   UTILITIES
================================================================ */
.fw600 { font-weight: 600; }
.gap8 { display: flex; align-items: center; gap: 8px; }
.text-danger  { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
code {
  font-family: 'Courier New', monospace; font-size: 12px;
  background: var(--surface2); padding: 1px 5px;
  border-radius: 4px; border: 1px solid var(--border); color: var(--primary-dark);
}
hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }

/* ================================================================
   MKB-10 autocomplete
================================================================ */
.mkb-dropdown {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 500;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  max-height: 280px; overflow-y: auto;
}
.mkb-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--border);
  transition: background var(--transition); font-size: 13px;
}
.mkb-item:last-child { border-bottom: none; }
.mkb-item:hover { background: var(--primary-light); }
.mkb-kod {
  font-family: 'Courier New', monospace; font-size: 12px; font-weight: 700;
  color: var(--primary); background: var(--primary-light);
  padding: 2px 6px; border-radius: 4px; min-width: 55px; text-align: center;
  flex-shrink: 0;
}
.mkb-naziv { color: var(--text2); flex: 1; }
/* ================================================================
   TOP NAVBAR (replaces sidebar)
================================================================ */

/* Reset old sidebar/app layout */
#app {
  display: flex !important;
  flex-direction: column !important;
  height: 100vh;
  overflow: hidden;
}

/* Remove old sidebar styles */
#sidebar { display: none !important; }
#main    { display: contents; }
#header  { display: none !important; }

/* Top navbar */
#topnav {
  height: 54px;
  background: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 16px;
  flex-shrink: 0;
  position: relative;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.topnav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  padding-right: 20px;
  border-right: 1px solid rgba(255,255,255,.15);
  margin-right: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}
.topnav-logo i { color: #5bc8f5; font-size: 20px; }

/* Nav groups */
.topnav-groups {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 2px;
}

.nav-group {
  position: relative;
}

.nav-group-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: none;
  border: none;
  color: rgba(255,255,255,.8);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: all .15s ease;
  white-space: nowrap;
}
.nav-group-btn:hover,
.nav-group.open .nav-group-btn {
  background: rgba(255,255,255,.12);
  color: #fff;
}
.nav-group.open .nav-group-btn .nav-chevron {
  transform: rotate(180deg);
}
.nav-chevron {
  font-size: 12px;
  transition: transform .2s ease;
}

/* Dropdown */
.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  z-index: 200;
  overflow: hidden;
  animation: dropDown .15s ease;
}
@keyframes dropDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}
.nav-group.open .nav-dropdown {
  display: block;
}

/* Nav items inside dropdown */
.nav-dropdown .nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  transition: background .1s ease;
  border-radius: 0;
  margin: 0;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.nav-dropdown .nav-item:last-child { border-bottom: none; }
.nav-dropdown .nav-item:hover { background: var(--primary-light); color: var(--primary); }
.nav-dropdown .nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.nav-dropdown .nav-item i { font-size: 16px; color: var(--text3); }
.nav-dropdown .nav-item.active i,
.nav-dropdown .nav-item:hover i { color: var(--primary); }

/* Right side */
.topnav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
}

.topnav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: var(--radius);
  border-left: 1px solid rgba(255,255,255,.15);
  padding-left: 12px;
}

/* Override header-search for dark topnav */
#topnav .header-search input {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.2);
  color: #fff;
  max-width: 260px;
}
#topnav .header-search input::placeholder { color: rgba(255,255,255,.5); }
#topnav .header-search input:focus {
  background: rgba(255,255,255,.15);
  border-color: rgba(255,255,255,.4);
  box-shadow: none;
}
#topnav .header-search i { color: rgba(255,255,255,.5); }

/* Page title bar */
#pagetitlebar {
  height: 40px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  flex-shrink: 0;
  box-shadow: var(--shadow);
}
#pagetitlebar #page-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* Content area */
#content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* Fix user avatar color in topnav */
#topnav .user-avatar-sm {
  background: rgba(255,255,255,.2);
  color: #fff;
}
#topnav #sb-name { color: #fff !important; }

/* ============================================================
   Notification Bell
   ============================================================ */
.notif-bell-wrap {
  position: relative;
}
.notif-bell-btn {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: #fff;
  font-size: 18px;
  position: relative;
  transition: background .15s;
}
.notif-bell-btn:hover { background: rgba(255,255,255,.2); }
.notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--primary);
  pointer-events: none;
}
.notif-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  overflow: hidden;
}
.notif-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 600;
}
.notif-item {
  display: flex; gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .1s;
}
.notif-item:hover { background: var(--surface2); }
.notif-item.unread { background: rgba(59,130,246,.05); }
.notif-item .notif-icon {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 15px;
}
.notif-icon-odmor    { background: #dbeafe; color: #2563eb; }
.notif-icon-uspjeh   { background: #dcfce7; color: #16a34a; }
.notif-icon-opasnost { background: #fee2e2; color: #dc2626; }
.notif-icon-info     { background: var(--surface2); color: var(--text3); }
.notif-item .notif-body { flex: 1; min-width: 0; }
.notif-item .notif-naslov { font-size: 12px; font-weight: 600; color: var(--text); }
.notif-item .notif-poruka { font-size: 11px; color: var(--text3); margin-top: 2px; line-height: 1.4; }
.notif-item .notif-time   { font-size: 10px; color: var(--text3); margin-top: 4px; }
.notif-empty { padding: 30px; text-align: center; color: var(--text3); font-size: 13px; }

/* Status badges for odmori */
.badge-odmor-ceka    { background: #fef3c7; color: #92400e; }
.badge-odmor-ok      { background: #dcfce7; color: #166534; }
.badge-odmor-odbijen { background: #fee2e2; color: #991b1b; }
