/* ── CONFIGURATION & POLICES ── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;600;700&family=DM+Sans:wght@300;400;500&family=Playfair+Display:wght@400;600;700&family=Jost:wght@300;400;500&display=swap');

:root {
    /* Couleurs Principales */
    --green: #a1baa5;
    --green-dark: #4e7455;
    --green-light: #c8daca;
    --cream: #f8f4ee;
    --cream-dark: #ede8e0;
    --brown: #7c5c3e;
    
    /* Texte */
    --text-dark: #1e1a17;
    --text-light: #8a7b71;
    --white: #ffffff;
    
    /* UI */
    --shadow: 0 4px 20px rgba(30,26,23,0.1);
    --radius: 16px;
}

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

body {
    background: var(--cream);
    font-family: 'DM Sans', 'Jost', sans-serif;
    color: var(--text-dark);
    min-height: 100vh;
    line-height: 1.5;
}

h1, h2, h3, .font-serif {
    font-family: 'Cormorant Garamond', 'Playfair Display', serif;
}

/* ── HEADER PUBLIC ── */
.menu-header {
    background: var(--green);
    padding: 3rem 1.5rem 5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.menu-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(255,255,255,.12) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(255,255,255,.08) 0%, transparent 50%);
    pointer-events: none;
}

.menu-header::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 0; right: 0;
    height: 50px;
    background: var(--cream);
    border-radius: 50% 50% 0 0 / 80px 80px 0 0;
}

.header-inner { position: relative; z-index: 1; }

.header-logo {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 3px;
    text-shadow: 0 2px 20px rgba(0,0,0,.2);
    line-height: 1;
    margin-bottom: .4rem;
}

.header-tagline {
    font-size: .8rem;
    color: rgba(255,255,255,0.75);
    letter-spacing: .2em;
    text-transform: uppercase;
    font-weight: 300;
    margin-bottom: 1.25rem;
}

.table-pill {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: rgba(255,255,255,.25);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,.4);
    border-radius: 50px;
    padding: .5rem 1.25rem;
    color: var(--white);
    font-size: .88rem;
}

.table-pill .table-number {
    background: var(--white);
    color: var(--green-dark);
    border-radius: 50px;
    padding: .15rem .65rem;
    font-weight: 700;
}

/* ── NAVIGATION STICKY (TABS) ── */
.cat-tabs-wrapper {
    position: sticky;
    top: 8px;
    z-index: 100;
    margin: 0 auto 1.75rem;
    max-width: 900px;
    padding: 0 1rem;
}

.cat-tabs-inner {
    background: rgba(255,255,255,.95);
    backdrop-filter: blur(12px);
    border-radius: 50px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0,0,0,.06);
    padding: .5rem .75rem;
    display: flex;
    gap: .35rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.cat-tabs-inner::-webkit-scrollbar { display: none; }

.cat-tab {
    flex-shrink: 0;
    padding: .5rem 1.1rem;
    border: none;
    border-radius: 50px;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: .85rem;
    font-weight: 500;
    color: var(--text-light);
    transition: all .2s;
    white-space: nowrap;
}

.cat-tab.active, .cat-tab:hover {
    background: var(--green);
    color: var(--white);
}

/* ── SECTIONS & GRIDS ── */
.menu-body {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem 4rem;
}

.category-section {
    margin-bottom: 2.5rem;
    scroll-margin-top: 80px;
}

.category-title {
    font-size: 1.6rem;
    color: var(--brown);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    padding-bottom: .6rem;
    border-bottom: 2px solid var(--green-light);
}

.products-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}
/* ── PRODUCT CARDS (DISPOSITION SUR MESURE) ── */
.products-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.product-card {
    background: #fff;
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 2px 12px rgba(30,26,23,.06);
    display: flex;
    flex-wrap: wrap; /* Permet aux blocs de passer dessous */
    align-items: flex-start;
    justify-content: space-between; /* Pousse le prix à l'opposé de l'image */
}

/* L'image en haut à gauche */
.product-img, .product-img-placeholder {
    width: 65px;
    height: 65px;
    object-fit: cover;
    border-radius: 12px;
}

