/* ============================================================
   Tamil Mandram v9 — "Temple Earth" Design System
   Arasi Nagara Tamil Palli — Charlotte, NC

   Design DNA: Tamil cultural palette drawn from temple walls,
   turmeric ceremonies, terracotta pottery, peacock silk,
   jasmine-white cotton, and carved temple doors.
   Complete rewrite — shares nothing with v8.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Sans+Tamil:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,500&display=swap');

/* ============================================================
   1. CUSTOM PROPERTIES
   ============================================================ */

:root {
    /* --- Tamil Cultural Palette --- */
    --maroon: #8B1A1A;
    --maroon-light: #A52828;
    --maroon-dark: #6B1010;
    --gold: #D4A017;
    --gold-light: #E8B82E;
    --gold-dark: #B8890E;
    --gold-muted: rgba(212, 160, 23, 0.12);
    --terracotta: #C75B39;
    --terracotta-light: #D97350;
    --terracotta-dark: #A44A2E;
    --teal: #1A5653;
    --teal-light: #237A76;
    --teal-dark: #0F3836;
    --cream: #FFF8F0;
    --cream-dark: #F5EDE0;
    --dark-wood: #1C1016;
    --dark-wood-light: #2A1A22;
    --sand: #F5EDE0;
    --sand-dark: #E8DDD0;
    --lotus-pink: #E8A0BF;
    --lotus-pink-light: #F0BFDA;
    --lotus-pink-dark: #D080A5;

    /* --- Semantic Colors --- */
    --color-success: #2D8B55;
    --color-success-bg: rgba(45, 139, 85, 0.08);
    --color-warning: #C78E1A;
    --color-warning-bg: rgba(199, 142, 26, 0.08);
    --color-danger: #C43E3E;
    --color-danger-bg: rgba(196, 62, 62, 0.08);
    --color-info: #2A7AB5;
    --color-info-bg: rgba(42, 122, 181, 0.08);

    /* --- Typography --- */
    --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-tamil: 'Noto Sans Tamil', sans-serif;

    --text-xs: 0.75rem;
    --text-sm: 0.8125rem;
    --text-base: 0.9375rem;
    --text-md: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;
    --text-6xl: 3.75rem;

    --leading-tight: 1.2;
    --leading-snug: 1.35;
    --leading-normal: 1.6;
    --leading-relaxed: 1.75;

    --weight-light: 300;
    --weight-regular: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;
    --weight-extrabold: 800;

    /* --- Spacing --- */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;
    --space-20: 80px;

    /* --- Border Radius --- */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    /* --- Shadows --- */
    --shadow-xs: 0 1px 2px rgba(28, 16, 22, 0.04);
    --shadow-sm: 0 2px 8px rgba(28, 16, 22, 0.06);
    --shadow-md: 0 4px 16px rgba(28, 16, 22, 0.08);
    --shadow-lg: 0 8px 32px rgba(28, 16, 22, 0.1);
    --shadow-xl: 0 16px 48px rgba(28, 16, 22, 0.14);
    --shadow-gold: 0 4px 20px rgba(212, 160, 23, 0.2);
    --shadow-maroon: 0 4px 20px rgba(139, 26, 26, 0.2);

    /* --- Transitions --- */
    --ease-default: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-in: cubic-bezier(0.4, 0, 1, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --duration-slow: 400ms;

    /* --- Layout --- */
    --rail-width: 64px;
    --rail-width-expanded: 240px;
    --identity-bar-height: 56px;
    --pub-nav-height: 72px;
    --content-max-width: 1400px;
    --container-max-width: 1200px;

    /* --- Z-index scale --- */
    --z-rail: 100;
    --z-identity-bar: 99;
    --z-pub-nav: 100;
    --z-dropdown: 150;
    --z-modal-backdrop: 180;
    --z-modal: 200;
    --z-notif-panel: 200;
    --z-fab: 90;
    --z-tooltip: 250;
}


/* ============================================================
   2. CSS RESET & BASE
   ============================================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--weight-regular);
    line-height: var(--leading-normal);
    color: var(--dark-wood);
    background-color: var(--cream);
    min-height: 100vh;
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
}

input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

a {
    color: inherit;
    text-decoration: none;
}

ul,
ol {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    line-height: var(--leading-tight);
    font-weight: var(--weight-bold);
    color: var(--dark-wood);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
    margin-bottom: var(--space-4);
}

p:last-child {
    margin-bottom: 0;
}

strong {
    font-weight: var(--weight-semibold);
}

::selection {
    background: var(--gold-muted);
    color: var(--dark-wood);
}

/* Focus visible for accessibility */
:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Skip link for screen readers */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-4);
    padding: var(--space-3) var(--space-5);
    background: var(--dark-wood);
    color: white;
    border-radius: var(--radius-sm);
    z-index: 9999;
    font-weight: var(--weight-medium);
}

.skip-link:focus {
    top: var(--space-4);
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Tamil script class */
.tamil-text {
    font-family: var(--font-tamil);
}


/* ============================================================
   3. KOLAM PATTERN BACKGROUND
   ============================================================ */

.kolam-bg {
    position: relative;
}

.kolam-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Ccircle cx='10' cy='10' r='1.5' fill='%231C1016' opacity='0.4'/%3E%3Ccircle cx='30' cy='10' r='1.5' fill='%231C1016' opacity='0.4'/%3E%3Ccircle cx='50' cy='10' r='1.5' fill='%231C1016' opacity='0.4'/%3E%3Ccircle cx='10' cy='30' r='1.5' fill='%231C1016' opacity='0.4'/%3E%3Ccircle cx='30' cy='30' r='2' fill='%231C1016' opacity='0.5'/%3E%3Ccircle cx='50' cy='30' r='1.5' fill='%231C1016' opacity='0.4'/%3E%3Ccircle cx='10' cy='50' r='1.5' fill='%231C1016' opacity='0.4'/%3E%3Ccircle cx='30' cy='50' r='1.5' fill='%231C1016' opacity='0.4'/%3E%3Ccircle cx='50' cy='50' r='1.5' fill='%231C1016' opacity='0.4'/%3E%3Cpath d='M10 10 Q20 5 30 10 Q40 15 50 10' fill='none' stroke='%231C1016' stroke-width='0.5' opacity='0.3'/%3E%3Cpath d='M10 10 Q5 20 10 30 Q15 40 10 50' fill='none' stroke='%231C1016' stroke-width='0.5' opacity='0.3'/%3E%3Cpath d='M50 10 Q55 20 50 30 Q45 40 50 50' fill='none' stroke='%231C1016' stroke-width='0.5' opacity='0.3'/%3E%3Cpath d='M10 50 Q20 55 30 50 Q40 45 50 50' fill='none' stroke='%231C1016' stroke-width='0.5' opacity='0.3'/%3E%3Cpath d='M30 10 Q25 20 30 30 Q35 40 30 50' fill='none' stroke='%231C1016' stroke-width='0.5' opacity='0.25'/%3E%3Cpath d='M10 30 Q20 25 30 30 Q40 35 50 30' fill='none' stroke='%231C1016' stroke-width='0.5' opacity='0.25'/%3E%3Cpath d='M10 10 Q20 20 30 30' fill='none' stroke='%231C1016' stroke-width='0.4' opacity='0.2'/%3E%3Cpath d='M50 10 Q40 20 30 30' fill='none' stroke='%231C1016' stroke-width='0.4' opacity='0.2'/%3E%3Cpath d='M10 50 Q20 40 30 30' fill='none' stroke='%231C1016' stroke-width='0.4' opacity='0.2'/%3E%3Cpath d='M50 50 Q40 40 30 30' fill='none' stroke='%231C1016' stroke-width='0.4' opacity='0.2'/%3E%3C/svg%3E");
    background-size: 60px 60px;
    background-repeat: repeat;
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
}

.kolam-bg > * {
    position: relative;
    z-index: 1;
}


/* ============================================================
   4. GRADIENT MESH BACKGROUNDS
   ============================================================ */

.mesh-bg-1 {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(139, 26, 26, 0.08), transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(212, 160, 23, 0.06), transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(26, 86, 83, 0.06), transparent 50%),
        var(--cream);
}

.mesh-bg-2 {
    background:
        radial-gradient(ellipse at 10% 20%, rgba(199, 91, 57, 0.07), transparent 45%),
        radial-gradient(ellipse at 90% 80%, rgba(232, 160, 191, 0.06), transparent 45%),
        radial-gradient(ellipse at 50% 50%, rgba(212, 160, 23, 0.04), transparent 60%),
        var(--cream);
}

