/* ===================================================
   DormAI — Design System & Styles (v2, light theme)
   University: Shakarim | Author: DormAI Frontend
   =================================================== */

/* ---- RESET & ROOT ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #f6f7f9;
  --bg2:       #ffffff;
  --bg3:       #f1f2f5;
  --surface:   #ffffff;
  --surface2:  #f4f5f7;
  --border:    #e7e8ec;
  --border2:   #dfe1e6;

  --blue:       #2f5fe0;
  --blue-soft:  #eaf0ff;
  --green:      #1a9e5c;
  --green-soft: #e9f8ef;
  --red:        #d33a3a;
  --red-soft:   #fbeaea;
  --orange:     #c8761a;
  --orange-soft:#fdf1e4;
  --yellow:     #b08900;
  --yellow-soft:#fbf3da;
  --purple:     #6d4fd6;
  --purple-soft:#efeafc;

  --text:  #1c2024;
  --text2: #6b7280;
  --text3: #9aa0ac;

  --radius:    10px;
  --radius-sm: 8px;
  --radius-lg: 14px;

  --sidebar-w: 240px;
  --topbar-h:  60px;

  --font: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;

  --transition: 0.15s ease;
  --shadow-sm: 0 1px 2px rgba(20,20,43,.04);
  --shadow-md: 0 6px 20px rgba(20,20,43,.07);
}

html { font-size: 15px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}
.hidden { display: none !important; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* shared keyframes */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%      { opacity: .45; }
}
@keyframes load { from { width: 0; } to { width: 100%; } }

/* ===================== SPLASH ===================== */
.splash {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
}
.splash-content { text-align: center; }
.splash-logo {
  width: 60px; height: 60px;
  position: relative;
  margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center;
}
.logo-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 2px solid var(--border2);
  border-top-color: var(--blue);
  animation: spin .9s linear infinite;
}
.logo-icon { font-size: 26px; z-index: 1; }
.splash-title {
  font-size: 1.6rem; font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}
.splash-title span { color: var(--blue); }
.splash-sub { margin-top: 6px; color: var(--text2); font-size: .88rem; }
.splash-loader {
  margin: 28px auto 0;
  width: 160px; height: 3px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.loader-bar {
  height: 100%;
  background: var(--blue);
  border-radius: 99px;
  animation: load 1.4s ease forwards;
}

/* ===================== AUTH ===================== */
.page { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.auth-bg { display: none; }

.glass {
  background: var(--surface);
  border: 1px solid var(--border);
}
.auth-card {
  width: 400px; max-width: 92vw;
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  position: relative; z-index: 2;
  box-shadow: var(--shadow-md);
  animation: slideUp .35s ease;
}
.auth-logo {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 22px;
}
.logo-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--blue);
  display: inline-block;
}
.logo-text { font-size: 1rem; font-weight: 700; color: var(--text); letter-spacing: .2px; }

.auth-header h2 { font-size: 1.35rem; font-weight: 700; }
.auth-header p { color: var(--text2); margin-top: 6px; font-size: .88rem; }
.auth-form { margin-top: 22px; }
.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-group label { font-size: .8rem; color: var(--text2); font-weight: 500; }
.input-wrap {
  position: relative; display: flex; align-items: center;
}
.input-wrap .input-icon {
  position: absolute; left: 12px;
  font-size: .95rem; pointer-events: none; z-index: 1;
  color: var(--text3);
}
.input-wrap input {
  width: 100%;
  padding: 10px 38px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.input-wrap input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}
.input-wrap input::placeholder { color: var(--text3); }
.pw-toggle {
  position: absolute; right: 12px;
  background: none; border: none; cursor: pointer;
  font-size: .95rem; color: var(--text3);
}
.auth-error {
  padding: 10px 14px;
  background: var(--red-soft);
  border: 1px solid rgba(211,58,58,.25);
  border-radius: var(--radius-sm);
  color: var(--red);
  font-size: .85rem;
  margin-top: 12px;
}
.auth-footer {
  margin-top: 20px; text-align: center;
  color: var(--text2); font-size: .85rem;
}

