/* ====================================================
   Light Mode · All Pages · Polished UI System
   ==================================================== */

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --primary:        #722f37;
  --primary-dark:   #3d0c11;
  --primary-mid:    #8f3a44;
  --primary-light:  rgba(114, 47, 55, 0.07);
  --primary-glow:   rgba(114, 47, 55, 0.18);
  --gold:           #b8860b;
  --success:        #15803d;
  --danger:         #b91c1c;
  --warning:        #b45309;
  --bg-main:        #fffcf9;
  --bg-section:     #fdf7f4;
  --white:          #ffffff;
  --card-bg:        #ffffff;
  --sidebar-bg:     #ffffff;
  --text-main:      #1c0a0c;
  --text-muted:     #9a7178;
  --text-sub:       #c4a4a8;
  --border:         rgba(114, 47, 55, 0.1);
  --border-light:   rgba(114, 47, 55, 0.05);
  --shadow-sm:      0 2px 12px rgba(114,47,55,0.06);
  --shadow-md:      0 8px 32px rgba(114,47,55,0.08);
  --shadow-lg:      0 20px 60px rgba(114,47,55,0.12);
  --shadow-xl:      0 30px 80px rgba(114,47,55,0.16);
  --radius-sm:      10px;
  --radius-md:      16px;
  --radius-lg:      24px;
  --radius-xl:      32px;
  --transition:     all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

[data-theme="dark"] {
  --primary:        #ba4959;
  --primary-dark:   #1a0608;
  --primary-mid:    #8f3a44;
  --primary-light:  rgba(186, 73, 89, 0.12);
  --primary-glow:   rgba(186, 73, 89, 0.25);
  --gold:           #d4af37;
  --success:        #22c55e;
  --danger:         #ef4444;
  --warning:        #f59e0b;
  --bg-main:        #0f0507;
  --bg-section:     #17080a;
  --white:          #1a0608;
  --card-bg:        #17080a;
  --sidebar-bg:     #120406;
  --text-main:      #fdf7f4;
  --text-muted:     #c4a4a8;
  --text-sub:       #9a7178;
  --border:         rgba(255,255,255,0.08);
  --border-light:   rgba(255,255,255,0.04);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Outfit', -apple-system, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
button { font-family: inherit; }

/* ============================================================
   SCROLLBAR (subtle wine red)
   ============================================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { background: rgba(114,47,55,0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ============================================================
   BACKGROUND TREATMENT
   ============================================================ */
.mesh-container {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 10% 15%, rgba(114,47,55,0.05) 0%, transparent 100%),
    radial-gradient(ellipse 50% 35% at 90% 85%, rgba(184,134,11,0.04) 0%, transparent 100%);
}

/* ============================================================
   TYPOGRAPHY SYSTEM
   ============================================================ */
h1, h2, h3, h4, h5 {
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}
h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); letter-spacing: -2px; }
h2 { font-size: 1.8rem; letter-spacing: -0.5px; }
h3 { font-size: 1.1rem; }
h4 { font-size: 0.95rem; }
p  { color: var(--text-muted); line-height: 1.7; }
small { font-size: 0.78rem; color: var(--text-sub); }

/* ============================================================
   GLASS CARD SYSTEM
   ============================================================ */
.glass-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: var(--transition);
}
.glass-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(114,47,55,0.22);
}
.glass {
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: var(--shadow-sm);
}

/* ============================================================
   MODAL SYSTEM
   ============================================================ */
