/* ====================================================================
   BINOHA Design System
   A warm, mobile-first design system for community food distribution.
   ==================================================================== */

/* ---- Custom Properties ---- */
:root {
    /* Brand palette */
    --green: #5bc050;
    --green-dark: #4a9f42;
    --green-soft: rgba(91, 192, 80, 0.12);
    --orange: #f88d26;
    --orange-dark: #e07a15;
    --orange-soft: rgba(248, 141, 38, 0.12);
    --purple: #a32d9c;
    --purple-dark: #8a2484;
    --purple-soft: rgba(163, 45, 156, 0.10);
    --red: #d32f2f;
    --red-dark: #b71c1c;
    --red-soft: rgba(211, 47, 47, 0.10);
    --blue: #06abe6;
    --blue-dark: #0590c2;
    --blue-soft: rgba(6, 171, 230, 0.12);
    --yellow: #f9a825;
    --yellow-dark: #f57f17;
    --yellow-soft: rgba(249, 168, 37, 0.14);

    /* Surfaces */
    --bg: #faf8f3;
    --bg-card: #ffffff;
    --bg-elevated: #ffffff;
    --border-color: rgba(163, 45, 156, 0.12);
    --border-color-strong: rgba(163, 45, 156, 0.25);

    /* Text */
    --text: #1a1a1a;
    --text-secondary: #555;
    --text-muted: #888;
    --text-inverse: #ffffff;

    /* Typography */
    --font-display: 'Fredoka One', cursive;
    --font-heading: 'Libre Franklin', sans-serif;
    --font-body: 'Telex', sans-serif;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(163, 45, 156, 0.08), 0 2px 4px rgba(248, 141, 38, 0.06);
    --shadow-lg: 0 8px 24px rgba(163, 45, 156, 0.10), 0 4px 8px rgba(248, 141, 38, 0.08);
    --shadow-xl: 0 16px 48px rgba(163, 45, 156, 0.14), 0 8px 16px rgba(0,0,0,0.06);

    /* Transitions */
    --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
    --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --duration-fast: 150ms;
    --duration-base: 250ms;
    --duration-slow: 400ms;

    /* Layout */
    --nav-height: 60px;
    --bottom-nav-height: 64px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --content-max-width: 600px;

    /* Z-index */
    --z-sticky: 50;
    --z-nav: 100;
    --z-overlay: 150;
    --z-modal: 200;
}

/* ---- Reset & Base ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

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

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overscroll-behavior-y: none;
}

[x-cloak] { display: none !important; }

img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Typography ---- */
h1, h2, h3, h4 { line-height: 1.25; }

h1 {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 6vw, 2.75rem);
    color: var(--purple);
}

h2 {
    font-family: var(--font-heading);
    font-size: clamp(1.25rem, 4vw, 1.75rem);
    font-weight: 700;
    color: var(--text);
}

h3 {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
}

.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }

/* ---- Layout ---- */
.app-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.app-content {
    flex: 1;
    padding: var(--space-md);
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + var(--space-xl));
    max-width: var(--content-max-width);
    margin: 0 auto;
    width: 100%;
}

@media (min-width: 768px) {
    .app-content { padding: var(--space-xl) var(--space-lg); }
}

/* ---- Top Navigation ---- */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    height: var(--nav-height);
    background: var(--bg-elevated);
    position: sticky;
    top: 0;
    z-index: var(--z-nav);
    border-bottom: 1px solid var(--border-color);
}

.top-nav--transparent {
    background: transparent;
    border-bottom: none;
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: var(--z-nav);
}

.nav-brand {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--purple);
    letter-spacing: -0.01em;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.nav-back {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    background: none;
    border: none;
    color: var(--purple);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    padding: var(--space-sm);
    margin-left: calc(-1 * var(--space-sm));
    border-radius: var(--radius-sm);
    min-height: 44px;
}

.nav-back:active { opacity: 0.7; }

.nav-back svg { width: 20px; height: 20px; }

