/* =========================================================
   AI SMART HOSTEL — DESIGN SYSTEM  (loaded LAST on every page)

   Light pages, black "ink" panels, one accent colour.
     Student side: indigo (from the landing page)
     Admin side:   crimson  (css/admin-theme.css swaps the accent)
   Type: Poppins for text, Outfit for headings.
   The opening intro and the welcome sequence stay dark and cinematic
   (css/welcome-intro.css).
   ========================================================= */
@import url("https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&family=Outfit:wght@200..700&display=swap");

:root {
    --bg: #ffffff;
    --fg: #111111;
    --ink: #0a0a0a;
    --mute: #8d8d8d;
    --subtle: #b6b6b6;
    --hair: #e6e5e2;
    --surface: #f1f0ee;
    --surface-2: #e3e2df;

    --accent: #5b5fc7;
    --accent-from: #8b8fe8;
    --accent-to: #3c3f9e;
    --accent-rgb: 91, 95, 199;
    --accent-grad: linear-gradient(135deg, var(--accent-from), var(--accent-to));

    --r-pill: 9999px;
    --r-card: 1.75rem;
    --r-card-sm: 1.15rem;
    --r-control: 0.875rem;
    --spring: cubic-bezier(0.22, 1, 0.36, 1);
    --spring-snappy: cubic-bezier(0.2, 0.8, 0.2, 1);

    /* names the page stylesheets already use */
    --text: var(--fg);
    --muted: #6f6d69;
    --secondary: #5e5c58;
    --soft: #8d8d8d;
    --light-muted: #8d8d8d;
    --line: var(--hair);
    --border: var(--hair);
    --glass: rgba(255, 255, 255, 0.86);
    --glass-strong: #ffffff;
    --glass-border: var(--hair);
    --card: #ffffff;
    --card-solid: #ffffff;
    --primary: var(--accent);
    --primary-dark: var(--accent-to);
    --primary-soft: rgba(var(--accent-rgb), 0.1);
    --purple: var(--accent);
    --purple-soft: rgba(var(--accent-rgb), 0.1);
    --blue: var(--accent);
    --blue-dark: var(--accent-to);
    --blue-soft: rgba(var(--accent-rgb), 0.1);
    --shadow: 0 1px 2px rgba(17, 17, 17, 0.04), 0 12px 32px rgba(17, 17, 17, 0.06);
    --radius: var(--r-card-sm);
}