.glass-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(28, 10, 12, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.glass-overlay.active,
.modal.active { display: flex; }
.modal { display: none; }

.modal-content {
  position: relative;
  width: 100%; max-width: 480px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 52px 44px 44px;
  box-shadow: var(--shadow-xl);
}
.modal-content h2 { margin-bottom: 4px; }
.modal-content > p { margin-bottom: 28px; font-size: 0.95rem; }
.close-btn {
  position: absolute; top: 18px; right: 18px;
  width: 36px; height: 36px;
  background: var(--primary-light); border: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: var(--primary); cursor: pointer;
  transition: var(--transition);
}
.close-btn:hover { background: var(--primary); color: white; }

/* ============================================================
   BUTTON SYSTEM — The Premium Wine Red Set
   ============================================================ */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--primary);
  color: white;
  padding: 13px 28px;
  border-radius: var(--radius-md);
  border: none;
  font-weight: 700; font-size: 0.92rem; letter-spacing: 0.2px;
  cursor: pointer; white-space: nowrap;
  box-shadow: 0 4px 16px var(--primary-glow);
  transition: var(--transition);
  position: relative; overflow: hidden;
}
.btn-primary::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, transparent 100%);
  pointer-events: none;
}
.btn-primary:hover {
  background: var(--primary-mid);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px var(--primary-glow);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--white);
  color: var(--primary);
  padding: 12px 28px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--primary);
  font-weight: 700; font-size: 0.92rem;
  cursor: pointer;
  transition: var(--transition);
}
.btn-secondary:hover { background: var(--primary-light); transform: translateY(-2px); }

.btn-text {
  background: none; border: none;
  color: var(--primary); font-family: inherit;
  font-weight: 600; font-size: 0.88rem;
  cursor: pointer; padding: 4px 0;
  transition: opacity 0.2s;
}
.btn-text:hover { opacity: 0.7; }

.btn-large  { padding: 16px 40px; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-pill   { border-radius: 100px !important; }
.w-100      { width: 100%; }

/* Icon button */
.icon-btn {
  width: 42px; height: 42px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: var(--text-muted); cursor: pointer;
  transition: var(--transition); position: relative;
}
.icon-btn:hover { color: var(--primary); border-color: var(--primary); }

/* Danger / success variants */
.btn-danger  { background: var(--danger) !important; box-shadow: 0 4px 14px rgba(185,28,28,0.2) !important; }
.btn-success { background: var(--success) !important; box-shadow: 0 4px 14px rgba(21,128,61,0.2) !important; }

/* ============================================================
   BADGE / CHIP
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px; border-radius: 100px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.4px;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--border);
}
.badge.success { background: rgba(21,128,61,0.08); color: var(--success); border-color: rgba(21,128,61,0.2); }
.badge.danger  { background: rgba(185,28,28,0.08); color: var(--danger);  border-color: rgba(185,28,28,0.2); }
.badge.warning { background: rgba(180,83,9,0.08); color: var(--warning);  border-color: rgba(180,83,9,0.2); }

/* ============================================================
   AVATAR
   ============================================================ */
.avatar,
div:nth-of-type(1) > aside:nth-of-type(1) > div:nth-of-type(2) > img#sidebarAvatar:nth-of-type(1),
img#sidebarAvatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
  border: 2.5px solid var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  background: var(--primary-light);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.avatar:hover,
div:nth-of-type(1) > aside:nth-of-type(1) > div:nth-of-type(2) > img#sidebarAvatar:nth-of-type(1):hover {
  transform: scale(1.04);
  box-shadow: 0 0 0 4px rgba(114, 47, 55, 0.25);
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  display: flex; align-items: center; justify-content: space-between;
    padding: 16px 5%;
    position: fixed; top: 0; left: 0; width: 100%;
    z-index: 500;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.35rem; font-weight: 800;
  color: var(--primary-dark); letter-spacing: -0.5px;
}
.logo i { font-size: 1.1rem; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
  font-weight: 600; font-size: 0.9rem;
  color: var(--text-muted); transition: color 0.2s;
}
.nav-links a:hover { color: var(--primary); }

/* ============================================================
   HERO SECTION — Full Width Centered
   ============================================================ */
.hero-full {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding-top: 80px;
    padding-bottom: 80px;
}
.hero-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 80px 6% 0;
    max-width: 780px;
    width: 100%;
    text-align: center;
}
.hero-center > * {
    opacity: 0;
    animation: heroReveal 0.9s cubic-bezier(0.16,1,0.3,1) forwards;
}
.hero-center .hero-badge   { animation-delay: 0.2s; }
.hero-center h1            { animation-delay: 0.35s; }
.hero-center > p           { animation-delay: 0.5s; }
.hero-center .hero-actions { animation-delay: 0.65s; }
.hero-center .landing-stats{ animation-delay: 0.80s; }

