/* =========================================================
   CHS Student Services Portal — Stylesheet
   ========================================================= */

:root {
  --sidebar-w: 248px;
  --topbar-h: 60px;

  --primary:       #1e3a5f;
  --primary-dark:  #162c47;
  --primary-mid:   #234b78;
  --accent:        #2563eb;
  --accent-hover:  #1d4ed8;

  --bg-page:   #f1f5f9;
  --bg-card:   #ffffff;
  --bg-hover:  #f8fafc;
  --border:    #e2e8f0;
  --border-md: #cbd5e1;

  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.06);
  --shadow-sm: 0 1px 4px rgba(0,0,0,.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.12);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --urgency-low-bg:    #dcfce7; --urgency-low-text:    #166534;
  --urgency-med-bg:    #fef9c3; --urgency-med-text:    #854d0e;
  --urgency-high-bg:   #fee2e2; --urgency-high-text:   #991b1b;

  --status-open-bg:   #dcfce7; --status-open-text:   #166534;
  --status-closed-bg: #f1f5f9; --status-closed-text: #475569;

  --priority-high-bg:  #fee2e2; --priority-high-text:  #991b1b;
  --priority-gen-bg:   #dbeafe; --priority-gen-text:   #1e40af;
  --priority-info-bg:  #f1f5f9; --priority-info-text:  #475569;
}

/* =========================================================
   DARK MODE
   ========================================================= */
body.dark {
  --bg-page:   #0f172a;
  --bg-card:   #1e293b;
  --bg-hover:  #253347;
  --border:    #334155;
  --border-md: #475569;

  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.3);
  --shadow-sm: 0 1px 4px rgba(0,0,0,.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,.4);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.5);

  --urgency-low-bg:    #14532d; --urgency-low-text:    #86efac;
  --urgency-med-bg:    #451a03; --urgency-med-text:    #fcd34d;
  --urgency-high-bg:   #450a0a; --urgency-high-text:   #fca5a5;

  --status-open-bg:   #14532d; --status-open-text:   #86efac;
  --status-closed-bg: #1e293b; --status-closed-text: #94a3b8;

  --priority-high-bg:  #450a0a; --priority-high-text:  #fca5a5;
  --priority-gen-bg:   #1e3a5f; --priority-gen-text:   #93c5fd;
  --priority-info-bg:  #1e293b; --priority-info-text:  #94a3b8;
}

