/**
 * FFE Monitor — Premium Equestrian Design
 * A luxury dashboard for FFE competition monitoring
 */

/* ============================================================================
   CSS Variables — Equestrian Luxury Palette
   ============================================================================ */

:root {
    /* Primary Colors - Rich Leather & Stables */
    --burgundy: #722F37;
    --burgundy-deep: #5A252C;
    --burgundy-light: #8B3A44;

    /* Accent - Championship Gold */
    --gold: #C9A227;
    --gold-light: #E5C76B;
    --gold-muted: #A68B2A;

    /* Neutrals - Cream & Charcoal */
    --cream: #F5F0E8;
    --cream-dark: #E8E0D4;
    --cream-light: #FAF8F5;
    --charcoal: #1A1A1A;
    --charcoal-light: #2D2D2D;
    --charcoal-muted: #4A4A4A;

    /* Forest Green - Fields */
    --forest: #2D4A3E;
    --forest-light: #3D5F50;

    /* Status Colors */
    --success: #4A7C59;
    --success-light: #5D9B70;
    --warning: #C9A227;
    --danger: #A63D40;
    --info: #3D6B99;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(26, 26, 26, 0.08);
    --shadow-md: 0 4px 20px rgba(26, 26, 26, 0.12);
    --shadow-lg: 0 8px 40px rgba(26, 26, 26, 0.16);
    --shadow-gold: 0 4px 20px rgba(201, 162, 39, 0.25);

    /* Typography */
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

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

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    /* Transitions */
    --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================================================
   Light Theme Variables
   ============================================================================ */

/* ============================================================================
   Light Theme - Complete Override
   ============================================================================ */

[data-theme="light"] {
    --burgundy: #7A3038;
    --burgundy-deep: #5C252B;
    --burgundy-light: #9A4048;
    --gold: #9A7B1C;
    --gold-light: #B8922A;
    --gold-dark: #7A6015;
    --gold-muted: #8A7020;
    --forest: #2D5A40;
    --forest-light: #3D7050;
    --success: #16A34A;
    --success-light: #22C55E;
    --warning: #CA8A04;
    --danger: #DC2626;
    --info: #2563EB;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.16);
}

[data-theme="light"] body {
    background: #F8F6F3;
    color: #1A1A1A;
}

[data-theme="light"] .noise-overlay {
    opacity: 0.015;
}

[data-theme="light"] .header {
    background: #F8F6F3;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .header-text h1,
[data-theme="light"] .card-header h2 {
    color: #1A1A1A;
}

[data-theme="light"] .tagline {
    color: #666;
}

[data-theme="light"] .login-card,
[data-theme="light"] .bento-card {
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: var(--shadow-sm);
}

[data-theme="light"] .card-icon {
    background: linear-gradient(135deg, #F5F0E8, #EDE8DD);
}

[data-theme="light"] .login-form .input-wrapper input,
[data-theme="light"] .input-wrapper input {
    background: #F5F2EE;
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: #1A1A1A;
}

[data-theme="light"] .login-form .input-wrapper input::placeholder,
[data-theme="light"] .input-wrapper input::placeholder {
    color: #888;
}

[data-theme="light"] .login-form .input-wrapper input:focus,
[data-theme="light"] .input-wrapper input:focus {
    background: #FFFFFF;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(154, 123, 28, 0.15);
}

[data-theme="light"] .btn-login,
[data-theme="light"] .btn-add {
    background: linear-gradient(135deg, var(--burgundy), var(--burgundy-deep));
    color: #FFFFFF;
}

[data-theme="light"] .status-block {
    background: #F5F2EE;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .status-label {
    color: #666;
}

[data-theme="light"] .status-value {
    color: #1A1A1A;
}

[data-theme="light"] .last-update,
[data-theme="light"] .test-label {
    color: #888;
}

[data-theme="light"] .concours-card {
    background: #F9F7F4;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .concours-card:hover {
    background: #FFFFFF;
    border-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .concours-nom {
    color: #1A1A1A;
}

[data-theme="light"] .concours-subtitle {
    color: #666;
}

[data-theme="light"] .concours-time {
    color: #888;
}

[data-theme="light"] .btn-access {
    color: var(--burgundy);
    border-color: var(--burgundy);
}

[data-theme="light"] .btn-access:hover {
    color: #FFFFFF;
}

[data-theme="light"] .btn-access::before {
    background: linear-gradient(135deg, var(--burgundy), var(--burgundy-deep));
}

[data-theme="light"] .btn-delete {
    background: transparent;
    border-color: rgba(0, 0, 0, 0.15);
    color: #666;
}

[data-theme="light"] .btn-delete:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: #FFFFFF;
}

[data-theme="light"] .btn-test {
    background: #F5F2EE;
    border-color: rgba(0, 0, 0, 0.1);
    color: #666;
}

[data-theme="light"] .btn-test:hover {
    background: #FFFFFF;
    border-color: var(--gold);
    color: var(--gold);
}

[data-theme="light"] .concours-badge {
    background: rgba(0, 0, 0, 0.06);
    color: #555;
}

[data-theme="light"] .badge-status.previsionnel {
    background: rgba(154, 123, 28, 0.12);
    color: #7A6015;
}

[data-theme="light"] .badge-status.engagement {
    background: rgba(22, 163, 74, 0.12);
    color: #15803D;
}

[data-theme="light"] .badge-status.demande {
    background: rgba(37, 99, 235, 0.12);
    color: #1D4ED8;
}

[data-theme="light"] .badge-status.cloture {
    background: rgba(220, 38, 38, 0.1);
    color: #B91C1C;
}

[data-theme="light"] .badge-notif {
    background: rgba(154, 123, 28, 0.1);
    color: #7A6015;
}

[data-theme="light"] .empty-state p {
    color: #888;
}

[data-theme="light"] .cal-header {
    color: #1A1A1A;
}

[data-theme="light"] .cal-day-header {
    color: #888;
}

[data-theme="light"] .cal-day {
    background: #F9F7F4;
    color: #1A1A1A;
}

[data-theme="light"] .cal-day.today {
    background: rgba(154, 123, 28, 0.1);
    border-color: var(--gold);
}

[data-theme="light"] .cal-day.has-event {
    background: #FFFFFF;
    border-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .cal-tooltip {
    background: #1A1A1A;
    color: #F5F0E8;
}

[data-theme="light"] .calendar-legend {
    border-top-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .legend-item {
    color: #666;
}

[data-theme="light"] .stats-number {
    color: #1A1A1A;
}

[data-theme="light"] .stats-label,
[data-theme="light"] .stat-label {
    color: #888;
}

[data-theme="light"] .stat-value {
    color: #1A1A1A;
}

[data-theme="light"] .period-btn {
    background: #F5F2EE;
    color: #666;
}

[data-theme="light"] .period-btn:hover,
[data-theme="light"] .period-btn.active {
    background: var(--burgundy);
    color: #FFFFFF;
}

[data-theme="light"] .footer-content {
    color: #888;
    border-top-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .footer-content a {
    color: var(--burgundy);
}

[data-theme="light"] .decoration-circle {
    border-color: rgba(154, 123, 28, 0.1);
}

[data-theme="light"] ::-webkit-scrollbar-track {
    background: #F8F6F3;
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* ============================================================================
   Reset & Base
   ============================================================================ */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background: var(--charcoal);
    color: var(--cream);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================================================================
   Noise Overlay — Subtle Texture
   ============================================================================ */

.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ============================================================================
   Login Screen
   ============================================================================ */

.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    position: relative;
    overflow: hidden;
}

.login-container {
    position: relative;
    width: 100%;
    max-width: 440px;
    z-index: 1;
}

.login-card {
    background: var(--charcoal-light);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    border: 1px solid rgba(245, 240, 232, 0.08);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    animation: loginSlideUp 0.8s var(--ease-out) forwards;
}

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

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--burgundy), var(--gold), var(--burgundy));
}

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

.login-logo-wrapper {
    width: 180px;
    height: 180px;
    margin: 0 auto var(--space-lg);
    background: linear-gradient(135deg, var(--burgundy), var(--burgundy-deep));
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% {
        box-shadow: var(--shadow-md), 0 0 0 0 rgba(114, 47, 55, 0.4);
    }
    50% {
        box-shadow: var(--shadow-md), 0 0 0 15px rgba(114, 47, 55, 0);
    }
}

.login-logo-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(201, 162, 39, 0.2) 100%);
    border-radius: var(--radius-lg);
    pointer-events: none;
}

.login-logo {
    width: 200px;
    height: 200px;
    filter: brightness(0) invert(1);
    opacity: 0.95;
}

.login-header h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
    color: var(--cream);
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.login-tagline {
    font-size: 0.9rem;
    color: var(--gold);
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.login-form .form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.login-form label {
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(245, 240, 232, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.login-form .input-wrapper {
    position: relative;
}

.login-form .input-wrapper input {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    padding-right: 48px;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--cream);
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(245, 240, 232, 0.1);
    border-radius: var(--radius-md);
    transition: all 0.3s var(--ease-out);
}

.login-form .input-wrapper input::placeholder {
    color: rgba(245, 240, 232, 0.3);
}

.login-form .input-wrapper input:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.1);
}

.login-form .input-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(245, 240, 232, 0.3);
    pointer-events: none;
    transition: color 0.3s var(--ease-out);
}

