/* ===================================================
   DormFlow — Hostel Management System
   style.css — Complete Design System
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* ── CSS Variables (Light Theme) ── */
:root {
  --primary: #1a237e;
  --primary-light: #3949ab;
  --accent: #00bcd4;
  --success: #43a047;
  --danger: #e53935;
  --warning: #fb8c00;
  --bg: #f0f2f8;
  --card-bg: #ffffff;
  --text-primary: #1a1a2e;
  --text-muted: #6b7280;
  --shadow: 0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.15);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-width: 260px;
  --sidebar-width-student: 240px;
  --transition: 0.2s ease;
  --border: #e5e7eb;
}

/* ── Dark Mode Variables ── */
[data-theme="dark"] {
  --bg: #0d1117;
  --card-bg: #161b22;
  --text-primary: #e6edf3;
  --text-muted: #8b949e;
  --border: #30363d;
  --shadow: 0 4px 12px rgba(0,0,0,0.40);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.50);
  --primary: #3949ab;
  --primary-light: #5c6bc0;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
input, select, textarea, button { font-family: inherit; }
img { max-width: 100%; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 99px; }

/* =========================================
   LOGIN PAGE (index.html)
   ========================================= */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a237e 0%, #3949ab 55%, #00bcd4 100%);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(0,188,212,0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(255,255,255,0.08) 0%, transparent 50%);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255,255,255,0.97);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.30), 0 4px 12px rgba(0,0,0,0.15);
  padding: 40px 36px;
  position: relative;
  z-index: 1;
  animation: cardSlideUp 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}

[data-theme="dark"] .login-card {
  background: rgba(22,27,34,0.97);
  border: 1px solid var(--border);
}

@keyframes cardSlideUp {
  from { opacity: 0; transform: translateY(40px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo .logo-icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(26,35,126,0.30);
}

.login-logo h1 { font-size: 26px; font-weight: 700; color: var(--primary); letter-spacing: -0.5px; }
.login-logo p  { font-size: 12px; color: var(--text-muted); font-weight: 500; letter-spacing: 0.5px; margin-top: 2px; }

/* Tab Switcher */
.tab-switcher {
  display: flex;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 28px;
  gap: 4px;
}

.tab-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tab-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(26,35,126,0.25);
}

/* Form Styles */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper .input-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: none;
}

.form-control {
  width: 100%;
  padding: 11px 40px 11px 38px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--card-bg);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(57,73,171,0.15);
}

.toggle-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  display: flex;
  align-items: center;
}

.toggle-password:hover { color: var(--primary); }

.btn-login {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 4px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-login:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(26,35,126,0.30);
}

.btn-login:active { transform: translateY(0); }

.forgot-link {
  display: block;
  text-align: center;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  margin-top: 14px;
  transition: opacity var(--transition);
}
.forgot-link:hover { opacity: 0.8; }

/* Floating decorative shapes */
.login-shapes .shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.08;
  background: #fff;
}
.login-shapes .shape-1 { width: 300px; height: 300px; top: -80px; right: -80px; }
.login-shapes .shape-2 { width: 200px; height: 200px; bottom: -60px; left: -60px; }
.login-shapes .shape-3 { width: 120px; height: 120px; top: 40%; left: 5%; }

/* =========================================
   DASHBOARD LAYOUT (admin.html / user.html)
   ========================================= */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--primary);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease, width 0.3s ease;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar.student { width: var(--sidebar-width-student); }

.sidebar-header {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.sidebar-logo .logo-icon {
  width: 38px; height: 38px;
  background: rgba(255,255,255,0.15);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}

.sidebar-role-label {
  font-size: 10px;
  color: rgba(255,255,255,0.55);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-left: 48px;
}

.sidebar-user {
  padding: 20px 20px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), rgba(0,188,212,0.5));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.avatar.lg { width: 64px; height: 64px; font-size: 24px; }
.avatar.xl { width: 120px; height: 120px; font-size: 48px; }

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-info .user-name {
  font-size: 13px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-info .user-meta {
  font-size: 11px; color: rgba(255,255,255,0.55); margin-top: 1px;
}

.role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  background: rgba(0,188,212,0.25);
  color: var(--accent);
  border: 1px solid rgba(0,188,212,0.4);
  margin-top: 3px;
}