/* ===================== BUTTONS ===================== */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px;
  background: var(--blue);
  color: #fff; font-weight: 600; font-size: .9rem;
  border-radius: var(--radius-sm);
  border: none; cursor: pointer;
  transition: background var(--transition), opacity var(--transition);
}
.btn-primary:hover { background: #2750c4; }
.btn-primary:active { opacity: .9; }
.btn-primary.full-width { width: 100%; margin-top: 18px; }
.btn-ghost {
  padding: 9px 18px;
  color: var(--text2); font-size: .88rem;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: background var(--transition), color var(--transition);
}
.btn-ghost:hover { background: var(--surface2); color: var(--text); }
.btn-ghost-sm {
  padding: 5px 12px;
  color: var(--blue); font-size: .8rem;
  border: 1px solid rgba(47,95,224,.22);
  border-radius: var(--radius-sm);
  background: var(--blue-soft);
  transition: background var(--transition);
}
.btn-ghost-sm:hover { background: #dde8ff; }
.btn-loader {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* ===================== MODAL ===================== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15,18,25,.45);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .15s ease;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 32px; border-radius: var(--radius-lg);
  max-width: 520px; width: 92vw;
  box-shadow: var(--shadow-md);
  animation: slideUp .25s ease;
}
.modal h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 6px; }
.modal > p { color: var(--text2); font-size: .88rem; margin-bottom: 22px; }
.role-cards { display: flex; gap: 12px; flex-wrap: wrap; }
.role-card {
  flex: 1; min-width: 140px;
  padding: 18px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  transition: border-color var(--transition), background var(--transition);
  color: var(--text);
}
.role-card:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
}
.role-icon { font-size: 1.7rem; }
.role-name { font-weight: 600; font-size: .92rem; }
.role-desc { font-size: .78rem; color: var(--text2); text-align: center; }
.modal .btn-ghost { margin-top: 18px; }

/* ===================== APP LAYOUT ===================== */
.app { display: flex; min-height: 100vh; width: 100%; }

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; left: 0; top: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}
.sidebar.collapsed { transform: translateX(-100%); }
.sidebar-brand {
  padding: 20px 18px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}
.brand-logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 1rem; font-weight: 700; color: var(--text);
}
.brand-logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}
.role-badge {
  display: inline-flex;
  padding: 3px 9px;
  border-radius: 99px;
  background: var(--blue-soft);
  border: 1px solid rgba(47,95,224,.2);
  color: var(--blue);
  font-size: .72rem; font-weight: 600;
  width: fit-content;
}
.sidebar-nav { padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text2);
  font-size: .88rem; font-weight: 500;
  transition: background var(--transition), color var(--transition);
  text-align: left; width: 100%;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active {
  background: var(--blue-soft);
  color: var(--blue);
}
.nav-icon { font-size: 1rem; width: 20px; text-align: center; }
.sidebar-bottom { padding: 10px 8px; border-top: 1px solid var(--border); }
.logout-btn { color: var(--red) !important; }
.logout-btn:hover { background: var(--red-soft) !important; }

/* TOPBAR */
.topbar {
  position: fixed; left: var(--sidebar-w); right: 0; top: 0; height: var(--topbar-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
  z-index: 90;
  transition: left var(--transition);
}
.topbar.full { left: 0; }
.hamburger {
  font-size: 1.2rem; color: var(--text2);
  display: none;
  transition: color var(--transition);
}
.hamburger:hover { color: var(--text); }
.topbar-title { font-weight: 700; font-size: .98rem; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  animation: pulse-dot 2.2s ease-in-out infinite;
}
.topbar-user { font-size: .82rem; color: var(--text2); font-family: var(--mono); }

/* MAIN CONTENT */
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  padding: 32px;
  min-height: calc(100vh - var(--topbar-h));
  transition: margin-left var(--transition);
  width: calc(100% - var(--sidebar-w));
  box-sizing: border-box;
}
.main-content.full { margin-left: 0; width: 100%; }