.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--primary-light); color: var(--primary);
    border: 1px solid var(--border);
    padding: 8px 18px; border-radius: 100px;
    font-size: 0.75rem; font-weight: 700; letter-spacing: 1px;
    margin-bottom: 0;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }

.landing-stats { display: flex; gap: 48px; }
.landing-stats .stat-item h3 {
    font-size: 2.2rem; color: var(--primary);
    margin-bottom: 2px; letter-spacing: -1px;
    background: linear-gradient(135deg, var(--primary), var(--gold));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.landing-stats .stat-item p { font-size: 0.82rem; }

/* ============================================================
   CSS DASHBOARD MOCKUP
   ============================================================ */
.mockup-wrapper {
    position: relative;
    width: min(860px, 92%);
    margin: 60px auto 0;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 32px 80px rgba(114,47,55,0.12), 0 0 0 1px rgba(114,47,55,0.05);
    overflow: visible;
    opacity: 0;
    animation: heroReveal 1s cubic-bezier(0.16,1,0.3,1) 0.95s forwards;
}

/* Browser chrome bar */
.dash-bar {
    display: flex; align-items: center; gap: 7px;
    padding: 0 16px;
    height: 40px;
    background: #f8f3f0;
    border-bottom: 1px solid var(--border-light);
    border-radius: 16px 16px 0 0;
}
.dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.dash-url {
    flex: 1; margin: 0 10px;
    background: #ede5e2; border-radius: 6px;
    height: 22px; display: flex; align-items: center;
    padding: 0 10px;
    font-size: 0.65rem; font-weight: 500; color: var(--text-muted);
}

/* Mockup body — sidebar + main */
.dash-body {
    display: flex;
    height: 380px;
    overflow: hidden;
    border-radius: 0 0 16px 16px;
}

/* ---- Mini Sidebar ---- */
.dash-sidebar {
    width: 70px;
    background: var(--white);
    border-right: 1px solid var(--border-light);
    padding: 16px 12px;
    display: flex; flex-direction: column; gap: 16px; align-items: center;
    flex-shrink: 0;
}
.ds-logo { font-size: 1rem; color: var(--primary); }
.ds-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--primary-light);
    border: 2px solid var(--border);
}
.ds-nav { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.ds-item {
    height: 8px; border-radius: 4px;
    background: #ede5e2;
    animation: skeletonPulse 2s ease-in-out infinite;
}
.ds-item.active { background: var(--primary-light); border-left: 2px solid var(--primary); }

/* ---- Main Dashboard area ---- */
.dash-main { flex: 1; padding: 20px; background: #fdf8f6; display: flex; flex-direction: column; gap: 16px; overflow: hidden; }

.dm-topbar { display: flex; justify-content: space-between; align-items: center; }
.dm-title { height: 14px; width: 160px; background: #e8dbd8; border-radius: 4px; margin-bottom: 6px; animation: skeletonPulse 2s ease-in-out infinite; }
.dm-sub   { height: 9px; width: 110px; background: #ede5e2; border-radius: 3px; animation: skeletonPulse 2s ease-in-out 0.2s infinite; }
.dm-btn   { height: 30px; width: 88px; background: var(--primary); border-radius: 8px; opacity: 0.9; }

/* Stat cards row */
.dm-cards { display: flex; gap: 12px; }
.dm-card {
    flex: 1; background: white;
    border: 1px solid var(--border-light);
    border-radius: 12px; padding: 12px;
    display: flex; align-items: center; gap: 10px;
    box-shadow: 0 2px 8px rgba(114,47,55,0.04);
    animation: cardIn 0.5s ease both;
}
.dm-card:nth-child(1) { animation-delay: 1.1s; }
.dm-card:nth-child(2) { animation-delay: 1.2s; }
.dm-card:nth-child(3) { animation-delay: 1.3s; }
@keyframes cardIn {
    from { opacity:0; transform:translateY(10px); }
    to   { opacity:1; transform:translateY(0); }
}
.dc-icon { width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0; }
.dc-lines { display: flex; flex-direction: column; gap: 5px; flex: 1; }
.dc-l1 { height: 10px; background: #ddd; border-radius: 3px; animation: skeletonPulse 2s ease-in-out infinite; }
.dc-l2 { height: 7px; width: 60%; background: #eee; border-radius: 3px; animation: skeletonPulse 2s ease-in-out 0.3s infinite; }

/* Table area */
.dm-table { background: white; border: 1px solid var(--border-light); border-radius: 12px; overflow: hidden; flex: 1; }
.dt-head { display: flex; gap: 12px; padding: 10px 14px; background: #fdf7f4; border-bottom: 1px solid var(--border-light); }
.dt-h { height: 8px; flex: 1; background: #e8dbd8; border-radius: 3px; animation: skeletonPulse 2s ease-in-out infinite; }
.dt-row { display: flex; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border-light); align-items: center; }
.dt-row:last-child { border-bottom: none; }
.dt-cell { height: 9px; flex: 1; background: #eee; border-radius: 3px; animation: skeletonPulse 2s ease-in-out infinite; }
.dt-cell.w60 { flex: 1.5; }
.dt-cell.w40 { flex: 0.9; }
.dt-badge {
    width: 52px; height: 18px; border-radius: 20px; flex-shrink: 0;
    background: rgba(180,83,9,0.12);
    animation: skeletonPulse 2s ease-in-out infinite;
}
.dt-badge.s { background: rgba(21,128,61,0.12); }
.dt-badge.w { background: rgba(114,47,55,0.1); }

/* Row stagger */
.dt-row:nth-child(2) * { animation-delay: 0.1s; }
.dt-row:nth-child(3) * { animation-delay: 0.2s; }
.dt-row:nth-child(4) * { animation-delay: 0.3s; }

@keyframes skeletonPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}

/* ---- Floating chips on mockup ---- */
.mock-chip {
    position: absolute;
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px 16px;
    display: flex; align-items: center; gap: 10px;
    box-shadow: 0 8px 28px rgba(114,47,55,0.1);
    white-space: nowrap;
}
.chip-1 {
    bottom: -18px; left: -24px;
    animation: floatBadge 5s ease-in-out infinite, badgeEntry 0.7s ease 1.4s both;
}
.chip-2 {
    top: 28px; right: -24px;
    animation: floatBadge2 6s ease-in-out infinite, badgeEntry2 0.7s ease 1.6s both;
}


/* ============================================================
   DASHBOARD LAYOUT
   ============================================================ */
.dashboard-body { background: var(--bg-main); overflow: hidden; }

.dashboard-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* --- SIDEBAR --- */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  height: 100vh;
  position: sticky; top: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
}
.sidebar .logo { padding: 4px 8px; border-radius: var(--radius-sm); }
.sidebar .logo i { color: var(--primary); }

/* User Profile card in sidebar */
.user-profile {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--primary-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.user-profile .info h4 { font-size: 0.9rem; font-weight: 700; color: var(--text-main); margin-bottom: 2px; }
.user-profile .info p  { font-size: 0.75rem; }

/* Alert toggle row */
.alert-toggle {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

/* Sidebar nav */
.side-nav {
  display: flex; flex-direction: column;
  flex: 1;
}
.side-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 3px;
  transition: background 0.2s, color 0.2s;
}
.side-nav a i { width: 16px; text-align: center; font-size: 0.9rem; }
.side-nav a:hover,
.side-nav a.active {
  background: var(--primary-light);
  color: var(--primary);
}
.side-nav a.active {
  border-left: 3px solid var(--primary);
  padding-left: 11px;
}

/* Divider */
.nav-divider {
  height: 1px;
  background: var(--border-light);
  margin: 8px 0;
}

/* Logout button */
.logout-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 600; font-size: 0.85rem;
  cursor: pointer; transition: var(--transition);
  margin-top: auto;
}
.logout-btn:hover { color: var(--danger); border-color: var(--danger); background: rgba(185,28,28,0.04); }

/* --- MAIN CONTENT area --- */
.dashboard-content {
  flex: 1;
  padding: 36px 44px;
  overflow-y: auto;
  background: var(--bg-main);
}

/* Top Bar */
.topbar {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 32px;
  gap: 20px;
}
.topbar h2 { font-size: 1.6rem; margin-bottom: 4px; }
.topbar p  { font-size: 0.85rem; }
.top-actions { display: flex; gap: 12px; align-items: center; flex-shrink: 0; }

/* ============================================================
   STAT CARDS GRID
   ============================================================ */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}
.glass-card.stat {
  display: flex; align-items: center; gap: 18px;
  padding: 22px 24px;
}
.stat-icon {
  width: 52px; height: 52px; flex-shrink: 0;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
}
.icon.blue   { background: rgba(59,130,246,0.1);  color: #2563eb; }
.icon.orange { background: rgba(234,88,12,0.1);   color: #ea580c; }
.icon.green  { background: rgba(21,128,61,0.1);   color: var(--success); }
.icon.red    { background: rgba(185,28,28,0.1);   color: var(--danger); }
.icon.gold   { background: rgba(184,134,11,0.1);  color: var(--gold); }
.icon.wine   { background: var(--primary-light);  color: var(--primary); }
/* aliases */

.details p  { font-size: 0.78rem; font-weight: 500; margin-bottom: 4px; line-height: 1; }
.details h3 { font-size: 1.55rem; letter-spacing: -1px; line-height: 1; }

/* ============================================================
   QUICK ACTIONS
   ============================================================ */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
.action-btn {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px; padding: 22px 16px;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer; transition: var(--transition);
}
.action-btn:hover {
  background: var(--primary-light);
  border-color: var(--border);
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
}
.action-btn i  { font-size: 1.5rem; }
.action-btn p  { font-size: 0.78rem; font-weight: 700; color: var(--text-main); }

/* ============================================================
   DASHBOARD GRID (2-column)
   ============================================================ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
}
.span-2 { grid-column: span 2; }
.flex-col { display: flex; flex-direction: column; }

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.card-header h3 { font-size: 1rem; font-weight: 700; }

/* ============================================================
   DATA TABLE
   ============================================================ */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; padding: 11px 16px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.5px;
  color: var(--text-sub);
  background: var(--bg-section);
  border-bottom: 1px solid var(--border-light);
}
.data-table th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.data-table th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }
.data-table td {
  padding: 14px 16px; font-size: 0.88rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle; color: var(--text-main);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:hover { background: var(--bg-section); }

/* Student avatar in table */
.student-chip {
  display: flex; align-items: center; gap: 10px;
}
.student-chip .initials {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: white;
  font-size: 0.7rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ============================================================
   LOGIN FORM
   ============================================================ */
.login-form { margin-top: 20px; }

.role-selector {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 8px;
  margin-top: 8px;
}
.radio-card { display: block; cursor: pointer; }
.radio-card input { display: none; }
.card-content {
  display: block; text-align: center;
  padding: 10px 8px; border-radius: var(--radius-sm);
  font-size: 0.88rem; font-weight: 600;
  border: 1.5px solid var(--border-light);
  color: var(--text-muted); background: var(--bg-section);
  transition: var(--transition);
}
.card-content:hover { border-color: var(--border); }
.radio-card input:checked + .card-content {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.input-group {
  position: relative;
  margin-bottom: 18px;
}
.input-group label {
  display: block; margin-bottom: 7px;
  font-size: 0.82rem; font-weight: 600;
  color: var(--text-muted);
}
.input-group i {
  position: absolute;
  left: 16px; bottom: 15px;
  color: var(--primary); opacity: 0.6;
  font-size: 0.95rem; pointer-events: none;
}
.input-group input:not([type="radio"]):not([type="checkbox"]) {
  width: 100%;
  padding: 13px 16px 13px 44px;
  background: var(--bg-section);
  border: 1.5px solid #ead0d2;
  border-radius: var(--radius-md);
  font-family: inherit; font-size: 0.92rem;
  color: var(--text-main); outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-group input:focus {
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(114,47,55,0.08);
}
.input-group input::placeholder { color: var(--text-sub); }

/* Password wrapper & eye icon toggle */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.password-input-wrapper input {
  padding-right: 46px !important;
}
.password-toggle-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  padding: 6px;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.2s, background-color 0.2s;
  z-index: 5;
}
.password-toggle-btn:hover {
  color: var(--primary);
  background-color: var(--primary-light);
}
.password-toggle-btn i {
  position: static !important;
  pointer-events: auto !important;
  opacity: 1 !important;
  font-size: 1rem !important;
  color: inherit !important;
  transform: none !important;
}
.field-error-msg {
  color: #ef4444;
  font-size: 0.8rem;
  font-weight: 500;
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
  animation: fieldShake 0.3s ease;
}
.input-error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}
@keyframes fieldShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.demo-hints {
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--bg-section);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}
.demo-hints code {
  color: var(--primary);
  font-weight: 600;
  font-family: inherit;
}

.form-options {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 20px; font-size: 0.88rem;
  color: var(--text-muted);
}
.form-options label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.forgot { color: var(--primary); font-weight: 600; }

/* Attendance input in warden page */
.attendance-input {
  width: 100%; padding: 12px 14px;
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: inherit; font-size: 0.88rem;
  outline: none; margin-bottom: 16px;
}
.attendance-input:focus { border-color: var(--primary); }

/* ============================================================
   TOGGLE SWITCH
   ============================================================ */
.switch {
  position: relative; display: inline-block;
  width: 38px; height: 21px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer;
  inset: 0; background: #e8d0d2;
  border-radius: 34px; transition: .3s;
}
.slider:before {
  content: ""; position: absolute;
  height: 15px; width: 15px;
  left: 3px; bottom: 3px;
  background: white; border-radius: 50%; transition: .3s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
input:checked + .slider { background: var(--success); }
input:checked + .slider:before { transform: translateX(17px); }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white; padding: 14px 20px;
  border-radius: var(--radius-md);
  font-weight: 600; font-size: 0.88rem;
  box-shadow: 0 8px 28px rgba(114,47,55,0.35);
  display: flex; align-items: center; gap: 10px;
  transform: translateX(130%);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  min-width: 260px;
}
.toast.show { transform: translateX(0); }
.toast i { font-size: 1rem; }

/* ============================================================
   PAYMENT MODAL
   ============================================================ */
.payment-amount-box {
  background: var(--primary-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px; text-align: center;
  margin-bottom: 24px;
}
.payment-amount-box p { font-size: 0.82rem; margin-bottom: 4px; }
.payment-amount-box h1 {
  font-size: 2.8rem; color: var(--primary);
  letter-spacing: -2px;
}
.payment-amount-box h1 span { font-size: 1.2rem; letter-spacing: 0; }

/* ============================================================
   MISC UTILITIES
   ============================================================ */
.divider { height: 1px; background: var(--border-light); margin: 16px 0; }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger);  }
.text-muted   { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.fw-700 { font-weight: 700; }
.mt-auto { margin-top: auto; }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes float { 0%,100%{ transform: translateY(0); } 50%{ transform: translateY(-8px); } }
@keyframes fadeIn { from{ opacity:0; transform:translateY(10px); } to{ opacity:1; transform:translateY(0); } }

.dashboard-content > * { animation: fadeIn 0.4s ease both; }
.dashboard-content > *:nth-child(2) { animation-delay: 0.05s; }
.dashboard-content > *:nth-child(3) { animation-delay: 0.10s; }
.dashboard-content > *:nth-child(4) { animation-delay: 0.15s; }

/* ============================================================
   PREMIUM FOOTER SYSTEM
   ============================================================ */
.footer {
  background: var(--bg-section);
  color: var(--text-muted);
  padding: 80px 8% 40px;
  position: relative;
  overflow: hidden;
  margin-top: 60px;
  border-top: 1px solid var(--border-light);
  transition: background 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}
.footer::before {
  content: '';
  position: absolute; top: 0; left: 0; width: 100%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 60px;
  margin-bottom: 50px;
}
.footer-brand .logo { 
  color: var(--text-main) !important; margin-bottom: 20px; font-size: 1.5rem; 
  background: none; border: none; padding: 0;
  display: inline-flex; align-items: center; gap: 10px; font-weight: 800;
}
.footer-brand .logo i { color: var(--primary); }
.footer-brand p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.7; max-width: 320px; }

.footer-col h4 {
  font-size: 1rem; font-weight: 700; margin-bottom: 24px;
  color: var(--text-main);
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 12px; }
.footer-col ul li a {
  color: var(--text-muted); text-decoration: none;
  font-size: 0.88rem; transition: var(--transition);
}
.footer-col ul li a:hover { color: var(--primary); padding-left: 5px; }

.footer-contact .contact-item {
  display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px;
}
.footer-contact .contact-item i { color: var(--primary); margin-top: 4px; }
.footer-contact .contact-item div h5 { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 4px; }
.footer-contact .contact-item div p { font-size: 0.9rem; color: var(--text-main); }

.footer-bottom {
  padding-top: 30px;
  border-top: 1px solid var(--border-light);
  display: flex; justify-content: center; align-items: center; text-align: center;
}
.footer-bottom p { font-size: 0.85rem; color: var(--text-muted); text-align: center; margin: 0; }
.footer-socials { display: flex; gap: 16px; }
.social-link {
  width: 40px; height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-main); text-decoration: none; transition: var(--transition);
}
.social-link:hover {
  background: var(--primary); border-color: var(--primary); color: #fff;
  transform: translateY(-4px); box-shadow: 0 8px 20px rgba(114,47,55,0.25);
}

@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
}
@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 20px; text-align: center; }
}

/* =============================================
   ROOM AVAILABILITY GRID
   ============================================= */
.room-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.room-card {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.room-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.room-card h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-main);
}