.login-form .input-wrapper input:focus + .input-icon {
    color: var(--gold);
}

.login-error {
    color: #E57373;
    font-size: 0.9rem;
    text-align: center;
    min-height: 1.4em;
    margin: 0;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s var(--ease-out);
}

.login-error.visible {
    opacity: 1;
    transform: translateY(0);
}

.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    margin-top: var(--space-sm);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    color: var(--charcoal);
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s var(--ease-out);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-gold);
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-login .btn-icon {
    transition: transform 0.3s var(--ease-spring);
}

.btn-login:hover .btn-icon {
    transform: translateX(4px);
}

.login-footer {
    margin-top: var(--space-xl);
    padding-top: var(--space-md);
    border-top: 1px solid rgba(245, 240, 232, 0.06);
    text-align: center;
}

.login-footer p {
    font-size: 0.8rem;
    color: rgba(245, 240, 232, 0.3);
}

/* Login decorations */
.login-decoration {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.decoration-circle {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(201, 162, 39, 0.1);
}

.circle-1 {
    width: 600px;
    height: 600px;
    top: -200px;
    right: -200px;
    animation: floatCircle 20s ease-in-out infinite;
}

.circle-2 {
    width: 400px;
    height: 400px;
    bottom: -100px;
    left: -100px;
    animation: floatCircle 15s ease-in-out infinite reverse;
}

.circle-3 {
    width: 200px;
    height: 200px;
    top: 50%;
    left: 10%;
    animation: floatCircle 10s ease-in-out infinite;
}

@keyframes floatCircle {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(20px, -20px) rotate(5deg);
    }
    50% {
        transform: translate(0, -40px) rotate(0deg);
    }
    75% {
        transform: translate(-20px, -20px) rotate(-5deg);
    }
}