/* ===================== VIEWS ===================== */
.view { animation: fadeSlide .25s ease; width: 100%; }
.view.hidden { display: none !important; }
.view.active { display: block; width: 100%; }
.view-header { margin-bottom: 28px; }
.view-header h1 { font-size: 1.7rem; font-weight: 700; line-height: 1.2; }
.view-sub { color: var(--text2); margin-top: 6px; font-size: .9rem; }

/* ===================== CARDS ===================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  width: 100%;
  box-sizing: border-box;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.card-header h3 { font-size: .95rem; font-weight: 700; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

/* STAT CARDS */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; width: 100%; }
.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex; align-items: center; gap: 14px;
}
.stat-icon {
  font-size: 1.25rem;
  width: 38px; height: 38px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--surface2);
}
.stat-info { display: flex; flex-direction: column; gap: 2px; }
.stat-label { font-size: .76rem; color: var(--text2); }
.stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1.1; color: var(--text); }

.stat-card.accent-blue   .stat-icon { background: var(--blue-soft);   color: var(--blue); }
.stat-card.accent-green  .stat-icon { background: var(--green-soft);  color: var(--green); }
.stat-card.accent-purple .stat-icon { background: var(--purple-soft); color: var(--purple); }
.stat-card.accent-orange .stat-icon { background: var(--orange-soft); color: var(--orange); }
.stat-card.accent-red    .stat-icon { background: var(--red-soft);    color: var(--red); }

/* BADGES */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 99px;
  font-size: .74rem; font-weight: 600;
}
.badge-info   { background: var(--blue-soft);   color: var(--blue);   border: 1px solid rgba(47,95,224,.18); }
.badge-green  { background: var(--green-soft);  color: var(--green);  border: 1px solid rgba(26,158,92,.18); }
.badge-yellow { background: var(--yellow-soft); color: var(--yellow); border: 1px solid rgba(176,137,0,.18); }
.badge-red    { background: var(--red-soft);    color: var(--red);    border: 1px solid rgba(211,58,58,.18); }

/* ===================== TIMELINE ===================== */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-step {
  display: flex; gap: 14px; align-items: flex-start;
  padding-bottom: 18px;
  position: relative;
}
.timeline-step:not(:last-child)::after {
  content: '';
  position: absolute; left: 7px; top: 18px; bottom: 0;
  width: 2px;
  background: var(--border2);
}
.timeline-step.done::after { background: var(--green); }
.timeline-step.active::after { background: var(--blue); }
.step-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border2);
  background: var(--bg2);
  flex-shrink: 0; position: relative; z-index: 1;
}
.timeline-step.done .step-dot {
  background: var(--green);
  border-color: var(--green);
}
.timeline-step.active .step-dot {
  background: var(--blue);
  border-color: var(--blue);
}
.step-body { display: flex; flex-direction: column; gap: 2px; }
.step-title { font-weight: 600; font-size: .88rem; }
.step-date { font-size: .78rem; color: var(--text2); }

/* ===================== PRIORITY BREAKDOWN ===================== */
.priority-breakdown { display: flex; flex-direction: column; gap: 14px; }
.priority-row { display: grid; grid-template-columns: 1fr 1fr 80px; align-items: center; gap: 12px; }
.priority-label { font-size: .84rem; white-space: nowrap; }
.priority-bar-wrap { height: 6px; background: var(--surface2); border-radius: 99px; overflow: hidden; }
.priority-bar { height: 100%; width: var(--w); border-radius: 99px; background: var(--blue); transition: width .6s ease; }
.priority-pts { font-size: .84rem; font-weight: 700; text-align: right; font-family: var(--mono); color: var(--blue); }