/* Dark mode overrides for specific elements */
body.dark .login-card          { background: #1e293b; }
body.dark .topbar              { background: #1e293b; border-color: #334155; }
body.dark .sidebar             { background: #0f172a; border-right: 1px solid #1e293b; }
body.dark .logo-badge          { background: #2563eb; }
body.dark .sidebar-quick-label { color: rgba(255,255,255,.25); }
body.dark .quick-btn           { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.08); }
body.dark .modal-box           { background: #1e293b; }
body.dark .modal-header,
body.dark .modal-footer        { border-color: #334155; }
body.dark .form-control        { background: #0f172a; border-color: #334155; color: #f1f5f9; }
body.dark .form-control:focus  { border-color: #2563eb; }
body.dark .select-filter       { background: #1e293b; border-color: #334155; color: #f1f5f9; }
body.dark .search-dropdown     { background: #1e293b; border-color: #334155; }
body.dark .search-dropdown-item:hover { background: #253347; }
body.dark .data-table th       { background: #253347; }
body.dark .data-table tbody tr:hover { background: #253347; }
body.dark .doc-tabs,
body.dark .comm-tabs           { background: #253347; border-color: #334155; }
body.dark .doc-tab,
body.dark .comm-tab            { color: #64748b; }
body.dark .doc-tab.active,
body.dark .comm-tab.active     { background: #1e293b; }
body.dark .drop-zone           { background: #253347; border-color: #475569; }
body.dark .drop-zone:hover,
body.dark .drop-zone.drag-over { background: #1e3a5f; border-color: #2563eb; }
body.dark .upload-mini         { background: #253347; border-color: #475569; }
body.dark .upload-mini:hover   { background: #1e3a5f; border-color: #2563eb; }
body.dark .messages-layout     { background: #1e293b; }
body.dark .msg-sidebar         { border-color: #334155; }
body.dark .msg-sidebar-header  { border-color: #334155; }
body.dark .msg-list-item:hover { background: #253347; }
body.dark .msg-list-item.active { background: #1e3a5f; }
body.dark .ref-notes-block     { background: #253347; }
body.dark .filter-tab.active   { background: #1e293b; }
body.dark .filter-tabs         { background: #253347; }
body.dark .urgency-opt         { background: #0f172a; border-color: #334155; color: #94a3b8; }
body.dark .toast               { background: #1e293b; border: 1px solid #334155; color: #f1f5f9; }
body.dark .toast-success       { background: #14532d; }
body.dark .toast-error         { background: #450a0a; }
body.dark .toast-info          { background: #1e3a5f; }
body.dark #login-screen        { background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #1e40af 100%); }

/* Dark mode toggle button */
.dark-toggle {
  width: 34px;
  height: 34px;
  border: none;
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background .12s, color .12s;
}
.dark-toggle:hover { background: var(--border); color: var(--text-primary); }
.dark-toggle svg   { width: 16px; height: 16px; }

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, 'Helvetica Neue', sans-serif; font-size: 14px; }
body { background: var(--bg-page); color: var(--text-primary); line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }
ul, ol { list-style: none; }
.hidden { display: none !important; }

/* =========================================================
   LOGIN
   ========================================================= */
#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3a5f 0%, #1e40af 50%, #0ea5e9 100%);
  padding: 24px;
}

.login-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 28px;
  color: white;
  font-weight: 800;
  letter-spacing: -1px;
}

.login-logo h1 { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.login-logo p  { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.login-card .form-group { margin-bottom: 16px; }
.login-card label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.login-card input,
.login-card select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: border-color .15s;
  background: white;
}
.login-card input:focus,
.login-card select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }

.btn-login {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  margin-top: 8px;
  transition: opacity .15s, transform .1s;
}
.btn-login:hover { opacity: .92; transform: translateY(-1px); }
.btn-login:active { transform: translateY(0); }

.login-hint { text-align: center; font-size: 12px; color: var(--text-muted); margin-top: 16px; }

/* =========================================================
   APP SHELL
   ========================================================= */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* =========================================================
   SIDEBAR
   ========================================================= */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--primary);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  transition: width .25s ease;
  position: relative;
  z-index: 100;
}

.sidebar-header {
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-badge {
  width: 38px;
  height: 38px;
  background: var(--accent);
  color: white;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .5px;
  flex-shrink: 0;
}

.logo-title { font-size: 13px; font-weight: 700; color: white; line-height: 1.2; }
.logo-sub   { font-size: 11px; color: rgba(255,255,255,.5); }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  color: rgba(255,255,255,.7);
  cursor: pointer;
  border-radius: 0;
  transition: background .12s, color .12s;
  position: relative;
  font-size: 13.5px;
  font-weight: 500;
  user-select: none;
}

.nav-item:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.95); }
.nav-item.active {
  background: rgba(255,255,255,.12);
  color: white;
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }

.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* Quick actions */
.sidebar-quick {
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}

.sidebar-quick-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .8px;
  color: rgba(255,255,255,.35);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.quick-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.8);
  font-size: 12.5px;
  font-weight: 500;
  margin-bottom: 6px;
  transition: background .12s, color .12s;
}
.quick-btn:last-child { margin-bottom: 0; }
.quick-btn:hover { background: rgba(255,255,255,.14); color: white; }
.quick-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Sidebar user */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.sidebar-user .user-name { font-size: 12.5px; font-weight: 600; color: white; line-height: 1.2; }
.sidebar-user .user-role { font-size: 11px; color: rgba(255,255,255,.5); }

.logout-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: rgba(255,255,255,.4);
  padding: 4px;
  border-radius: 4px;
  transition: color .12s, background .12s;
  flex-shrink: 0;
}
.logout-btn:hover { color: white; background: rgba(255,255,255,.1); }
.logout-btn svg { width: 16px; height: 16px; }

/* =========================================================
   MAIN CONTENT
   ========================================================= */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* Top bar */
.topbar {
  height: var(--topbar-h);
  background: white;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
  z-index: 50;
}

.topbar-left { display: flex; align-items: center; gap: 14px; flex: 1; }
.page-title  { font-size: 16px; font-weight: 700; color: var(--text-primary); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-date {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border: none;
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  position: relative;
  transition: background .12s;
}
.icon-btn:hover { background: var(--border); color: var(--text-primary); }
.icon-btn svg { width: 16px; height: 16px; }

.notif-dot {
  width: 7px;
  height: 7px;
  background: var(--urgency-high-text);
  border: 1.5px solid white;
  border-radius: 50%;
  position: absolute;
  top: 6px;
  right: 6px;
}

.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
  cursor: pointer;
}

/* Views container */
.views-wrap {
  flex: 1;
  overflow-y: auto;
  position: relative;
}

.views-wrap::-webkit-scrollbar { width: 6px; }
.views-wrap::-webkit-scrollbar-thumb { background: var(--border-md); border-radius: 3px; }

.view { display: none; padding: 24px; min-height: 100%; }
.view.active { display: block; }

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

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.card-title { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.card-body  { padding: 16px 20px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: none;
  transition: background .12s, opacity .12s, transform .08s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary { background: var(--bg-hover); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }

.btn-danger { background: #fee2e2; color: #991b1b; }
.btn-danger:hover { background: #fecaca; }

.btn-ghost { background: transparent; color: var(--text-secondary); padding: 6px 10px; }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 11px 22px; font-size: 14px; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-urgency-low    { background: var(--urgency-low-bg);  color: var(--urgency-low-text);  }
.badge-urgency-medium { background: var(--urgency-med-bg);  color: var(--urgency-med-text);  }
.badge-urgency-high   { background: var(--urgency-high-bg); color: var(--urgency-high-text); }

.badge-open   { background: var(--status-open-bg);   color: var(--status-open-text);   }
.badge-closed { background: var(--status-closed-bg); color: var(--status-closed-text); }

.badge-priority-high { background: var(--priority-high-bg); color: var(--priority-high-text); }
.badge-priority-gen  { background: var(--priority-gen-bg);  color: var(--priority-gen-text);  }
.badge-priority-info { background: var(--priority-info-bg); color: var(--priority-info-text); }

.badge-digital  { background: #dbeafe; color: #1e40af; }
.badge-physical { background: #fef9c3; color: #854d0e; }

/* Dot indicators */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-red    { background: #ef4444; }
.dot-blue   { background: #3b82f6; }
.dot-gray   { background: #94a3b8; }
.dot-green  { background: #22c55e; }
.dot-amber  { background: #f59e0b; }

/* Tables */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-hover);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-primary);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background .1s; }
.data-table tbody tr:hover { background: var(--bg-hover); cursor: pointer; }
.data-table .td-id    { font-family: monospace; font-size: 12px; color: var(--text-secondary); }
.data-table .td-name  { font-weight: 600; }

/* Form elements */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-group .required { color: #ef4444; }

.form-control {
  width: 100%;
  padding: 9px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-primary);
  background: white;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

textarea.form-control { resize: vertical; min-height: 80px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.form-error {
  background: #fee2e2;
  color: #991b1b;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-top: 4px;
}

/* Urgency picker */
.urgency-picker { display: flex; gap: 8px; }
.urgency-opt {
  flex: 1;
  padding: 8px;
  text-align: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  font-size: 12.5px;
  font-weight: 600;
  transition: all .12s;
  color: var(--text-secondary);
}
.urgency-opt:hover { border-color: var(--border-md); }
.urgency-opt.active-low    { border-color: #16a34a; background: var(--urgency-low-bg);  color: var(--urgency-low-text);  }
.urgency-opt.active-medium { border-color: #ca8a04; background: var(--urgency-med-bg);  color: var(--urgency-med-text);  }
.urgency-opt.active-high   { border-color: #dc2626; background: var(--urgency-high-bg); color: var(--urgency-high-text); }

/* Search input */
.search-wrap { position: relative; }
.search-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  pointer-events: none;
}
.search-input {
  padding-left: 34px !important;
}

/* Student search dropdown */
.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 200;
  max-height: 220px;
  overflow-y: auto;
}
.search-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background .1s;
}
.search-dropdown-item:hover { background: var(--bg-hover); }
.search-dropdown-item .student-info-small { flex: 1; }
.search-dropdown-item .stu-name { font-size: 13px; font-weight: 600; }
.search-dropdown-item .stu-meta { font-size: 11px; color: var(--text-muted); }
.search-dropdown-empty { padding: 16px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--border-md);
  border-radius: var(--radius-md);
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: var(--bg-hover);
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent);
  background: #eff6ff;
}
.drop-zone svg { width: 36px; height: 36px; color: var(--text-muted); margin-bottom: 10px; }
.drop-zone p { font-size: 13px; color: var(--text-secondary); }
.drop-zone .drop-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.drop-zone .browse-link { color: var(--accent); cursor: pointer; font-weight: 600; }
.drop-zone .drop-types { font-size: 11px; color: var(--text-muted); margin-top: 8px; }

/* =========================================================
   DASHBOARD VIEW
   ========================================================= */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow .15s;
}
.stat-card:hover { box-shadow: var(--shadow-sm); }

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-icon-blue   { background: #dbeafe; color: #1d4ed8; }
.stat-icon-green  { background: #dcfce7; color: #166534; }
.stat-icon-amber  { background: #fef9c3; color: #854d0e; }
.stat-icon-purple { background: #f3e8ff; color: #6b21a8; }
.stat-icon-red    { background: #fee2e2; color: #991b1b; }

.stat-content .stat-value { font-size: 26px; font-weight: 800; color: var(--text-primary); line-height: 1; }
.stat-content .stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }
.stat-content .stat-sub   { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
}

/* Priority filter tabs */
.filter-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-hover);
  padding: 4px;
  border-radius: var(--radius-sm);
}
.filter-tab {
  padding: 5px 12px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  background: none;
  border: none;
  color: var(--text-muted);
  transition: background .12s, color .12s;
}
.filter-tab.active {
  background: white;
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
}

/* Notice cards */
.notice-list { display: flex; flex-direction: column; gap: 1px; }
.notice-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
  cursor: pointer;
}
.notice-item:last-child { border-bottom: none; }
.notice-item:hover { background: var(--bg-hover); }
.notice-item.unread .notice-title { font-weight: 700; }

.notice-dot-wrap { padding-top: 5px; flex-shrink: 0; }
.notice-content { flex: 1; min-width: 0; }
.notice-title  { font-size: 13px; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notice-meta   { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.notice-office { font-size: 11px; color: var(--text-muted); }
.notice-time   { font-size: 11px; color: var(--text-muted); }
.notice-badge-wrap { flex-shrink: 0; }

/* Referral overview (right column on dashboard) */
.dash-right { display: flex; flex-direction: column; gap: 16px; }

/* =========================================================
   REFERRALS LIST VIEW
   ========================================================= */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.view-header h2 { font-size: 18px; font-weight: 800; }

.view-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.select-filter {
  padding: 7px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-primary);
  background: white;
  cursor: pointer;
}
.select-filter:focus { outline: none; border-color: var(--accent); }

/* =========================================================
   REFERRAL DETAIL VIEW
   ========================================================= */
.ref-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.ref-detail-header-left { display: flex; align-items: center; gap: 12px; }
.ref-detail-id { font-size: 15px; font-weight: 700; font-family: monospace; color: var(--text-primary); }
.ref-detail-meta { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }
.ref-detail-actions { display: flex; gap: 8px; }

.back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  transition: background .12s;
}
.back-btn:hover { background: var(--bg-hover); }
.back-btn svg { width: 14px; height: 14px; }

/* 3-column grid */
.ref-detail-grid {
  display: grid;
  grid-template-columns: 280px 1fr 320px;
  gap: 16px;
  margin-bottom: 20px;
}

.ref-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 560px;
  max-height: 70vh;
}

/* Student info panel */
.student-avatar-lg {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: white;
  margin: 0 auto 12px;
}
.student-name-lg { font-size: 17px; font-weight: 800; text-align: center; }
.student-id-lg   { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: 3px; font-family: monospace; }

.student-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0;
}
.info-cell .info-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); }
.info-cell .info-value { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-top: 2px; }

.divider { height: 1px; background: var(--border); margin: 12px 0; }

.ref-details-block { font-size: 13px; }
.ref-detail-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.ref-detail-row .rd-label { font-size: 11.5px; color: var(--text-muted); font-weight: 500; flex-shrink: 0; }
.ref-detail-row .rd-value { font-size: 13px; font-weight: 600; color: var(--text-primary); text-align: right; }

.ref-notes-block { background: #f8fafc; border-radius: var(--radius-sm); padding: 10px 12px; font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; margin-top: 8px; }

/* Documents panel */
.doc-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-hover);
  flex-shrink: 0;
}
.doc-tab {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color .1s;
}
.doc-tab:hover { color: var(--text-secondary); }
.doc-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: white;
}

.doc-list { flex: 1; overflow-y: auto; padding: 8px; }
.doc-list::-webkit-scrollbar { width: 4px; }
.doc-list::-webkit-scrollbar-thumb { background: var(--border-md); border-radius: 2px; }

.doc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 6px;
  transition: background .1s, border-color .1s;
  cursor: pointer;
}
.doc-item:hover { background: var(--bg-hover); border-color: var(--border-md); }
.doc-icon { width: 32px; height: 32px; border-radius: 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.doc-icon-pdf    { background: #fee2e2; color: #dc2626; }
.doc-icon-word   { background: #dbeafe; color: #2563eb; }
.doc-icon-img    { background: #fef9c3; color: #d97706; }
.doc-icon-other  { background: #f3f4f6; color: #6b7280; }
.doc-icon svg { width: 16px; height: 16px; }

.doc-name { font-size: 12.5px; font-weight: 600; color: var(--text-primary); line-height: 1.3; }
.doc-meta { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.doc-actions { margin-left: auto; flex-shrink: 0; }

.doc-upload-area { padding: 12px; border-top: 1px solid var(--border); flex-shrink: 0; }
.upload-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1.5px dashed var(--border-md);
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.upload-mini:hover { border-color: var(--accent); background: #eff6ff; }
.upload-mini svg { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }
.upload-mini span { font-size: 12px; color: var(--text-secondary); }

/* Communication panel */
.comm-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.comm-tab {
  flex: 1;
  padding: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  text-align: center;
  transition: color .1s;
}
.comm-tab:hover { color: var(--text-secondary); }
.comm-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.comm-content { flex: 1; overflow-y: auto; padding: 12px; }
.comm-content::-webkit-scrollbar { width: 4px; }
.comm-content::-webkit-scrollbar-thumb { background: var(--border-md); border-radius: 2px; }

/* Messages */
.msg-bubble {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  margin-top: 2px;
}
.msg-body { flex: 1; }
.msg-sender { font-size: 11.5px; font-weight: 700; color: var(--text-primary); }
.msg-sender span { font-weight: 400; color: var(--text-muted); margin-left: 5px; font-size: 10.5px; }
.msg-text { font-size: 12.5px; color: var(--text-secondary); margin-top: 3px; line-height: 1.5; }
.msg-time { font-size: 10.5px; color: var(--text-muted); margin-top: 4px; }

/* Activity log */
.activity-item {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 12.5px;
}
.activity-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.activity-icon svg { width: 12px; height: 12px; }
.ai-created  { background: #dbeafe; color: #1d4ed8; }
.ai-message  { background: #dcfce7; color: #166534; }
.ai-closed   { background: #f3f4f6; color: #6b7280; }
.ai-viewed   { background: #fef9c3; color: #854d0e; }
.ai-file     { background: #f3e8ff; color: #6b21a8; }
.activity-text { flex: 1; color: var(--text-secondary); line-height: 1.4; }
.activity-time { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

/* Participants */
.participant-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.participant-row:last-child { border-bottom: none; }
.participant-name { font-size: 12.5px; font-weight: 600; color: var(--text-primary); }
.participant-role-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  background: #f1f5f9;
  color: var(--text-secondary);
}

/* Message composer */
.msg-composer {
  border-top: 1px solid var(--border);
  padding: 10px;
  flex-shrink: 0;
}
.msg-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.msg-input-row textarea {
  flex: 1;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  resize: none;
  height: 56px;
  transition: border-color .15s;
}
.msg-input-row textarea:focus { outline: none; border-color: var(--accent); }
.msg-send-btn {
  width: 36px;
  height: 36px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .12s;
}
.msg-send-btn:hover { background: var(--accent-hover); }
.msg-send-btn svg { width: 16px; height: 16px; }

/* Recent referrals table */
.recent-refs-card { margin-top: 20px; }

/* =========================================================
   STUDENTS VIEW
   ========================================================= */
.students-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
}

.csv-section { display: flex; flex-direction: column; gap: 16px; }

.uploaded-rows { margin-top: 12px; }
.csv-success {
  background: #dcfce7;
  color: #166534;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.csv-error {
  background: #fee2e2;
  color: #991b1b;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

/* Student avatar small */
.student-row-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

/* =========================================================
   DOCUMENTS VIEW
   ========================================================= */
.doc-center-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.doc-search-wrap { flex: 1; min-width: 220px; }

.doc-center-table .doc-name-cell { max-width: 220px; }
.doc-center-table .doc-name-cell span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

/* =========================================================
   REPORTS VIEW
   ========================================================= */
.reports-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
}

.report-gen-card {
  text-align: center;
  padding: 36px 24px;
}

.report-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #dbeafe, #eff6ff);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.report-icon svg { width: 36px; height: 36px; color: var(--accent); }
.report-gen-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.report-gen-card p  { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }

.report-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
  justify-content: center;
}
.report-meta svg { width: 13px; height: 13px; }

.chart-wrap { padding: 16px; }

.breakdown-list { margin-top: 4px; }
.breakdown-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.breakdown-row:last-child { border-bottom: none; }
.breakdown-label { flex: 1; color: var(--text-secondary); }
.breakdown-count { font-weight: 700; color: var(--text-primary); }
.breakdown-bar-wrap { width: 80px; }
.breakdown-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.breakdown-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width .3s;
}

/* =========================================================
   MESSAGES VIEW
   ========================================================= */
.messages-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  min-height: 560px;
}

.msg-sidebar {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.msg-sidebar-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 700;
}

.msg-list { flex: 1; overflow-y: auto; }
.msg-list-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .1s;
}
.msg-list-item:hover { background: var(--bg-hover); }
.msg-list-item.active { background: #eff6ff; }
.msg-list-item.unread .msg-list-subject { font-weight: 700; }
.msg-list-subject { font-size: 12.5px; font-weight: 500; color: var(--text-primary); }
.msg-list-preview { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 230px; }
.msg-list-time { font-size: 10.5px; color: var(--text-muted); white-space: nowrap; margin-left: auto; }
.msg-unread-dot { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; flex-shrink: 0; margin-top: 5px; }

.msg-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.msg-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  color: var(--text-muted);
}
.msg-empty svg { width: 40px; height: 40px; }

/* =========================================================
   SETTINGS VIEW
   ========================================================= */
.settings-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  align-items: start;
}

.settings-nav { position: sticky; top: 0; }
.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background .1s, color .1s;
  margin-bottom: 2px;
}
.settings-nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.settings-nav-item.active { background: #eff6ff; color: var(--accent); font-weight: 600; }
.settings-nav-item svg { width: 15px; height: 15px; }

/* =========================================================
   MODALS
   ========================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(2px);
  animation: fadeIn .15s ease;
}

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

.modal-box {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: slideUp .15s ease;
}

.modal-box-lg { max-width: 700px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-header h2 { font-size: 16px; font-weight: 700; }

.modal-close {
  width: 30px;
  height: 30px;
  border: none;
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background .1s;
}
.modal-close:hover { background: var(--border); color: var(--text-primary); }
.modal-close svg { width: 16px; height: 16px; }

.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

/* =========================================================
   TOAST NOTIFICATIONS
   ========================================================= */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #0f172a;
  color: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  min-width: 240px;
  max-width: 360px;
  pointer-events: all;
  animation: slideUp .2s ease;
  transition: opacity .2s, transform .2s;
}
.toast.removing { opacity: 0; transform: translateX(20px); }
.toast svg { width: 16px; height: 16px; flex-shrink: 0; }
.toast-success { background: #166534; }
.toast-error   { background: #991b1b; }
.toast-info    { background: #1e40af; }

/* =========================================================
   EMPTY STATES
   ========================================================= */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: var(--text-muted);
  text-align: center;
  gap: 12px;
}
.empty-state svg { width: 44px; height: 44px; color: var(--border-md); }
.empty-state p   { font-size: 13px; }

/* =========================================================
   SCROLLBAR GLOBAL
   ========================================================= */
.views-wrap::-webkit-scrollbar { width: 6px; }
.views-wrap::-webkit-scrollbar-track { background: transparent; }
.views-wrap::-webkit-scrollbar-thumb { background: var(--border-md); border-radius: 3px; }

/* =========================================================
   UTILITIES
   ========================================================= */
.mt-0 { margin-top: 0; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-16 { margin-bottom: 16px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.font-mono { font-family: monospace; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.flex-1 { flex: 1; }
.text-right { text-align: right; }
.cursor-pointer { cursor: pointer; }

/* =========================================================
   ROOMS / LOCATION TRACKER
   ========================================================= */
.rooms-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  align-items: start;
}

.room-col {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.room-col-header {
  padding: 10px 12px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--bg-hover);
}

.room-col-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-count-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  flex-shrink: 0;
  margin-left: 6px;
}

.room-col-body {
  padding: 8px;
  min-height: 120px;
  flex: 1;
  transition: background .15s;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.room-col-body.drag-over {
  background: #eff6ff;
  border: 1.5px dashed var(--accent);
  border-radius: var(--radius-sm);
}

body.dark .room-col-body.drag-over {
  background: #1e3a5f;
  border-color: #2563eb;
}

.room-drop-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px;
  font-size: 11px;
  color: var(--text-muted);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  margin-top: 4px;
  transition: opacity .15s;
}

.room-col-body:has(.student-room-card) .room-drop-hint {
  opacity: 0;
}

/* Student card in room */
.student-room-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  cursor: grab;
  transition: box-shadow .12s, opacity .12s, border-color .12s;
  user-select: none;
}
.student-room-card:hover { box-shadow: var(--shadow-sm); border-color: var(--border-md); }
.student-room-card:active { cursor: grabbing; }
.student-room-card.dragging { opacity: .4; box-shadow: none; }

.room-card-name  { font-size: 12.5px; font-weight: 700; color: var(--text-primary); }
.room-card-grade { font-size: 11px; color: var(--text-muted); }

.room-card-footer {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.room-card-time {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  color: var(--text-muted);
}

.room-card-note {
  font-size: 11px;
  color: var(--text-secondary);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-history-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 2px;
  border-radius: 4px;
  transition: color .1s, background .1s;
  flex-shrink: 0;
}
.room-history-btn:hover { color: var(--accent); background: var(--bg-hover); }

/* Quick note buttons */
.quick-notes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.quick-note-btn {
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: left;
  transition: border-color .12s, background .12s, color .12s;
}
.quick-note-btn:hover  { border-color: var(--accent); color: var(--accent); background: #eff6ff; }
.quick-note-btn.active { border-color: var(--accent); background: #eff6ff; color: var(--accent); font-weight: 700; }

body.dark .quick-note-btn:hover,
body.dark .quick-note-btn.active { background: #1e3a5f; }
