/* =============================================
   LAOSS CLINICAL TRACKER — STYLES
   Claude dark mode palette + LAOSS branding
   ============================================= */

:root {
  /* ── Claude dark mode palette ── */
  --bg-base:      #1a1a1a;   /* deepest background */
  --bg-elevated:  #222222;   /* sidebar, cards on dark */
  --bg-surface:   #2a2a2a;   /* table headers, section dividers */
  --bg-hover:     #333333;   /* nav hover, row hover */
  --border:       #3d3d3d;   /* subtle dividers */
  --border-light: #484848;   /* slightly more visible */

  /* Text hierarchy */
  --text-primary:  #ececec;
  --text-secondary:#a0a0a0;
  --text-muted:    #6e6e6e;
  --text-dim:      #4a4a4a;

  /* LAOSS accent — warm orange */
  --accent:       #cf6428;
  --accent-light: #e07540;
  --accent-dim:   rgba(207, 100, 40, 0.15);
  --accent-glow:  rgba(207, 100, 40, 0.08);

  /* Semantic colors */
  --c-blue:   #4a9eff;
  --c-purple: #a78bfa;
  --c-green:  #34d399;
  --c-red:    #f87171;
  --c-amber:  #fbbf24;
  --c-teal:   #2dd4bf;

  /* Tinted surfaces */
  --blue-dim:   rgba(74,158,255,0.1);
  --purple-dim: rgba(167,139,250,0.1);
  --green-dim:  rgba(52,211,153,0.1);
  --red-dim:    rgba(248,113,113,0.1);
  --amber-dim:  rgba(251,191,36,0.1);
  --teal-dim:   rgba(45,212,191,0.1);

  /* Layout */
  --sidebar-w: 210px;
  --radius:    8px;
  --radius-sm: 6px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow:    0 2px 8px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ══════════════════════════════════════════
   AUTH GATE
═══════════════════════════════════════════ */
.auth-gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
}

.auth-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  text-align: center;
  max-width: 380px;
  width: 90%;
  box-shadow: var(--shadow-lg);
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px; height: 52px;
  background: var(--accent);
  border-radius: 12px;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  letter-spacing: -0.5px;
}
.logo-mark.sm { width: 32px; height: 32px; border-radius: 8px; font-size: 0.75rem; }

.auth-logo { margin-bottom: 1.5rem; }