/* ---- Bottom Tab Bar ---- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--bottom-nav-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: var(--bg-elevated);
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.06);
    z-index: var(--z-nav);
    border-top: 1px solid var(--border-color);
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: color var(--duration-fast) var(--ease-out);
    position: relative;
    -webkit-tap-highlight-color: transparent;
    padding: var(--space-xs) 0;
}

.bottom-nav-item svg {
    width: 24px;
    height: 24px;
    stroke-width: 2;
    transition: transform var(--duration-fast) var(--ease-bounce);
}

.bottom-nav-item.active {
    color: var(--purple);
}

.bottom-nav-item.active svg {
    transform: scale(1.1);
}

.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 3px;
    background: var(--purple);
    border-radius: 0 0 3px 3px;
}

.bottom-nav-item:active svg { transform: scale(0.9); }

.bottom-nav-badge {
    position: absolute;
    top: 4px;
    right: 50%;
    transform: translateX(14px);
    min-width: 18px;
    height: 18px;
    background: var(--red);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

/* Hide bottom nav on desktop */
@media (min-width: 768px) {
    .bottom-nav { display: none; }
    .app-content {
        padding-bottom: var(--space-xl);
    }
}

/* ---- Landing Page ---- */
.landing {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: calc(var(--nav-height) + var(--space-xl)) var(--space-lg) var(--space-2xl);
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, #faf8f3 0%, #e8f5e9 40%, #fff8e1 100%);
}

.hero::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -20%;
    width: 60vw;
    height: 60vw;
    max-width: 400px;
    max-height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(91, 192, 80, 0.18) 0%, transparent 65%);
    animation: float 8s ease-in-out infinite;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -15%;
    left: -20%;
    width: 50vw;
    height: 50vw;
    max-width: 350px;
    max-height: 350px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(248, 141, 38, 0.14) 0%, transparent 65%);
    animation: float 8s ease-in-out infinite 4s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(10px, -15px); }
}

.hero-decoration {
    position: absolute;
    top: 20%;
    left: 10%;
    width: 30vw;
    height: 30vw;
    max-width: 200px;
    max-height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--purple-soft) 0%, transparent 65%);
    animation: float 10s ease-in-out infinite 2s;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 480px;
}

.hero h1 {
    font-size: clamp(2rem, 8vw, 3.25rem);
    margin-bottom: var(--space-md);
    line-height: 1.1;
}

.hero-subtitle {
    font-size: clamp(1rem, 3vw, 1.25rem);
    color: var(--text-secondary);
    margin-bottom: var(--space-2xl);
    line-height: 1.5;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
}

/* How It Works */
.how-it-works {
    padding: var(--space-2xl) var(--space-lg);
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
}

.how-it-works h2 {
    text-align: center;
    margin-bottom: var(--space-xl);
    color: var(--purple);
}

.steps {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    max-width: 400px;
    margin: 0 auto;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

.step-number {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--text-inverse);
}

.step:nth-child(1) .step-number { background: var(--purple); }
.step:nth-child(2) .step-number { background: var(--orange); }
.step:nth-child(3) .step-number { background: var(--green); }

.step-text h3 {
    margin-bottom: var(--space-xs);
    font-size: 1rem;
}

.step-text p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Landing footer */
.landing-footer {
    text-align: center;
    padding: var(--space-lg);
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
}

/* ---- Auth Pages ---- */
.auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

.auth-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--space-lg);
    max-width: 420px;
    margin: 0 auto;
    width: 100%;
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.auth-header h1 {
    font-size: 1.75rem;
    margin-bottom: var(--space-xs);
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.auth-footer {
    text-align: center;
    margin-top: var(--space-lg);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--purple);
    font-weight: 600;
}

/* ---- App Header (Dashboard) ---- */
.app-header {
    padding: var(--space-lg) var(--space-md) var(--space-md);
    max-width: var(--content-max-width);
    margin: 0 auto;
    width: 100%;
}

.app-header-greeting {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--purple);
    margin-bottom: var(--space-xs);
}

.app-header-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ---- Section Headers ---- */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
    padding: 0 var(--space-xs);
}

.section-header h2 {
    font-size: 1.15rem;
    margin: 0;
}

/* ---- Cards ---- */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow var(--duration-base) var(--ease-out),
                transform var(--duration-base) var(--ease-out);
}

.card:active {
    transform: scale(0.985);
}

.card-body {
    padding: var(--space-md);
}

.card + .card { margin-top: var(--space-md); }