/* ===================== PROFILE ===================== */
.profile-layout { display: grid; grid-template-columns: 270px 1fr; gap: 18px; }
.profile-card { text-align: center; }
.profile-avatar { position: relative; display: inline-block; margin-bottom: 16px; }
.avatar-circle {
  width: 76px; height: 76px; border-radius: 50%;
  background: var(--blue-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 700; color: var(--blue);
}
.avatar-status {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--bg2);
  position: absolute; right: 2px; bottom: 2px;
}
.profile-card h2 { font-size: 1.1rem; font-weight: 700; }
.profile-sub { color: var(--text2); font-size: .86rem; margin-top: 4px; }
.profile-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 14px; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.info-item { display: flex; flex-direction: column; gap: 3px; }
.info-label { font-size: .73rem; text-transform: uppercase; letter-spacing: .3px; color: var(--text3); }
.info-val { font-weight: 600; font-size: .92rem; }
.social-cats { display: flex; flex-wrap: wrap; gap: 10px; }
.social-cat-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: .85rem; font-weight: 500;
}
.social-cat-item.yes { background: var(--green-soft); border: 1px solid rgba(26,158,92,.2); color: var(--green); }
.social-cat-item.no  { background: var(--surface2); border: 1px solid var(--border); color: var(--text3); }

/* ===================== AI SECTION ===================== */
.ai-layout { display: grid; grid-template-columns: 340px 1fr; gap: 18px; }
.ai-criteria h4 { font-size: .86rem; color: var(--text2); margin-bottom: 12px; font-weight: 600; }
.criteria-pills { display: flex; flex-wrap: wrap; gap: 7px; }
.cpill {
  padding: 4px 12px; border-radius: 99px;
  font-size: .76rem; font-weight: 600;
}
.cpill-red    { background: var(--red-soft);    color: var(--red);    border: 1px solid rgba(211,58,58,.18); }
.cpill-blue   { background: var(--blue-soft);   color: var(--blue);   border: 1px solid rgba(47,95,224,.18); }
.cpill-purple { background: var(--purple-soft); color: var(--purple); border: 1px solid rgba(109,79,214,.18); }
.cpill-orange { background: var(--orange-soft); color: var(--orange); border: 1px solid rgba(200,118,26,.18); }

.ai-idle { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 50px 20px; gap: 12px; color: var(--text2); }
.ai-idle-icon { font-size: 2.4rem; opacity: .4; }
.ai-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 50px 20px; gap: 18px; color: var(--text2); }
.ai-pulse {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--border2);
  border-top-color: var(--blue);
  animation: spin .8s linear infinite;
}
.ai-result-text {
  font-size: .9rem; line-height: 1.65; color: var(--text);
  white-space: pre-wrap;
  font-family: var(--font);
}

/* ===================== APPEAL ===================== */
.styled-select {
  width: 100%; padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .88rem; font-family: var(--font); outline: none;
  transition: border-color var(--transition);
}
.styled-select:focus { border-color: var(--blue); }
.styled-select.sm { width: auto; padding: 6px 10px; font-size: .8rem; }
.styled-textarea {
  width: 100%; padding: 11px 12px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text); resize: vertical;
  font-size: .88rem; font-family: var(--font); outline: none;
  transition: border-color var(--transition);
}
.styled-textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.upload-zone {
  border: 1px dashed var(--border2);
  border-radius: var(--radius-sm);
  padding: 26px;
  text-align: center;
  color: var(--text2); cursor: pointer;
  font-size: .86rem;
  transition: border-color .15s, background .15s;
}
.upload-zone:hover { border-color: var(--blue); background: var(--blue-soft); }
.file-chip {
  margin-top: 8px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  background: var(--green-soft);
  border: 1px solid rgba(26,158,92,.2);
  border-radius: 99px;
  color: var(--green); font-size: .82rem;
}
.success-msg {
  margin-top: 14px; padding: 12px 16px;
  background: var(--green-soft);
  border: 1px solid rgba(26,158,92,.2);
  border-radius: var(--radius-sm);
  color: var(--green); font-size: .88rem;
  animation: slideUp .25s ease;
}