.room-card p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.room-card .occupancy {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 4px;
}

.room-card .bed-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e2e8f0;
}

.room-card.available .bed-dot.filled { background: var(--success); }
.room-card.partial .bed-dot.filled   { background: var(--warning); }
.room-card.full .bed-dot.filled      { background: var(--danger); }

/* Room Status Indicators in Grid */
.room-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
}

.room-card.available::after { background: var(--success); }
.room-card.partial::after   { background: var(--warning); }
.room-card.full::after      { background: var(--danger); }

.block-tabs {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.room-stats-banner {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    padding: 18px 24px;
    background: var(--bg-section);
    border-radius: 16px;
    border: 1px solid var(--border-light);
}

.stat-item h5 { font-size: 0.75rem; text-transform: uppercase; color: var(--text-muted); margin-bottom: 2px; }
.stat-item p { font-size: 1.2rem; font-weight: 700; color: var(--text-main); }

/* =============================================
   ROOM AVAILABILITY PRO UPGRADE
   ============================================= */
.search-filter-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-input-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-input-wrap i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-input-wrap input {
    width: 100%;
    padding: 12px 14px 12px 40px;
    border-radius: 12px;
    border: 1.5px solid var(--border-light);
    background: var(--white);
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s;
}

.search-input-wrap input:focus {
    border-color: var(--primary);
}

.filter-select {
    padding: 12px 16px;
    border-radius: 12px;
    border: 1.5px solid var(--border-light);
    background: var(--white);
    color: var(--text-main);
    font-family: inherit;
    outline: none;
    cursor: pointer;
}

.room-legend {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.legend-item { display: flex; align-items: center; gap: 8px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }

.room-card .type-tag {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--bg-section);
    color: var(--text-muted);
}

/* Modal Occupants */
.occupants-list {
    margin: 20px 0;
    text-align: left;
}

.occupant-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    background: var(--bg-section);
    margin-bottom: 8px;
}