.mesh-bg-3 {
    background:
        radial-gradient(ellipse at 30% 70%, rgba(26, 86, 83, 0.08), transparent 50%),
        radial-gradient(ellipse at 70% 30%, rgba(139, 26, 26, 0.06), transparent 50%),
        radial-gradient(ellipse at 50% 10%, rgba(212, 160, 23, 0.05), transparent 50%),
        var(--sand);
}

.mesh-bg-dark {
    background:
        radial-gradient(ellipse at 20% 30%, rgba(139, 26, 26, 0.15), transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(212, 160, 23, 0.1), transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(26, 86, 83, 0.08), transparent 60%),
        var(--dark-wood);
}


/* ============================================================
   5. PUBLIC NAVIGATION BAR
   ============================================================ */

.pub-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--pub-nav-height);
    z-index: var(--z-pub-nav);
    background: rgba(255, 248, 240, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-8);
    transition: background var(--duration-normal) var(--ease-default),
                box-shadow var(--duration-normal) var(--ease-default);
}

.pub-nav.scrolled {
    background: rgba(255, 248, 240, 0.95);
    box-shadow: var(--shadow-sm);
}

.pub-nav-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-shrink: 0;
}

.pub-nav-logo img {
    height: 52px;
    width: auto;
}

.pub-nav-logo-text {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: var(--weight-bold);
    color: var(--maroon);
    letter-spacing: 0.01em;
    line-height: 1.2;
}

.pub-nav-logo-subtitle {
    display: block;
    font-size: 0.6rem;
    color: var(--text-muted);
    font-weight: var(--weight-normal);
    letter-spacing: 0.03em;
    opacity: 0.5;
    margin-top: 2px;
    line-height: 1;
}

.pub-nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-8);
}

.pub-nav-links a {
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--dark-wood);
    position: relative;
    padding: var(--space-2) 0;
    transition: color var(--duration-fast) var(--ease-default);
}

.pub-nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform var(--duration-normal) var(--ease-default);
    border-radius: 1px;
}

.pub-nav-links a:hover {
    color: var(--maroon);
}

.pub-nav-links a:hover::after,
.pub-nav-links a.active::after {
    transform: scaleX(1);
}

.pub-nav-links a.active {
    color: var(--maroon);
    font-weight: var(--weight-semibold);
}

/* Dropdown menus */
.pub-nav-dropdown {
    position: relative;
}

.pub-nav-dropdown > a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pub-nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    min-width: 200px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: var(--space-2) 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 200;
}

.pub-nav-dropdown:hover .pub-nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.pub-nav-dropdown-menu a {
    display: block;
    padding: var(--space-2) var(--space-5);
    font-size: var(--text-sm);
    color: var(--text-primary);
    white-space: nowrap;
}

.pub-nav-dropdown-menu a::after {
    display: none;
}

.pub-nav-dropdown-menu a:hover {
    background: var(--cream);
    color: var(--maroon);
}

/* Mobile menu overlay */
.pub-nav-mobile {
    position: fixed;
    top: 0;
    right: -320px;
    bottom: 0;
    width: 320px;
    background: white;
    z-index: 300;
    transition: right 0.3s ease;
    overflow-y: auto;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.1);
}

.pub-nav-mobile.open {
    right: 0;
}

.pub-nav-mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-5);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.pub-nav-mobile-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    padding: var(--space-2);
}

.pub-nav-mobile-links {
    padding: var(--space-4);
}

.pub-nav-mobile-links a {
    display: block;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
}

.pub-nav-mobile-links a:hover {
    background: var(--cream);
    color: var(--maroon);
}

.pub-nav-mobile-links .mobile-section-title {
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: var(--space-4) var(--space-4) var(--space-2);
    margin-top: var(--space-2);
}

.pub-nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-shrink: 0;
}

.pub-nav-cta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-5);
    background: var(--gold);
    color: var(--dark-wood);
    font-weight: var(--weight-semibold);
    font-size: var(--text-sm);
    border-radius: var(--radius-full);
    transition: all var(--duration-fast) var(--ease-default);
    box-shadow: var(--shadow-gold);
}

.pub-nav-cta:hover {
    background: var(--gold-light);
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(212, 160, 23, 0.3);
}

/* Mobile hamburger */
.pub-nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: background var(--duration-fast);
}

.pub-nav-toggle:hover {
    background: rgba(0, 0, 0, 0.04);
}

.pub-nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--dark-wood);
    border-radius: 1px;
    position: relative;
    transition: all var(--duration-normal) var(--ease-default);
}

.pub-nav-toggle span::before,
.pub-nav-toggle span::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--dark-wood);
    border-radius: 1px;
    transition: all var(--duration-normal) var(--ease-default);
}

.pub-nav-toggle span::before { top: -6px; }
.pub-nav-toggle span::after { bottom: -6px; }

/* Mobile menu open state */
.pub-nav-toggle.open span {
    background: transparent;
}

.pub-nav-toggle.open span::before {
    top: 0;
    transform: rotate(45deg);
}

.pub-nav-toggle.open span::after {
    bottom: 0;
    transform: rotate(-45deg);
}

/* Mobile nav overlay */
.pub-nav-mobile {
    display: none;
    position: fixed;
    top: var(--pub-nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 248, 240, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: calc(var(--z-pub-nav) - 1);
    padding: var(--space-8);
    flex-direction: column;
    gap: var(--space-4);
}

.pub-nav-mobile.open {
    display: flex;
}

.pub-nav-mobile a {
    font-size: var(--text-xl);
    font-weight: var(--weight-medium);
    padding: var(--space-4) 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}


/* ============================================================
   6. ICON RAIL NAVIGATION (Dashboard)
   ============================================================ */

.icon-rail {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--rail-width);
    background: linear-gradient(180deg, #1C1016 0%, #2A1A22 100%);
    z-index: var(--z-rail);
    transition: width 0.3s var(--ease-default);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.icon-rail:hover,
.icon-rail.expanded {
    width: var(--rail-width-expanded);
}

.rail-header {
    height: var(--identity-bar-height);
    display: flex;
    align-items: center;
    padding: 0 var(--space-5);
    gap: var(--space-3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.rail-header-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
}

.rail-header-text {
    font-family: var(--font-heading);
    font-size: var(--text-base);
    font-weight: var(--weight-bold);
    color: var(--gold);
    white-space: nowrap;
    opacity: 0;
    transition: opacity var(--duration-normal) 0.1s;
}

.icon-rail:hover .rail-header-text,
.icon-rail.expanded .rail-header-text {
    opacity: 1;
}

.rail-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--space-3) 0;
}

.rail-section-label {
    padding: var(--space-3) var(--space-5);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.3);
    white-space: nowrap;
    opacity: 0;
    transition: opacity var(--duration-normal) 0.1s;
}

.icon-rail:hover .rail-section-label,
.icon-rail.expanded .rail-section-label {
    opacity: 1;
}

.rail-item {
    display: flex;
    align-items: center;
    height: 48px;
    padding: 0 var(--space-5);
    color: rgba(255, 255, 255, 0.55);
    gap: var(--space-4);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--duration-fast) var(--ease-default);
    position: relative;
    text-decoration: none;
}

.rail-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.rail-item.active {
    color: var(--gold);
}

.rail-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: var(--gold);
    border-radius: 0 2px 2px 0;
}

.rail-item-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.rail-item-label {
    opacity: 0;
    transition: opacity var(--duration-normal) 0.1s;
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
}

.icon-rail:hover .rail-item-label,
.icon-rail.expanded .rail-item-label {
    opacity: 1;
}

.rail-item-badge {
    margin-left: auto;
    background: var(--maroon);
    color: white;
    font-size: 0.6875rem;
    font-weight: var(--weight-semibold);
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    padding: 0 6px;
    opacity: 0;
    transition: opacity var(--duration-normal) 0.1s;
}

.icon-rail:hover .rail-item-badge,
.icon-rail.expanded .rail-item-badge {
    opacity: 1;
}

/* Collapsed badge indicator (small dot) */
.rail-item-badge::before {
    content: '';
    position: absolute;
    right: 16px;
    top: 12px;
    width: 6px;
    height: 6px;
    background: var(--maroon);
    border-radius: 50%;
    display: block;
}

.icon-rail:hover .rail-item-badge::before,
.icon-rail.expanded .rail-item-badge::before {
    display: none;
}

