/*
 * styles.css
 * ─────────────────────────────────────────────────────────────────────────────
 * PLACE THIS FILE AT: /css/styles.css
 *
 * UCC Campus Accommodation Portal
 * Design: Navy + Gold — institutional elegance with modern clarity
 * ─────────────────────────────────────────────────────────────────────────────
 */

/* ── Google Fonts ─────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=Source+Sans+3:wght@300;400;500;600&display=swap');

/* ── Design Tokens ────────────────────────────────────────────────────────── */
:root {
  --navy:       #1e3a5f;
  --navy-dark:  #122540;
  --navy-light: #2c5282;
  --gold:       #c9a84c;
  --gold-light: #e6c96a;
  --gold-pale:  #faf3e0;
  --white:      #ffffff;
  --gray-50:    #f9fafb;
  --gray-100:   #f3f4f6;
  --gray-200:   #e5e7eb;
  --gray-400:   #9ca3af;
  --gray-600:   #4b5563;
  --gray-800:   #1f2937;
  --green:      #22c55e;
  --yellow:     #f59e0b;
  --red:        #ef4444;
  --blue:       #3b82f6;
  --purple:     #a855f7;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Source Sans 3', system-ui, sans-serif;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow-md:  0 4px 16px rgba(0,0,0,.12);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.16);
  --radius:     8px;
  --radius-lg:  14px;
  --transition: .2s ease;
}

/* ── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--gray-800);
  background: var(--gray-50);
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  outline: none;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: .5rem .8rem;
  width: 100%;
  transition: border-color var(--transition);
  background: var(--white);
}
input:focus, select:focus, textarea:focus { border-color: var(--navy); }
textarea { resize: vertical; min-height: 80px; }
label { display: block; font-weight: 600; font-size: 13px; margin-bottom: .35rem; color: var(--navy); }

/* ── Utility ──────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14px;
  border: none;
  transition: all var(--transition);
}
.btn-primary   { background: var(--navy);  color: var(--white); }
.btn-primary:hover { background: var(--navy-dark); }
.btn-gold      { background: var(--gold);  color: var(--white); }
.btn-gold:hover { background: #b8943d; }
.btn-success   { background: var(--green); color: var(--white); }
.btn-danger    { background: var(--red);   color: var(--white); }
.btn-warning   { background: var(--yellow);color: var(--white); }
.btn-secondary { background: var(--gray-200); color: var(--gray-800); }
.btn-full      { width: 100%; justify-content: center; }
.btn-outline   {
  background: transparent;
  border: 2px solid var(--gold);
  color: var(--gold);
}
.btn-outline:hover { background: var(--gold); color: var(--white); }

.btn-sm {
  padding: .3rem .7rem;
  font-size: 12px;
  border-radius: 5px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}
.btn-sm:hover { opacity: .85; }
.btn-sm.btn-primary  { background: var(--navy);  color: #fff; }
.btn-sm.btn-danger   { background: var(--red);   color: #fff; }
.btn-sm.btn-success  { background: var(--green); color: #fff; }
.btn-sm.btn-warning  { background: var(--yellow);color: #fff; }
.btn-sm.btn-secondary{ background: var(--gray-200); color: var(--gray-800); }

/* ── Form Group ───────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.input-readonly { background: var(--gray-100); color: var(--gray-600); }

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .15rem .6rem;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.badge-pending  { background: #fef3c7; color: #92400e; }
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-admin    { background: #dbeafe; color: #1e40af; }
.badge-student  { background: #f3e8ff; color: #6b21a8; }
.badge-vacant   { background: #d1fae5; color: #065f46; }
.badge-partial  { background: #fef3c7; color: #92400e; }
.badge-full     { background: #fee2e2; color: #991b1b; }
.badge-staff    { background: #dbeafe; color: #1e40af; }
.badge-NSP      { background: #f3e8ff; color: #6b21a8; }
.badge-suite    { background: #ede9fe; color: #5b21b6; }

/* ═══════════════════════════════════════════════════════════════════════════ */
/*  LANDING PAGE (index.html)                                                  */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* ── Top Nav ─────────────────────────────────────────────────────────────── */
.landing-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(18, 37, 64, .95);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 2.5rem;
  border-bottom: 1px solid rgba(201,168,76,.2);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: .8rem;
}
.nav-brand-icon {
  width: 42px; height: 42px;
  background: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--navy-dark);
  font-family: var(--font-display);
}
.nav-brand-text {
  display: flex;
  flex-direction: column;
}
.nav-brand-name {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--white);
  font-weight: 700;
  line-height: 1.1;
}
.nav-brand-sub {
  font-size: 10px;
  color: var(--gold);
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  background:
    linear-gradient(160deg, rgba(18,37,64,.97) 0%, rgba(30,58,95,.9) 60%, rgba(18,37,64,.97) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Crect width='60' height='60' fill='%231e3a5f'/%3E%3Cpath d='M0 30h60M30 0v60' stroke='%23c9a84c' stroke-width='.3' opacity='.15'/%3E%3C/svg%3E");
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 2rem 4rem;
  position: relative;
  overflow: hidden;
}

/* Decorative orbs */
.hero::before {
  content: "";
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(201,168,76,.08) 0%, transparent 70%);
  top: -100px; right: -100px;
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(201,168,76,.06) 0%, transparent 70%);
  bottom: -50px; left: -50px;
  pointer-events: none;
}

.hero-crest {
  width: 90px; height: 90px;
  background: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  margin: 0 auto 1.5rem;
  box-shadow: 0 0 0 12px rgba(201,168,76,.15), 0 0 0 24px rgba(201,168,76,.07);
  animation: pulseGlow 3s ease-in-out infinite;
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 12px rgba(201,168,76,.15), 0 0 0 24px rgba(201,168,76,.07); }
  50%       { box-shadow: 0 0 0 16px rgba(201,168,76,.2),  0 0 0 32px rgba(201,168,76,.05); }
}