.occupant-row i { color: var(--primary); }
.occupant-info h5 { font-size: 0.88rem; font-weight: 600; margin: 0; }
.occupant-info p { font-size: 0.75rem; color: var(--text-muted); margin: 0; }

/* ============================================================
   FAQ ACCORDION SYSTEM
   ============================================================ */
.faq-section {
    padding: 80px 7%;
    background: var(--bg-section);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}

.faq-header-wrapper {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 40px;
}

.faq-header-wrapper .section-label {
    display: inline-block;
    padding: 6px 14px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 14px;
}

.faq-header-wrapper .section-heading {
    margin-bottom: 12px;
}

.faq-header-wrapper .section-sub {
    font-size: 1rem;
    color: var(--text-muted);
}

.faq-controls {
    max-width: 820px;
    margin: 0 auto 30px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.faq-search-box {
    position: relative;
    width: 100%;
}

.faq-search-box i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    opacity: 0.7;
    font-size: 0.95rem;
    pointer-events: none;
}

.faq-search-input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.92rem;
    color: var(--text-main);
    outline: none;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
}

.faq-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(114, 47, 55, 0.12);
}

.faq-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.faq-pill {
    padding: 7px 16px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.faq-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.faq-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(114, 47, 55, 0.25);
}

.faq-accordion-list {
    max-width: 820px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}