.rail-footer {
    padding: var(--space-3);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.rail-footer .rail-item {
    border-radius: var(--radius-sm);
}


/* ============================================================
   7. IDENTITY BAR (Dashboard Top Bar)
   ============================================================ */

.identity-bar {
    position: fixed;
    top: 0;
    left: var(--rail-width);
    right: 0;
    height: var(--identity-bar-height);
    background: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    z-index: var(--z-identity-bar);
    display: flex;
    align-items: center;
    padding: 0 var(--space-6);
    gap: var(--space-6);
    transition: left 0.3s var(--ease-default);
}

.identity-bar-title {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    font-weight: var(--weight-bold);
    color: var(--gold-dark);
    flex-shrink: 0;
    letter-spacing: -0.01em;
}

.identity-bar-search {
    flex: 1;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
}

.identity-bar-search input {
    width: 100%;
    height: 36px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-full);
    padding: 0 var(--space-4) 0 var(--space-10);
    font-size: var(--text-sm);
    background: var(--sand);
    transition: all var(--duration-fast) var(--ease-default);
}

.identity-bar-search input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-muted);
    background: white;
}

.identity-bar-search-icon {
    position: absolute;
    left: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    color: rgba(28, 16, 22, 0.35);
    width: 16px;
    height: 16px;
}

.identity-bar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-shrink: 0;
}

.identity-bar-icon-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: rgba(28, 16, 22, 0.6);
    transition: all var(--duration-fast) var(--ease-default);
    position: relative;
}

.identity-bar-icon-btn:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--dark-wood);
}

.identity-bar-icon-btn .notif-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--maroon);
    border-radius: 50%;
    border: 2px solid white;
}

.identity-bar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--maroon), var(--terracotta));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    cursor: pointer;
    transition: box-shadow var(--duration-fast) var(--ease-default);
}

.identity-bar-avatar:hover {
    box-shadow: 0 0 0 3px var(--gold-muted);
}

.identity-bar-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* Avatar dropdown */
.avatar-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: var(--space-2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all var(--duration-fast) var(--ease-default);
    z-index: var(--z-dropdown);
}

.avatar-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.avatar-dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--duration-fast);
}

.avatar-dropdown-item:hover {
    background: var(--sand);
}

.avatar-dropdown-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.06);
    margin: var(--space-2) 0;
}


/* ============================================================
   8. APP LAYOUT (Dashboard Container)
   ============================================================ */

.app-layout {
    padding-top: var(--identity-bar-height);
    padding-left: var(--rail-width);
    transition: padding-left 0.3s var(--ease-default);
    min-height: 100vh;
}

.app-content {
    padding: var(--space-6);
    max-width: var(--content-max-width);
    margin: 0 auto;
}

/* Page header within dashboard */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
    gap: var(--space-4);
}

.page-header-left {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.page-title {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: var(--weight-bold);
    color: var(--dark-wood);
}

.page-subtitle {
    font-size: var(--text-sm);
    color: rgba(28, 16, 22, 0.5);
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}


/* ============================================================
   9. BENTO GRID
   ============================================================ */

.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-5);
}

.bento-card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
    transition: transform var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
    overflow: hidden;
    position: relative;
}

.bento-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

.bento-card.span-2 {
    grid-column: span 2;
}

.bento-card.span-row-2 {
    grid-row: span 2;
}

.bento-card.span-full {
    grid-column: 1 / -1;
}

.bento-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-5);
}

.bento-card-title {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    font-weight: var(--weight-semibold);
    color: var(--dark-wood);
}

.bento-card-action {
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    color: var(--gold-dark);
    cursor: pointer;
    transition: color var(--duration-fast);
}

.bento-card-action:hover {
    color: var(--maroon);
}


/* ============================================================
   10. GLASSMORPHIC CARD
   ============================================================ */

.glass-card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
    transition: transform var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

.glass-card-dark {
    background: rgba(28, 16, 22, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
}


/* ============================================================
   11. CARD VARIANTS
   ============================================================ */

/* --- Stat Card --- */
.stat-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
}

.stat-card-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.stat-card-value {
    font-family: var(--font-heading);
    font-size: var(--text-3xl);
    font-weight: var(--weight-bold);
    color: var(--dark-wood);
    line-height: 1;
}

.stat-card-label {
    font-size: var(--text-sm);
    color: rgba(28, 16, 22, 0.5);
    font-weight: var(--weight-medium);
}

.stat-card-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    margin-top: var(--space-1);
}

.stat-card-trend.up {
    color: var(--color-success);
}

.stat-card-trend.down {
    color: var(--color-danger);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 22px;
}

.stat-card-icon.gold {
    background: var(--gold-muted);
    color: var(--gold-dark);
}

.stat-card-icon.maroon {
    background: rgba(139, 26, 26, 0.08);
    color: var(--maroon);
}

.stat-card-icon.teal {
    background: rgba(26, 86, 83, 0.08);
    color: var(--teal);
}

.stat-card-icon.terracotta {
    background: rgba(199, 91, 57, 0.08);
    color: var(--terracotta);
}

/* --- List Card --- */
.list-card-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 320px;
    overflow-y: auto;
}

.list-card-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-3);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--duration-fast);
}

.list-card-item:hover {
    background: rgba(0, 0, 0, 0.03);
}

.list-card-item-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--sand);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--maroon);
}

.list-card-item-content {
    flex: 1;
    min-width: 0;
}

.list-card-item-title {
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-card-item-subtitle {
    font-size: var(--text-xs);
    color: rgba(28, 16, 22, 0.45);
}

.list-card-item-meta {
    font-size: var(--text-xs);
    color: rgba(28, 16, 22, 0.4);
    white-space: nowrap;
    flex-shrink: 0;
}

/* --- Chart Card --- */
.chart-card-placeholder {
    height: 200px;
    background: linear-gradient(135deg, var(--sand) 0%, rgba(212, 160, 23, 0.05) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(28, 16, 22, 0.25);
    font-size: var(--text-sm);
}

/* --- Calendar Card --- */
.calendar-mini {
    width: 100%;
}

.calendar-mini-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.calendar-mini-month {
    font-weight: var(--weight-semibold);
    font-size: var(--text-base);
}

.calendar-mini-nav {
    display: flex;
    gap: var(--space-2);
}

.calendar-mini-nav button {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(28, 16, 22, 0.5);
    transition: all var(--duration-fast);
}

.calendar-mini-nav button:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--dark-wood);
}

.calendar-mini-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
}

.calendar-mini-day-label {
    font-size: 0.6875rem;
    font-weight: var(--weight-semibold);
    color: rgba(28, 16, 22, 0.35);
    padding: var(--space-1) 0;
    text-transform: uppercase;
}

.calendar-mini-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--duration-fast);
    color: var(--dark-wood);
}

.calendar-mini-day:hover {
    background: var(--sand);
}

.calendar-mini-day.today {
    background: var(--gold);
    color: var(--dark-wood);
    font-weight: var(--weight-semibold);
}

.calendar-mini-day.has-event::after {
    content: '';
    display: block;
    width: 4px;
    height: 4px;
    background: var(--maroon);
    border-radius: 50%;
    position: absolute;
    bottom: 3px;
}

.calendar-mini-day.has-event {
    position: relative;
}

.calendar-mini-day.other-month {
    color: rgba(28, 16, 22, 0.2);
}

/* --- Action Card --- */
.action-card {
    background: linear-gradient(135deg, var(--maroon), var(--terracotta));
    color: white;
    border: none;
}

.action-card .bento-card-title {
    color: white;
}

.action-card-text {
    font-size: var(--text-sm);
    opacity: 0.85;
    margin-bottom: var(--space-5);
    line-height: var(--leading-relaxed);
}

.action-card .btn {
    background: white;
    color: var(--maroon);
}

.action-card .btn:hover {
    background: var(--cream);
}