.hero-eyebrow {
  font-size: 11px;
  letter-spacing: .15em;
  color: var(--gold);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: .6rem;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: var(--white);
  line-height: 1.1;
  margin-bottom: .8rem;
}
.hero-title span { color: var(--gold-light); }
.hero-subtitle {
  font-size: 1rem;
  color: rgba(255,255,255,.65);
  max-width: 480px;
  margin: 0 auto 2rem;
  font-weight: 300;
}
.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-actions .btn {
  padding: .75rem 2rem;
  font-size: 15px;
}

/* ── Stats Strip ─────────────────────────────────────────────────────────── */
.stats-strip {
  background: var(--white);
  border-bottom: 3px solid var(--gold);
  padding: 2rem;
  display: flex;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
}
.stat-item {
  text-align: center;
}
.stat-item .stat-number {
  font-family: var(--font-display);
  font-size: 2.4rem;
  color: var(--navy);
  font-weight: 700;
  line-height: 1;
}
.stat-item .stat-label {
  font-size: 12px;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 600;
}
.stat-divider {
  width: 1px;
  background: var(--gray-200);
  height: 50px;
  align-self: center;
}

/* ── Availability Grid Section ───────────────────────────────────────────── */
.availability-section {
  padding: 4rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}
.section-title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  color: var(--navy);
  margin-bottom: .3rem;
}
.section-subtitle {
  color: var(--gray-400);
  font-size: 13px;
  margin-bottom: 2rem;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.landing-footer {
  background: var(--navy-dark);
  color: rgba(255,255,255,.5);
  text-align: center;
  padding: 1.5rem;
  font-size: 13px;
}
.landing-footer strong { color: var(--gold); }

/* ═══════════════════════════════════════════════════════════════════════════ */
/*  MODAL                                                                       */
/* ═══════════════════════════════════════════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(18,37,64,.75);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: slideUp .25s ease;
}
@keyframes slideUp {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.modal-header {
  background: var(--navy);
  padding: 1.2rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title {
  font-family: var(--font-display);
  color: var(--white);
  font-size: 1.15rem;
}
.modal-close {
  background: none;
  border: none;
  color: rgba(255,255,255,.6);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--white); }
.modal-body { padding: 1.5rem; }

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 1.3rem;
}
.tab-btn {
  flex: 1;
  padding: .6rem;
  background: none;
  border: none;
  font-weight: 600;
  font-size: 14px;
  color: var(--gray-400);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
}
.tab-btn.active { color: var(--navy); border-bottom-color: var(--gold); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Password hint ───────────────────────────────────────────────────────── */
.password-hint {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: .3rem;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/*  DASHBOARD LAYOUT (admin.html & student.html)                               */
/* ═══════════════════════════════════════════════════════════════════════════ */
.dash-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  width: 240px;
  min-height: 100vh;
  background: var(--navy-dark);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 50;
  overflow-y: auto;
}
.sidebar-brand {
  padding: 1.3rem 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar-logo {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--white);
  line-height: 1.2;
}
.sidebar-logo span { color: var(--gold); display: block; font-size: .7rem; font-family: var(--font-body); letter-spacing: .1em; text-transform: uppercase; font-weight: 400; }
.sidebar-user {
  padding: .8rem 1.2rem;
  font-size: 12px;
  color: rgba(255,255,255,.45);
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar-user strong { color: var(--gold); display: block; font-size: 13px; }
.sidebar-nav { flex: 1; padding: .8rem 0; }
.nav-group-label {
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.25);
  padding: .9rem 1.2rem .3rem;
  font-weight: 700;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .65rem 1.2rem;
  font-size: 13.5px;
  color: rgba(255,255,255,.65);
  transition: all var(--transition);
  border-left: 3px solid transparent;
}
.nav-link:hover { background: rgba(255,255,255,.05); color: var(--white); }
.nav-link.active { background: rgba(201,168,76,.12); color: var(--gold-light); border-left-color: var(--gold); }
.nav-icon { font-size: 15px; }
.sidebar-footer {
  padding: 1rem 1.2rem;
  border-top: 1px solid rgba(255,255,255,.07);
}
.logout-btn {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
  padding: .6rem .8rem;
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.25);
  border-radius: var(--radius);
  color: #fca5a5;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.logout-btn:hover { background: rgba(239,68,68,.2); }

/* ── Main Content ────────────────────────────────────────────────────────── */
.dash-main {
  margin-left: 240px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.dash-topbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 1rem 1.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}
.dash-page-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--navy);
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 13px;
  color: var(--gray-600);
}
.dash-content {
  padding: 1.8rem;
  flex: 1;
}

/* ── Stat Cards ──────────────────────────────────────────────────────────── */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.8rem;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--gold);
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.stat-card-icon { font-size: 1.5rem; }
.stat-card-value {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--navy);
  font-weight: 700;
  line-height: 1;
}
.stat-card-label {
  font-size: 11px;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 600;
}

/* ── Charts ──────────────────────────────────────────────────────────────── */
.chart-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 1.2rem;
  margin-bottom: 1.8rem;
}
.chart-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: var(--shadow-sm);
}
.chart-card canvas {
  width: 100% !important;
}

/* ── Data Tables ─────────────────────────────────────────────────────────── */
.table-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.table-card-header {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
}
.table-card-title {
  font-weight: 700;
  color: var(--navy);
  font-size: 15px;
}
.table-filters {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: center;
}
.table-filters select,
.table-filters input {
  width: auto;
  min-width: 120px;
  padding: .35rem .6rem;
  font-size: 12px;
}
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
thead th {
  background: var(--gray-50);
  padding: .7rem 1rem;
  text-align: left;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gray-400);
  font-weight: 700;
  border-bottom: 1px solid var(--gray-200);
}
tbody tr { border-bottom: 1px solid var(--gray-100); }
tbody tr:hover { background: var(--gray-50); }
tbody td { padding: .6rem 1rem; color: var(--gray-800); vertical-align: middle; }