/* ---------- base ---------- */
html {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body {
    font-family: "DM Sans", "Segoe UI", system-ui, sans-serif !important;
    font-size: 16px;
    color: var(--fg);
    background: var(--bg) !important;
    letter-spacing: -0.005em;
}

button, input, select, textarea {
    font-family: inherit !important;
}

::selection {
    background: rgba(var(--accent-rgb), 0.22);
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* big, tight headings (the page's personality) */
body:not(.lp) h1 {
    font-family: "Outfit", "DM Sans", sans-serif !important;
    font-weight: 500 !important;
    letter-spacing: -0.03em !important;
    line-height: 1 !important;
    font-size: clamp(2.4rem, 3.6vw, 3.6rem) !important;
    color: var(--fg);
}

h2 {
    letter-spacing: -0.025em;
    font-weight: 650;
}

h3 {
    letter-spacing: -0.015em;
}

a {
    color: var(--accent);
}

/* ---------- sidebars: ink panel, accent pill for the current page ---------- */
.sidebar,
.asb {
    background: var(--ink) !important;
    color: rgba(255, 255, 255, 0.62) !important;
    border: 0 !important;
    border-radius: 0 1.75rem 1.75rem 0 !important;
    box-shadow: 12px 0 40px rgba(17, 17, 17, 0.12) !important;
    backdrop-filter: none !important;
}

.sidebar *,
.asb * {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.brand-mark,
.brand-icon,
.asb-logo {
    background: #ffffff url("../assets/brand/iitpkd-emblem.svg") center / 72% no-repeat !important;
    color: transparent !important;
    font-size: 0 !important;
    border-radius: 0.9rem !important;
    box-shadow: 0 8px 22px rgba(var(--accent-rgb), 0.35) !important;
}

.brand strong,
.brand h2,
.asb-brand strong {
    color: #ffffff !important;
    font-weight: 650 !important;
    letter-spacing: -0.01em !important;
    font-size: 17px !important;
}

.brand span,
.asb-brand small,
.asb-brand span {
    color: rgba(255, 255, 255, 0.45) !important;
}

.nav-label,
.asb-title,
.asb-section,
.asb-nav h4,
.asb-nav small,
.nav-section-title {
    color: rgba(255, 255, 255, 0.35) !important;
}

.nav-item,
.asb-link {
    color: rgba(255, 255, 255, 0.66) !important;
    background: transparent !important;
    font-size: 15.5px !important;
    font-weight: 500 !important;
    border-radius: 999px !important;
    transition: background 0.25s var(--spring-snappy), color 0.25s ease, transform 0.25s var(--spring-snappy) !important;
}

.nav-item span,
.asb-link span {
    color: inherit !important;
}

.nav-item:hover,
.asb-link:hover {
    background: rgba(255, 255, 255, 0.07) !important;
    color: #ffffff !important;
    transform: translateX(3px);
}

.nav-item.active,
.asb-link.active {
    background: var(--accent-grad) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    box-shadow: 0 10px 26px rgba(var(--accent-rgb), 0.35) !important;
}

.asb-title {
    font-size: 11.5px !important;
    font-weight: 600 !important;
    letter-spacing: 0.06em !important;
}

.asb-badge {
    background: var(--accent) !important;
    color: #ffffff !important;
}

.profile-avatar {
    background: var(--accent-grad) !important;
    color: #ffffff !important;
}

.sidebar .profile-button {
    background: rgba(255, 255, 255, 0.05) !important;
    border-radius: 1rem !important;
}

.asb-avatar,
.sidebar .avatar {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

.asb-who strong,
.sidebar-bottom strong {
    color: #ffffff !important;
}

.asb-who small,
.sidebar-bottom small,
.sidebar-bottom span {
    color: rgba(255, 255, 255, 0.45) !important;
}

.asb-logout,
.sidebar .logout-btn,
.sidebar-bottom button {
    color: rgba(255, 255, 255, 0.6) !important;
    background: transparent !important;
}

.asb-logout:hover,
.sidebar-bottom button:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.07) !important;
}

/* ---------- cards: white, hairline ring, generous radius ---------- */
.glass-card,
.summary-card,
.stat-card,
.action-card,
.management-card,
.info-card,
.content-card,
.form-card,
.schedule-card,
.student-card {
    background: #ffffff !important;
    border: 1px solid var(--hair) !important;
    border-radius: var(--r-card) !important;
    box-shadow: 0 1px 2px rgba(17, 17, 17, 0.03) !important;
    backdrop-filter: none !important;
    transition: transform 0.45s var(--spring), box-shadow 0.45s var(--spring), border-color 0.3s ease !important;
}

.stat-card,
.action-card,
.management-card,
.summary-card,
.schedule-card,
.student-card {
    transform-style: preserve-3d;
    will-change: transform;
}

.stat-card:hover,
.action-card:hover,
.management-card:hover,
.summary-card:hover,
.schedule-card:hover {
    border-color: rgba(17, 17, 17, 0.14) !important;
    box-shadow: 0 24px 50px rgba(17, 17, 17, 0.1) !important;
}

/* big numbers in stat cards */
.stat-card h3,
.stat-card strong,
.stat-value,
.stat-number {
    letter-spacing: -0.03em;
}

/* icon tiles: ink, accent, warm grey, ink */
.stat-icon,
.action-icon,
.management-icon {
    background: var(--ink) !important;
    color: #ffffff !important;
    border-radius: 1rem !important;
    box-shadow: none !important;
}

.stat-card:nth-child(4n + 2) .stat-icon,
.action-card:nth-child(4n + 2) .action-icon,
.management-card:nth-child(4n + 2) .management-icon {
    background: var(--accent-grad) !important;
}

.stat-card:nth-child(4n + 3) .stat-icon,
.action-card:nth-child(4n + 3) .action-icon,
.management-card:nth-child(4n + 3) .management-icon {
    background: var(--surface) !important;
    color: var(--fg) !important;
}

/* ---------- buttons: pills ---------- */
.primary-btn,
.primary-button,
.login-button,
button[type="submit"]:not(.aic-icon-btn):not(.icon-btn):not(.lp-plain) {
    background: var(--ink) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: var(--r-pill) !important;
    font-weight: 600 !important;
    box-shadow: none !important;
    transition: transform 0.35s var(--spring-snappy), background 0.25s ease !important;
}

.primary-btn:hover,
.primary-button:hover,
.login-button:hover,
button[type="submit"]:not(.aic-icon-btn):not(.icon-btn):not(.lp-plain):hover {
    transform: scale(1.03);
    background: #222222 !important;
}

.primary-btn *,
.primary-button *,
.login-button * {
    color: inherit !important;
}

.secondary-btn,
.secondary-button,
.filter-btn,
.filter-button {
    background: transparent !important;
    border: 1px solid var(--hair) !important;
    color: var(--fg) !important;
    border-radius: var(--r-pill) !important;
    transition: transform 0.35s var(--spring-snappy), background 0.25s ease !important;
}

.secondary-btn:hover,
.secondary-button:hover,
.filter-btn:hover,
.filter-button:hover {
    background: var(--surface) !important;
    transform: scale(1.03);
}

.mess-tab.active *,
.filter-btn.active *,
.tab.active * {
    color: #ffffff !important;
}

.filter-btn.active,
.filter-button.active,
.tab.active,
.tab-btn.active,
.mess-tab.active,
.week-btn.active {
    background: var(--ink) !important;
    border-color: var(--ink) !important;
    color: #ffffff !important;
}

/* ---------- form fields ---------- */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
select,
textarea {
    background-color: rgba(241, 240, 238, 0.55) !important;
    border: 1px solid var(--hair) !important;
    border-radius: var(--r-control) !important;
    color: var(--fg) !important;
    font-size: 15px !important;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none !important;
    background-color: #ffffff !important;
    border-color: rgba(17, 17, 17, 0.35) !important;
    box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.12) !important;
}

input::placeholder,
textarea::placeholder {
    color: #a3a19d !important;
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--accent);
}

label {
    font-weight: 500;
}

/* ---------- tables ---------- */
table thead th {
    background: var(--surface) !important;
    color: #5e5c58 !important;
    font-weight: 600;
}

table tbody tr {
    transition: background 0.2s ease;
}

table tbody tr:hover {
    background: rgba(241, 240, 238, 0.6) !important;
}

/* ---------- modals ---------- */
.modal-overlay {
    background: rgba(17, 17, 17, 0.3) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.modal {
    border-radius: var(--r-card) !important;
    animation: th-pop 0.45s var(--spring) backwards;
}

/* ---------- scroll + motion ---------- */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(17, 17, 17, 0.18);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

@keyframes th-rise {
    from {
        opacity: 0;
        transform: translateY(28px);
    }
}

@keyframes th-pop {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.98);
    }
}