/* ============================================================
   12. BUTTONS
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 10px 20px;
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-default);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1;
}

.btn:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: var(--gold);
    color: var(--dark-wood);
    font-weight: var(--weight-semibold);
}

.btn-primary:hover {
    background: var(--gold-light);
    box-shadow: var(--shadow-gold);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-secondary {
    background: transparent;
    color: var(--maroon);
    border: 1.5px solid var(--maroon);
}

.btn-secondary:hover {
    background: rgba(139, 26, 26, 0.04);
    border-color: var(--maroon-light);
}

.btn-ghost {
    background: transparent;
    color: var(--maroon);
}

.btn-ghost:hover {
    background: rgba(139, 26, 26, 0.04);
}

.btn-teal {
    background: var(--teal);
    color: white;
}

.btn-teal:hover {
    background: var(--teal-light);
    box-shadow: 0 4px 16px rgba(26, 86, 83, 0.2);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--color-danger);
    color: white;
}

.btn-danger:hover {
    background: #D04E4E;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 6px 14px;
    font-size: var(--text-xs);
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 14px 28px;
    font-size: var(--text-md);
    border-radius: var(--radius-lg);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon.btn-sm {
    width: 32px;
    height: 32px;
}

.btn-icon.btn-lg {
    width: 48px;
    height: 48px;
}

.btn-full {
    width: 100%;
}

/* Button group */
.btn-group {
    display: inline-flex;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.btn-group .btn {
    border-radius: 0;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
}

.btn-group .btn:first-child {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.btn-group .btn:last-child {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    border-right: none;
}


/* ============================================================
   13. FORM ELEMENTS
   ============================================================ */

.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--dark-wood);
    margin-bottom: var(--space-2);
}

.form-label.required::after {
    content: ' *';
    color: var(--color-danger);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px var(--space-4);
    font-size: var(--text-base);
    border: 1.5px solid rgba(0, 0, 0, 0.12);
    border-radius: var(--radius-md);
    background: white;
    color: var(--dark-wood);
    transition: all var(--duration-fast) var(--ease-default);
    appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-muted);
}

.form-input::placeholder {
    color: rgba(28, 16, 22, 0.35);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: var(--color-danger);
    box-shadow: 0 0 0 3px var(--color-danger-bg);
}

.form-error {
    font-size: var(--text-xs);
    color: var(--color-danger);
    margin-top: var(--space-1);
}

.form-hint {
    font-size: var(--text-xs);
    color: rgba(28, 16, 22, 0.45);
    margin-top: var(--space-1);
}

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

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%231C1016' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none' opacity='0.4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

/* Floating label pattern */
.form-floating {
    position: relative;
}

.form-floating .form-input,
.form-floating .form-select,
.form-floating .form-textarea {
    padding-top: 22px;
    padding-bottom: 6px;
}

.form-floating .form-float-label {
    position: absolute;
    top: 50%;
    left: var(--space-4);
    transform: translateY(-50%);
    font-size: var(--text-base);
    color: rgba(28, 16, 22, 0.4);
    pointer-events: none;
    transition: all var(--duration-fast) var(--ease-default);
    transform-origin: left top;
}

.form-floating .form-input:focus ~ .form-float-label,
.form-floating .form-input:not(:placeholder-shown) ~ .form-float-label,
.form-floating .form-select:focus ~ .form-float-label,
.form-floating .form-select:not([value=""]) ~ .form-float-label,
.form-floating .form-textarea:focus ~ .form-float-label,
.form-floating .form-textarea:not(:placeholder-shown) ~ .form-float-label {
    top: 10px;
    transform: translateY(0) scale(0.75);
    color: var(--gold-dark);
    font-weight: var(--weight-medium);
}

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    cursor: pointer;
    padding: var(--space-2) 0;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: var(--gold);
    cursor: pointer;
    margin-top: 2px;
}

.form-check-label {
    font-size: var(--text-sm);
    color: var(--dark-wood);
    user-select: none;
}

/* Toggle switch */
.form-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    cursor: pointer;
}

.form-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.form-toggle-track {
    width: 44px;
    height: 24px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-full);
    position: relative;
    transition: background var(--duration-fast) var(--ease-default);
}

.form-toggle-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    box-shadow: var(--shadow-xs);
    transition: transform var(--duration-fast) var(--ease-default);
}

.form-toggle input:checked ~ .form-toggle-track {
    background: var(--gold);
}

.form-toggle input:checked ~ .form-toggle-track::after {
    transform: translateX(20px);
}

.form-toggle-label {
    font-size: var(--text-sm);
}


/* ============================================================
   14. DATA TABLE
   ============================================================ */

.data-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: white;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.data-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

.data-table th {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    font-weight: var(--weight-semibold);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(28, 16, 22, 0.5);
    background: var(--sand);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    white-space: nowrap;
}

.data-table td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    color: var(--dark-wood);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background var(--duration-fast);
}

.data-table tbody tr:nth-child(even) {
    background: rgba(245, 237, 224, 0.3);
}

.data-table tbody tr:hover {
    background: rgba(212, 160, 23, 0.04);
}

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

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.data-table th.sortable:hover {
    color: var(--dark-wood);
}

.data-table th.sortable::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 6px;
    vertical-align: middle;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    opacity: 0.3;
}

.data-table th.sort-asc::after {
    border-top: none;
    border-bottom: 4px solid currentColor;
    opacity: 1;
}

.data-table th.sort-desc::after {
    opacity: 1;
}

/* Table toolbar */
.data-table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-4);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    flex-wrap: wrap;
}

/* Pagination */
.data-table-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    font-size: var(--text-xs);
    color: rgba(28, 16, 22, 0.5);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.pagination-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    transition: all var(--duration-fast);
    color: var(--dark-wood);
}

.pagination-btn:hover {
    background: var(--sand);
}

.pagination-btn.active {
    background: var(--gold);
    color: var(--dark-wood);
    font-weight: var(--weight-semibold);
}


/* ============================================================
   15. TAGS / BADGES
   ============================================================ */

.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    font-size: 0.6875rem;
    font-weight: var(--weight-semibold);
    border-radius: var(--radius-full);
    line-height: 1.4;
    white-space: nowrap;
    background: var(--sand);
    color: var(--dark-wood);
}

.tag-success {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.tag-warning {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.tag-danger {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

.tag-info {
    background: var(--color-info-bg);
    color: var(--color-info);
}

.tag-gold {
    background: var(--gold-muted);
    color: var(--gold-dark);
}

.tag-maroon {
    background: rgba(139, 26, 26, 0.08);
    color: var(--maroon);
}

.tag-teal {
    background: rgba(26, 86, 83, 0.08);
    color: var(--teal);
}

.tag-terracotta {
    background: rgba(199, 91, 57, 0.08);
    color: var(--terracotta);
}

.tag-lg {
    padding: 5px 14px;
    font-size: var(--text-xs);
}

.tag-removable {
    padding-right: 6px;
}

.tag-remove {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 10px;
    cursor: pointer;
    transition: background var(--duration-fast);
}

.tag-remove:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Badge (count indicator) */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 0.6875rem;
    font-weight: var(--weight-bold);
    border-radius: var(--radius-full);
    background: var(--maroon);
    color: white;
    line-height: 1;
}

.badge-gold {
    background: var(--gold);
    color: var(--dark-wood);
}

.badge-teal {
    background: var(--teal);
}

.badge-sm {
    min-width: 16px;
    height: 16px;
    font-size: 0.625rem;
    padding: 0 4px;
}

.badge-dot {
    width: 8px;
    height: 8px;
    min-width: 8px;
    padding: 0;
    border-radius: 50%;
}


/* ============================================================
   16. NOTIFICATION PANEL
   ============================================================ */

.notif-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(28, 16, 22, 0.3);
    z-index: calc(var(--z-notif-panel) - 1);
    opacity: 0;
    visibility: hidden;
    transition: all var(--duration-normal) var(--ease-default);
}

.notif-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.notif-panel {
    position: fixed;
    top: 0;
    right: -380px;
    bottom: 0;
    width: 380px;
    background: white;
    z-index: var(--z-notif-panel);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.1);
    transition: right 0.3s var(--ease-default);
    display: flex;
    flex-direction: column;
}

.notif-panel.open {
    right: 0;
}

.notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}

.notif-panel-title {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    font-weight: var(--weight-semibold);
}

.notif-panel-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: rgba(28, 16, 22, 0.5);
    transition: all var(--duration-fast);
}

.notif-panel-close:hover {
    background: var(--sand);
    color: var(--dark-wood);
}

.notif-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4);
}

.notif-item {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--duration-fast);
}

.notif-item:hover {
    background: var(--sand);
}

.notif-item.unread {
    background: rgba(212, 160, 23, 0.04);
}

.notif-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
    background: var(--sand);
}

.notif-item-content {
    flex: 1;
    min-width: 0;
}

.notif-item-text {
    font-size: var(--text-sm);
    line-height: var(--leading-snug);
}

.notif-item-time {
    font-size: var(--text-xs);
    color: rgba(28, 16, 22, 0.4);
    margin-top: 2px;
}

.notif-item-dot {
    width: 8px;
    height: 8px;
    background: var(--gold);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
}