/* ── Room Grid ───────────────────────────────────────────────────────────── */
.room-legend {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  background: var(--white);
  padding: .7rem 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.legend-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.legend-label {
  font-size: 12px;
  color: var(--gray-600);
  margin-right: .6rem;
}
.block-section { margin-bottom: 2rem; }
.block-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--navy);
  margin-bottom: .8rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid var(--gold);
  display: inline-block;
}
.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: .6rem;
}
.room-card {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.room-card.clickable { cursor: pointer; }
.room-card.clickable:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.room-card-header {
  padding: .35rem .4rem;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-align: center;
}
.room-card-body {
  background: var(--white);
  padding: .4rem .4rem .35rem;
  text-align: center;
}
.room-stat {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
}
.room-type-label {
  font-size: 9px;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.room-bar-wrap {
  height: 3px;
  background: var(--gray-100);
  border-radius: 2px;
  margin-top: .3rem;
  overflow: hidden;
}
.room-bar {
  height: 100%;
  border-radius: 2px;
  transition: width .4s ease;
}

/* ── Room Info Panel ─────────────────────────────────────────────────────── */
.room-info-panel {
  position: fixed;
  right: -380px;
  top: 0; bottom: 0;
  width: 340px;
  background: var(--white);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  padding: 1.5rem;
  transition: right .3s ease;
  overflow-y: auto;
}
.room-info-panel.open { right: 0; }
.room-info-panel h3 {
  font-family: var(--font-display);
  color: var(--navy);
  margin-bottom: .5rem;
}
.room-info-panel ul { padding-left: 1.2rem; color: var(--gray-600); }

/* ── Notices ─────────────────────────────────────────────────────────────── */
.notice-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  margin-bottom: .9rem;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--gray-200);
}
.notice-card.priority-urgent  { border-left-color: var(--red);    }
.notice-card.priority-info    { border-left-color: var(--blue);   }
.notice-card.priority-general { border-left-color: var(--green);  }
.notice-card.notice-expired   { opacity: .5; }
.notice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .4rem;
}
.notice-title { font-weight: 700; color: var(--navy); font-size: 15px; }
.notice-priority { font-size: 10px; font-weight: 700; color: var(--gray-400); letter-spacing: .08em; }
.notice-msg { color: var(--gray-600); font-size: 14px; margin-bottom: .5rem; }
.notice-meta { font-size: 11px; color: var(--gray-400); }
.notice-actions { display: flex; gap: .4rem; margin-top: .6rem; }
.notice-badge {
  font-size: 10px;
  font-weight: 700;
  padding: .1rem .5rem;
  border-radius: 999px;
  letter-spacing: .05em;
}
.priority-badge-urgent  { background: #fee2e2; color: #991b1b; }
.priority-badge-info    { background: #dbeafe; color: #1e40af; }
.priority-badge-general { background: #d1fae5; color: #065f46; }
.expired-tag { background: var(--gray-200); color: var(--gray-600); font-size: 10px; padding: .1rem .4rem; border-radius: 3px; margin-left: .4rem; font-weight: 700; }
.expired-divider { text-align: center; color: var(--gray-400); font-size: 12px; padding: 1rem 0; border-top: 1px solid var(--gray-200); margin: 1rem 0; }

/* ── Student Profile ─────────────────────────────────────────────────────── */
.profile-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  max-width: 560px;
}
.profile-header {
  background: var(--navy);
  padding: 1.8rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
}
.profile-avatar {
  width: 64px; height: 64px;
  background: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--navy-dark);
  font-weight: 700;
}
.profile-name { color: var(--white); font-family: var(--font-display); font-size: 1.15rem; }
.profile-reg  { color: var(--gold-light); font-size: 13px; }
.profile-body { padding: 1.5rem; }
.profile-field {
  display: flex;
  justify-content: space-between;
  padding: .65rem 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 14px;
}
.profile-field:last-child { border-bottom: none; }
.profile-field-label { color: var(--gray-400); font-weight: 600; }
.profile-field-value { color: var(--gray-800); font-weight: 500; }
.password-box {
  background: var(--gold-pale);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  margin-top: 1rem;
}
.password-box h4 { color: var(--navy); font-size: 13px; margin-bottom: .3rem; }
.password-box code { font-size: 1.2rem; font-weight: 700; color: var(--navy-dark); letter-spacing: .08em; }
.password-box small { display: block; color: var(--gray-400); font-size: 11px; margin-top: .3rem; }

/* ── Room Detail (student) ───────────────────────────────────────────────── */
.room-detail-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  max-width: 560px;
  padding: 2rem;
}
.room-badge {
  display: inline-block;
  background: var(--navy);
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .3rem .8rem;
  border-radius: 999px;
  margin-bottom: .8rem;
}
.room-number-big {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--navy);
  margin-bottom: 1rem;
}
.room-detail-stats {
  display: flex;
  gap: 2rem;
  margin-bottom: 1rem;
}
.detail-stat { text-align: center; }
.stat-num { display: block; font-family: var(--font-display); font-size: 1.8rem; color: var(--navy); }
.stat-lbl { font-size: 11px; color: var(--gray-400); text-transform: uppercase; letter-spacing: .07em; }
.occupancy-bar-full {
  height: 8px;
  background: var(--gray-100);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.occupancy-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--gold));
  border-radius: 4px;
  transition: width .6s ease;
}
.roommates-title { font-weight: 700; color: var(--navy); margin-bottom: .8rem; }
.no-roommates { color: var(--gray-400); font-size: 14px; }
.roommate-list { display: flex; flex-direction: column; gap: .7rem; }
.roommate-card {
  display: flex;
  align-items: center;
  gap: .9rem;
  background: var(--gray-50);
  border-radius: var(--radius);
  padding: .8rem 1rem;
}
.roommate-avatar {
  width: 40px; height: 40px;
  background: var(--navy);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.roommate-name { font-weight: 600; color: var(--gray-800); font-size: 14px; }
.roommate-info { font-size: 12px; color: var(--gray-400); }

/* ── Apply ────────────────────────────────────────────────────────────────── */
.apply-status-card, .apply-form-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2.5rem 2rem;
  max-width: 480px;
  text-align: center;
}
.apply-form-card { text-align: left; }
.apply-icon { font-size: 3rem; margin-bottom: .8rem; }
.apply-status-card h3 { font-family: var(--font-display); color: var(--navy); margin-bottom: .5rem; font-size: 1.2rem; }
.apply-badge {
  display: inline-block;
  padding: .4rem 1.2rem;
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  margin: .8rem 0;
}
.apply-note { font-size: 13px; color: var(--gray-600); margin-top: .5rem; }
.apply-form-card h3 { font-family: var(--font-display); color: var(--navy); margin-bottom: .5rem; }
.apply-form-card p { color: var(--gray-400); font-size: 13px; margin-bottom: 1.2rem; }