.auth-card h1 {
  font-family: 'Syne', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.auth-card p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.btn-login {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
}

/* ══════════════════════════════════════════
   MODULE SELECTOR
═══════════════════════════════════════════ */
.module-selector {
  min-height: 100vh;
  background: var(--bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
}

.module-selector-inner {
  width: 100%;
  max-width: 700px;
  padding: 2rem 1.5rem;
}

.module-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.module-logo-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.module-org {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  color: var(--text-primary);
}

.module-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.module-user-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.module-user-name {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.module-logout {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.module-logout:hover { color: var(--c-red); }

.module-hero { margin-bottom: 2rem; }

.module-greeting {
  font-family: 'Syne', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.module-prompt {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.module-cards {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.module-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  width: 100%;
}

.module-card:hover {
  border-color: var(--accent);
  background: var(--bg-surface);
  transform: translateY(-1px);
}

.module-card-icon {
  width: 64px; height: 64px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.injection-icon { background: var(--accent-dim); color: var(--accent-light); }
.forms-icon { background: var(--blue-dim); color: var(--c-blue); }

.module-card-body { flex: 1; }

.module-card-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.module-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 0.75rem;
}

.module-card-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.ftag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.module-card-arrow { color: var(--text-muted); flex-shrink: 0; transition: transform 0.15s; }
.module-card:hover .module-card-arrow { transform: translateX(3px); color: var(--accent); }

/* ══════════════════════════════════════════
   APP SHELL
═══════════════════════════════════════════ */
#app { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.25s ease;
}

.sidebar-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-home-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: none;
  border: none;
  cursor: pointer;
  width: 100%;
  padding: 0.3rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.sidebar-home-btn:hover { background: var(--bg-hover); }

.sidebar-logo-text { text-align: left; }

.logo-name {
  display: block;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1;
}

.sidebar-module-label {
  display: block;
  font-size: 0.65rem;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 1px;
}

.sidebar-nav {
  padding: 0.85rem 0.65rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 0.5rem;
  margin-bottom: 0.4rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.12s ease;
}

.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }

.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent-light);
}
.nav-item.active svg { stroke: var(--accent-light); }

.sidebar-footer {
  padding: 0.85rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-info { display: flex; align-items: center; gap: 0.55rem; flex: 1; min-width: 0; }

.user-avatar {
  width: 30px; height: 30px;
  background: var(--accent);
  border-radius: 50%;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.7rem;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-details { min-width: 0; }
.user-name { font-size: 0.78rem; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.68rem; color: var(--text-muted); }

.logout-btn { color: var(--text-dim); text-decoration: none; padding: 0.3rem; border-radius: 4px; transition: color 0.15s; flex-shrink: 0; }
.logout-btn:hover { color: var(--c-red); }

/* ── Main ── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ── */
.topbar {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: 0 1.25rem;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  flex: 1;
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0.25rem;
}

/* ══════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  text-decoration: none;
}
.btn-primary:hover { background: var(--accent-light); }
.btn-primary:active { transform: scale(0.98); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-ghost:hover { border-color: var(--text-secondary); color: var(--text-primary); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.85rem;
  font-size: 0.83rem;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
}
.icon-btn:hover { border-color: var(--text-secondary); color: var(--text-primary); }

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.82rem;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  padding: 0;
  transition: color 0.15s;
}
.link-btn:hover { color: var(--accent-light); }

/* ══════════════════════════════════════════
   VIEWS
═══════════════════════════════════════════ */
.view-container { padding: 1.5rem; flex: 1; }

.view { display: none; }
.view.active { display: block; animation: fadeIn 0.18s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.view-header { margin-bottom: 1.5rem; }

.view-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.view-subtitle { color: var(--text-muted); font-size: 0.82rem; margin-top: 0.2rem; }

/* ══════════════════════════════════════════
   STAT CARDS
═══════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
}
.stat-card:hover { border-color: var(--border-light); transform: translateY(-1px); }

.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.c-orange { background: var(--accent-dim);   color: var(--accent-light); }
.c-blue   { background: var(--blue-dim);     color: var(--c-blue); }
.c-purple { background: var(--purple-dim);   color: var(--c-purple); }
.c-green  { background: var(--green-dim);    color: var(--c-green); }
.c-red    { background: var(--red-dim);      color: var(--c-red); }
.c-amber  { background: var(--amber-dim);    color: var(--c-amber); }

.stat-number {
  font-family: 'Syne', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.stat-label { font-size: 0.77rem; color: var(--text-muted); margin-top: 0.2rem; }

/* ══════════════════════════════════════════
   SECTION HEADERS
═══════════════════════════════════════════ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.section-title {
  font-family: 'Syne', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.overdue-dot {
  width: 7px; height: 7px;
  background: var(--c-red);
  border-radius: 50%;
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ══════════════════════════════════════════
   CARD LIST (dashboard rows)
═══════════════════════════════════════════ */
.card-list { display: flex; flex-direction: column; gap: 0.4rem; }

.case-row {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.case-row:hover { border-color: var(--border-light); background: var(--bg-surface); }
.case-row.overdue { border-left: 3px solid var(--c-red); }

.case-row-name { font-weight: 500; font-size: 0.875rem; flex: 1; color: var(--text-primary); }
.case-row-office { font-size: 0.77rem; color: var(--text-muted); min-width: 90px; }
.case-row-meta { font-size: 0.77rem; color: var(--text-muted); }

/* Form type pill in list */
.form-type-pill {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════
   FORM TYPE BREAKDOWN
═══════════════════════════════════════════ */
.form-type-breakdown {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.type-breakdown-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 110px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.type-breakdown-card:hover { border-color: var(--border-light); }

.tbc-count { font-family: 'Syne', sans-serif; font-size: 1.4rem; font-weight: 800; color: var(--text-primary); }
.tbc-label { font-size: 0.75rem; color: var(--text-muted); }

/* ══════════════════════════════════════════
   FILTER BAR
═══════════════════════════════════════════ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.search-wrap { position: relative; flex: 1; min-width: 180px; }
.search-wrap svg { position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }

.search-input {
  width: 100%;
  padding: 0.55rem 0.75rem 0.55rem 2.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  background: var(--bg-elevated);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s;
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--text-muted); }

.filter-selects { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

.filter-select {
  padding: 0.5rem 2rem 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.83rem;
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236e6e6e' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
  transition: border-color 0.15s;
}
.filter-select:focus { border-color: var(--accent); }
.filter-select option { background: var(--bg-elevated); }

/* ══════════════════════════════════════════
   TABLES
═══════════════════════════════════════════ */
.table-wrap {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.data-table { width: 100%; border-collapse: collapse; }

.data-table thead { background: var(--bg-surface); border-bottom: 1px solid var(--border); }

.data-table th {
  padding: 0.7rem 0.9rem;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.data-table th:hover { color: var(--text-secondary); }
.sort-icon { opacity: 0.35; }

.data-table td {
  padding: 0.8rem 0.9rem;
  font-size: 0.855rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { cursor: pointer; transition: background 0.1s; }
.data-table tbody tr:hover { background: var(--bg-hover); }
.data-table tbody tr.overdue-row { background: rgba(248,113,113,0.05); }
.data-table tbody tr.overdue-row:hover { background: rgba(248,113,113,0.1); }

.patient-name { font-weight: 500; }
.chart-num { color: var(--text-muted); font-size: 0.78rem; }

.loading-row { text-align: center; color: var(--text-muted); font-size: 0.85rem; padding: 2.5rem; }

/* ══════════════════════════════════════════
   STATUS BADGES
═══════════════════════════════════════════ */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.status-badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}

/* Injection statuses */
.badge-ordered       { background: rgba(110,110,110,0.15); color: #a0a0a0; }
.badge-auth-sub      { background: var(--blue-dim);         color: var(--c-blue); }
.badge-auth-app      { background: var(--purple-dim);       color: var(--c-purple); }
.badge-pharmacy      { background: var(--amber-dim);        color: var(--c-amber); }
.badge-received      { background: var(--teal-dim);         color: var(--c-teal); }
.badge-schedule      { background: var(--green-dim);        color: var(--c-green); }
.badge-completed     { background: rgba(110,110,110,0.15); color: #6e6e6e; }
.badge-cancelled     { background: var(--red-dim);          color: var(--c-red); }

/* Form statuses */
.badge-form-received { background: var(--blue-dim);         color: var(--c-blue); }
.badge-in-progress   { background: var(--amber-dim);        color: var(--c-amber); }
.badge-completed-f   { background: var(--green-dim);        color: var(--c-green); }
.badge-delivered     { background: var(--teal-dim);         color: var(--c-teal); }
.badge-cancelled-f   { background: var(--red-dim);          color: var(--c-red); }

/* Form types */
.ftype-edd    { background: var(--blue-dim);   color: var(--c-blue); }
.ftype-fmla   { background: var(--purple-dim); color: var(--c-purple); }
.ftype-wc     { background: var(--amber-dim);  color: var(--c-amber); }
.ftype-rtw    { background: var(--green-dim);  color: var(--c-green); }
.ftype-other  { background: rgba(110,110,110,0.15); color: #a0a0a0; }

/* Days badge */
.days-badge { display: inline-block; padding: 0.18rem 0.5rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; }
.days-normal { background: rgba(110,110,110,0.15); color: #a0a0a0; }
.days-warn   { background: var(--amber-dim);       color: var(--c-amber); }
.days-overdue{ background: var(--red-dim);         color: var(--c-red); }

/* ══════════════════════════════════════════
   ACTION BUTTONS
═══════════════════════════════════════════ */
.action-btns { display: flex; gap: 0.35rem; }

.action-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.28rem 0.5rem;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.72rem;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 0.28rem;
  font-family: 'DM Sans', sans-serif;
}
.action-btn:hover { border-color: var(--accent); color: var(--accent-light); }

/* ══════════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-state svg { margin-bottom: 0.65rem; opacity: 0.3; }
.empty-state p { font-size: 0.875rem; }

/* ══════════════════════════════════════════
   PHARMACY GRID
═══════════════════════════════════════════ */
.pharmacy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.85rem;
}

.pharmacy-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.pharmacy-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.pharmacy-name { font-weight: 600; font-size: 0.88rem; color: var(--text-primary); }

.pharmacy-cat { font-size: 0.68rem; font-weight: 700; padding: 0.18rem 0.5rem; border-radius: 999px; }
.cat-good  { background: var(--green-dim);  color: var(--c-green); }
.cat-dnu   { background: var(--red-dim);    color: var(--c-red); }
.cat-bill  { background: var(--blue-dim);   color: var(--c-blue); }

.pharmacy-notes { font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; }

/* ══════════════════════════════════════════
   MODAL
═══════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(3px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.15s ease;
}

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.18s ease;
}

.modal-wide { max-width: 740px; }

@keyframes slideUp {
  from { transform: translateY(10px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.25rem;
  border-radius: 4px;
  transition: color 0.15s;
}
.modal-close:hover { color: var(--text-primary); }

.modal-body { overflow-y: auto; padding: 1.4rem; flex: 1; }

/* ══════════════════════════════════════════
   FORM
═══════════════════════════════════════════ */
.form-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 1.2rem 0 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}
.form-section-label:first-child { margin-top: 0; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

.form-row.three-col { grid-template-columns: 1fr 1fr 1fr; }

.form-group { display: flex; flex-direction: column; gap: 0.3rem; }
.form-group.full-width { grid-column: 1 / -1; margin-bottom: 0.65rem; }

.form-group label { font-size: 0.78rem; font-weight: 500; color: var(--text-secondary); }
.req { color: var(--accent); }

.form-group input,
.form-group select,
.form-group textarea {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  color: var(--text-primary);
  background: var(--bg-base);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.form-group select option { background: var(--bg-elevated); }
.form-group input.invalid,
.form-group select.invalid { border-color: var(--c-red); }
.form-group textarea { resize: vertical; min-height: 68px; }

/* Payment input with prefix */
.input-prefix-wrap { position: relative; }
.input-prefix {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}
input.has-prefix { padding-left: 1.6rem; }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ══════════════════════════════════════════
   HISTORY
═══════════════════════════════════════════ */
.history-list { display: flex; flex-direction: column; gap: 0.45rem; }

.history-item { display: flex; gap: 0.65rem; font-size: 0.78rem; align-items: flex-start; }
.history-dot { width: 7px; height: 7px; background: var(--accent); border-radius: 50%; margin-top: 0.25rem; flex-shrink: 0; }
.history-text { color: var(--text-primary); }
.history-time { color: var(--text-muted); }

/* ══════════════════════════════════════════
   TOAST
═══════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 999;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.2s ease;
}

.toast.success { background: rgba(52,211,153,0.15); border-color: var(--c-green); color: var(--c-green); }
.toast.error   { background: var(--red-dim);         border-color: var(--c-red);   color: var(--c-red); }

/* ══════════════════════════════════════════
   DELETE BUTTON & ADMIN ELEMENTS
═══════════════════════════════════════════ */
.btn-delete {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(248,113,113,0.1);
  color: var(--c-red);
  border: 1px solid rgba(248,113,113,0.2);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-delete:hover { background: rgba(248,113,113,0.2); border-color: var(--c-red); }

.admin-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--accent-light, var(--accent));
  text-decoration: none;
  padding: 0.32rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent-dim);
  margin-bottom: 0.5rem;
  transition: all 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.admin-sidebar-link:hover { background: var(--accent-dim); }

.admin-icon { background: rgba(248,113,113,0.1); color: var(--c-red); }
.module-card-admin { border-color: rgba(248,113,113,0.15); }
.module-card-admin:hover { border-color: var(--c-red); }

/* ══════════════════════════════════════════
   UTILITIES
═══════════════════════════════════════════ */

/* ── LAOSS Logo images ── */
.auth-logo-img {
  width: 200px;
  height: auto;
  display: block;
  margin: 0 auto;
  mix-blend-mode: screen;
  border-radius: 4px;
}

.header-logo-img {
  height: 40px;
  width: auto;
  object-fit: contain;
  mix-blend-mode: screen;
}

.sidebar-logo-img {
  height: 28px;
  width: auto;
  object-fit: contain;
  mix-blend-mode: screen;
}


/* ── Searchable combobox ── */
.combobox {
  position: relative;
  width: 100%;
}

.combobox-input {
  width: 100%;
  background: var(--bg-input, #2a2a2a);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.combobox-input:focus {
  border-color: var(--accent);
}

.combobox-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-elevated, #2a2a2a);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 1000;
  max-height: 220px;
  overflow-y: auto;
  display: none;
}

.combobox-dropdown.open {
  display: block;
}

.combobox-option {
  padding: 0.55rem 0.85rem;
  font-size: 0.875rem;
  cursor: pointer;
  color: var(--text);
  border-radius: 4px;
  margin: 2px 4px;
  transition: background 0.1s;
}

.combobox-option:hover,
.combobox-option.active {
  background: var(--accent);
  color: #fff;
}

.combobox-option.no-match {
  color: var(--text-muted, #888);
  cursor: default;
  font-style: italic;
}

.combobox-option.no-match:hover {
  background: transparent;
  color: var(--text-muted, #888);
}


/* ── GLOBAL SEARCH IN TOPBAR ── */
.topbar-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.35rem 0.85rem;
  flex: 1;
  max-width: 320px;
  color: var(--text-muted);
}

.topbar-search-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.85rem;
  width: 100%;
  font-family: inherit;
}

.topbar-search-input::placeholder { color: var(--text-muted); }

/* ── BATCH ACTION BAR ── */
.batch-bar { background: rgba(207,100,40,0.12); }
.batch-bar td { padding: 0.6rem 1rem !important; }
.batch-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
#batch-count {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
}
.btn-batch-complete, .btn-batch-cancel, .btn-batch-clear {
  border: none;
  border-radius: 6px;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}
.btn-batch-complete { background: rgba(52,211,153,0.2); color: var(--c-green); border: 1px solid rgba(52,211,153,0.35); }
.btn-batch-cancel   { background: rgba(248,113,113,0.15); color: var(--c-red); border: 1px solid rgba(248,113,113,0.3); }
.btn-batch-clear    { background: var(--bg-elevated); color: var(--text-muted); border: 1px solid var(--border); }
.btn-batch-complete:hover { opacity: 0.85; }
.btn-batch-cancel:hover   { opacity: 0.85; }
.btn-batch-clear:hover    { color: var(--text); }

/* Row selection */
.row-selected { background: rgba(207,100,40,0.07) !important; }
.row-check { cursor: pointer; accent-color: var(--accent); width: 15px; height: 15px; }
#select-all-forms { cursor: pointer; accent-color: var(--accent); }

/* ── EXPORT GROUP ── */
.export-group { display: flex; gap: 0.4rem; }

/* ── OFFICE BREAKDOWN ── */
.office-breakdown-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0.75rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
  min-width: 100px;
}
.office-breakdown-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.obc-count { font-size: 1.5rem; font-weight: 800; color: var(--text); font-family: var(--font-display, sans-serif); }
.obc-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.15rem; }
.obc-overdue { font-size: 0.7rem; color: var(--c-red); margin-top: 0.25rem; font-weight: 600; }

/* ── QUICK COMPLETE BUTTON ── */
.quick-complete-btn {
  font-size: 0.75rem !important;
  padding: 0.25rem 0.6rem !important;
}

/* ── NOTIFICATION / TOAST ENHANCEMENTS ── */
.toast.toast-info { background: rgba(74,158,255,0.15); border-color: rgba(74,158,255,0.3); color: var(--c-blue); }
.toast.toast-warning { background: rgba(251,191,36,0.15); border-color: rgba(251,191,36,0.3); color: var(--amber, #fbbf24); }

.hidden { display: none !important; }

/* ══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .form-row, .form-row.three-col { grid-template-columns: 1fr; }
  .data-table th:nth-child(4), .data-table td:nth-child(4),
  .data-table th:nth-child(5), .data-table td:nth-child(5) { display: none; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .view-container { padding: 1rem; }
  .module-greeting { font-size: 1.5rem; }
}