.th-reveal {
    animation: th-rise 0.9s var(--spring) backwards;
}

/* =========================================================
   PHOTO HERO (dashboards) - see js/photo-hero.js
   ========================================================= */
.ph-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 27rem;
    margin: 0 0 1.75rem;
    border-radius: var(--r-card);
    background: #141546;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem 2.25rem;
    perspective: 1200px;
}

.ph-hero .ph-img,
.ph-hero canvas {
    position: absolute;
    inset: -3%;
    width: 106%;
    height: 106%;
    object-fit: cover;
    z-index: 0;
    transition: transform 0.9s var(--spring);
    will-change: transform;
}

.ph-hero canvas {
    pointer-events: none;
}

.ph-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(10, 10, 10, 0.05) 0%, rgba(10, 10, 10, 0.15) 45%, rgba(10, 10, 10, 0.72) 100%);
}

.ph-watermark {
    position: absolute;
    left: 0;
    right: 0;
    top: 1.2rem;
    z-index: 1;
    text-align: center;
    font-weight: 800;
    font-size: clamp(4rem, 11vw, 10rem);
    line-height: 1;
    letter-spacing: -0.04em;
    color: rgba(255, 255, 255, 0.28);
    pointer-events: none;
    user-select: none;
    transition: transform 0.9s var(--spring);
}

.ph-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    transition: transform 0.9s var(--spring);
}

.ph-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
}

.ph-eyebrow::before {
    content: "";
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    background: var(--accent-from);
}