/* ── Facilities ──────────────────────────────────────────────────────────── */
.facilities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.2rem;
}
.facility-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--gold);
  text-align: center;
}
.facility-icon { font-size: 2.2rem; margin-bottom: .7rem; }
.facility-card h3 { color: var(--navy); font-size: 1rem; margin-bottom: .5rem; }
.facility-card p  { color: var(--gray-600); font-size: 13px; line-height: 1.6; }

/* ── Empty State ─────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--gray-400);
}
.empty-icon { font-size: 3rem; margin-bottom: .8rem; }
.empty-state h3 { color: var(--gray-600); font-size: 1.1rem; margin-bottom: .4rem; }

/* ── Utilisation bar ─────────────────────────────────────────────────────── */
.util-bar-wrap {
  display: inline-block;
  width: 80px; height: 8px;
  background: var(--gray-100);
  border-radius: 4px;
  vertical-align: middle;
  margin-right: .4rem;
  overflow: hidden;
}
.util-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--gold));
  border-radius: 4px;
}

/* ── Export cards ────────────────────────────────────────────────────────── */
.export-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.2rem;
  margin-bottom: 1.8rem;
}
.export-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  text-align: center;
  border-top: 3px solid var(--navy);
}
.export-card h3 { color: var(--navy); margin-bottom: .7rem; }
.export-card .btn-sm { margin: .2rem; }

/* ── Form cards (admin forms) ────────────────────────────────────────────── */
.form-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  max-width: 480px;
  margin-bottom: 1.5rem;
}
.form-card h3 {
  font-family: var(--font-display);
  color: var(--navy);
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--gold);
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/*  TOAST NOTIFICATIONS                                                         */
/* ═══════════════════════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.toast {
  display: flex;
  align-items: center;
  gap: .7rem;
  background: var(--white);
  border-radius: var(--radius);
  padding: .75rem 1.1rem;
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 500;
  min-width: 240px;
  max-width: 340px;
  transform: translateX(120%);
  transition: transform .3s ease, opacity .3s ease;
  opacity: 0;
  border-left: 4px solid var(--gray-200);
}
.toast.toast-show { transform: translateX(0); opacity: 1; }
.toast-info    { border-left-color: var(--blue);  }
.toast-success { border-left-color: var(--green); }
.toast-error   { border-left-color: var(--red);   }
.toast-warning { border-left-color: var(--yellow);}
.toast-icon    { font-size: 16px; font-weight: 700; }
.toast-info    .toast-icon { color: var(--blue);  }
.toast-success .toast-icon { color: var(--green); }
.toast-error   .toast-icon { color: var(--red);   }
.toast-warning .toast-icon { color: var(--yellow);}

/* ═══════════════════════════════════════════════════════════════════════════ */
/*  RESPONSIVE                                                                  */
/* ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar {
    width: 200px;
    transform: translateX(-100%);
    transition: transform .3s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .dash-main { margin-left: 0; }
  .chart-row { grid-template-columns: 1fr; }
  .form-row  { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .hero-title { font-size: 1.8rem; }
  .stats-strip { gap: 1.5rem; }
  .stat-divider { display: none; }
}
@media (max-width: 480px) {
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .room-grid  { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/*  FACILITIES                                                                  */
/* ═══════════════════════════════════════════════════════════════════════════ */
.fac-summary {
  display: flex; gap: 1.2rem; margin-bottom: 1.5rem; flex-wrap: wrap;
}
.fac-sum-card {
  background: var(--white); border-radius: var(--radius); padding: 1rem 1.5rem;
  box-shadow: var(--shadow-sm); border-top: 3px solid var(--gold);
  display: flex; flex-direction: column; gap: .2rem; min-width: 140px;
}
.fac-sum-num { font-family: var(--font-display); font-size: 2rem; color: var(--navy); font-weight: 700; line-height: 1; }
.fac-sum-lbl { font-size: 11px; color: var(--gray-400); text-transform: uppercase; letter-spacing: .07em; }

.fac-filter-bar {
  display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.2rem; align-items: center;
}
.fac-filter-bar input, .fac-filter-bar select { width: auto; min-width: 130px; font-size: 12px; }

.fac-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem;
}
.fac-card {
  background: var(--white); border-radius: var(--radius); padding: 1.1rem;
  box-shadow: var(--shadow-sm); border-top: 3px solid var(--gold);
  transition: transform var(--transition), box-shadow var(--transition);
}
.fac-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.fac-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.fac-icon { font-size: 1.6rem; }
.fac-status-dot { width: 10px; height: 10px; border-radius: 50%; }
.fac-card-name { font-weight: 700; color: var(--navy); font-size: 14px; margin-bottom: .15rem; }
.fac-card-cat  { font-size: 12px; color: var(--gray-600); }
.fac-card-block{ font-size: 11px; color: var(--gray-400); margin-bottom: .3rem; }
.fac-card-status { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .6rem; }
.fac-card-actions { display: flex; gap: .3rem; flex-wrap: wrap; }