.sidebar-nav { flex: 1; padding: 12px 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  color: rgba(255,255,255,0.65);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  border-left: 4px solid transparent;
  user-select: none;
}

.nav-item .nav-icon { font-size: 18px; width: 22px; text-align: center; flex-shrink: 0; }
.nav-item .nav-label { flex: 1; }

.nav-item:hover { color: #fff; background: rgba(255,255,255,0.08); }

.nav-item.active {
  color: #fff;
  background: rgba(255,255,255,0.12);
  border-left-color: var(--accent);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 60%;
  background: var(--accent);
  border-radius: 0 4px 4px 0;
}

.nav-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 8px 20px;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.10);
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  text-align: center;
}

/* ── Main Content ── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

.main-content.student { margin-left: var(--sidebar-width-student); }

/* Top Header Bar */
.topbar {
  height: 64px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: background var(--transition);
}

.hamburger-btn {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-primary);
  padding: 4px;
}

.topbar-title { flex: 1; font-size: 18px; font-weight: 600; color: var(--text-primary); }
.topbar-date  { font-size: 12px; color: var(--text-muted); }

.topbar-actions { display: flex; align-items: center; gap: 12px; }

.icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-primary);
}
.icon-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Notifications Dropdown */
.notif-wrapper {
  position: relative;
}

.notif-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: -60px;
  width: 320px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  display: none;
  flex-direction: column;
  z-index: 1000;
  animation: slideDown 0.3s ease;
  overflow: hidden;
}

.notif-dropdown.open {
  display: flex;
}

.notif-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notif-header h4 { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.notif-clear { font-size: 11px; color: var(--accent); cursor: pointer; font-weight: 500; }

.notif-body {
  max-height: 380px;
  overflow-y: auto;
}

.notif-item {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 12px;
  cursor: pointer;
  transition: background var(--transition);
  text-align: left;
}

.notif-item:hover { background: var(--bg); }
.notif-item:last-child { border-bottom: none; }

.notif-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.notif-icon.new { background: rgba(57,73,171,0.1); color: var(--primary-light); }
.notif-icon.alert { background: rgba(229,57,53,0.1); color: var(--danger); }
.notif-icon.fee { background: rgba(67,160,71,0.1); color: var(--success); }

.notif-content { flex: 1; }
.notif-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.notif-desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.notif-time { font-size: 10px; color: var(--text-muted); margin-top: 6px; }

.notif-footer {
  padding: 10px;
  text-align: center;
  background: var(--bg);
  font-size: 12px;
  font-weight: 500;
  color: var(--primary-light);
  cursor: pointer;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 500px) {
  .notif-dropdown { right: -120px; width: 280px; }
}

/* Dark mode toggle */
.dark-toggle { cursor: pointer; font-size: 20px; }

/* Content Wrapper */
.content-wrapper { padding: 28px; flex: 1; }

/* Content Sections */
.content-section { display: none; animation: fadeInUp 0.35s ease both; }
.content-section.active { display: block; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================================
   COMPONENTS
   ========================================= */

/* Page Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h2 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ── Stat Cards ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  opacity: 0;
  animation: statFadeIn 0.5s ease forwards;
  border-bottom: 3px solid transparent;
}

.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.stat-card:nth-child(1) { border-bottom-color: var(--primary-light); animation-delay: 0.1s; }
.stat-card:nth-child(2) { border-bottom-color: var(--success); animation-delay: 0.2s; }
.stat-card:nth-child(3) { border-bottom-color: var(--danger); animation-delay: 0.3s; }
.stat-card:nth-child(4) { border-bottom-color: var(--warning); animation-delay: 0.4s; }

@keyframes statFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon.blue   { background: rgba(57,73,171,0.12); color: var(--primary-light); }
.stat-icon.green  { background: rgba(67,160,71,0.12);  color: var(--success); }
.stat-icon.red    { background: rgba(229,57,53,0.12);  color: var(--danger); }
.stat-icon.orange { background: rgba(251,140,0,0.12);  color: var(--warning); }
.stat-icon.cyan   { background: rgba(0,188,212,0.12);  color: var(--accent); }

.stat-info { flex: 1; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text-primary); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }

/* ── Cards ── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  transition: all var(--transition);
  border: 1px solid var(--border);
}

.card:hover { box-shadow: var(--shadow-lg); }

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ── Two Column Layout ── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ── Tables ── */
.table-wrapper { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: var(--bg); }

/* ── Badges / Pills ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-success { background: rgba(67,160,71,0.12); color: var(--success); }
.badge-danger  { background: rgba(229,57,53,0.12);  color: var(--danger); }
.badge-warning { background: rgba(251,140,0,0.12);  color: var(--warning); }
.badge-info    { background: rgba(0,188,212,0.12);  color: var(--accent); }
.badge-muted   { background: rgba(107,114,128,0.12); color: var(--text-muted); }
.badge-primary { background: rgba(57,73,171,0.12); color: var(--primary-light); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  position: relative;
  overflow: hidden;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26,35,126,0.25); }

.btn-accent  { background: var(--accent); color: #fff; }
.btn-accent:hover  { background: #00acc1; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,188,212,0.30); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #388e3c; transform: translateY(-1px); }

.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover  { background: #c62828; transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-primary);
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); background: rgba(57,73,171,0.06); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 6px 10px; }

/* Ripple Effect */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  transform: scale(0);
  animation: rippleAnim 0.55s linear;
  pointer-events: none;
}
@keyframes rippleAnim { to { transform: scale(4); opacity: 0; } }

/* ── Search Bar ── */
.search-bar {
  position: relative;
  margin-bottom: 18px;
}

.search-bar .search-icon {
  position: absolute;
  left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 15px;
  pointer-events: none;
}

.search-bar input {
  width: 100%;
  padding: 10px 16px 10px 38px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-bar input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(57,73,171,0.10);
}

/* ── Filter Buttons ── */
.filter-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.filter-btn {
  padding: 7px 14px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.filter-btn:hover { border-color: var(--primary-light); color: var(--primary-light); }
.filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Room Cards Grid ── */
.rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.room-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 18px;
  border: 2px solid transparent;
  box-shadow: var(--shadow);
  transition: all var(--transition);
  cursor: pointer;
}

.room-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.room-card.available { border-color: var(--success); }
.room-card.full      { border-color: var(--danger); }
.room-card.maintenance { border-color: var(--warning); }

.room-number {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 6px;
}

.room-floor  { font-size: 11px; color: var(--text-muted); margin-bottom: 10px; }
.room-beds   { font-size: 13px; font-weight: 600; margin-bottom: 10px; }

/* ── Donut Chart (CSS only) ── */
.donut-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  gap: 20px;
}