.ph-title {
    font-family: "Outfit", "DM Sans", sans-serif;
    margin: 0.6rem 0 0;
    font-size: clamp(2.4rem, 4.6vw, 4.4rem);
    font-weight: 700;
    line-height: 0.98;
    letter-spacing: -0.04em;
    color: #ffffff;
}

.ph-title .line {
    display: block;
    overflow: hidden;
    padding-bottom: 0.06em;
}

.ph-title .line > span {
    display: block;
    transform: translateY(105%);
    opacity: 0;
    transition: transform 0.9s cubic-bezier(0.215, 0.61, 0.355, 1), opacity 0.9s ease;
}

.ph-hero.is-in .ph-title .line > span {
    transform: none;
    opacity: 1;
}

.ph-sub {
    margin: 0.8rem 0 0;
    max-width: 38ch;
    font-size: 1.02rem;
    color: rgba(255, 255, 255, 0.78);
}

.ph-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ph-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.ph-chip strong {
    font-weight: 700;
}

.ph-hint {
    position: absolute;
    top: 1.1rem;
    right: 1.3rem;
    z-index: 2;
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
}

@media (max-width: 700px) {
    .ph-hero { min-height: 18rem; padding: 1.5rem; }
    .ph-hint { display: none; }
}

/* transport page photo strip */
.tr-photos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 0 0 1.75rem;
}

.tr-photos figure {
    position: relative;
    margin: 0;
    height: clamp(9rem, 16vw, 12rem);
    border-radius: var(--r-card);
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 1.2rem 1.3rem;
    color: #fff;
    transition: transform 0.5s var(--spring);
}