/* ===================== TABLE ===================== */
.table-wrap { overflow-x: auto; width: 100%; }
.dormai-table { width: 100%; border-collapse: collapse; font-size: .87rem; }
.dormai-table thead tr {
  border-bottom: 1px solid var(--border);
}
.dormai-table th {
  padding: 10px 14px; text-align: left;
  font-size: .72rem; text-transform: uppercase; letter-spacing: .3px;
  color: var(--text3); font-weight: 600;
  white-space: nowrap;
}
.dormai-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.dormai-table tbody tr { transition: background .12s; }
.dormai-table tbody tr:hover { background: var(--surface2); }
.dormai-table tbody tr:last-child td { border-bottom: none; }

/* search */
.search-wrap {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  flex: 1;
}
.search-icon { font-size: .88rem; color: var(--text3); }
.search-input {
  background: none; border: none;
  padding: 9px 0; color: var(--text);
  font-size: .87rem; outline: none; min-width: 0; width: 100%;
}
.search-input::placeholder { color: var(--text3); }
.filter-group { display: flex; gap: 10px; align-items: center; }

/* cards-row — two-column grid for paired cards */
.cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  width: 100%;
}

/* ===================== DORMS ===================== */
.dorm-list { display: flex; flex-direction: column; gap: 16px; }
.dorm-row { display: grid; grid-template-columns: 1fr 2fr 50px; align-items: center; gap: 14px; }
.dorm-info { display: flex; flex-direction: column; gap: 2px; }
.dorm-name { font-weight: 600; font-size: .9rem; }
.dorm-nums { font-size: .78rem; color: var(--text3); }
.dorm-bar-wrap { height: 8px; background: var(--surface2); border-radius: 99px; overflow: hidden; }
.dorm-bar { height: 100%; width: var(--pct); border-radius: 99px; background: var(--blue); transition: width .6s ease; }
.dorm-bar.high { background: var(--red); }
.dorm-bar.low  { background: var(--green); }
.dorm-pct { font-size: .87rem; font-weight: 700; font-family: var(--mono); color: var(--text2); }

/* Mini list helpers */
.mini-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.mini-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; background: var(--surface2);
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  font-size: .84rem;
}
.mini-item span:first-child { font-weight: 500; }
.mini-item strong { color: var(--blue); font-family: var(--mono); }

/* Room grid */
.rooms-legend { display: flex; gap: 20px; margin-bottom: 16px; }
.room-legend-item { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--text2); }
.room-dot { width: 12px; height: 12px; border-radius: 3px; }
.room-dot.free     { background: var(--green); }
.room-dot.occupied { background: var(--red); }
.room-dot.reserved { background: var(--yellow); }
.dorm-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.dorm-tab {
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: .86rem; font-weight: 600;
  background: var(--surface); color: var(--text2);
  border: 1px solid var(--border2);
  transition: all .15s;
}
.dorm-tab.active { background: var(--blue-soft); color: var(--blue); border-color: rgba(47,95,224,.25); }
.dorm-tab:hover { background: var(--surface2); color: var(--text); }
.rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 10px;
}
.room-cell {
  height: 60px; border-radius: var(--radius-sm);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: .74rem; font-weight: 600; cursor: pointer;
  border: 1px solid transparent;
  transition: transform .12s;
}
.room-cell:hover { transform: scale(1.04); }
.room-cell.free     { background: var(--green-soft);  border-color: rgba(26,158,92,.2);  color: var(--green); }
.room-cell.occupied { background: var(--red-soft);    border-color: rgba(211,58,58,.2);  color: var(--red); }
.room-cell.reserved { background: var(--yellow-soft); border-color: rgba(176,137,0,.2);  color: var(--yellow); }