/* ---- Event Cards ---- */
.event-card {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
}

.event-date-badge {
    flex-shrink: 0;
    width: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-sm) var(--space-xs);
    background: linear-gradient(145deg, var(--purple), var(--purple-dark));
    border-radius: var(--radius-md);
    color: var(--text-inverse);
    text-align: center;
}

.event-date-month {
    font-family: var(--font-heading);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.9;
}

.event-date-day {
    font-family: var(--font-display);
    font-size: 1.4rem;
    line-height: 1.1;
}

.event-date-weekday {
    font-size: 0.6rem;
    opacity: 0.8;
    margin-top: 1px;
}

.event-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-sm);
}

.event-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
}

.event-availability {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.event-availability-left {
    color: var(--green-dark);
    font-weight: 600;
}

.event-availability-full {
    color: var(--red);
    font-weight: 600;
}

.event-action {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

/* ---- Progress Bar ---- */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--purple-soft);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--green) 0%, var(--orange) 100%);
    border-radius: var(--radius-full);
    transition: width var(--duration-slow) var(--ease-out);
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
    animation: shimmer 2.5s infinite;
}

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

/* ---- Reservation Cards ---- */
.reservation-card {
    padding: var(--space-md);
}

.reservation-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.reservation-event {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
}

.reservation-event-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.reservation-detail {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 0.875rem;
}

.reservation-detail--pending {
    background: var(--yellow-soft);
    color: var(--yellow-dark);
}

.reservation-detail--approved {
    background: var(--green-soft);
}

.reservation-detail--rejected {
    background: var(--red-soft);
    color: var(--red-dark);
}

.reservation-detail--picked_up {
    background: var(--blue-soft);
    color: var(--blue-dark);
}

/* ---- Pickup Code ---- */
.pickup-code {
    display: block;
    font-family: var(--font-display);
    font-size: 2rem;
    letter-spacing: 0.3em;
    color: var(--green-dark);
    margin: var(--space-sm) 0;
    animation: code-reveal 0.5s var(--ease-bounce);
}

.pickup-code-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pickup-code-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

@keyframes code-reveal {
    0% { opacity: 0; transform: scale(0.85); }
    100% { opacity: 1; transform: scale(1); }
}

/* ---- Status Badges ---- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    border: 1.5px solid transparent;
}

.badge::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    animation: pulse 2.5s infinite;
}

.badge--pending {
    background: var(--yellow-soft);
    color: var(--yellow-dark);
    border-color: rgba(249, 168, 37, 0.25);
}
.badge--pending::before { background: var(--yellow); }

.badge--approved {
    background: var(--green-soft);
    color: var(--green-dark);
    border-color: rgba(91, 192, 80, 0.25);
}
.badge--approved::before { background: var(--green); }

.badge--rejected {
    background: var(--red-soft);
    color: var(--red-dark);
    border-color: rgba(211, 47, 47, 0.25);
}
.badge--rejected::before { background: var(--red); }

.badge--picked_up, .badge--picked-up {
    background: var(--blue-soft);
    color: var(--blue-dark);
    border-color: rgba(6, 171, 230, 0.25);
}
.badge--picked_up::before, .badge--picked-up::before { background: var(--blue); }

.badge--active {
    background: var(--green-soft);
    color: var(--green-dark);
    border-color: rgba(91, 192, 80, 0.25);
}
.badge--active::before { background: var(--green); }

.badge--inactive {
    background: rgba(0,0,0,0.05);
    color: var(--text-muted);
    border-color: rgba(0,0,0,0.08);
}
.badge--inactive::before { background: var(--text-muted); animation: none; }

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

/* ---- Buttons ---- */
button, .btn {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    min-height: 48px;
    transition: all var(--duration-base) var(--ease-out);
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

button:active, .btn:active {
    transform: scale(0.97);
}

button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
}

/* Primary (green) */
.btn-primary, button[type="submit"] {
    background: var(--green);
    color: var(--text-inverse);
    box-shadow: 0 2px 8px rgba(91, 192, 80, 0.3);
}

.btn-primary:hover, button[type="submit"]:hover {
    background: var(--green-dark);
    box-shadow: 0 4px 12px rgba(91, 192, 80, 0.35);
}