/* ============================================================================
   App Container
   ============================================================================ */

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-lg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================================================
   Header
   ============================================================================ */

.header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg) 0;
    margin-bottom: var(--space-md);
    animation: fadeSlideDown 0.8s var(--ease-out) forwards;
}

.header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* Help Button - Premium Gold Style */
.btn-guide {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--gold);
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.1), rgba(201, 162, 39, 0.05));
    border: 1px solid rgba(201, 162, 39, 0.3);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.btn-guide::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(201, 162, 39, 0.2), transparent);
    transition: left 0.5s var(--ease-out);
}

.btn-guide:hover::before {
    left: 100%;
}

.btn-guide svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s var(--ease-out);
}

.btn-guide:hover {
    color: var(--gold-light);
    border-color: var(--gold);
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.2), rgba(201, 162, 39, 0.1));
    box-shadow: 0 0 20px rgba(201, 162, 39, 0.2);
    transform: translateY(-1px);
}

.btn-guide:hover svg {
    transform: rotate(15deg) scale(1.1);
}

.btn-guide:active {
    transform: scale(0.98) translateY(0);
}

/* Logout Button */
.btn-logout {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(245, 240, 232, 0.6);
    background: transparent;
    border: 1px solid rgba(245, 240, 232, 0.15);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
}

.btn-logout svg {
    width: 18px;
    height: 18px;
}