/* Booking badges */
.badge-suite      { background: #ede9fe; color: #5b21b6; }
.badge-staff_room { background: #dbeafe; color: #1e40af; }
.badge-NSP        { background: #f3e8ff; color: #6b21a8; }
.badge-facility   { background: #d1fae5; color: #065f46; }
.badge-ended      { background: var(--gray-100); color: var(--gray-400); }
.badge-open       { background: #fee2e2; color: #991b1b; }
.badge-in_progress{ background: #fef3c7; color: #92400e; }
.badge-resolved   { background: #d1fae5; color: #065f46; }
.badge-closed     { background: var(--gray-100); color: var(--gray-400); }

/* ── Room Summary Strip ──────────────────────────────────────────────────── */
.room-summary-strip {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  background: var(--white);
  padding: .8rem 1.2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
  font-size: 13px;
  color: var(--gray-600);
}
.room-sum-item { display: flex; align-items: center; gap: .3rem; }

/* ── Room Type Change Dropdown ───────────────────────────────────────────── */
.room-type-change {
  margin-top: .4rem;
}
.room-type-select {
  width: 100%;
  font-size: 9px;
  padding: .15rem .2rem;
  border-radius: 4px;
  border: 1px solid var(--gray-200);
  background: var(--gray-50);
  color: var(--gray-600);
  cursor: pointer;
}
.room-type-select:focus { border-color: var(--navy); }

/* ═══════════════════════════════════════════════════════════════════════════ */
/*  BEAUTIFUL TABLES — All Students & Allocations                              */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* ── Enhanced Table Card ─────────────────────────────────────────────────── */
.table-card {
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 24px rgba(30,58,95,.08);
  overflow: hidden;
  border: 1px solid var(--gray-200);
}

.table-card-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  padding: 1.2rem 1.5rem;
  border-bottom: none;
}

.table-card-title {
  color: var(--white) !important;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: .02em;
}

/* ── Filter bar inside table ─────────────────────────────────────────────── */
.table-filter-bar {
  background: var(--gray-50);
  padding: .9rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  align-items: center;
}

.table-filter-bar input,
.table-filter-bar select {
  width: auto;
  min-width: 130px;
  font-size: 12.5px;
  padding: .4rem .7rem;
  border-radius: 6px;
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-800);
}

.table-filter-bar input:focus,
.table-filter-bar select:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(30,58,95,.08);
}

/* ── Table itself ────────────────────────────────────────────────────────── */
.beautiful-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.beautiful-table thead tr {
  background: var(--gray-50);
  border-bottom: 2px solid var(--gold);
}

.beautiful-table thead th {
  padding: .85rem 1.1rem;
  text-align: left;
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--navy);
  font-weight: 800;
  white-space: nowrap;
  border-bottom: none;
}

.beautiful-table thead th:first-child { padding-left: 1.5rem; }
.beautiful-table thead th:last-child  { padding-right: 1.5rem; text-align: right; }

/* ── Body rows ───────────────────────────────────────────────────────────── */
.beautiful-table tbody tr {
  border-bottom: 1px solid var(--gray-100);
  transition: background var(--transition);
}

.beautiful-table tbody tr:last-child { border-bottom: none; }

.beautiful-table tbody tr:hover {
  background: linear-gradient(90deg, rgba(201,168,76,.04) 0%, rgba(30,58,95,.03) 100%);
}

.beautiful-table tbody td {
  padding: .85rem 1.1rem;
  color: var(--gray-800);
  vertical-align: middle;
}

.beautiful-table tbody td:first-child { padding-left: 1.5rem; }
.beautiful-table tbody td:last-child  { padding-right: 1.5rem; text-align: right; }

/* ── Avatar + name cell ──────────────────────────────────────────────────── */
.student-name-cell {
  display: flex;
  align-items: center;
  gap: .7rem;
}

.student-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--font-display);
}

.student-avatar.female {
  background: linear-gradient(135deg, #be185d 0%, #ec4899 100%);
}

.student-name-text {
  font-weight: 600;
  color: var(--navy);
  font-size: 13.5px;
  line-height: 1.2;
}

.student-reg-text {
  font-size: 11px;
  color: var(--gray-400);
  font-weight: 400;
}

/* ── Programme pill ──────────────────────────────────────────────────────── */
.prog-pill {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .7rem;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.prog-pill.nursing {
  background: #dbeafe;
  color: #1e40af;
}

.prog-pill.nutrition {
  background: #d1fae5;
  color: #065f46;
}

/* ── Level badge ─────────────────────────────────────────────────────────── */
.level-badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: var(--gold-pale);
  color: var(--navy);
  border: 1px solid rgba(201,168,76,.3);
}

/* ── Sex indicator ───────────────────────────────────────────────────────── */
.sex-indicator {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  font-size: 12px;
  font-weight: 600;
}

.sex-indicator.male   { color: #3b82f6; }
.sex-indicator.female { color: #ec4899; }

/* ── Room cell ───────────────────────────────────────────────────────────── */
.room-cell {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .6rem;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.room-cell.assigned {
  background: #d1fae5;
  color: #065f46;
}

.room-cell.unassigned {
  background: var(--gray-100);
  color: var(--gray-400);
  font-style: italic;
}

/* ── Enrolment badge ─────────────────────────────────────────────────────── */
.enrol-badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: 11px;
  font-weight: 700;
  padding: .2rem .55rem;
  border-radius: 999px;
}

.enrol-badge.enrolled {
  background: #d1fae5;
  color: #065f46;
}

.enrol-badge.not-enrolled {
  background: #fee2e2;
  color: #991b1b;
}

/* ── Action buttons in table ─────────────────────────────────────────────── */
.table-actions {
  display: flex;
  gap: .3rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.table-actions .btn-sm {
  padding: .3rem .65rem;
  font-size: 11.5px;
  border-radius: 6px;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Empty state inside table ────────────────────────────────────────────── */
.table-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--gray-400);
}

.table-empty-icon { font-size: 2.5rem; margin-bottom: .5rem; }
.table-empty h4   { color: var(--gray-600); margin-bottom: .3rem; }

/* ── Row counter ─────────────────────────────────────────────────────────── */
.table-footer {
  background: var(--gray-50);
  padding: .7rem 1.5rem;
  border-top: 1px solid var(--gray-200);
  font-size: 12px;
  color: var(--gray-400);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/*  STUDENT MAINTENANCE REPORTING                                               */
/* ═══════════════════════════════════════════════════════════════════════════ */

.maint-form-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.8rem;
  margin-bottom: 1.5rem;
  border-top: 4px solid var(--navy);
}

.maint-form-card h3 {
  font-family: var(--font-display);
  color: var(--navy);
  font-size: 1.15rem;
  margin-bottom: .4rem;
}

.maint-form-card p {
  color: var(--gray-400);
  font-size: 13px;
  margin-bottom: 1.2rem;
}

.maint-history-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.8rem;
}

.maint-history-card h3 {
  font-family: var(--font-display);
  color: var(--navy);
  font-size: 1.1rem;
  margin-bottom: 1.2rem;
  padding-bottom: .6rem;
  border-bottom: 2px solid var(--gold);
}

.maint-report-card {
  background: var(--gray-50);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin-bottom: .9rem;
  border-left: 4px solid var(--navy);
  transition: box-shadow var(--transition);
}

.maint-report-card:hover { box-shadow: var(--shadow-md); }

.maint-report-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .4rem;
  flex-wrap: wrap;
  gap: .4rem;
}

.maint-report-title {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-weight: 700;
  color: var(--navy);
  font-size: 14px;
}

.maint-category-icon { font-size: 1rem; }

.maint-badge {
  display: inline-block;
  padding: .15rem .55rem;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.maint-report-location {
  font-size: 12px;
  color: var(--gray-400);
  margin-bottom: .4rem;
}

.maint-report-desc {
  font-size: 13.5px;
  color: var(--gray-600);
  margin-bottom: .5rem;
  line-height: 1.5;
}

.maint-report-footer {
  font-size: 11px;
  color: var(--gray-400);
  border-top: 1px solid var(--gray-200);
  padding-top: .4rem;
  margin-top: .4rem;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/*  STUDENT MAINTENANCE REPORTING                                               */
/* ═══════════════════════════════════════════════════════════════════════════ */

.maint-form-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.8rem;
  margin-bottom: 1.5rem;
  border-top: 4px solid var(--gold);
  max-width: 680px;
}

.maint-form-card h3 {
  font-family: var(--font-display);
  color: var(--navy);
  font-size: 1.15rem;
  margin-bottom: .4rem;
}

.maint-form-card p {
  color: var(--gray-400);
  font-size: 13px;
  margin-bottom: 1.2rem;
}

.maint-reports-card {
  max-width: 680px;
}

.maint-reports-card h3 {
  font-family: var(--font-display);
  color: var(--navy);
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.maint-report-item {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  margin-bottom: .8rem;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--gold);
}

.maint-report-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .5rem;
  flex-wrap: wrap;
  gap: .4rem;
}

.maint-report-location {
  font-weight: 700;
  color: var(--navy);
  font-size: 14px;
}

.maint-report-cat {
  font-size: 12px;
  color: var(--gray-600);
  margin-bottom: .3rem;
}

.maint-report-desc {
  font-size: 13.5px;
  color: var(--gray-800);
  line-height: 1.5;
  margin-bottom: .4rem;
}

.maint-report-date {
  font-size: 11px;
  color: var(--gray-400);
}

.maint-resolved-note {
  margin-top: .5rem;
  font-size: 12px;
  color: #065f46;
  background: #d1fae5;
  padding: .4rem .7rem;
  border-radius: 6px;
  font-weight: 600;
}

.mini-badge {
  font-size: 11px;
  font-weight: 700;
  padding: .2rem .55rem;
  border-radius: 999px;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/*  STUDENT MAINTENANCE REPORTING                                               */
/* ═══════════════════════════════════════════════════════════════════════════ */

.report-issue-box {
  margin-top: 1.8rem;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  border-radius: var(--radius);
  padding: 1.3rem 1.5rem;
  color: var(--white);
}

.report-issue-box h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  margin-bottom: .3rem;
  color: var(--white);
}

.report-issue-box p {
  font-size: 13px;
  color: rgba(255,255,255,.7);
  margin-bottom: .9rem;
}

.report-issue-box .btn {
  background: var(--gold);
  color: var(--navy-dark);
  font-weight: 700;
  padding: .5rem 1.3rem;
  font-size: 13px;
}

.report-issue-box .btn:hover {
  background: var(--gold-light);
}

/* ── My Reports List ─────────────────────────────────────────────────────── */
.my-reports-box {
  margin-top: 1.5rem;
}

.my-reports-box h3 {
  font-family: var(--font-display);
  color: var(--navy);
  font-size: 1rem;
  margin-bottom: .8rem;
}

.my-report-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: .9rem 1.1rem;
  margin-bottom: .7rem;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--gold);
}