/* Secondary (outlined) */
.btn-secondary {
    background: transparent;
    color: var(--purple);
    border: 2px solid var(--purple);
}

.btn-secondary:hover {
    background: var(--purple-soft);
}

/* Ghost */
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

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

/* Positive/Negative */
.btn-positive {
    background: var(--green);
    color: var(--text-inverse);
    box-shadow: 0 2px 8px rgba(91, 192, 80, 0.25);
}

.btn-negative {
    background: var(--red);
    color: var(--text-inverse);
    box-shadow: 0 2px 8px rgba(211, 47, 47, 0.25);
}

/* Small */
.btn-sm {
    padding: 0.5rem 0.875rem;
    font-size: 0.85rem;
    min-height: 38px;
    border-radius: var(--radius-sm);
}

/* Full width */
.btn-block { width: 100%; }

/* Icon button */
.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--text-secondary);
}

.btn-icon:hover { background: rgba(0,0,0,0.04); }
.btn-icon svg { width: 22px; height: 22px; }

/* ---- Forms ---- */
label {
    display: block;
    margin-bottom: var(--space-xs);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="tel"],
select,
textarea {
    font-family: var(--font-body);
    font-size: 1rem;
    width: 100%;
    padding: 0.8rem 0.875rem;
    border: 2px solid var(--border-color-strong);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text);
    min-height: 48px;
    transition: border-color var(--duration-fast) var(--ease-out),
                box-shadow var(--duration-fast) var(--ease-out);
    margin-bottom: var(--space-md);
    outline: none;
    -webkit-appearance: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px var(--purple-soft);
}

input::placeholder { color: var(--text-muted); }

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    font-weight: 400;
    font-size: 0.9rem;
    margin-bottom: var(--space-md);
    min-height: 44px;
}

.checkbox-label input[type="checkbox"] {
    width: 22px;
    height: 22px;
    min-height: auto;
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--green);
}

/* Form group */
.form-group { margin-bottom: var(--space-md); }
.form-group label { margin-bottom: var(--space-xs); }
.form-group input,
.form-group select { margin-bottom: 0; }

/* ---- Alerts ---- */
.alert {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    font-size: 0.9rem;
    font-weight: 500;
    border-left: 4px solid;
    animation: slide-in-down 0.3s var(--ease-out);
}

.alert-success { background: var(--green-soft); border-color: var(--green); color: var(--green-dark); }
.alert-error { background: var(--red-soft); border-color: var(--red); color: var(--red-dark); }
.alert-warning { background: var(--yellow-soft); border-color: var(--yellow); color: var(--yellow-dark); }
.alert-info { background: var(--blue-soft); border-color: var(--blue); color: var(--blue-dark); }

@keyframes slide-in-down {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- Empty States ---- */
.empty-state {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
    opacity: 0.3;
}

.empty-state-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--purple);
    margin-bottom: var(--space-xs);
}

.empty-state-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ---- Loading ---- */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    padding: var(--space-3xl);
    color: var(--text-secondary);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--purple-soft);
    border-top-color: var(--purple);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

[aria-busy="true"] {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    padding: var(--space-2xl);
    color: var(--text-secondary);
}

[aria-busy="true"]::before {
    content: '';
    width: 24px; height: 24px;
    border: 3px solid var(--purple-soft);
    border-top-color: var(--purple);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

/* ---- Admin Stats ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.75rem;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-value--green { color: var(--green); }
.stat-value--orange { color: var(--orange); }
.stat-value--purple { color: var(--purple); }
.stat-value--blue { color: var(--blue); }

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ---- Admin Approval Cards ---- */
.approval-card {
    padding: var(--space-md);
}

.approval-user {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 2px;
}

.approval-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.approval-actions {
    display: flex;
    gap: var(--space-sm);
}

.approval-actions button {
    flex: 1;
}

/* ---- Distribution Mode ---- */
.distribution-input {
    font-family: var(--font-display) !important;
    font-size: 2rem !important;
    text-align: center;
    letter-spacing: 0.5rem;
    padding: var(--space-md) !important;
}

/* ---- Language Selector ---- */
.lang-select {
    font-family: var(--font-body);
    font-size: 0.85rem;
    padding: var(--space-sm) var(--space-md);
    border: 2px solid var(--border-color-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer;
    min-height: 40px;
    margin-bottom: 0;
    min-width: 0;
    width: auto;
}

.lang-select:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px var(--purple-soft);
}

/* ---- Profile Section ---- */
.profile-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: var(--space-md);
}