.faq-item:hover {
    border-color: rgba(114, 47, 55, 0.3);
    box-shadow: var(--shadow-md);
}

.faq-item.active {
    border-color: var(--primary);
    box-shadow: 0 8px 24px -4px rgba(114, 47, 55, 0.15);
}

.faq-trigger {
    width: 100%;
    padding: 20px 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    text-align: left;
    outline: none;
    transition: background-color 0.2s ease;
}

.faq-trigger:focus-visible {
    background: var(--bg-hover);
}

.faq-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.faq-category-tag {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: var(--primary-light);
    color: var(--primary);
    white-space: nowrap;
    flex-shrink: 0;
}

.faq-question {
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.faq-item.active .faq-question {
    color: var(--primary);
}

.faq-icon-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-section);
    border: 1px solid var(--border-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 0.82rem;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s ease, color 0.2s ease;
}

.faq-item.active .faq-icon-badge {
    transform: rotate(180deg);
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.faq-collapse {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item.active .faq-collapse {
    grid-template-rows: 1fr;
}

.faq-collapse-inner {
    overflow: hidden;
}

.faq-answer {
    padding: 0 24px 22px 24px;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.7;
    border-top: 1px dashed var(--border-light);
    margin-top: 4px;
    padding-top: 16px;
}

.faq-answer p {
    margin: 0 0 10px;
    color: var(--text-muted);
}

.faq-answer ul, .faq-answer ol {
    margin: 8px 0 12px 20px;
    padding: 0;
    color: var(--text-muted);
}

.faq-answer li {
    margin-bottom: 6px;
    line-height: 1.6;
}

.faq-answer strong {
    color: var(--text-main);
    font-weight: 600;
}

.faq-help-box {
    max-width: 820px;
    margin: 40px auto 0;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-shadow: var(--shadow-sm);
}

.faq-help-content h4 {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 700;
}

.faq-help-content p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.faq-empty-message {
    text-align: center;
    padding: 40px 20px;
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
    font-size: 0.95rem;
    display: none;
}

@media (max-width: 768px) {
    .faq-trigger {
        padding: 16px;
        align-items: flex-start;
    }
    .faq-title-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .faq-answer {
        padding: 0 16px 16px;
    }
    .faq-help-box {
        flex-direction: column;
        text-align: center;
    }
}

/* ============================================================
   RESPONSIVE DASHBOARD & MOBILE SIDEBAR DRAWER
   ============================================================ */
.mobile-menu-btn {
  display: none;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.sidebar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 900px) {
  .mobile-menu-btn {
    display: inline-flex !important;
  }
  .dashboard-layout {
    position: relative;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 270px;
    height: 100vh;
    z-index: 999;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
  }
  .sidebar.open {
    transform: translateX(280px);
  }
  .dashboard-content {
    padding: 20px 16px;
    width: 100%;
  }
  .grid-cards {
    grid-template-columns: 1fr;
  }
  .quick-actions {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .span-2 {
    grid-column: span 1;
  }
}