.donut {
  width: 140px; height: 140px;
  border-radius: 50%;
  background: conic-gradient(
    var(--danger)  0deg 159deg,
    var(--success) 159deg 324deg,
    var(--warning) 324deg 360deg
  );
  display: flex; align-items: center; justify-content: center;
  position: relative;
}

.donut::after {
  content: '';
  width: 80px; height: 80px;
  background: var(--card-bg);
  border-radius: 50%;
  position: absolute;
}

.donut-label {
  position: relative; z-index: 1;
  font-size: 18px; font-weight: 700;
  color: var(--text-primary);
}

.donut-legend { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.legend-item  { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.legend-dot   { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
}

.modal-overlay.open {
  display: flex;
  animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--card-bg);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  margin: 20px;
  box-shadow: var(--shadow-lg);
  animation: modalSlideIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: scale(0.90) translateY(-20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-title { font-size: 17px; font-weight: 600; }

.modal-close {
  background: none; border: none;
  font-size: 20px; cursor: pointer;
  color: var(--text-muted);
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--bg); color: var(--danger); }

.modal-body   { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
}

/* Form elements inside modals / sections */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

select.form-control, textarea.form-control {
  padding: 10px 14px;
}

textarea.form-control { resize: vertical; min-height: 80px; }

.toggle-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}

.toggle-switch {
  width: 42px; height: 22px;
  background: var(--border);
  border-radius: 99px;
  position: relative;
  cursor: pointer;
  transition: background var(--transition);
}

.toggle-switch.on { background: var(--success); }

.toggle-switch::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: left var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.toggle-switch.on::after { left: 23px; }

/* ── Attendance Calendar ── */
.calendar-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}

.calendar-month {
  font-size: 16px; font-weight: 600;
  color: var(--text-primary);
}

.calendar-nav {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-primary);
  font-size: 16px;
  transition: all var(--transition);
}
.calendar-nav:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  text-align: center;
}

.calendar-weekday {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  color: var(--text-muted); padding: 6px 0; letter-spacing: 0.5px;
}