.btn-logout:hover {
    color: var(--cream);
    border-color: var(--burgundy);
    background: rgba(114, 47, 55, 0.2);
}

.btn-logout:active {
    transform: scale(0.98);
}

/* Theme Toggle Button */
.btn-theme {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    font-family: var(--font-body);
    font-size: 1.2rem;
    color: var(--gold);
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.1), rgba(201, 162, 39, 0.05));
    border: 1px solid rgba(201, 162, 39, 0.3);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.btn-theme:hover {
    color: var(--gold-light);
    border-color: var(--gold);
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.2), rgba(201, 162, 39, 0.1));
    box-shadow: 0 0 20px rgba(201, 162, 39, 0.2);
    transform: translateY(-1px);
}

.btn-theme:active {
    transform: scale(0.95);
}

.btn-theme .theme-icon {
    transition: transform 0.4s var(--ease-spring);
}

.btn-theme:hover .theme-icon {
    transform: rotate(20deg);
}

/* Sun/Moon icon transitions */
.btn-theme .icon-sun,
.btn-theme .icon-moon {
    position: absolute;
    transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}

.btn-theme .icon-sun {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

.btn-theme .icon-moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

[data-theme="light"] .btn-theme .icon-sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

[data-theme="light"] .btn-theme .icon-moon {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

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

.logo-wrapper {
    width: 140px;
    height: 140px;
    background: linear-gradient(135deg, var(--burgundy), var(--burgundy-deep));
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.logo-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(201, 162, 39, 0.15) 100%);
    pointer-events: none;
}

.logo {
    width: 200px;
    height: 200px;
    filter: brightness(0) invert(1);
    opacity: 0.95;
}

.header-text h1 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--cream);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.tagline {
    font-size: 0.95rem;
    color: var(--gold);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 4px;
}

/* ============================================================================
   Bento Grid Layout
   ============================================================================ */

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

/* Card Base Styles */
.bento-card {
    background: var(--charcoal-light);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(245, 240, 232, 0.06);
    transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}

.bento-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201, 162, 39, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.4s var(--ease-out);
}

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

.bento-card:hover::before {
    opacity: 1;
}

/* Card Header */
.card-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.card-icon {
    color: var(--gold);
    font-size: 1rem;
    opacity: 0.8;
}

.card-header h2 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--cream);
    letter-spacing: -0.01em;
}

/* Animation delays for stagger effect */
.bento-card:nth-child(1) { animation: fadeSlideUp 0.6s 0.1s var(--ease-out) both; }
.bento-card:nth-child(2) { animation: fadeSlideUp 0.6s 0.2s var(--ease-out) both; }
.bento-card:nth-child(3) { animation: fadeSlideUp 0.6s 0.3s var(--ease-out) both; }
.bento-card:nth-child(4) { animation: fadeSlideUp 0.6s 0.4s var(--ease-out) both; }

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

/* ============================================================================
   Status Card
   ============================================================================ */

.card-status {
    grid-column: span 7;
    background: linear-gradient(145deg, var(--charcoal-light), var(--charcoal));
}

.status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.status-block {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    border: 1px solid rgba(245, 240, 232, 0.04);
}

.status-indicator-wrapper {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--charcoal-muted);
    transition: background 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
    z-index: 2;
    position: relative;
}

.status-pulse {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    z-index: 1;
}

.status-dot.connected {
    background: var(--success-light);
    box-shadow: 0 0 12px rgba(93, 155, 112, 0.6);
}

.status-dot.connected + .status-pulse {
    animation: pulse 2s infinite;
    background: var(--success);
}

.status-dot.disconnected {
    background: var(--danger);
    box-shadow: 0 0 8px rgba(166, 61, 64, 0.4);
}