.my-report-header {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .4rem;
  flex-wrap: wrap;
}

.my-report-category {
  font-weight: 700;
  color: var(--navy);
  font-size: 13px;
  text-transform: capitalize;
}

.my-report-priority {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.my-report-status {
  font-size: 10px;
  font-weight: 700;
  padding: .15rem .5rem;
  border-radius: 999px;
  text-transform: capitalize;
  margin-left: auto;
}

.my-report-desc {
  font-size: 13px;
  color: var(--gray-600);
  margin-bottom: .4rem;
  line-height: 1.5;
}

.my-report-meta {
  font-size: 11px;
  color: var(--gray-400);
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/*  MOBILE RESPONSIVE — Enhanced                                               */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* ── Mobile menu toggle button ───────────────────────────────────────────── */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: .8rem;
  left: .8rem;
  z-index: 200;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 49;
}

@media (max-width: 768px) {
  /* Show mobile menu button */
  .mobile-menu-btn { display: flex; align-items: center; justify-content: center; }

  /* Sidebar hidden by default on mobile */
  .sidebar {
    width: 260px;
    transform: translateX(-100%);
    transition: transform .3s ease;
    z-index: 100;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }

  /* Main content full width */
  .dash-main { margin-left: 0; }
  .dash-topbar { padding-left: 3.5rem; }

  /* Stack charts */
  .chart-row { grid-template-columns: 1fr; }
  .form-row  { grid-template-columns: 1fr; }

  /* Stat cards 2 columns */
  .stat-cards { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
  .stat-card  { padding: .8rem 1rem; }
  .stat-card-value { font-size: 1.5rem; }

  /* Tables scroll horizontally */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 500px; }
  .beautiful-table { font-size: 12px; }
  .beautiful-table thead th { padding: .6rem .7rem; }
  .beautiful-table tbody td { padding: .5rem .7rem; }

  /* Room grid smaller cards */
  .room-grid { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: .4rem; }
  .room-card-header { font-size: 10px; padding: .3rem; }
  .room-stat { font-size: 11px; }

  /* Facilities grid */
  .facilities-grid { grid-template-columns: repeat(2, 1fr); gap: .8rem; }
  .fac-grid { grid-template-columns: repeat(2, 1fr); }

  /* Dashboard content padding */
  .dash-content { padding: 1rem; }

  /* Student name cell compact */
  .student-name-cell { gap: .4rem; }
  .student-avatar { width: 28px; height: 28px; font-size: 10px; }
  .student-name-text { font-size: 12px; }
  .student-reg-text { font-size: 10px; }

  /* Table actions stack */
  .table-actions { flex-direction: column; gap: .2rem; }
  .table-actions .btn-sm { font-size: 11px; padding: .25rem .5rem; }

  /* Modal full width on mobile */
  .modal-box { margin: .5rem; max-width: calc(100vw - 1rem) !important; }
  .modal-body { padding: 1rem; }

  /* Room detail card */
  .room-detail-stats { gap: 1rem; }
  .stat-num { font-size: 1.4rem; }

  /* Form cards full width */
  .form-card { max-width: 100%; }
  .profile-card { max-width: 100%; }
  .apply-form-card { max-width: 100%; }
  .apply-status-card { max-width: 100%; }

  /* Export grid */
  .export-grid { grid-template-columns: repeat(2, 1fr); }

  /* Notice board */
  .notice-card { padding: .8rem; }

  /* Room summary strip */
  .room-summary-strip { gap: .6rem; font-size: 12px; }
}

@media (max-width: 480px) {
  /* Single column for very small screens */
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .facilities-grid { grid-template-columns: 1fr 1fr; }
  .fac-grid { grid-template-columns: 1fr 1fr; }
  .export-grid { grid-template-columns: 1fr 1fr; }

  /* Landing page */
  .hero { padding: 5rem 1rem 3rem; }
  .hero-title { font-size: 1.6rem; }
  .hero-actions { flex-direction: column; align-items: center; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .stats-strip { gap: 1rem; padding: 1.2rem; }
  .stat-item .stat-number { font-size: 1.8rem; }

  /* Apply form on landing */
  .form-row { grid-template-columns: 1fr; }

  /* Roommate cards */
  .roommate-card { padding: .6rem; }
  .roommate-avatar { width: 34px; height: 34px; }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/*  iOS / iPhone SPECIFIC FIXES                                                */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* Prevent iOS zoom on input focus */
input, select, textarea {
  font-size: 16px !important;
}

/* Fix iOS safe area (notch) */
.dash-layout {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.sidebar {
  padding-bottom: env(safe-area-inset-bottom);
}

/* Fix iOS momentum scrolling */
.table-wrap {
  -webkit-overflow-scrolling: touch;
  overflow-x: auto;
}

.dash-main {
  -webkit-overflow-scrolling: touch;
  overflow-y: auto;
}

@media (max-width: 768px) {

  /* Ensure sidebar is fully hidden off-screen */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 75vw;
    max-width: 280px;
    transform: translateX(-100%);
    transition: transform .3s ease;
    z-index: 1000;
    overflow-y: auto;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0,0,0,.3);
  }

  /* Overlay covers full screen */
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 999;
    display: none;
  }
  .sidebar-overlay.open { display: block; }

  /* Main content takes full width */
  .dash-main {
    margin-left: 0 !important;
    width: 100% !important;
    min-height: 100vh;
  }

  /* Dashboard content padding with room for menu button */
  .dash-content {
    padding: 1rem;
    padding-top: 3.5rem;
  }

  /* Mobile menu button — always visible */
  .mobile-menu-btn {
    display: flex !important;
    position: fixed;
    top: .7rem;
    left: .7rem;
    z-index: 1001;
    width: 42px;
    height: 42px;
    background: var(--navy);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.3rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
    -webkit-tap-highlight-color: transparent;
  }

  /* Topbar shifts right on mobile */
  .dash-topbar {
    padding-left: 3.5rem !important;
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--white);
  }

  /* Stat cards — 2 columns on mobile */
  .stat-cards {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: .5rem !important;
  }

  .stat-card {
    padding: .7rem !important;
  }

  .stat-card-value {
    font-size: 1.4rem !important;
  }

  .stat-card-label {
    font-size: 10px !important;
  }

  /* Charts stack vertically */
  .chart-row {
    grid-template-columns: 1fr !important;
  }

  /* Tables */
  .table-wrap {
    overflow-x: auto;
    max-width: 100vw;
  }

  table {
    min-width: 500px;
  }

  /* Form rows stack */
  .form-row {
    grid-template-columns: 1fr !important;
  }

  /* Manage rooms grid stacks */
  #section-managerooms > div {
    grid-template-columns: 1fr !important;
  }

  /* Student name cell compact */
  .student-name-cell { gap: .3rem; }
  .student-avatar { width: 28px !important; height: 28px !important; font-size: 10px !important; }
  .student-name-text { font-size: 12px !important; }
  .student-reg-text { font-size: 10px !important; }

  /* Action buttons compact */
  .table-actions { gap: .2rem; }
  .btn-sm { font-size: 10px !important; padding: .2rem .4rem !important; }

  /* Modals full screen on mobile */
  .modal-overlay {
    padding: .5rem;
    align-items: flex-start;
    padding-top: 2rem;
  }

  .modal-box {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 90vh;
    overflow-y: auto;
  }

  /* Room grid smaller */
  .room-grid {
    grid-template-columns: repeat(auto-fill, minmax(65px, 1fr)) !important;
    gap: .3rem !important;
  }

  .room-card-header {
    font-size: 9px !important;
    padding: .25rem !important;
  }

  /* Notices */
  .notice-card { padding: .7rem; }

  /* Room summary strip wraps */
  .room-summary-strip {
    gap: .5rem;
    font-size: 11px;
  }

  /* Profile card full width */
  .profile-card,
  .room-detail-card,
  .apply-form-card { max-width: 100% !important; }
}