/* ============================================================
   17. FAB (Floating Action Button)
   ============================================================ */

.fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--maroon), var(--terracotta));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(139, 26, 26, 0.3);
    z-index: var(--z-fab);
    transition: transform var(--duration-fast) var(--ease-default),
                box-shadow var(--duration-fast) var(--ease-default);
    font-size: 24px;
}

.fab:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 28px rgba(139, 26, 26, 0.4);
}

.fab:active {
    transform: scale(0.96);
}

.fab.open {
    transform: rotate(45deg);
}

.fab-menu {
    position: fixed;
    bottom: 96px;
    right: 28px;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    z-index: calc(var(--z-fab) - 1);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: all 0.3s var(--ease-default);
}

.fab-menu.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.fab-menu-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: white;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--duration-fast) var(--ease-default);
}

.fab-menu-item:hover {
    transform: translateX(-4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
}

.fab-menu-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}


/* ============================================================
   18. ALERT TICKER BAR
   ============================================================ */

.alert-ticker {
    background: linear-gradient(90deg, var(--maroon), var(--terracotta));
    color: white;
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    padding: var(--space-2) var(--space-6);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.alert-ticker-text {
    display: inline-block;
    white-space: nowrap;
}

.alert-ticker-text.scrolling {
    animation: tickerScroll 20s linear infinite;
}

@keyframes tickerScroll {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

.alert-ticker-close {
    position: absolute;
    right: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    transition: all var(--duration-fast);
}

.alert-ticker-close:hover {
    color: white;
    background: rgba(255, 255, 255, 0.15);
}


/* ============================================================
   19. PUBLIC PAGES — SECTIONS
   ============================================================ */

.pub-page {
    padding-top: var(--pub-nav-height);
}

.section {
    padding: var(--space-20) 0;
}

.section-alt {
    background: var(--sand);
}

.section-white {
    background: white;
}

.section-title {
    font-family: var(--font-heading);
    font-size: var(--text-4xl);
    font-weight: var(--weight-bold);
    text-align: center;
    color: var(--dark-wood);
    margin-bottom: var(--space-4);
    position: relative;
    padding-bottom: var(--space-5);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--terracotta));
    border-radius: 2px;
}

.section-subtitle {
    text-align: center;
    font-size: var(--text-lg);
    color: rgba(28, 16, 22, 0.55);
    max-width: 600px;
    margin: 0 auto var(--space-12);
    line-height: var(--leading-relaxed);
}


/* ============================================================
   20. HERO (Public Homepage)
   ============================================================ */

.hero {
    min-height: calc(100vh - var(--pub-nav-height));
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: var(--space-16) 0;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-16);
    align-items: center;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--gold-muted);
    color: var(--gold-dark);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    border-radius: var(--radius-full);
    margin-bottom: var(--space-6);
    letter-spacing: 0.02em;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: var(--text-6xl);
    font-weight: var(--weight-extrabold);
    color: var(--dark-wood);
    line-height: 1.08;
    margin-bottom: var(--space-6);
    letter-spacing: -0.02em;
}

.hero-title .highlight {
    color: var(--maroon);
    position: relative;
}

.hero-title .highlight-gold {
    color: var(--gold-dark);
}

.hero-description {
    font-size: var(--text-lg);
    color: rgba(28, 16, 22, 0.6);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-8);
    max-width: 520px;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.hero-visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Decorative floating elements */
.hero-visual::before {
    content: '';
    position: absolute;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 160, 23, 0.1), transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.hero-visual::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border: 2px dashed rgba(139, 26, 26, 0.12);
    border-radius: 50%;
    top: 10%;
    right: 5%;
    animation: gentleRotate 30s linear infinite;
}

@keyframes gentleRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.hero-stats {
    display: flex;
    gap: var(--space-8);
    margin-top: var(--space-10);
    padding-top: var(--space-8);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.hero-stat-value {
    font-family: var(--font-heading);
    font-size: var(--text-3xl);
    font-weight: var(--weight-bold);
    color: var(--maroon);
}

.hero-stat-label {
    font-size: var(--text-xs);
    color: rgba(28, 16, 22, 0.5);
    font-weight: var(--weight-medium);
}


/* ============================================================
   21. FOOTER
   ============================================================ */

.site-footer {
    background: var(--dark-wood);
    color: rgba(255, 255, 255, 0.7);
    padding: var(--space-16) 0 var(--space-6);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-10);
    margin-bottom: var(--space-12);
}

.footer-brand-name {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: var(--weight-bold);
    color: var(--gold);
    margin-bottom: var(--space-3);
}

.footer-brand-desc {
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-5);
    max-width: 300px;
}

.footer-social {
    display: flex;
    gap: var(--space-3);
}

.footer-social a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    transition: all var(--duration-fast);
}

.footer-social a:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(212, 160, 23, 0.1);
}

.footer-heading {
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: var(--space-5);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.footer-links a {
    font-size: var(--text-sm);
    transition: color var(--duration-fast);
}

.footer-links a:hover {
    color: var(--gold);
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--space-6);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: var(--text-xs);
    color: rgba(255, 255, 255, 0.4);
    flex-wrap: wrap;
    gap: var(--space-4);
}

.footer-bottom-links {
    display: flex;
    gap: var(--space-5);
}

.footer-bottom-links a {
    transition: color var(--duration-fast);
}

.footer-bottom-links a:hover {
    color: rgba(255, 255, 255, 0.7);
}


/* ============================================================
   22. STUDENT SWITCHER
   ============================================================ */

.student-switcher {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.student-pill {
    padding: 6px 16px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(0, 0, 0, 0.1);
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-default);
    background: white;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.student-pill:hover {
    border-color: var(--gold);
    background: rgba(212, 160, 23, 0.04);
}

.student-pill.active {
    background: var(--gold);
    color: var(--dark-wood);
    border-color: var(--gold);
    font-weight: var(--weight-semibold);
}

.student-pill-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--sand);
    font-size: 0.5625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--weight-bold);
}

.student-pill.active .student-pill-avatar {
    background: rgba(28, 16, 22, 0.1);
}


/* ============================================================
   23. YEAR SELECTOR
   ============================================================ */

.year-selector {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 6px 14px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    background: white;
    cursor: pointer;
    transition: all var(--duration-fast);
}

.year-selector:hover {
    border-color: var(--gold);
}

.year-selector-icon {
    color: rgba(28, 16, 22, 0.4);
    font-size: 14px;
}

.year-selector-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: var(--space-2);
    z-index: var(--z-dropdown);
    min-width: 140px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all var(--duration-fast);
}

.year-selector-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.year-selector-option {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--duration-fast);
}

.year-selector-option:hover {
    background: var(--sand);
}

.year-selector-option.active {
    background: var(--gold-muted);
    color: var(--gold-dark);
    font-weight: var(--weight-semibold);
}


/* ============================================================
   24. MODAL
   ============================================================ */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(28, 16, 22, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: var(--z-modal-backdrop);
    opacity: 0;
    visibility: hidden;
    transition: all var(--duration-normal) var(--ease-default);
}

.modal-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    z-index: var(--z-modal);
    width: 90%;
    max-width: 560px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: all var(--duration-normal) var(--ease-default);
}

.modal.open {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.modal-lg {
    max-width: 720px;
}

.modal-sm {
    max-width: 400px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-6);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: var(--weight-semibold);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: rgba(28, 16, 22, 0.5);
    transition: all var(--duration-fast);
}

.modal-close:hover {
    background: var(--sand);
    color: var(--dark-wood);
}

.modal-body {
    padding: var(--space-6);
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}


/* ============================================================
   25. TOAST NOTIFICATIONS
   ============================================================ */

.toast-container {
    position: fixed;
    top: var(--space-6);
    right: var(--space-6);
    z-index: calc(var(--z-tooltip) + 1);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border-left: 3px solid var(--dark-wood);
    min-width: 320px;
    max-width: 420px;
    pointer-events: auto;
    animation: slideInRight 0.3s var(--ease-out) both;
}

.toast-success {
    border-left-color: var(--color-success);
}

.toast-warning {
    border-left-color: var(--color-warning);
}

.toast-danger {
    border-left-color: var(--color-danger);
}

.toast-info {
    border-left-color: var(--color-info);
}

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    margin-bottom: 2px;
}

.toast-message {
    font-size: var(--text-xs);
    color: rgba(28, 16, 22, 0.6);
    line-height: var(--leading-snug);
}