@keyframes pulse {
    0% {
        transform: scale(0.5);
        opacity: 0.6;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

.status-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.status-label {
    font-size: 0.8rem;
    color: rgba(245, 240, 232, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.status-value {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--cream);
}

.last-update {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid rgba(245, 240, 232, 0.06);
    font-size: 0.85rem;
    color: rgba(245, 240, 232, 0.4);
}

.update-icon {
    display: inline-block;
    animation: spin 8s linear infinite;
}

.test-notifications {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid rgba(245, 240, 232, 0.06);
}

.test-label {
    font-size: 0.8rem;
    color: rgba(245, 240, 232, 0.4);
}

.btn-test {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(245, 240, 232, 0.05);
    border: 1px solid rgba(245, 240, 232, 0.1);
    border-radius: 8px;
    color: var(--cream);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-test:hover {
    background: rgba(245, 240, 232, 0.1);
    border-color: var(--gold);
    color: var(--gold);
}

.btn-test:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-test.loading {
    animation: pulse 1s ease-in-out infinite;
}

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

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

/* ============================================================================
   Add Concours Card
   ============================================================================ */

.card-add {
    grid-column: span 5;
    background: linear-gradient(145deg, var(--burgundy-deep), var(--burgundy));
}

.card-add .card-icon {
    color: var(--gold-light);
}

.card-add .card-header h2 {
    color: var(--cream-light);
}

.add-form {
    display: flex;
    gap: var(--space-sm);
}

.input-wrapper {
    flex: 1;
    position: relative;
}

.input-wrapper input {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--cream);
    background: rgba(0, 0, 0, 0.25);
    border: 2px solid rgba(245, 240, 232, 0.15);
    border-radius: var(--radius-md);
    transition: all 0.3s var(--ease-out);
}

.input-wrapper input::placeholder {
    color: rgba(245, 240, 232, 0.4);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(0, 0, 0, 0.35);
    box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.15);
}

/* Remove spinner from number input */
.input-wrapper input::-webkit-outer-spin-button,
.input-wrapper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.input-wrapper input[type=number] {
    -moz-appearance: textfield;
}

.btn-add {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-lg);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--charcoal);
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.btn-add::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s var(--ease-out);
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-gold);
}

.btn-add:hover::before {
    left: 100%;
}

.btn-add:active {
    transform: translateY(0);
}

.btn-add:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    transition: transform 0.3s var(--ease-spring);
}

.btn-add:hover .btn-icon {
    transform: translateX(4px);
}

.form-message {
    margin-top: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    display: none;
    animation: messageSlide 0.3s var(--ease-out);
}

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

.form-message.success {
    display: block;
    background: rgba(74, 124, 89, 0.2);
    color: var(--success-light);
    border: 1px solid rgba(74, 124, 89, 0.3);
}

.form-message.error {
    display: block;
    background: rgba(166, 61, 64, 0.2);
    color: #E57373;
    border: 1px solid rgba(166, 61, 64, 0.3);
}

/* ============================================================================
   Stats Card
   ============================================================================ */

.card-stats {
    grid-column: span 3;
    grid-row: span 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(145deg, var(--forest), var(--forest-light));
    position: relative;
}

.stats-number {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 700;
    color: var(--cream);
    line-height: 1;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.stats-label {
    font-size: 0.9rem;
    color: rgba(245, 240, 232, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: var(--space-xs);
    line-height: 1.3;
}

.stats-decoration {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    border: 2px solid rgba(201, 162, 39, 0.15);
    border-radius: 50%;
    pointer-events: none;
}

/* ============================================================================
   Global Stats Card
   ============================================================================ */

.card-global-stats {
    grid-column: span 9;
}

.global-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-md);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    border: 1px solid rgba(245, 240, 232, 0.04);
    transition: all 0.3s var(--ease-out);
}

.stat-item:hover {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(201, 162, 39, 0.2);
}

.stat-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
    color: var(--gold);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8rem;
    color: rgba(245, 240, 232, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: var(--space-xs);
}

@media (max-width: 768px) {
    .card-global-stats {
        grid-column: span 1;
    }

    .global-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }
}

/* ============================================================================
   Activity Chart Card
   ============================================================================ */

.card-chart {
    grid-column: span 12;
}

.card-chart .card-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.chart-period-toggle {
    margin-left: auto;
    display: flex;
    gap: 4px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: var(--radius-sm);
}

.period-btn {
    padding: 6px 12px;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(245, 240, 232, 0.5);
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
}

.period-btn:hover {
    color: rgba(245, 240, 232, 0.8);
}

.period-btn.active {
    color: var(--charcoal);
    background: var(--gold);
}