.tr-photos .tr-bus   { background: linear-gradient(150deg, #2d3192 0%, #6f73d8 70%, #a9a6f2 100%); }
.tr-photos .tr-buggy { background: linear-gradient(150deg, #22306b 0%, #4c8fc9 70%, #9fd0e8 100%); }

.tr-photos figure:hover { transform: translateY(-4px); }

.tr-photos figure svg {
    position: absolute;
    right: 1.2rem;
    top: 50%;
    width: clamp(4.5rem, 9vw, 6.5rem);
    height: auto;
    transform: translateY(-50%);
    fill: none;
    stroke: rgba(255, 255, 255, 0.9);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tr-photos figcaption {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    color: #fff;
    font-family: "Outfit", "DM Sans", sans-serif;
    font-size: 1.35rem;
    font-weight: 500;
}

.tr-photos figcaption small {
    font: 400 0.8rem "DM Sans", sans-serif;
    color: rgba(255, 255, 255, 0.78);
}

@media (max-width: 640px) { .tr-photos { grid-template-columns: 1fr; } }

/* =========================================================
   AI chat widget - light + accent
   ========================================================= */
.aic-fab {
    background: var(--ink) !important;
    box-shadow: 0 14px 34px rgba(17, 17, 17, 0.3) !important;
}

.aic-fab .aic-dot { background: var(--accent-from) !important; border-color: var(--ink) !important; }

.aic-panel {
    background: #ffffff !important;
    border: 1px solid var(--hair) !important;
    border-radius: 1.75rem !important;
    box-shadow: 0 30px 80px rgba(17, 17, 17, 0.18) !important;
    font-family: "DM Sans", system-ui, sans-serif !important;
    color: var(--fg) !important;
}

.aic-head { background: var(--ink) !important; color: #fff !important; }
.aic-head strong { color: #fff !important; font-family: inherit !important; letter-spacing: -0.01em !important; }
.aic-head .aic-avatar { background: var(--accent-grad) !important; }
.aic-body { background: #ffffff !important; }
.aic-msg.bot { background: var(--surface) !important; color: var(--fg) !important; border: 0 !important; }
.aic-msg.user { background: var(--ink) !important; color: #ffffff !important; }
.aic-msg em, .aic-meta { color: var(--accent) !important; }
.aic-links a, .aic-chip {
    background: #ffffff !important;
    color: var(--fg) !important;
    border: 1px solid var(--hair) !important;
}
.aic-links a:hover, .aic-chip:hover { background: var(--ink) !important; color: #fff !important; }
.aic-chips, .aic-form { background: #ffffff !important; border-color: var(--hair) !important; }
.aic-form button { background: var(--ink) !important; color: #fff !important; border-radius: 999px !important; }

@media (prefers-reduced-motion: reduce) {
    .th-reveal,
    .modal {
        animation: none;
    }

    .ph-title .line > span {
        transform: none;
        opacity: 1;
        transition: none;
    }

    * {
        transition-duration: 0.01ms !important;
    }
}



/* =========================================================
   RIDGE SCENE (js/ridge-scene.js) - vector campus, no photos
   ========================================================= */
.rs-svg { display: block; width: 100%; height: 100%; }
.rs-mist { animation: rs-drift 30s ease-in-out infinite alternate; }
.rs-mist1 { animation-duration: 38s; animation-direction: alternate-reverse; }
.rs-mist2 { animation-duration: 46s; }
.rs-flick { animation: rs-flick 7s steps(1) infinite; }
@keyframes rs-drift { from { transform: translateX(-140px); } to { transform: translateX(140px); } }
@keyframes rs-flick { 0%, 62% { opacity: 1; } 63%, 80% { opacity: 0.15; } 81% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    .rs-mist, .rs-flick { animation: none; }
}

/* =========================================================
   GLASS + 3D LAYER (v9)  - built with the UI/UX Pro Max skill:
   style "Glassmorphism" (frosted panels over a vivid, layered
   background), Outfit headings + DM Sans body ("Premium Sans"),
   contrast >= 4.5:1, visible focus, reduced motion respected.
   js/theme.js adds the ambient background, marks every white card
   as glass (.gx-glass), adds 3D tilt (.gx-tilt) and swaps emoji
   for line icons (.ux-ico).
   ========================================================= */

:root {
    --gx-base: #eef0fb;
    --gx-text: #14163a;
    --gx-mute: #4d5075;
    --gx-glass: rgba(255, 255, 255, 0.56);
    --gx-glass-strong: rgba(255, 255, 255, 0.78);
    --gx-inner: rgba(255, 255, 255, 0.5);
    --gx-edge: rgba(255, 255, 255, 0.78);
    --gx-line: rgba(30, 32, 80, 0.1);
    --gx-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 24px 48px -26px rgba(32, 30, 90, 0.38), 0 2px 6px -2px rgba(32, 30, 90, 0.08);
    --gx-blur: blur(18px) saturate(1.6);
    --orb-1: #6366f1;
    --orb-2: #a78bfa;
    --orb-3: #2dd4bf;
    --orb-4: #f9a8d4;
    --grid-line: rgba(91, 95, 199, 0.16);
    --muted: #55587a;
    --secondary: #4d5075;
    --hair: rgba(30, 32, 80, 0.1);
}

body.role-admin {
    --gx-base: #f8f0ef;
    --gx-text: #1e1215;
    --gx-mute: #5e4a4e;
    --gx-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 24px 48px -26px rgba(90, 20, 30, 0.35), 0 2px 6px -2px rgba(90, 20, 30, 0.08);
    --orb-1: #e5383b;
    --orb-2: #f59e0b;
    --orb-3: #c8102e;
    --orb-4: #fda4af;
    --grid-line: rgba(200, 16, 46, 0.14);
    --muted: #6a5559;
    --secondary: #5e4a4e;
}

html { background: var(--gx-base) !important; }
html body:not(.lp) {
    background: transparent !important;
    color: var(--gx-text);
    font-family: "DM Sans", "Segoe UI", system-ui, sans-serif !important;
}
body:not(.lp) h1, body:not(.lp) h2, body:not(.lp) h3 { color: var(--gx-text); }
body:not(.lp) h2, body:not(.lp) h3 { font-family: "Outfit", "DM Sans", sans-serif; }

/* ---------- ambient background: drifting light + 3D grid floor ---------- */
.amb {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    perspective: 900px;
}

.amb-orb {
    position: absolute;
    width: 46vmax;
    height: 46vmax;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.5;
    will-change: transform;
    transition: transform 1.2s cubic-bezier(.2, .8, .2, 1);
}

.amb-orb:nth-child(1) { left: -12vmax; top: -16vmax; background: radial-gradient(circle, var(--orb-1), transparent 66%); animation: amb-a 26s ease-in-out infinite alternate; }
.amb-orb:nth-child(2) { right: -14vmax; top: -6vmax; background: radial-gradient(circle, var(--orb-2), transparent 66%); animation: amb-b 31s ease-in-out infinite alternate; }
.amb-orb:nth-child(3) { left: 24vw; bottom: -24vmax; background: radial-gradient(circle, var(--orb-3), transparent 66%); opacity: 0.32; animation: amb-a 36s ease-in-out infinite alternate-reverse; }
.amb-orb:nth-child(4) { right: 8vw; bottom: -10vmax; width: 30vmax; height: 30vmax; background: radial-gradient(circle, var(--orb-4), transparent 66%); opacity: 0.45; animation: amb-b 22s ease-in-out infinite alternate-reverse; }

@keyframes amb-a { to { translate: 6vw 5vh; } }
@keyframes amb-b { to { translate: -5vw 7vh; } }

.amb-floor {
    position: absolute;
    left: -50%;
    right: -50%;
    bottom: -12vh;
    height: 70vh;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 64px 64px;
    transform: rotateX(72deg);
    transform-origin: 50% 100%;
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 55%);
    mask-image: linear-gradient(180deg, transparent 0%, #000 55%);
    animation: amb-floor 18s linear infinite;
}

@keyframes amb-floor { to { background-position: 0 64px, 0 0; } }

.amb-grain {
    position: absolute;
    inset: 0;
    opacity: 0.05;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- glass surfaces ---------- */
:is(html) .gx-glass.gx-glass {
    background: var(--gx-glass) !important;
    -webkit-backdrop-filter: var(--gx-blur) !important;
    backdrop-filter: var(--gx-blur) !important;
    border: 1px solid var(--gx-edge) !important;
    box-shadow: var(--gx-shadow) !important;
}

:is(html) .gx-inner.gx-inner {
    background: var(--gx-inner) !important;
    border-color: rgba(255, 255, 255, 0.7) !important;
    box-shadow: none !important;
}

:is(html) .gx-clear.gx-clear { background: transparent !important; box-shadow: none !important; }

/* 3D tilt with a light glare that follows the pointer */
.gx-tilt {
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(.2, .8, .2, 1), box-shadow 0.4s ease !important;
    will-change: transform;
}

.gx-tilt::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, 0.55), transparent 45%);
    opacity: 0;
    transition: opacity 0.35s ease;
    mix-blend-mode: soft-light;
}

.gx-tilt.is-tilting::after { opacity: 1; }
.gx-tilt.is-tilting { transition: transform 0.08s linear, box-shadow 0.3s ease !important; }

/* ---------- controls on glass ---------- */
body:not(.lp) input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
body:not(.lp) select,
body:not(.lp) textarea {
    background-color: rgba(255, 255, 255, 0.72) !important;
    border: 1px solid var(--gx-line) !important;
    color: var(--gx-text) !important;
    min-height: 44px;
}

body:not(.lp) textarea { min-height: 88px; }

body:not(.lp) input:focus,
body:not(.lp) select:focus,
body:not(.lp) textarea:focus {
    background-color: #ffffff !important;
    border-color: rgba(var(--accent-rgb), 0.55) !important;
    box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.16) !important;
}

body:not(.lp) input::placeholder,
body:not(.lp) textarea::placeholder { color: #7a7d9c !important; }

/* primary actions: accent gradient with a soft glow */
body:not(.lp) .primary-btn,
body:not(.lp) .primary-button,
body:not(.lp) button[type="submit"]:not(.aic-icon-btn):not(.icon-btn):not(.lp-plain):not(.gl-btn) {
    background: linear-gradient(135deg, var(--accent-from), var(--accent-to)) !important;
    color: #ffffff !important;
    box-shadow: 0 12px 26px -12px rgba(var(--accent-rgb), 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
    min-height: 44px;
}

body:not(.lp) .primary-btn:hover,
body:not(.lp) .primary-button:hover,
body:not(.lp) button[type="submit"]:not(.aic-icon-btn):not(.icon-btn):not(.lp-plain):not(.gl-btn):hover {
    background: linear-gradient(135deg, var(--accent-from), var(--accent-to)) !important;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 18px 32px -14px rgba(var(--accent-rgb), 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
}

body:not(.lp) .secondary-btn,
body:not(.lp) .secondary-button,
body:not(.lp) .filter-btn,
body:not(.lp) .filter-button {
    background: rgba(255, 255, 255, 0.6) !important;
    border: 1px solid var(--gx-edge) !important;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

body:not(.lp) .filter-btn.active,
body:not(.lp) .filter-button.active,
body:not(.lp) .tab.active,
body:not(.lp) .tab-btn.active,
body:not(.lp) .mess-tab.active,
body:not(.lp) .week-btn.active {
    background: linear-gradient(135deg, var(--accent-from), var(--accent-to)) !important;
    border-color: transparent !important;
}

/* icon tiles become small gradient glass chips */
body:not(.lp) .stat-icon,
body:not(.lp) .action-icon,
body:not(.lp) .management-icon {
    background: linear-gradient(140deg, var(--accent-from), var(--accent-to)) !important;
    color: #fff !important;
    box-shadow: 0 10px 20px -10px rgba(var(--accent-rgb), 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

body:not(.lp) .stat-card:nth-child(4n + 2) .stat-icon,
body:not(.lp) .action-card:nth-child(4n + 2) .action-icon,
body:not(.lp) .management-card:nth-child(4n + 2) .management-icon {
    background: linear-gradient(140deg, #2dd4bf, #0d9488) !important;
}

body:not(.lp) .stat-card:nth-child(4n + 3) .stat-icon,
body:not(.lp) .action-card:nth-child(4n + 3) .action-icon,
body:not(.lp) .management-card:nth-child(4n + 3) .management-icon {
    background: linear-gradient(140deg, #fbbf24, #d97706) !important;
}

body:not(.lp) .stat-card:nth-child(4n + 4) .stat-icon,
body:not(.lp) .action-card:nth-child(4n + 4) .action-icon,
body:not(.lp) .management-card:nth-child(4n + 4) .management-icon {
    background: linear-gradient(140deg, #f472b6, #db2777) !important;
}

body.role-admin .stat-card:nth-child(4n + 2) .stat-icon,
body.role-admin .action-card:nth-child(4n + 2) .action-icon,
body.role-admin .management-card:nth-child(4n + 2) .management-icon {
    background: linear-gradient(140deg, #3b3b46, #111114) !important;
}

/* ---------- tables on glass ---------- */
body:not(.lp) table { border-collapse: separate; border-spacing: 0; }
body:not(.lp) table thead th {
    background: rgba(255, 255, 255, 0.55) !important;
    color: var(--gx-mute) !important;
    border-bottom: 1px solid var(--gx-line) !important;
}
body:not(.lp) table tbody tr:hover { background: rgba(255, 255, 255, 0.55) !important; }
body:not(.lp) table td { border-color: var(--gx-line) !important; }

/* ---------- modals ---------- */
body:not(.lp) .modal-overlay,
body:not(.lp) .modal-backdrop {
    background: rgba(20, 20, 50, 0.28) !important;
    -webkit-backdrop-filter: blur(10px) saturate(1.2);
    backdrop-filter: blur(10px) saturate(1.2);
}

body:not(.lp) .modal,
body:not(.lp) .modal-content {
    background: rgba(255, 255, 255, 0.82) !important;
    -webkit-backdrop-filter: blur(24px) saturate(1.5) !important;
    backdrop-filter: blur(24px) saturate(1.5) !important;
    border: 1px solid var(--gx-edge) !important;
    box-shadow: 0 40px 80px -30px rgba(20, 20, 60, 0.45) !important;
    animation: gx-modal 0.5s cubic-bezier(.2, .8, .2, 1) backwards;
}

@keyframes gx-modal {
    from { opacity: 0; transform: perspective(1200px) translateY(30px) rotateX(10deg) scale(0.96); }
}

/* ---------- icons that replaced emoji ---------- */
.ux-ico {
    display: inline-block;
    width: 1.1em;
    height: 1.1em;
    vertical-align: -0.17em;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: none;
}

.ux-ico + .ux-gap { margin-left: 0.4em; }
.ux-solo { display: inline-grid; place-items: center; }
.ux-solo .ux-ico { width: 1em; height: 1em; vertical-align: 0; }

/* ---------- chat assistant: glass ---------- */
.aic-fab {
    background: linear-gradient(140deg, var(--accent-from), var(--accent-to)) !important;
    box-shadow: 0 16px 34px -12px rgba(var(--accent-rgb), 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
    color: #fff !important;
}

.aic-panel {
    background: rgba(255, 255, 255, 0.72) !important;
    -webkit-backdrop-filter: blur(26px) saturate(1.6) !important;
    backdrop-filter: blur(26px) saturate(1.6) !important;
    border: 1px solid var(--gx-edge) !important;
    box-shadow: 0 40px 90px -30px rgba(20, 20, 60, 0.5) !important;
    font-family: "DM Sans", system-ui, sans-serif !important;
    color: var(--gx-text) !important;
    transform-origin: 100% 100%;
}

.aic-head { background: linear-gradient(135deg, var(--accent-from), var(--accent-to)) !important; }
.aic-body, .aic-chips, .aic-form { background: transparent !important; }
.aic-msg.bot { background: rgba(255, 255, 255, 0.85) !important; color: var(--gx-text) !important; box-shadow: 0 6px 16px -10px rgba(20, 20, 60, 0.3); }
.aic-msg.user { background: linear-gradient(135deg, var(--accent-from), var(--accent-to)) !important; color: #fff !important; }
.aic-links a, .aic-chip { background: rgba(255, 255, 255, 0.8) !important; border: 1px solid var(--gx-edge) !important; }
.aic-links a:hover, .aic-chip:hover { background: var(--accent) !important; color: #fff !important; }
.aic-form button { background: linear-gradient(135deg, var(--accent-from), var(--accent-to)) !important; }
.aic-form input { background: rgba(255, 255, 255, 0.9) !important; }

/* ---------- reveal: cards rise in depth ---------- */
@keyframes gx-rise {
    from { opacity: 0; transform: perspective(1000px) translate3d(0, 26px, -60px) rotateX(8deg); }
}
.th-reveal { animation: gx-rise 0.8s cubic-bezier(.2, .8, .2, 1) backwards; }

/* settings: compact density + hidden demo labels (admin Settings > Appearance) */
body.density-compact .main-content { padding-top: 12px !important; }
body.density-compact .stat-card,
body.density-compact .summary-card { padding: 14px 16px !important; }
body.hide-demo .demo-banner,
body.hide-demo .demo-notice,
body.hide-demo [data-demo-label] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
    .amb-orb, .amb-floor { animation: none !important; }
    .gx-tilt { transform: none !important; }
}

/* hero text stays white on the dark campus scene */
body:not(.lp) .ph-hero h1,
body:not(.lp) .ph-hero h2,
body:not(.lp) .ph-hero h3,
body:not(.lp) .ph-hero .ph-title,
body:not(.lp) .ph-hero .ph-title span { color: #ffffff !important; }


/* hostel office info from admin Settings (js/hostel-info.js) */
.hi-card { padding: 24px; }
.hi-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 18px; margin-top: 14px; }
.hi-row { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.55); }
.hi-row span { font-size: 12.5px; color: var(--gx-mute); }
.hi-row strong { font-size: 14.5px; font-weight: 600; word-break: break-word; }
.hi-row a { color: var(--accent); }
.hi-rules {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(var(--accent-rgb), 0.08);
    border: 1px solid rgba(var(--accent-rgb), 0.16);
    font-size: 14px;
    line-height: 1.5;
}
.hi-rules.is-paused { background: #fef3f2; border-color: #fecdca; color: #912018; }

/* profile > password (js/password-card.js) */
.pw-card { padding: 24px; }
.pw-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.pw-field { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; font-weight: 600; min-width: 0; }
.pw-field input { box-sizing: border-box; width: 100%; padding: 10px 14px; border-radius: 14px; }
.pw-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.pw-msg { margin: 0; font-size: 14px; color: #b42318; }
.pw-msg.is-ok { color: #067647; }
@media (max-width: 700px) { .pw-form { grid-template-columns: 1fr; } }

/* mess: items served every day */
.common-card { padding: 22px 24px; margin-top: 18px; }
.common-card h2 { margin: 0 0 12px; font-size: 18px; }
.common-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.common-item { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.55); }
.common-item strong { font-size: 13px; color: var(--accent); }
.common-item span { font-size: 14px; line-height: 1.5; }