@media (max-width: 390px) {
  /* iPhone SE and small phones */
  .stat-cards { grid-template-columns: repeat(2, 1fr) !important; }
  .stat-card-value { font-size: 1.2rem !important; }
  .room-grid { grid-template-columns: repeat(auto-fill, minmax(55px, 1fr)) !important; }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/*  PORTRAIT MODE FIX — Full content visible without rotating phone            */
/* ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) and (orientation: portrait) {

  /* Sidebar fully hidden until toggled — never overlaps content */
  .sidebar {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    height: 100% !important;
    width: 80vw !important;
    max-width: 260px !important;
    transform: translateX(-100%) !important;
    z-index: 1000 !important;
  }

  .sidebar.open {
    transform: translateX(0) !important;
  }

  /* Main content always full width in portrait */
  .dash-main {
    margin-left: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  /* Dashboard content — enough top padding for menu button */
  .dash-content {
    padding: 4rem 0.8rem 1.5rem !important;
  }

  /* Topbar — shift right to avoid menu button */
  .dash-topbar {
    padding-left: 3.5rem !important;
    font-size: 13px !important;
  }

  /* Stat cards — 2 per row, compact */
  .stat-cards {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
    padding: 0 !important;
  }

  .stat-card {
    padding: 0.7rem 0.6rem !important;
    min-width: 0 !important;
  }

  .stat-card-value {
    font-size: 1.3rem !important;
  }

  .stat-card-label {
    font-size: 9px !important;
    letter-spacing: 0 !important;
  }

  .stat-card-icon {
    font-size: 1.2rem !important;
  }

  /* Charts — single column, full width */
  .chart-row {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .chart-card {
    width: 100% !important;
    overflow: hidden !important;
  }

  .chart-card canvas {
    max-width: 100% !important;
    height: 180px !important;
  }

  /* Tables — scroll horizontally */
  .table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-width: calc(100vw - 1.6rem) !important;
  }

  /* Room grid — smaller cards */
  .room-grid {
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)) !important;
    gap: 0.3rem !important;
  }

  .room-card-header {
    font-size: 8px !important;
    padding: 0.2rem !important;
  }

  .room-card-body {
    padding: 0.2rem !important;
  }

  .room-stat {
    font-size: 10px !important;
  }

  .room-type-label {
    font-size: 8px !important;
  }

  .room-type-select {
    font-size: 7px !important;
  }

  /* Manage rooms — stack vertically */
  #section-managerooms > div {
    grid-template-columns: 1fr !important;
  }

  /* Modals — full screen width */
  .modal-box {
    width: calc(100vw - 1rem) !important;
    max-width: calc(100vw - 1rem) !important;
    margin: 0.5rem auto !important;
  }

  /* Form rows — stack */
  .form-row {
    grid-template-columns: 1fr !important;
  }

  /* Beautiful table compact */
  .beautiful-table {
    font-size: 11px !important;
  }

  .beautiful-table th,
  .beautiful-table td {
    padding: 0.4rem 0.5rem !important;
  }

  /* Student avatar smaller */
  .student-avatar {
    width: 26px !important;
    height: 26px !important;
    font-size: 9px !important;
    flex-shrink: 0 !important;
  }

  .student-name-text { font-size: 11px !important; }
  .student-reg-text  { font-size: 9px !important;  }

  /* Prog pill compact */
  .prog-pill { font-size: 9px !important; padding: 0.1rem 0.4rem !important; }
  .level-badge { font-size: 9px !important; padding: 0.1rem 0.4rem !important; }

  /* Action buttons stacked */
  .table-actions {
    flex-direction: column !important;
    gap: 0.15rem !important;
  }

  .btn-sm {
    font-size: 9px !important;
    padding: 0.2rem 0.4rem !important;
  }

  /* Notice board */
  .notice-card { padding: 0.7rem !important; }
  .notice-title { font-size: 13px !important; }

  /* Room summary strip wraps */
  .room-summary-strip {
    flex-wrap: wrap !important;
    gap: 0.4rem !important;
    font-size: 10px !important;
    padding: 0.6rem !important;
  }

  /* Profile card full width */
  .profile-card,
  .room-detail-card {
    padding: 1rem !important;
  }

  /* Room detail stats */
  .room-detail-stats {
    gap: 0.8rem !important;
  }

  .stat-num { font-size: 1.3rem !important; }
}

/* MBChB-COBES programme pill */
.prog-pill.cobes {
  background: #ede9fe;
  color: #5b21b6;
}