.chart-container {
    position: relative;
    height: 250px;
    margin-top: var(--space-md);
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

@media (max-width: 768px) {
    .card-chart {
        grid-column: span 1;
    }

    .chart-container {
        height: 200px;
    }

    .chart-period-toggle {
        padding: 2px;
    }

    .period-btn {
        padding: 4px 8px;
        font-size: 0.7rem;
    }
}

/* ============================================================================
   Calendar Card
   ============================================================================ */

.card-calendar {
    grid-column: span 12;
}

.card-calendar .card-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.calendar-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.cal-nav-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--gold);
    background: rgba(201, 162, 39, 0.1);
    border: 1px solid rgba(201, 162, 39, 0.3);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
}

.cal-nav-btn:hover {
    background: rgba(201, 162, 39, 0.2);
    border-color: var(--gold);
}

.cal-month-label {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 500;
    color: var(--cream);
    min-width: 140px;
    text-align: center;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-top: var(--space-md);
}

.cal-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(245, 240, 232, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: center;
    padding: var(--space-xs) 0;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: rgba(245, 240, 232, 0.7);
    position: relative;
    transition: all 0.2s var(--ease-out);
    cursor: default;
}

.cal-day.empty {
    background: transparent;
}

.cal-day.today {
    border: 2px solid var(--gold);
    color: var(--cream);
}

.cal-day.has-event {
    cursor: pointer;
}

.cal-day.has-event:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: scale(1.05);
}

.cal-day-number {
    font-weight: 500;
}

.cal-event-dots {
    display: flex;
    gap: 3px;
    margin-top: 4px;
}

.cal-event-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    box-shadow: 0 0 4px currentColor;
}

.cal-event-dot.previsionnel {
    background: var(--gold);
    box-shadow: 0 0 6px rgba(200, 170, 110, 0.5);
}

.cal-event-dot.engagement {
    background: #22C55E;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
}

.cal-event-dot.demande {
    background: #3B82F6;
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.6);
}

.cal-event-dot.cloture,
.cal-event-dot.termine {
    background: #9CA3AF;
    box-shadow: 0 0 4px rgba(156, 163, 175, 0.4);
}

.cal-event-dot.en_cours {
    background: #A855F7;
    box-shadow: 0 0 6px rgba(168, 85, 247, 0.6);
}

.cal-event-dot.annule {
    background: #EF4444;
    box-shadow: 0 0 4px rgba(239, 68, 68, 0.4);
}

.cal-event-dot.ferme {
    background: #6B7280;
    box-shadow: 0 0 4px rgba(107, 114, 128, 0.3);
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid rgba(245, 240, 232, 0.06);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.8rem;
    color: rgba(245, 240, 232, 0.5);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-dot.engagement {
    background: var(--success-light);
}

.legend-dot.demande {
    background: var(--info);
}

.legend-dot.ferme {
    background: var(--charcoal-muted);
}

/* Calendar tooltip */
.cal-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--charcoal);
    border: 1px solid var(--gold);
    border-radius: var(--radius-sm);
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.75rem;
    color: var(--cream);
    white-space: nowrap;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s var(--ease-out);
}

.cal-day.has-event:hover .cal-tooltip {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 768px) {
    .card-calendar {
        grid-column: span 1;
    }

    .cal-month-label {
        font-size: 0.9rem;
        min-width: 100px;
    }

    .cal-nav-btn {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }

    .cal-header {
        font-size: 0.65rem;
    }

    .cal-day {
        font-size: 0.75rem;
    }

    .cal-event-dots {
        margin-top: 2px;
    }

    .cal-event-dot {
        width: 4px;
        height: 4px;
    }

    .calendar-legend {
        gap: var(--space-sm);
    }

    .legend-item {
        font-size: 0.7rem;
    }
}

/* ============================================================================
   Concours List Card
   ============================================================================ */

.card-list {
    grid-column: span 9;
    min-height: 300px;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl) var(--space-lg);
    text-align: center;
}

.empty-icon {
    width: 80px;
    height: 80px;
    color: rgba(245, 240, 232, 0.15);
    margin-bottom: var(--space-md);
}

.empty-icon svg {
    width: 100%;
    height: 100%;
}

.empty-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: rgba(245, 240, 232, 0.6);
    margin-bottom: var(--space-xs);
}