/* ===================== CHARTS ROW ===================== */
.charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.chart-card { }
.donut-chart-wrap {
  display: flex; align-items: center; gap: 24px;
  flex-wrap: wrap;
}
.donut-legend { display: flex; flex-direction: column; gap: 10px; }
.donut-legend-item { display: flex; align-items: center; gap: 8px; font-size: .82rem; }
.donut-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.transparency-list { display: flex; flex-direction: column; gap: 14px; }
.trans-item { display: flex; align-items: center; gap: 12px; }
.trans-icon { font-size: 1.1rem; width: 26px; text-align: center; color: var(--text2); }
.trans-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.trans-title { font-weight: 600; font-size: .87rem; }
.trans-sub { font-size: .78rem; color: var(--text2); }

/* ===================== CATEGORIES ===================== */
.categories-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.cat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.cat-card.priority-1 { border-left: 3px solid var(--red); }
.cat-card.priority-2 { border-left: 3px solid var(--orange); }
.cat-card.priority-3 { border-left: 3px solid var(--blue); }
.cat-card.priority-4 { border-left: 3px solid var(--purple); }
.cat-card.priority-5 { border-left: 3px solid var(--green); }
.cat-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.cat-priority { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: var(--text3); }
.cat-count { font-size: 1.5rem; font-weight: 700; font-family: var(--mono); color: var(--text); }
.cat-card h3 { font-size: .92rem; font-weight: 700; margin-bottom: 12px; }
.cat-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.cat-list li {
  display: flex; justify-content: space-between;
  font-size: .82rem; color: var(--text2);
  padding: 6px 0; border-bottom: 1px solid var(--border);
}
.cat-list li:last-child { border-bottom: none; }
.cat-list li strong { color: var(--text); font-family: var(--mono); }
.cat-bar-wrap { height: 4px; background: var(--surface2); border-radius: 99px; overflow: hidden; margin-top: 12px; }
.cat-bar { height: 100%; width: var(--w); border-radius: 99px; background: var(--blue); transition: width .8s ease; }

/* ===================== TOAST ===================== */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9000;
  padding: 12px 18px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  font-size: .87rem; font-weight: 600;
  box-shadow: var(--shadow-md);
  animation: slideUp .25s ease;
}
.toast.toast-success { border-color: rgba(26,158,92,.3); color: var(--green); }
.toast.toast-error   { border-color: rgba(211,58,58,.3);  color: var(--red); }

/* ===================== RANKING ===================== */
.rank-medal { font-family: var(--mono); font-weight: 700; }
.rank-1 { color: #c79a1e; }
.rank-2 { color: #9aa0ac; }
.rank-3 { color: #b9744a; }

/* STATUS CHIPS */
.status-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 99px;
  font-size: .74rem; font-weight: 600;
}
.status-chip.settled   { background: var(--green-soft);  color: var(--green);  border: 1px solid rgba(26,158,92,.18); }
.status-chip.queue     { background: var(--blue-soft);   color: var(--blue);   border: 1px solid rgba(47,95,224,.18); }
.status-chip.declined  { background: var(--red-soft);    color: var(--red);    border: 1px solid rgba(211,58,58,.18); }
.status-chip.verify    { background: var(--yellow-soft); color: var(--yellow); border: 1px solid rgba(176,137,0,.18); }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .topbar { left: 0 !important; }
  .main-content { margin-left: 0; width: 100%; }
  .hamburger { display: block; }
  .profile-layout { grid-template-columns: 1fr; }
  .ai-layout { grid-template-columns: 1fr; }
  .charts-row { grid-template-columns: 1fr; }
  .cards-row { grid-template-columns: 1fr; }
  .priority-row { grid-template-columns: 1fr 1fr 60px; }
}
@media (max-width: 600px) {
  .main-content { padding: 16px; }
  .cards-grid { grid-template-columns: 1fr 1fr; }
  .cards-row { grid-template-columns: 1fr; }
  .categories-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 20px; }
  .priority-row { grid-template-columns: 1fr; }
  .priority-label { font-size: .8rem; }
}