.toast-close {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: rgba(28, 16, 22, 0.35);
    flex-shrink: 0;
    transition: all var(--duration-fast);
}

.toast-close:hover {
    background: var(--sand);
    color: var(--dark-wood);
}


/* ============================================================
   26. PROGRESS & LOADING
   ============================================================ */

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--sand);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--gold), var(--terracotta));
    transition: width 0.5s var(--ease-default);
}

.progress-bar-fill.success {
    background: var(--color-success);
}

.progress-bar-sm {
    height: 4px;
}

.progress-bar-lg {
    height: 10px;
}

/* Skeleton loader */
.skeleton {
    background: linear-gradient(90deg, var(--sand) 25%, rgba(245, 237, 224, 0.5) 50%, var(--sand) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 14px;
    margin-bottom: var(--space-2);
}

.skeleton-text:last-child {
    width: 60%;
}

.skeleton-heading {
    height: 24px;
    width: 50%;
    margin-bottom: var(--space-4);
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-card {
    height: 200px;
    border-radius: var(--radius-xl);
}

/* Spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 2.5px solid var(--sand);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spinnerRotate 0.7s linear infinite;
}

@keyframes spinnerRotate {
    to { transform: rotate(360deg); }
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.spinner-lg {
    width: 36px;
    height: 36px;
    border-width: 3px;
}

/* Loading overlay */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 248, 240, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    z-index: 10;
}


/* ============================================================
   27. TABS
   ============================================================ */

.tabs {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    overflow-x: auto;
}

.tab {
    padding: var(--space-3) var(--space-5);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: rgba(28, 16, 22, 0.5);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-default);
    margin-bottom: -1px;
}

.tab:hover {
    color: var(--dark-wood);
}

.tab.active {
    color: var(--maroon);
    border-bottom-color: var(--gold);
    font-weight: var(--weight-semibold);
}

/* Pill tabs */
.tabs-pill {
    border-bottom: none;
    background: var(--sand);
    border-radius: var(--radius-md);
    padding: 3px;
    gap: 2px;
}

.tabs-pill .tab {
    border-bottom: none;
    border-radius: var(--radius-sm);
    padding: var(--space-2) var(--space-4);
    margin-bottom: 0;
}

.tabs-pill .tab.active {
    background: white;
    box-shadow: var(--shadow-xs);
    color: var(--dark-wood);
}

.tab-content {
    padding-top: var(--space-5);
}


/* ============================================================
   28. ACCORDION
   ============================================================ */

.accordion {
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.accordion-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    font-size: var(--text-base);
    font-weight: var(--weight-medium);
    text-align: left;
    background: white;
    cursor: pointer;
    transition: background var(--duration-fast);
}

.accordion-trigger:hover {
    background: var(--sand);
}

.accordion-trigger-icon {
    width: 20px;
    height: 20px;
    transition: transform var(--duration-normal) var(--ease-default);
    flex-shrink: 0;
    color: rgba(28, 16, 22, 0.4);
}

.accordion-item.open .accordion-trigger-icon {
    transform: rotate(180deg);
}

.accordion-body {
    padding: 0 var(--space-5) var(--space-5);
    font-size: var(--text-sm);
    color: rgba(28, 16, 22, 0.7);
    line-height: var(--leading-relaxed);
    display: none;
}

.accordion-item.open .accordion-body {
    display: block;
}


/* ============================================================
   29. TOOLTIP
   ============================================================ */

[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 5px 10px;
    background: var(--dark-wood);
    color: white;
    font-size: 0.6875rem;
    font-weight: var(--weight-medium);
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all var(--duration-fast) var(--ease-default);
    z-index: var(--z-tooltip);
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}


/* ============================================================
   30. EMPTY STATES
   ============================================================ */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-12) var(--space-6);
    text-align: center;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    background: var(--sand);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: rgba(28, 16, 22, 0.25);
    margin-bottom: var(--space-5);
}

.empty-state-title {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: var(--weight-semibold);
    margin-bottom: var(--space-2);
}

.empty-state-text {
    font-size: var(--text-sm);
    color: rgba(28, 16, 22, 0.5);
    max-width: 360px;
    margin-bottom: var(--space-6);
    line-height: var(--leading-relaxed);
}


/* ============================================================
   31. ANIMATIONS
   ============================================================ */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.92);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

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

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.animate-in {
    animation: fadeInUp 0.5s var(--ease-out) both;
}

.animate-fade {
    animation: fadeIn 0.4s var(--ease-out) both;
}

.animate-scale {
    animation: scaleIn 0.3s var(--ease-out) both;
}

.animate-slide-right {
    animation: slideInRight 0.4s var(--ease-out) both;
}

.animate-slide-left {
    animation: slideInLeft 0.4s var(--ease-out) both;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Stagger children animations */
.stagger-children > * {
    animation: fadeInUp 0.4s var(--ease-out) both;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.4s; }

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}


/* ============================================================
   32. UTILITY CLASSES
   ============================================================ */

/* --- Text Colors --- */
.text-gold { color: var(--gold); }
.text-gold-dark { color: var(--gold-dark); }
.text-maroon { color: var(--maroon); }
.text-teal { color: var(--teal); }
.text-terracotta { color: var(--terracotta); }
.text-lotus { color: var(--lotus-pink); }
.text-muted { color: rgba(28, 16, 22, 0.5); }
.text-light { color: rgba(28, 16, 22, 0.35); }
.text-white { color: white; }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger { color: var(--color-danger); }
.text-info { color: var(--color-info); }

/* --- Background Colors --- */
.bg-cream { background-color: var(--cream); }
.bg-sand { background-color: var(--sand); }
.bg-white { background-color: white; }
.bg-dark-wood { background-color: var(--dark-wood); }
.bg-maroon { background-color: var(--maroon); }
.bg-gold { background-color: var(--gold); }
.bg-teal { background-color: var(--teal); }
.bg-terracotta { background-color: var(--terracotta); }

/* --- Typography Utilities --- */
.font-heading { font-family: var(--font-heading); }
.font-body { font-family: var(--font-body); }
.font-tamil { font-family: var(--font-tamil); }

.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-md { font-size: var(--text-md); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }
.text-4xl { font-size: var(--text-4xl); }

.font-light { font-weight: var(--weight-light); }
.font-regular { font-weight: var(--weight-regular); }
.font-medium { font-weight: var(--weight-medium); }
.font-semibold { font-weight: var(--weight-semibold); }
.font-bold { font-weight: var(--weight-bold); }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.uppercase { text-transform: uppercase; }
.lowercase { text-transform: lowercase; }
.capitalize { text-transform: capitalize; }

.leading-tight { line-height: var(--leading-tight); }
.leading-snug { line-height: var(--leading-snug); }
.leading-normal { line-height: var(--leading-normal); }
.leading-relaxed { line-height: var(--leading-relaxed); }

.tracking-tight { letter-spacing: -0.02em; }
.tracking-wide { letter-spacing: 0.04em; }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Flexbox --- */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.items-stretch { align-items: stretch; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-grow { flex-grow: 1; }

/* --- Grid --- */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* --- Gap --- */
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }
.gap-10 { gap: var(--space-10); }
.gap-12 { gap: var(--space-12); }

/* --- Spacing (margin & padding) --- */
.m-0 { margin: 0; }
.m-auto { margin: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mt-10 { margin-top: var(--space-10); }
.mt-12 { margin-top: var(--space-12); }

.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-10 { margin-bottom: var(--space-10); }
.mb-12 { margin-bottom: var(--space-12); }

.ml-1 { margin-left: var(--space-1); }
.ml-2 { margin-left: var(--space-2); }
.ml-3 { margin-left: var(--space-3); }
.ml-4 { margin-left: var(--space-4); }
.ml-auto { margin-left: auto; }

.mr-1 { margin-right: var(--space-1); }
.mr-2 { margin-right: var(--space-2); }
.mr-3 { margin-right: var(--space-3); }
.mr-4 { margin-right: var(--space-4); }
.mr-auto { margin-right: auto; }

.p-0 { padding: 0; }
.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }
.p-10 { padding: var(--space-10); }
.p-12 { padding: var(--space-12); }