.product-img-placeholder {
    background: linear-gradient(135deg, #d0e4d3, #e8f0e9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Le prix en haut à droite */
.product-price {
    font-weight: 700;
    font-size: 1.1rem;
    color: #4e7455;
    padding-top: 0.5rem;
}

/* Le bloc texte (Nom + Description) qui passe en dessous */
.product-info-block {
    width: 100%; /* Force le passage sous l'image/prix */
    margin-top: 1rem;
    padding-top: 0.8rem;
    border-top: 1px dashed #ede8e0;
}

.product-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e1a17;
    margin-bottom: 0.4rem;
}

.product-desc {
    font-size: 0.85rem;
    color: #8a7b71;
    line-height: 1.5;
}

/* ── ADMIN NAV ── */
.admin-nav {
    background: var(--text-dark);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    height: 60px;
    position: relative;
    z-index: 200;
}

.admin-nav-brand {
    color: var(--green-light);
    font-size: 1.2rem;
    text-decoration: none;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700;
    letter-spacing: 1px;
}

.admin-nav-links {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.admin-nav-links a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    padding: 0 1rem;
    height: 60px;
    display: flex;
    align-items: center;
    font-size: 0.88rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.admin-nav-links a:hover,
.admin-nav-links a.active {
    color: var(--white);
    background: rgba(255,255,255,0.08);
}

/* ── BURGER BUTTON ── */
.burger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    margin-left: auto;
    border-radius: 8px;
    flex-shrink: 0;
}

.burger-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: rgba(255,255,255,0.8);
    border-radius: 2px;
    transition: transform 0.25s, opacity 0.25s;
}

.burger-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger-btn.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.burger-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1.4rem;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary { background: var(--green); color: var(--white); }
.btn-danger { background: #fdecea; color: #c0392b; }

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--cream-dark);
    border-radius: 10px;
    outline: none;
    background: var(--cream);
    font-family: inherit;
}

.form-control:focus { border-color: var(--green); background: var(--white); }

/* ── RESPONSIVE ── */
@media (max-width: 420px) {
    .header-logo { font-size: 2.1rem; }
}

@media (min-width: 600px) {
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
    .product-card { padding: 1.25rem; }
}

@media (min-width: 900px) {
    .products-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── MISSING VARIABLES ── */
:root {
    --green-deep: #2d6a38;
    --text-mid: #6b5b50;
}

/* ── LOGIN ── */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cream);
    padding: 1.5rem;
}

.login-box {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 8px 40px rgba(30,26,23,.15);
    text-align: center;
}

.login-box h1 {
    font-size: 2rem;
    color: var(--green-dark);
    margin-bottom: .4rem;
    letter-spacing: 2px;
}

.subtitle {
    color: var(--text-light);
    font-size: .9rem;
    margin-bottom: 2rem;
}

/* ── ALERTS ── */
.alert {
    padding: .9rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-size: .9rem;
}

.alert-success {
    background: #e6f4ea;
    color: #2d7a3a;
    border-left: 4px solid #2d7a3a;
}

.alert-error {
    background: #fdecea;
    color: #c0392b;
    border-left: 4px solid #c0392b;
}

/* ── FORMS ── */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: .85rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: .4rem;
}

/* ── ADMIN LAYOUT ── */
.admin-body {
    background: #f2ede6;
}

.admin-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.page-title {
    font-size: 1.8rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    font-family: 'Cormorant Garamond', serif;
}

/* ── NAV LOGOUT & LABEL ── */
.logout-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,.7);
    font-size: .9rem;
    font-family: inherit;
    cursor: pointer;
    padding: 0 1.25rem;
    height: 60px;
    transition: color .2s;
}

.logout-btn:hover {
    color: var(--white);
}

/* ── DASHBOARD STATS ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem 1rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-number {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--green-dark);
    font-family: 'Cormorant Garamond', serif;
    line-height: 1;
}

.stat-label {
    font-size: .78rem;
    color: var(--text-light);
    margin-top: .5rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ── DASHBOARD QUICK LINKS ── */
.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: 1rem;
}