.calendar-day {
  aspect-ratio: 1;
  border-radius: 8px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500;
  color: var(--text-muted);
  background: var(--bg);
  position: relative;
  transition: all var(--transition);
}

.calendar-day.present { background: rgba(67,160,71,0.12); color: var(--success); font-weight: 600; }
.calendar-day.absent  { background: rgba(229,57,53,0.12);  color: var(--danger);  font-weight: 600; }
.calendar-day.weekend { background: transparent; color: rgba(107,114,128,0.5); }
.calendar-day.today { outline: 2px solid var(--primary-light); }
.calendar-day.empty { background: transparent; }

.day-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  margin-top: 2px;
}
.present .day-dot { background: var(--success); }
.absent  .day-dot { background: var(--danger); }

.attendance-summary {
  display: flex;
  gap: 20px;
  margin-top: 18px;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.att-stat-item { text-align: center; flex: 1; }
.att-stat-value { font-size: 22px; font-weight: 700; color: var(--text-primary); }
.att-stat-label { font-size: 11px; color: var(--text-muted); font-weight: 500; }

/* ── Profile Hero ── */
.profile-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 60%, var(--accent) 100%);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 20px;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.profile-hero::before {
  content: '';
  position: absolute;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  top: -60px; right: -40px;
}

.profile-hero .avatar-wrap { position: relative; z-index: 1; }
.profile-hero .avatar { border: 3px solid rgba(255,255,255,0.3); }

.profile-hero-info { flex: 1; position: relative; z-index: 1; }
.profile-hero-info h2 { font-size: 24px; font-weight: 700; }
.profile-hero-info .profile-id-badge {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 99px;
  font-size: 12px;
  margin: 6px 0;
}
.profile-hero-info .profile-meta { font-size: 13px; opacity: 0.85; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.info-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  box-shadow: var(--shadow);
  transition: all var(--transition);
}

.info-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.info-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); margin-bottom: 4px; }
.info-value { font-size: 14px; font-weight: 600; color: var(--text-primary); }

/* ── Complaints / Maintenance ── */
.priority-options { display: flex; gap: 8px; flex-wrap: wrap; }

.priority-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 99px;
  border: 1.5px solid var(--border);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all var(--transition);
  color: var(--text-muted);
}

.priority-label input { display: none; }

.priority-label:has(input:checked) { border-color: currentColor; }
.priority-label.low:has(input:checked)    { color: var(--success); background: rgba(67,160,71,0.12); }
.priority-label.medium:has(input:checked) { color: var(--warning); background: rgba(251,140,0,0.12); }
.priority-label.high:has(input:checked)   { color: var(--danger);  background: rgba(229,57,53,0.12); }

/* ── Room Details ── */
.roommates-list { display: flex; flex-direction: column; gap: 12px; }
.roommate-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.facilities-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.facility-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
}
.facility-item .facility-check { color: var(--success); font-size: 17px; }

/* ── Date Picker Row ── */
.date-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.date-row label { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.date-row input[type="date"] {
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
}
.date-row input[type="date"]:focus { border-color: var(--primary-light); }

/* ── Fee Summary ── */
.fee-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }

.fee-stat {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.fee-stat-value { font-size: 22px; font-weight: 700; }
.fee-stat-label { font-size: 11px; color: var(--text-muted); font-weight: 500; margin-top: 2px; }

/* ── Action Buttons in Table ── */
.action-btns { display: flex; gap: 6px; align-items: center; }

/* ── Warden Card ── */
.warden-card {
  background: linear-gradient(135deg, rgba(26,35,126,0.06) 0%, rgba(0,188,212,0.06) 100%);
  border: 1.5px solid rgba(26,35,126,0.15);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .info-grid  { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .fee-summary { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .main-content,
  .main-content.student { margin-left: 0; }

  .hamburger-btn { display: flex; }
  .content-wrapper { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .rooms-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .profile-hero { flex-direction: column; text-align: center; }
  .info-grid { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 0 16px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .info-grid  { grid-template-columns: 1fr; }
  .filter-group { gap: 6px; }
}

/* ── Sidebar Overlay on Mobile ── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}

.sidebar-overlay.open { display: block; }

/* ── Notification badge ── */
.notif-badge {
  position: relative;
}
.notif-badge::after {
  content: '';
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--card-bg);
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ── Loading Spinner ── */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Complaint Form Section ── */
.complaint-form-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}