.px-1 { padding-left: var(--space-1); padding-right: var(--space-1); }
.px-2 { padding-left: var(--space-2); padding-right: var(--space-2); }
.px-3 { padding-left: var(--space-3); padding-right: var(--space-3); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-5 { padding-left: var(--space-5); padding-right: var(--space-5); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }
.px-8 { padding-left: var(--space-8); padding-right: var(--space-8); }

.py-1 { padding-top: var(--space-1); padding-bottom: var(--space-1); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-3 { padding-top: var(--space-3); padding-bottom: var(--space-3); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-5 { padding-top: var(--space-5); padding-bottom: var(--space-5); }
.py-6 { padding-top: var(--space-6); padding-bottom: var(--space-6); }
.py-8 { padding-top: var(--space-8); padding-bottom: var(--space-8); }

/* --- Border Radius --- */
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-full { border-radius: var(--radius-full); }
.rounded-none { border-radius: 0; }

/* --- Shadows --- */
.shadow-none { box-shadow: none; }
.shadow-xs { box-shadow: var(--shadow-xs); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

/* --- Borders --- */
.border { border: 1px solid rgba(0, 0, 0, 0.08); }
.border-b { border-bottom: 1px solid rgba(0, 0, 0, 0.06); }
.border-t { border-top: 1px solid rgba(0, 0, 0, 0.06); }
.border-none { border: none; }

/* --- Width & Height --- */
.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

/* --- Positioning --- */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.inset-0 { inset: 0; }

/* --- Overflow --- */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }

/* --- Display --- */
.block { display: block; }
.inline-block { display: inline-block; }
.hidden { display: none; }
.visible { visibility: visible; }
.invisible { visibility: hidden; }

/* --- Opacity --- */
.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }
.opacity-100 { opacity: 1; }

/* --- Cursor --- */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }
.cursor-not-allowed { cursor: not-allowed; }

/* --- Container --- */
.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-6);
    padding-right: var(--space-6);
}

.container-wide {
    max-width: var(--content-max-width);
}

/* --- Divider --- */
.divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.06);
    border: none;
    margin: var(--space-6) 0;
}

.divider-vertical {
    width: 1px;
    height: 24px;
    background: rgba(0, 0, 0, 0.08);
}


/* ============================================================
   33. FEATURE CARDS (Public Pages)
   ============================================================ */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-6);
}

.feature-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    box-shadow: var(--shadow-sm);
    transition: all var(--duration-normal) var(--ease-default);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-card-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: var(--space-5);
}

.feature-card-icon.gold-bg {
    background: var(--gold-muted);
    color: var(--gold-dark);
}

.feature-card-icon.maroon-bg {
    background: rgba(139, 26, 26, 0.08);
    color: var(--maroon);
}

.feature-card-icon.teal-bg {
    background: rgba(26, 86, 83, 0.08);
    color: var(--teal);
}

.feature-card-icon.terracotta-bg {
    background: rgba(199, 91, 57, 0.08);
    color: var(--terracotta);
}

.feature-card-icon.lotus-bg {
    background: rgba(232, 160, 191, 0.12);
    color: var(--lotus-pink-dark);
}

.feature-card-title {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: var(--weight-semibold);
    margin-bottom: var(--space-3);
}

.feature-card-text {
    font-size: var(--text-sm);
    color: rgba(28, 16, 22, 0.6);
    line-height: var(--leading-relaxed);
}


/* ============================================================
   34. TESTIMONIAL CARDS
   ============================================================ */

.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: var(--space-6);
}

.testimonial-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.04);
    position: relative;
}

.testimonial-card::before {
    content: '\201C';
    font-family: var(--font-heading);
    font-size: 4rem;
    line-height: 1;
    color: var(--gold-muted);
    position: absolute;
    top: var(--space-5);
    left: var(--space-6);
}

.testimonial-text {
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    color: rgba(28, 16, 22, 0.7);
    font-style: italic;
    margin-bottom: var(--space-6);
    padding-top: var(--space-6);
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.testimonial-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--sand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--weight-semibold);
    color: var(--maroon);
    flex-shrink: 0;
}

.testimonial-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.testimonial-name {
    font-weight: var(--weight-semibold);
    font-size: var(--text-sm);
}

.testimonial-role {
    font-size: var(--text-xs);
    color: rgba(28, 16, 22, 0.45);
}


/* ============================================================
   35. CTA BANNER
   ============================================================ */

.cta-banner {
    background: linear-gradient(135deg, var(--maroon), var(--maroon-dark));
    border-radius: var(--radius-2xl);
    padding: var(--space-16) var(--space-10);
    text-align: center;
    position: relative;
    overflow: hidden;
    color: white;
}

.cta-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: rgba(212, 160, 23, 0.08);
}

.cta-banner::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(199, 91, 57, 0.1);
}

.cta-banner > * {
    position: relative;
    z-index: 1;
}

.cta-banner-title {
    font-family: var(--font-heading);
    font-size: var(--text-4xl);
    font-weight: var(--weight-bold);
    margin-bottom: var(--space-4);
    color: white;
}

.cta-banner-text {
    font-size: var(--text-lg);
    opacity: 0.85;
    max-width: 560px;
    margin: 0 auto var(--space-8);
    line-height: var(--leading-relaxed);
}

.cta-banner .btn-primary {
    background: var(--gold);
    color: var(--dark-wood);
    padding: 14px 32px;
    font-size: var(--text-md);
}

.cta-banner .btn-primary:hover {
    background: var(--gold-light);
    box-shadow: 0 6px 24px rgba(212, 160, 23, 0.35);
}


/* ============================================================
   36. LOGIN / AUTH PAGES
   ============================================================ */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: white;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    padding: var(--space-10);
}

.auth-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: var(--space-8);
}

.auth-logo-mark {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--maroon), var(--terracotta));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: var(--weight-bold);
    margin-bottom: var(--space-4);
}

.auth-title {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: var(--weight-bold);
    text-align: center;
    margin-bottom: var(--space-2);
}

.auth-subtitle {
    font-size: var(--text-sm);
    color: rgba(28, 16, 22, 0.5);
    text-align: center;
}

.auth-form {
    margin-top: var(--space-6);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin: var(--space-6) 0;
    font-size: var(--text-xs);
    color: rgba(28, 16, 22, 0.35);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(0, 0, 0, 0.06);
}

.auth-footer {
    text-align: center;
    margin-top: var(--space-6);
    font-size: var(--text-sm);
    color: rgba(28, 16, 22, 0.5);
}

.auth-footer a {
    color: var(--maroon);
    font-weight: var(--weight-medium);
}

.auth-footer a:hover {
    text-decoration: underline;
}


/* ============================================================
   37. PROFILE / AVATAR COMPONENTS
   ============================================================ */

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--weight-semibold);
    font-size: var(--text-sm);
    flex-shrink: 0;
    overflow: hidden;
    background: linear-gradient(135deg, var(--maroon), var(--terracotta));
    color: white;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-xs { width: 24px; height: 24px; font-size: 0.625rem; }
.avatar-sm { width: 32px; height: 32px; font-size: var(--text-xs); }
.avatar-lg { width: 56px; height: 56px; font-size: var(--text-lg); }
.avatar-xl { width: 80px; height: 80px; font-size: var(--text-2xl); }

.avatar-gold { background: linear-gradient(135deg, var(--gold), var(--gold-dark)); color: var(--dark-wood); }
.avatar-teal { background: linear-gradient(135deg, var(--teal), var(--teal-dark)); }
.avatar-sand { background: var(--sand); color: var(--maroon); }

.avatar-group {
    display: flex;
}

.avatar-group .avatar {
    border: 2px solid white;
    margin-left: -10px;
}

.avatar-group .avatar:first-child {
    margin-left: 0;
}

.avatar-group-count {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--sand);
    border: 2px solid white;
    margin-left: -10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    color: rgba(28, 16, 22, 0.6);
}


/* ============================================================
   38. ATTENDANCE / STATUS INDICATORS
   ============================================================ */

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.status-dot.present { background: var(--color-success); }
.status-dot.absent { background: var(--color-danger); }
.status-dot.late { background: var(--color-warning); }
.status-dot.excused { background: var(--color-info); }

.attendance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 32px);
    gap: 4px;
}

.attendance-cell {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: var(--weight-medium);
    cursor: pointer;
    transition: all var(--duration-fast);
}

.attendance-cell.present { background: var(--color-success-bg); color: var(--color-success); }
.attendance-cell.absent { background: var(--color-danger-bg); color: var(--color-danger); }
.attendance-cell.late { background: var(--color-warning-bg); color: var(--color-warning); }
.attendance-cell.excused { background: var(--color-info-bg); color: var(--color-info); }
.attendance-cell.empty { background: var(--sand); color: rgba(28, 16, 22, 0.2); }

.attendance-cell:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-sm);
}