.quick-link {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text-dark);
    box-shadow: var(--shadow);
    display: block;
    transition: transform .2s, box-shadow .2s;
}

.quick-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(30,26,23,.14);
}

.quick-link-icon {
    font-size: 1.75rem;
    margin-bottom: .75rem;
}

.quick-link-title {
    font-weight: 600;
    font-size: .95rem;
    margin-bottom: .3rem;
}

.quick-link-sub {
    font-size: .78rem;
    color: var(--text-light);
}

/* ── TABLE ── */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}

.table th {
    background: var(--cream);
    color: var(--text-light);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 600;
    padding: .75rem 1rem;
    text-align: left;
    border-bottom: 2px solid var(--cream-dark);
}

.table td {
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--cream-dark);
    vertical-align: middle;
}

.table tbody tr:hover { background: var(--cream); }
.table tbody tr:last-child td { border-bottom: none; }

/* ── BADGES ── */
.badge {
    display: inline-block;
    padding: .25rem .75rem;
    border-radius: 50px;
    font-size: .75rem;
    font-weight: 600;
}

.badge-green  { background: #e6f4ea; color: #2d7a3a; }
.badge-red    { background: #fdecea; color: #c0392b; }
.badge-yellow { background: #fef9e7; color: #b7770d; }

/* ── ACTIONS ── */
.actions {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
}

/* ── BUTTON VARIANTS ── */
.btn-secondary {
    background: var(--cream-dark);
    color: var(--text-dark);
}

.btn-secondary:hover { background: #d9d3ca; }

.btn-sm {
    padding: .4rem .85rem;
    font-size: .8rem;
    border-radius: 7px;
}

/* ── DRAG HANDLE ── */
.handle-col { width: 36px; padding: 0 !important; }

.drag-handle {
    width: 36px;
    text-align: center;
    color: #ccc;
    font-size: 1.2rem;
    cursor: grab;
    user-select: none;
    touch-action: none;
    padding: 0 .5rem !important;
    transition: color .15s;
}

.drag-handle:hover { color: var(--green-dark); }
.drag-handle:active { cursor: grabbing; }

.sortable-ghost { opacity: .35; background: var(--cream) !important; }
.sortable-chosen { background: #fafaf8; }

/* ── IMAGES ── */
.thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
}

.qr-preview {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: contain;
    background: var(--cream);
    flex-shrink: 0;
}

/* ── STAFF LAYOUT ── */
.staff-body { background: #111; }

.staff-header {
    background: #1a1a1a;
    display: flex;
    align-items: center;
    padding: .85rem 1.25rem;
    border-bottom: 1px solid #333;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.staff-header h1 {
    font-family: 'Cormorant Garamond', serif;
    color: var(--green-light);
    font-size: 1.2rem;
    font-weight: 700;
}

.staff-content {
    padding: 1.25rem;
    max-width: 1400px;
    margin: 0 auto;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    animation: live-pulse 2s infinite;
}

@keyframes live-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: .35; }
}

.empty-staff {
    text-align: center;
    padding: 4rem 2rem;
    color: #555;
    font-size: 1.1rem;
}

.empty-staff p:first-child {
    font-size: 3rem;
    margin-bottom: .5rem;
}

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

/* ── ORDER CARD INTERNALS ── */
.order-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .75rem;
}

.order-time {
    font-size: .78rem;
    color: #777;
}

.order-customer {
    font-size: .85rem;
    color: #bbb;
    margin-bottom: .75rem;
}

.order-items { margin-bottom: .75rem; }

.order-item-row {
    display: flex;
    justify-content: space-between;
    font-size: .85rem;
    color: #ccc;
    padding: .25rem 0;
    border-bottom: 1px solid #2e2e2e;
}

.order-item-qty {
    color: var(--green-light);
    font-weight: 700;
    margin-right: .4rem;
}

.order-note {
    font-size: .8rem;
    color: #888;
    font-style: italic;
    margin-bottom: .5rem;
    padding: .4rem .6rem;
    background: #1a1a1a;
    border-radius: 6px;
}

/* ── MOBILE OVERLAY (burger menu) ── */
.menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 198;
}

.menu-overlay.open { display: block; }

/* ════════════════════════════════════════
   RESPONSIVE — TABLET (≤900px)
════════════════════════════════════════ */
@media (max-width: 900px) {
    .admin-nav { padding: 0 1rem; }

    .admin-nav-links a { padding: 0 .75rem; font-size: .82rem; }

    .stats-grid  { grid-template-columns: repeat(3, 1fr); }
    .quick-links { grid-template-columns: repeat(3, 1fr); }
}

/* ════════════════════════════════════════
   RESPONSIVE — MOBILE (≤768px)
════════════════════════════════════════ */
@media (max-width: 768px) {

    /* ── NAV ── */
    .burger-btn { display: flex; }

    .admin-nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: #1a1a1a;
        border-top: 1px solid rgba(255,255,255,.08);
        padding: .5rem 0 1rem;
        margin-left: 0;
        z-index: 199;
        box-shadow: 0 8px 24px rgba(0,0,0,.4);
    }

    .admin-nav-links.open { display: flex; }

    .admin-nav-links a {
        height: 52px;
        padding: 0 1.5rem;
        font-size: .95rem;
        border-bottom: 1px solid rgba(255,255,255,.05);
        width: 100%;
    }

    .admin-nav-links form { width: 100%; }

    .logout-btn {
        width: 100%;
        height: 52px;
        text-align: left;
        padding: 0 1.5rem;
        font-size: .95rem;
        border-top: 1px solid rgba(255,255,255,.08);
        margin-top: .25rem;
    }

    /* ── LAYOUT ── */
    .admin-content { padding: 1rem; }

    .page-title {
        font-size: 1.4rem;
        margin-bottom: 1rem;
    }

    .card {
        padding: 1.1rem;
        border-radius: 12px;
        /* allow horizontal scroll for table cards — overrides inline overflow:hidden */
        overflow-x: auto !important;
    }

    /* ── TABLES ── */
    .table { min-width: 580px; }

    .table th,
    .table td { padding: .65rem .75rem; }

    /* ── STATS ── */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: .75rem; }

    .stat-card { padding: 1.1rem .75rem; }

    .stat-number { font-size: 2rem; }

    /* ── QUICK LINKS ── */
    .quick-links { grid-template-columns: repeat(2, 1fr); gap: .75rem; }

    .quick-link { padding: 1.1rem; }

    .quick-link-icon { font-size: 1.5rem; margin-bottom: .5rem; }

    .quick-link-title { font-size: .88rem; }

    /* ── FORMS ── */
    /* price/category inline grid → stack */
    .admin-content .card form [style*="grid-template-columns:1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    .form-group { margin-bottom: 1rem; }

    /* ── BUTTONS ── */
    .btn {
        padding: .7rem 1.1rem;
        min-height: 44px;
    }

    .btn-sm {
        padding: .5rem .8rem;
        min-height: 38px;
    }

    .actions { gap: .4rem; }

    /* ── DASHBOARD header row ── */
    .admin-content > div[style*="justify-content:space-between"] {
        flex-direction: column;
        align-items: flex-start !important;
    }

    /* ── TABLES PAGE — card grid ── */
    .admin-content > div[style*="grid-template-columns:repeat(auto-fill,minmax(280px"] {
        grid-template-columns: 1fr !important;
    }

    /* ── SPLASH PAGE — image grid ── */
    .admin-content > div[style*="grid-template-columns:repeat(auto-fill,minmax(220px"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* ── QR PREVIEW ── */
    .qr-preview { width: 64px; height: 64px; }
}

/* ════════════════════════════════════════
   RESPONSIVE — SMALL PHONE (≤420px)
════════════════════════════════════════ */
@media (max-width: 420px) {
    .stats-grid  { grid-template-columns: repeat(2, 1fr); }
    .quick-links { grid-template-columns: 1fr 1fr; gap: .6rem; }

    .quick-link  { padding: .9rem; }

    .admin-nav-brand { font-size: 1rem; }

    /* Splash grid → 1 col on very small screens */
    .admin-content > div[style*="grid-template-columns:repeat(auto-fill,minmax(220px"] {
        grid-template-columns: 1fr !important;
    }
}