/* XMCDok — Custom Styles */
:root {
  --primary:       #1d6fa4;
  --primary-dark:  #165a87;
  --primary-light: #e8f4fd;
  --success:       #22c55e;
  --warning:       #f59e0b;
  --danger:        #ef4444;
  --sidebar-w:     240px;
  --topbar-h:      56px;
}

* { box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; font-size: .875rem; }

/* ---- SIDEBAR ---- */
#sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: linear-gradient(180deg, #1a5f8a 0%, #0e3d5c 100%);
  color: #fff;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1000;
  transition: transform .25s ease;
  overflow-y: auto;
}
#sidebar.collapsed { transform: translateX(calc(-1 * var(--sidebar-w))); }

.sidebar-brand {
  color: #fff;
  text-decoration: none;
  padding: 1rem 1.25rem;
  font-size: 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,.15);
}
.sidebar-brand:hover { color: #fff; }

.sidebar-section {
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: rgba(255,255,255,.4);
  padding: .75rem 1.25rem .25rem;
  text-transform: uppercase;
}

#sidebar .nav-link {
  color: rgba(255,255,255,.8);
  padding: .45rem 1.25rem;
  border-radius: 0 2rem 2rem 0;
  margin-right: .75rem;
  transition: background .15s, color .15s;
  font-size: .84rem;
}
#sidebar .nav-link:hover {
  background: rgba(255,255,255,.12);
  color: #fff;
}
#sidebar .nav-link.active {
  background: rgba(255,255,255,.22);
  color: #fff;
  font-weight: 600;
}

.sidebar-footer { border-top: 1px solid rgba(255,255,255,.1); }

/* ---- MAIN CONTENT ---- */
#main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  transition: margin .25s ease;
}
#main-content.expanded { margin-left: 0; }

.topbar { height: var(--topbar-h); position: sticky; top: 0; z-index: 900; }
.content-area { min-height: calc(100vh - var(--topbar-h)); }

/* ---- CARDS ---- */
.card { border: none; box-shadow: 0 1px 4px rgba(0,0,0,.08); border-radius: .75rem; }
.card-header { background: transparent; border-bottom: 1px solid rgba(0,0,0,.06); font-weight: 600; }

/* ---- STAT CARDS ---- */
.stat-card { border-radius: .75rem; color: #fff; padding: 1.25rem; }
.stat-card .stat-icon { font-size: 2rem; opacity: .7; }
.stat-card .stat-value { font-size: 2rem; font-weight: 700; }
.stat-card .stat-label { font-size: .8rem; opacity: .85; }

/* ---- QUEUE BADGE ---- */
.queue-number {
  width: 2.5rem; height: 2.5rem;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .95rem;
  flex-shrink: 0;
}

/* ---- STATUS BADGES ---- */
.badge-waiting      { background: #fef3c7; color: #92400e; }
.badge-in_progress  { background: #dbeafe; color: #1e40af; }
.badge-done         { background: #dcfce7; color: #166534; }
.badge-cancelled    { background: #fee2e2; color: #991b1b; }
.badge-paid         { background: #dcfce7; color: #166534; }
.badge-pending      { background: #fef3c7; color: #92400e; }

/* ---- VITAL SIGNS GRID ---- */
.vital-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .75rem; }
.vital-item {
  background: var(--primary-light);
  border-radius: .5rem;
  padding: .75rem;
  text-align: center;
}
.vital-item .vital-val { font-size: 1.3rem; font-weight: 700; color: var(--primary); }
.vital-item .vital-lbl { font-size: .7rem; color: #6b7280; }

/* ---- PRESCRIPTION TABLE ---- */
.rx-row { background: #f9fafb; border-radius: .5rem; padding: .75rem; margin-bottom: .5rem; }

/* ---- ICD SEARCH ---- */
#icdResults, #medResults {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid #dee2e6;
  border-radius: .375rem;
  background: #fff;
  z-index: 100;
}
#icdResults .list-group-item, #medResults .list-group-item {
  cursor: pointer;
  font-size: .83rem;
}
#icdResults .list-group-item:hover, #medResults .list-group-item:hover {
  background: var(--primary-light);
}

/* ---- PRINT ---- */
@media print {
  #sidebar, .topbar, .no-print { display: none !important; }
  #main-content { margin-left: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #dee2e6 !important; }
}

/* ---- MISC ---- */
.table th { font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.form-label { font-weight: 500; font-size: .83rem; }
.section-title { font-size: 1rem; font-weight: 700; color: var(--primary); margin-bottom: 1rem; }
.page-title { font-size: 1.4rem; font-weight: 700; }

/* SOAP form */
.soap-label {
  font-size: .75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--primary);
  margin-bottom: .25rem;
}

/* Login page */
.login-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, #1a5f8a 0%, #0e3d5c 100%);
  display: flex; align-items: center; justify-content: center;
}
.login-card { border-radius: 1rem; max-width: 420px; width: 100%; }

/* Patient timeline */
.timeline-item { border-left: 3px solid var(--primary); padding: .75rem 1rem; margin-left: 1rem; position: relative; margin-bottom: 1rem; }
.timeline-item::before {
  content: ''; position: absolute; left: -8px; top: 1rem;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--primary);
}