/* Grade indicator */
.grade-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: var(--weight-bold);
}

.grade-badge.grade-a { background: var(--color-success-bg); color: var(--color-success); }
.grade-badge.grade-b { background: var(--color-info-bg); color: var(--color-info); }
.grade-badge.grade-c { background: var(--color-warning-bg); color: var(--color-warning); }
.grade-badge.grade-d { background: rgba(199, 91, 57, 0.08); color: var(--terracotta); }
.grade-badge.grade-f { background: var(--color-danger-bg); color: var(--color-danger); }


/* ============================================================
   39. TIMELINE COMPONENT
   ============================================================ */

.timeline {
    position: relative;
    padding-left: var(--space-8);
}

.timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(0, 0, 0, 0.06);
}

.timeline-item {
    position: relative;
    padding-bottom: var(--space-6);
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: calc(-1 * var(--space-8) + 4px);
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--gold);
    z-index: 1;
}

.timeline-dot.completed {
    background: var(--gold);
}

.timeline-dot.current {
    background: var(--maroon);
    border-color: var(--maroon);
    box-shadow: 0 0 0 4px rgba(139, 26, 26, 0.15);
}

.timeline-time {
    font-size: var(--text-xs);
    color: rgba(28, 16, 22, 0.4);
    font-weight: var(--weight-medium);
    margin-bottom: var(--space-1);
}

.timeline-title {
    font-weight: var(--weight-semibold);
    font-size: var(--text-sm);
    margin-bottom: var(--space-1);
}

.timeline-text {
    font-size: var(--text-xs);
    color: rgba(28, 16, 22, 0.55);
    line-height: var(--leading-relaxed);
}


/* ============================================================
   40. RESPONSIVE BREAKPOINTS
   ============================================================ */

/* Tablet landscape and below */
@media (max-width: 1200px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero .container {
        grid-template-columns: 1fr;
        gap: var(--space-10);
        text-align: center;
    }

    .hero-content {
        order: 1;
    }

    .hero-visual {
        order: 0;
    }

    .hero-description {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-stats {
        justify-content: center;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-8);
    }

    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet portrait and below */
@media (max-width: 768px) {
    :root {
        --text-5xl: 2.25rem;
        --text-6xl: 2.75rem;
        --text-4xl: 1.875rem;
    }

    /* Icon rail becomes bottom tab bar */
    .icon-rail {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100% !important;
        height: 64px;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        background: var(--dark-wood);
    }

    .icon-rail:hover {
        width: 100% !important;
    }

    .rail-header,
    .rail-section-label,
    .rail-item-label,
    .rail-item-badge,
    .rail-footer {
        display: none;
    }

    .rail-nav {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-around;
        padding: 0;
        width: 100%;
        overflow: visible;
    }

    .rail-item {
        flex-direction: column;
        height: auto;
        padding: var(--space-2) var(--space-3);
        gap: 2px;
        justify-content: center;
        align-items: center;
        min-width: 0;
        flex: 1;
    }

    .rail-item.active::before {
        left: 8px;
        right: 8px;
        top: 0;
        bottom: auto;
        width: auto;
        height: 3px;
        border-radius: 0 0 2px 2px;
    }

    .rail-item-icon {
        width: 20px;
        height: 20px;
        font-size: 18px;
    }

    /* App layout adjustments */
    .app-layout {
        padding-left: 0;
        padding-bottom: 64px;
    }

    .identity-bar {
        left: 0;
    }

    .identity-bar-search {
        display: none;
    }

    .app-content {
        padding: var(--space-4);
    }

    /* Bento grid to single column */
    .bento-grid {
        grid-template-columns: 1fr;
    }

    .bento-card.span-2,
    .bento-card.span-full {
        grid-column: span 1;
    }

    /* Public nav */
    .pub-nav {
        padding: 0 var(--space-4);
    }

    .pub-nav-links {
        display: none;
    }

    .pub-nav-toggle {
        display: flex;
    }

    /* Section spacing */
    .section {
        padding: var(--space-12) 0;
    }

    .section-title {
        font-size: var(--text-3xl);
    }

    .container {
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }

    .hero {
        min-height: auto;
        padding: var(--space-10) 0;
    }

    .hero-title {
        font-size: var(--text-4xl);
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    /* Feature grid */
    .feature-grid {
        grid-template-columns: 1fr;
    }

    .testimonial-grid {
        grid-template-columns: 1fr;
    }

    /* FAB */
    .fab {
        bottom: 80px;
    }

    .fab-menu {
        bottom: 148px;
    }

    /* Notification panel full width on mobile */
    .notif-panel {
        width: 100%;
        right: -100%;
    }

    /* Modal full-screen on mobile */
    .modal {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        top: 0;
        left: 0;
        transform: translateY(20px);
    }

    .modal.open {
        transform: translateY(0);
    }

    /* Auth card */
    .auth-card {
        padding: var(--space-6);
        box-shadow: none;
        border-radius: 0;
        max-width: 100%;
    }

    /* Data table scroll */
    .data-table-wrapper {
        border-radius: var(--radius-sm);
    }

    /* CTA banner */
    .cta-banner {
        padding: var(--space-10) var(--space-6);
        border-radius: var(--radius-xl);
    }

    .cta-banner-title {
        font-size: var(--text-2xl);
    }
}

/* Small phones */
@media (max-width: 480px) {
    :root {
        --text-5xl: 1.875rem;
        --text-6xl: 2.25rem;
        --text-4xl: 1.5rem;
        --text-3xl: 1.25rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header-actions {
        width: 100%;
    }

    .page-header-actions .btn {
        flex: 1;
    }

    .hero-stats {
        flex-direction: column;
        gap: var(--space-4);
    }

    .student-switcher {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: var(--space-2);
    }

    .student-pill {
        flex-shrink: 0;
    }

    .btn-group {
        flex-direction: column;
        border-radius: var(--radius-md);
    }

    .btn-group .btn {
        border-radius: 0;
        border-right: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }

    .btn-group .btn:first-child {
        border-radius: var(--radius-md) var(--radius-md) 0 0;
    }

    .btn-group .btn:last-child {
        border-radius: 0 0 var(--radius-md) var(--radius-md);
        border-bottom: none;
    }
}

/* Large desktop */
@media (min-width: 1600px) {
    .bento-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .glass-card,
    .bento-card {
        background: white;
        border: 2px solid var(--dark-wood);
        backdrop-filter: none;
    }

    .pub-nav {
        background: white;
        backdrop-filter: none;
        border-bottom-width: 2px;
    }

    .form-input,
    .form-select,
    .form-textarea {
        border-width: 2px;
    }
}

/* Dark mode foundation (opt-in via class) */
.dark-mode {
    --cream: #161216;
    --sand: #1E181C;
    --dark-wood: #F5EDE0;
    color-scheme: dark;
}

.dark-mode body {
    background-color: #121012;
    color: #E8DDD0;
}

.dark-mode .glass-card,
.dark-mode .bento-card {
    background: rgba(30, 24, 28, 0.85);
    border-color: rgba(255, 255, 255, 0.06);
}

.dark-mode .identity-bar {
    background: #1A151A;
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

.dark-mode .form-input,
.dark-mode .form-select,
.dark-mode .form-textarea {
    background: #1E181C;
    border-color: rgba(255, 255, 255, 0.1);
    color: #E8DDD0;
}

.dark-mode .data-table-wrapper {
    background: #1A151A;
    border-color: rgba(255, 255, 255, 0.06);
}

.dark-mode .data-table th {
    background: #1E181C;
    color: rgba(232, 221, 208, 0.5);
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

.dark-mode .data-table td {
    border-bottom-color: rgba(255, 255, 255, 0.04);
    color: #E8DDD0;
}

.dark-mode .modal,
.dark-mode .notif-panel,
.dark-mode .toast {
    background: #1A151A;
}


/* ============================================================
   41. PRINT STYLES
   ============================================================ */

@media print {
    body {
        background: white;
        color: black;
        font-size: 12pt;
    }

    .icon-rail,
    .identity-bar,
    .pub-nav,
    .fab,
    .fab-menu,
    .alert-ticker,
    .notif-panel,
    .notif-backdrop,
    .toast-container {
        display: none !important;
    }

    .app-layout {
        padding: 0;
    }

    .glass-card,
    .bento-card {
        background: white;
        backdrop-filter: none;
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }

    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    a[href]::after {
        content: ' (' attr(href) ')';
        font-size: 0.8em;
        color: #666;
    }
}