.empty-hint {
    font-size: 0.9rem;
    color: rgba(245, 240, 232, 0.35);
    max-width: 300px;
}

/* Concours Grid */
.concours-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-md);
}

/* Individual Concours Card */
.concours-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(245, 240, 232, 0.06);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    transition: all 0.3s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.concours-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--charcoal-muted);
    transition: background 0.3s var(--ease-out);
}

.concours-card:hover {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(245, 240, 232, 0.1);
    transform: translateX(4px);
}

.concours-card.status-engagement::before {
    background: var(--success-light);
}

.concours-card.status-demande::before {
    background: var(--info);
}

.concours-card.status-ferme::before {
    background: var(--charcoal-muted);
}

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

.concours-title-wrapper {
    flex: 1;
    min-width: 0;
}

.concours-nom {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--cream);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.concours-subtitle {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--charcoal-muted);
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.concours-numero {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--cream);
}

.concours-numero a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s var(--ease-out);
}

.concours-numero a:hover {
    color: var(--gold);
}

.concours-actions {
    display: flex;
    gap: var(--space-xs);
}

.btn-delete {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(166, 61, 64, 0.4);
    border-radius: var(--radius-sm);
    color: var(--danger);
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s var(--ease-out);
}

.btn-delete:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: var(--cream);
}

.btn-access {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: var(--space-md);
    padding: 10px 16px;
    background: transparent;
    color: var(--gold);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: 1.5px solid var(--gold);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.25s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.btn-access::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    opacity: 0;
    transition: opacity 0.25s var(--ease-out);
    z-index: -1;
}

.btn-access:hover::before {
    opacity: 1;
}

.btn-access:hover {
    color: var(--charcoal);
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(200, 170, 110, 0.4);
}

.btn-access:active {
    transform: translateY(0);
}

.btn-access svg {
    transition: transform 0.25s var(--ease-out);
}

.btn-access:hover svg {
    transform: translate(2px, -2px);
}

.concours-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.concours-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-status {
    background: rgba(74, 74, 74, 0.4);
    color: rgba(245, 240, 232, 0.7);
}

.badge-status.previsionnel {
    background: rgba(201, 162, 39, 0.2);
    color: var(--gold-light);
}

.badge-status.engagement {
    background: rgba(34, 197, 94, 0.2);
    color: #22C55E;
}

.badge-status.demande {
    background: rgba(59, 130, 246, 0.2);
    color: #3B82F6;
}

.badge-status.cloture {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
}

.badge-status.en_cours {
    background: rgba(168, 85, 247, 0.2);
    color: #A855F7;
}

.badge-status.termine {
    background: rgba(107, 114, 128, 0.3);
    color: #9CA3AF;
}

.badge-status.annule {
    background: rgba(239, 68, 68, 0.2);
    color: #F87171;
}

.badge-notif {
    background: rgba(201, 162, 39, 0.15);
    color: var(--gold-light);
}

.badge-notif.pending {
    background: rgba(74, 74, 74, 0.3);
    color: rgba(245, 240, 232, 0.5);
}

.concours-time {
    font-size: 0.8rem;
    color: rgba(245, 240, 232, 0.4);
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px solid rgba(245, 240, 232, 0.06);
}

/* ============================================================================
   Footer
   ============================================================================ */

.footer {
    margin-top: auto;
    padding: var(--space-lg) 0 var(--space-sm);
    animation: fadeIn 0.6s 0.5s var(--ease-out) both;
}

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

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-size: 0.85rem;
    color: rgba(245, 240, 232, 0.3);
}

.footer-brand {
    font-family: var(--font-display);
    font-weight: 500;
    color: rgba(245, 240, 232, 0.5);
}

.footer-divider {
    opacity: 0.3;
}

/* ============================================================================
   Responsive Design
   ============================================================================ */