.profile-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-color);
    min-height: 56px;
}

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

.profile-item-label {
    font-weight: 600;
    font-size: 0.9rem;
}

.profile-item-value {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple), var(--orange));
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin: 0 auto var(--space-md);
}

/* ---- Admin Form ---- */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
}

@media (max-width: 400px) {
    .form-row { grid-template-columns: 1fr; }
}

/* ---- Tables (Desktop) ---- */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    display: none;
}

@media (min-width: 768px) {
    .data-table { display: table; }
    .card-list--mobile-only { display: none; }
}

.data-table thead {
    background: linear-gradient(135deg, var(--purple-soft) 0%, var(--orange-soft) 100%);
}

.data-table th {
    padding: var(--space-md);
    text-align: left;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--purple);
}

.data-table td {
    padding: var(--space-md);
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
}

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

.data-table tbody tr:hover {
    background: rgba(248, 141, 38, 0.04);
}

/* ---- Animations ---- */
.fade-in {
    animation: fade-in 0.4s var(--ease-out);
}

.slide-up {
    animation: slide-up 0.4s var(--ease-out);
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.stagger > *:nth-child(1) { animation-delay: 0.04s; }
.stagger > *:nth-child(2) { animation-delay: 0.08s; }
.stagger > *:nth-child(3) { animation-delay: 0.12s; }
.stagger > *:nth-child(4) { animation-delay: 0.16s; }
.stagger > *:nth-child(5) { animation-delay: 0.20s; }
.stagger > *:nth-child(6) { animation-delay: 0.24s; }
.stagger > *:nth-child(7) { animation-delay: 0.28s; }
.stagger > *:nth-child(8) { animation-delay: 0.32s; }

.stagger > * {
    animation: slide-up 0.35s var(--ease-out) backwards;
}

/* Page transition */
.view-enter {
    animation: view-enter 0.3s var(--ease-out);
}

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

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

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }

.w-full { width: 100%; }
.rounded-full { border-radius: var(--radius-full); }
.overflow-hidden { overflow: hidden; }

.divider {
    height: 1px;
    background: var(--border-color);
    margin: var(--space-lg) 0;
}

/* ---- Accessibility ---- */
:focus-visible {
    outline: 3px solid var(--purple);
    outline-offset: 2px;
}

/* ---- Print ---- */
@media print {
    .bottom-nav, .top-nav, .no-print { display: none !important; }
    body { background: white; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ---- Inline Edit Form ---- */
.edit-overlay {
    padding: var(--space-md);
    background: var(--bg);
    border-top: 1px solid var(--border-color);
}

.edit-overlay .form-row {
    margin-bottom: var(--space-sm);
}

.edit-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.edit-actions button { flex: 1; }

/* ---- User Management Cards ---- */
.user-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
}

.user-avatar-sm {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple), var(--orange));
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-action {
    flex-shrink: 0;
}

.user-action select {
    min-height: 36px;
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.8rem;
    margin-bottom: 0;
    min-width: 110px;
}

/* ---- Search Input ---- */
.search-input {
    position: relative;
    margin-bottom: var(--space-md);
}

.search-input input {
    padding-left: 2.5rem;
    margin-bottom: 0;
}

.search-input svg {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

/* ---- Cancel Button on Reservation Cards ---- */
.reservation-cancel {
    display: flex;
    justify-content: flex-end;
    padding-top: var(--space-sm);
    border-top: 1px solid var(--border-color);
    margin-top: var(--space-sm);
}

/* ---- Forgot Password ---- */
.forgot-link {
    display: block;
    text-align: right;
    font-size: 0.85rem;
    margin-top: calc(-1 * var(--space-sm));
    margin-bottom: var(--space-md);
}

/* ---- Success Screen ---- */
.success-screen {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
}

.success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--green-soft);
    color: var(--green);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-md);
}

.success-icon svg {
    width: 32px;
    height: 32px;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color-strong); border-radius: var(--radius-full); }