@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(6, 1fr);
    }

    .card-status {
        grid-column: span 6;
    }

    .card-add {
        grid-column: span 4;
    }

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

    .card-list {
        grid-column: span 6;
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: var(--space-md);
        padding-top: 0;
    }

    /* Sticky header on mobile */
    .header {
        position: sticky;
        top: 0;
        z-index: 100;
        background: var(--charcoal);
        padding: var(--space-md) 0;
        margin-bottom: var(--space-md);
        flex-wrap: wrap;
        gap: var(--space-sm);
        border-bottom: 1px solid rgba(245, 240, 232, 0.06);
    }

    [data-theme="light"] .header {
        background: var(--charcoal);
    }

    .logo-wrapper {
        width: 60px;
        height: 60px;
        border-radius: var(--radius-md);
    }

    .logo {
        width: 100px;
        height: 100px;
    }

    .header-text h1 {
        font-size: 1.5rem;
    }

    .tagline {
        font-size: 0.7rem;
        letter-spacing: 0.04em;
    }

    /* Mobile menu toggle */
    .header-actions {
        margin-left: auto;
        display: flex;
        gap: var(--space-xs);
    }

    /* Hide text labels on mobile for header buttons */
    .btn-guide span,
    .btn-logout span {
        display: none;
    }

    .btn-guide,
    .btn-logout {
        padding: var(--space-xs);
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
    }

    .btn-theme {
        min-width: 44px;
        min-height: 44px;
    }

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

    .card-status,
    .card-add,
    .card-stats,
    .card-list {
        grid-column: span 1;
    }

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

    .add-form {
        flex-direction: column;
    }

    /* Touch-friendly buttons - 48px minimum */
    .btn-add {
        justify-content: center;
        min-height: 48px;
    }

    .btn-delete {
        min-width: 44px;
        min-height: 44px;
    }

    /* Prevent iOS zoom on input focus */
    .input-wrapper input,
    .login-form .input-wrapper input {
        font-size: 16px;
    }

    .stats-number {
        font-size: 3rem;
    }

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

    /* Login responsive */
    .login-screen {
        padding: var(--space-md);
    }

    .login-card {
        padding: var(--space-lg);
    }

    .login-logo-wrapper {
        width: 120px;
        height: 120px;
    }

    .login-logo {
        width: 150px;
        height: 150px;
    }

    .login-header h1 {
        font-size: 1.75rem;
    }

    .login-tagline {
        font-size: 0.8rem;
    }

    .btn-login {
        min-height: 48px;
    }
}

@media (max-width: 480px) {
    :root {
        --space-lg: 1.5rem;
        --space-xl: 2rem;
    }

    .app-container {
        padding: var(--space-sm);
        padding-top: 0;
    }

    .header {
        padding: var(--space-sm) 0;
    }

    .logo-wrapper {
        width: 50px;
        height: 50px;
    }

    .logo {
        width: 80px;
        height: 80px;
    }

    .header-text h1 {
        font-size: 1.25rem;
    }

    .tagline {
        font-size: 0.65rem;
    }

    .header-actions {
        gap: 4px;
    }

    .btn-guide,
    .btn-logout,
    .btn-theme {
        min-width: 40px;
        min-height: 40px;
        padding: 8px;
    }

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

    .card-header h2 {
        font-size: 1rem;
    }

    .concours-nom {
        font-size: 1rem;
        -webkit-line-clamp: 2;
    }

    .concours-subtitle {
        font-size: 0.75rem;
    }

    .concours-badge {
        font-size: 0.7rem;
        padding: 3px 8px;
    }

    .btn-access {
        padding: 12px 16px;
        font-size: 0.8rem;
        min-height: 44px;
    }

    .stats-number {
        font-size: 2.5rem;
    }

    .stats-label {
        font-size: 0.8rem;
    }

    .footer-content {
        flex-wrap: wrap;
        gap: var(--space-xs);
        font-size: 0.75rem;
    }

    /* Login on very small screens */
    .login-logo-wrapper {
        width: 100px;
        height: 100px;
    }

    .login-logo {
        width: 130px;
        height: 130px;
    }

    .login-header h1 {
        font-size: 1.5rem;
    }
}

/* ============================================================================
   Loading & Refresh States
   ============================================================================ */

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.refreshing .update-icon {
    animation: spin 0.8s linear infinite;
}

/* ============================================================================
   Scrollbar Styling
   ============================================================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--charcoal);
}

::-webkit-scrollbar-thumb {
    background: var(--charcoal-muted);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(245, 240, 232, 0.2);
}

/* ============================================================================
   Selection Styling
   ============================================================================ */

::selection {
    background: var(--burgundy);
    color: var(--cream);
}
