/* ===================================================
   Q-FOOD — Mobile-first stylesheet
   Breakpoints : base = mobile, 600px = tablet, 900px = desktop
=================================================== */

/* ===== VARIABLES ===== */
:root {
    --orange:       #FF6B00;
    --orange-light: #FF8C33;
    --orange-dark:  #CC5500;
    --yellow:       #FFD700;
    --yellow-light: #FFE44D;
    --black:        #0A0A0A;
    --dark:         #141414;
    --dark-2:       #1E1E1E;
    --dark-3:       #2A2A2A;
    --dark-4:       #333333;
    --gray:         #888888;
    --gray-light:   #AAAAAA;
    --white:        #F5F5F5;
    --green:        #28A745;
    --red:          #DC3545;
    --radius:       10px;
    --shadow:       0 4px 24px rgba(0,0,0,0.5);
    --tap:          48px; /* taille minimale zone de tap */
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--black);
    color: var(--white);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--orange); text-decoration: none; -webkit-tap-highlight-color: transparent; }
a:hover, a:active { color: var(--orange-light); }
img { max-width: 100%; display: block; }

/* ===== NAVBAR ===== */
.navbar {
    background: var(--dark-2);
    border-bottom: 2px solid var(--orange);
    padding: 0 1rem;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,0.6);
}
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}
.brand-logo { height: 36px; width: auto; object-fit: contain; }
.brand-name {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--orange);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Hamburger button */
.nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: var(--tap);
    height: var(--tap);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--white);
    border-radius: 2px;
    transition: transform 0.25s, opacity 0.25s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Menu mobile — déroulant sous la navbar */
.navbar-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--dark-2);
    border-bottom: 2px solid var(--orange);
    padding: 0.5rem 0;
    box-shadow: 0 8px 20px rgba(0,0,0,0.5);
    z-index: 99;
}
.navbar-menu.open { display: flex; }

.nav-link {
    display: flex;
    align-items: center;
    min-height: var(--tap);
    padding: 0 1.25rem;
    color: var(--gray-light);
    font-size: 1rem;
    font-weight: 500;
    border-bottom: 1px solid var(--dark-3);
    transition: background 0.15s, color 0.15s;
}
.nav-link:hover, .nav-link:active { background: var(--dark-3); color: var(--orange); }
.nav-user {
    display: flex;
    align-items: center;
    min-height: var(--tap);
    padding: 0 1.25rem;
    color: var(--yellow);
    font-size: 0.9rem;
    font-weight: 600;
    border-bottom: 1px solid var(--dark-3);
}
.nav-logout { color: var(--gray) !important; }
.nav-logout:hover, .nav-logout:active { color: var(--red) !important; background: rgba(220,53,69,0.08) !important; }
.nav-switch       { color: var(--yellow) !important; font-weight: 700 !important; }
.nav-switch:hover { color: var(--yellow-light) !important; background: rgba(255,215,0,0.08) !important; }
.nav-switch-admin       { color: var(--orange) !important; font-weight: 700 !important; }
.nav-switch-admin:hover { color: var(--orange-light) !important; background: rgba(255,107,0,0.08) !important; }

/* Desktop : menu horizontal dans la barre */
@media (min-width: 900px) {
    .navbar { padding: 0 2rem; height: 60px; }
    .nav-toggle { display: none; }
    .navbar-menu {
        display: flex !important;
        flex-direction: row;
        position: static;
        background: none;
        border: none;
        padding: 0;
        box-shadow: none;
        align-items: center;
        gap: 0.25rem;
    }
    .nav-link {
        min-height: 36px;
        padding: 0 0.9rem;
        border: none;
        border-radius: 6px;
        font-size: 0.9rem;
    }
    .nav-user {
        min-height: 36px;
        padding: 0 0.9rem;
        border: none;
        font-size: 0.85rem;
    }
}

/* ===== LAYOUT ===== */
.main-content { padding: 1.25rem 0 2rem; }
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}
@media (min-width: 600px) { .container { padding: 0 1.5rem; } }

.page-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.page-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1.2;
}
.page-subtitle { color: var(--gray); font-size: 0.9rem; }
@media (min-width: 600px) {
    .page-header { flex-direction: row; align-items: center; justify-content: space-between; }
    .page-header h2 { font-size: 1.6rem; }
}

/* ===== FORMS ===== */
.form-group { margin-bottom: 1.1rem; }
.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-light);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--dark-3);
    border: 1px solid var(--dark-4);
    border-radius: var(--radius);
    color: var(--white);
    font-size: 1rem;         /* important : évite le zoom auto sur iOS */
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(255,107,0,0.18);
}
.form-group input::placeholder { color: var(--dark-4); }
.form-row { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 500px) {
    .form-row { grid-template-columns: 1fr 1fr; gap: 1rem; }
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: var(--tap);
    padding: 0 1.4rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary  { background: var(--orange); color: #fff; }
.btn-primary:hover  { background: var(--orange-light); color: #fff; }
.btn-secondary { background: var(--dark-4); color: var(--white); }
.btn-secondary:hover { background: var(--dark-3); color: var(--white); }
.btn-danger   { background: var(--red);   color: #fff; }
.btn-danger:hover   { background: #c82333; color: #fff; }
.btn-success  { background: var(--green); color: #fff; }
.btn-success:hover  { background: #218838; color: #fff; }
.btn-full { width: 100%; }
.btn-sm { min-height: 36px; padding: 0 0.85rem; font-size: 0.82rem; }

/* ===== ALERTS ===== */
.alert {
    padding: 0.9rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
}
.alert-error   { background: rgba(220,53,69,0.15); border: 1px solid var(--red);   color: #ff8a94; }
.alert-success { background: rgba(40,167,69,0.15);  border: 1px solid var(--green); color: #6fcf83; }

/* ===== STATS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
@media (min-width: 600px) {
    .stats-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
}
.stat-card {
    background: var(--dark-2);
    border: 1px solid var(--dark-4);
    border-left: 4px solid var(--orange);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
}
.stat-number {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--orange);
    line-height: 1;
}
.stat-number.stat-green { color: var(--green); }
.stat-label {
    font-size: 0.75rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.35rem;
}

/* ===== CARDS ===== */
.cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}
@media (min-width: 500px) {
    .cards-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
}
.card {
    background: var(--dark-2);
    border: 1px solid var(--dark-4);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: border-color 0.2s, transform 0.2s;
}
.card-link { display: block; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.card-link:active, .card-link:hover {
    border-color: var(--orange);
    transform: translateY(-2px);
    color: var(--white);
}
.card-icon { font-size: 1.8rem; margin-bottom: 0.6rem; }
.card h3 { font-size: 1rem; font-weight: 700; color: var(--white); margin-bottom: 0.25rem; }
.card p { color: var(--gray); font-size: 0.85rem; }

/* ===== TABLE → CARDS sur mobile ===== */
.table-wrapper { margin-top: 0.5rem; }

/* Vue carte sur mobile */
.table-card-list { display: flex; flex-direction: column; gap: 0.75rem; }
.table-card {
    background: var(--dark-2);
    border: 1px solid var(--dark-4);
    border-left: 4px solid var(--orange);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
}
.table-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--dark-3);
    font-size: 0.9rem;
}
.table-card-row:last-child { border-bottom: none; padding-bottom: 0; }
.table-card-row:first-child { padding-top: 0; }
.tc-label { color: var(--gray); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.4px; min-width: 80px; }
.tc-value { color: var(--white); font-weight: 500; text-align: right; }
.table-card-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 0.75rem; }

/* Vue tableau sur desktop */
.table-desktop {
    display: none;
    background: var(--dark-2);
    border: 1px solid var(--dark-4);
    border-radius: var(--radius);
    overflow: hidden;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
@media (min-width: 700px) {
    .table-card-list { display: none; }
    .table-desktop   { display: block; }
}
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.table thead tr {
    background: var(--dark-3);
    border-bottom: 2px solid var(--orange);
}
.table th {
    padding: 0.85rem 1rem;
    text-align: left;
    font-size: 0.73rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--orange);
    font-weight: 700;
    white-space: nowrap;
}
.table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--dark-3);
    color: var(--white);
    white-space: nowrap;
}
.table tbody tr:hover  { background: var(--dark-3); }
.table tbody tr:last-child td { border-bottom: none; }
.row-inactive { opacity: 0.45; }
.text-center { text-align: center; }
.text-muted  { color: var(--gray); }

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}
.badge-green { background: rgba(40,167,69,0.18);  color: #6fcf83; }
.badge-red   { background: rgba(220,53,69,0.18);  color: #ff8a94; }

/* ===== MODAL ===== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: flex-end;  /* glisse du bas sur mobile */
    justify-content: center;
}
.modal.hidden { display: none; }
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
.modal-box {
    position: relative;
    background: var(--dark-2);
    border: 1px solid var(--dark-4);
    border-top: 3px solid var(--orange);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 1.5rem 1.25rem;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: var(--shadow);
    z-index: 1;
}
/* Indicateur de glissement */
.modal-box::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: var(--dark-4);
    border-radius: 2px;
    margin: 0 auto 1.25rem;
}
.modal-box h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--orange);
}
.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 1.25rem;
}
.modal-actions .btn { width: 100%; }

@media (min-width: 600px) {
    .modal { align-items: center; }
    .modal-box {
        border-radius: var(--radius);
        max-width: 500px;
        padding: 2rem;
    }
    .modal-box::before { display: none; }
    .modal-actions { flex-direction: row; justify-content: flex-end; }
    .modal-actions .btn { width: auto; }
}

/* ===== LOGIN PAGE ===== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
    background: radial-gradient(ellipse at center, var(--dark-2) 0%, var(--black) 70%);
}
.login-container {
    background: var(--dark-2);
    border: 1px solid var(--dark-4);
    border-top: 3px solid var(--orange);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
}
@media (min-width: 480px) { .login-container { padding: 2.5rem 2rem; } }
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo-img { height: 80px; width: auto; object-fit: contain; margin: 0 auto 0.75rem; display: block; }
.login-logo h1 {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--orange);
    letter-spacing: 2px;
    text-transform: uppercase;
}
.login-subtitle { color: var(--gray-light); font-size: 0.9rem; margin-top: 0.2rem; }
.login-form .btn-primary { margin-top: 0.5rem; }

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    padding: 1.25rem 1rem;
    color: var(--gray);
    font-size: 0.78rem;
    border-top: 1px solid var(--dark-3);
    margin-top: 2rem;
}

/* ===== SCROLLBAR (desktop uniquement) ===== */
@media (min-width: 900px) {
    ::-webkit-scrollbar { width: 6px; height: 6px; }
    ::-webkit-scrollbar-track { background: var(--dark); }
    ::-webkit-scrollbar-thumb { background: var(--dark-4); border-radius: 3px; }
    ::-webkit-scrollbar-thumb:hover { background: var(--orange-dark); }
}

/* ===== SAFE AREA (iPhone avec encoche/barre home) ===== */
.navbar {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
}
.footer {
    padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
}

/* ===== BADGES SUPPLÉMENTAIRES ===== */
.badge-orange { background: rgba(255,107,0,0.18);  color: var(--orange); }
.badge-yellow { background: rgba(255,215,0,0.18);  color: var(--yellow); }
.badge-blue   { background: rgba(100,149,255,0.2); color: #82a8ff; }

/* ===== SECTION TITLE ===== */
.section-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--gray);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

/* ===== MODULE GRID (dashboard cards) ===== */
.module-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
}
@media (min-width: 480px) {
    .module-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
    .module-grid { grid-template-columns: repeat(3, 1fr); gap: 0.85rem; }
}
.module-card {
    background: var(--dark-2);
    border: 1px solid var(--dark-4);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    text-decoration: none;
    color: var(--white);
    min-height: 72px;
    -webkit-tap-highlight-color: transparent;
}
.module-card:hover, .module-card:active {
    border-color: var(--orange);
    background: var(--dark-3);
    color: var(--white);
}
.module-icon { font-size: 1.8rem; flex-shrink: 0; }
.module-body { flex: 1; min-width: 0; }
.module-body h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.1rem; }
.module-body p  { font-size: 0.8rem; color: var(--gray); }
.module-arrow { font-size: 1.3rem; color: var(--orange); flex-shrink: 0; }

/* ===== TABS ===== */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.tab-btn {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
    padding: 0 1.2rem;
    background: var(--dark-3);
    border: 1px solid var(--dark-4);
    border-radius: var(--radius);
    color: var(--gray-light);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.tab-btn.active, .tab-btn:hover {
    background: var(--orange);
    border-color: var(--orange);
    color: #fff;
}

/* ===== WEEK NAV ===== */
.week-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.week-nav-label {
    flex: 1;
    text-align: center;
    font-weight: 600;
    color: var(--white);
    font-size: 0.88rem;
}
.week-nav .btn { min-height: 40px; padding: 0 0.85rem; flex-shrink: 0; }

/* ===== SCHEDULE (employee view) ===== */
.schedule-list { display: flex; flex-direction: column; gap: 0.5rem; }
.schedule-day {
    background: var(--dark-2);
    border: 1px solid var(--dark-4);
    border-radius: var(--radius);
    padding: 0.9rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.schedule-today { border-color: var(--orange); background: rgba(255,107,0,0.06); }
.schedule-work  { border-left: 4px solid var(--green); }
.schedule-today.schedule-work { border-left: 4px solid var(--orange); }
.schedule-day-label {
    flex: 0 0 auto;
    min-width: 120px;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.schedule-dayname { font-weight: 700; color: var(--white); font-size: 0.9rem; }
.schedule-date    { color: var(--gray); font-size: 0.78rem; }
.schedule-day-shift { flex: 1; text-align: right; }
.schedule-hours { font-size: 1rem; font-weight: 700; color: var(--yellow); }
.schedule-note  { display: block; font-size: 0.78rem; color: var(--gray); margin-top: 0.2rem; }
.schedule-rest  { color: var(--gray); font-size: 0.88rem; }

/* ===== PLANNING GRID (admin) ===== */
.planning-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--dark-2);
    border: 1px solid var(--dark-4);
    border-radius: var(--radius);
}
.planning-table { border-collapse: collapse; min-width: 680px; width: 100%; }
.planning-table th {
    background: var(--dark-3);
    border-bottom: 2px solid var(--orange);
    padding: 0.6rem 0.5rem;
    text-align: center;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--orange);
    font-weight: 700;
    white-space: nowrap;
}
.planning-day-header.today { color: var(--yellow) !important; }
.planning-table td {
    padding: 0.35rem 0.4rem;
    border: 1px solid var(--dark-3);
    text-align: center;
    vertical-align: middle;
    font-size: 0.8rem;
}
.planning-table td.emp-name {
    text-align: left;
    font-weight: 600;
    color: var(--white);
    white-space: nowrap;
    padding-left: 0.85rem;
    min-width: 130px;
}
.planning-today { background: rgba(255,107,0,0.06) !important; }
.planning-cell {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--orange-light);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.3rem;
    border-radius: 4px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    transition: background 0.15s;
}
.planning-cell:hover { background: rgba(255,107,0,0.12); }
.shift-hours { color: var(--yellow); font-size: 0.72rem; }
.planning-cell-empty {
    background: none;
    border: 1px dashed var(--dark-4);
    cursor: pointer;
    color: var(--dark-4);
    font-size: 1rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    width: 100%;
    transition: all 0.15s;
}
.planning-cell-empty:hover { border-color: var(--orange); color: var(--orange); background: rgba(255,107,0,0.06); }

/* ===== CHECKBOX GROUP ===== */
.checkbox-group { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.checkbox-item  {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.92rem;
    color: var(--white);
    cursor: pointer;
    min-height: 36px;
}
.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--orange);
    cursor: pointer;
}

/* ===== TASK ITEM ===== */
.task-item {
    background: var(--dark-2);
    border: 1px solid var(--dark-4);
    border-radius: var(--radius);
    padding: 0.9rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    transition: border-color 0.2s;
}
.task-item.done { border-left: 4px solid var(--green); }
.task-item-icon { font-size: 1.3rem; flex-shrink: 0; }
.task-item-body { flex: 1; min-width: 0; }
.task-item-name { font-weight: 600; color: var(--white); font-size: 0.92rem; }
.task-item-sub  { color: var(--gray); font-size: 0.78rem; margin-top: 0.15rem; }
.task-item-action { flex-shrink: 0; }

/* ===== SIGNATURE PAD ===== */
.sig-wrapper {
    background: #fff;
    border: 2px solid var(--dark-4);
    border-radius: var(--radius);
    overflow: hidden;
    touch-action: none;
}
.sig-canvas {
    display: block;
    width: 100%;
    height: 150px;
    cursor: crosshair;
}
.sig-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}
.sig-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-light);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== PHOTO PREVIEW ===== */
.photo-preview {
    width: 100%;
    max-height: 160px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--dark-4);
    display: none;
    margin-top: 0.5rem;
}
.photo-preview.show { display: block; }

/* ===== INVENTORY FORM ===== */
.inv-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--dark-3);
}
.inv-row:last-child { border-bottom: none; }
.inv-name  { flex: 1; font-size: 0.88rem; color: var(--white); }
.inv-unit  { color: var(--gray); font-size: 0.78rem; white-space: nowrap; min-width: 36px; text-align: right; }
.inv-input {
    width: 88px;
    padding: 0.45rem 0.65rem;
    background: var(--dark-3);
    border: 1px solid var(--dark-4);
    border-radius: 6px;
    color: var(--white);
    font-size: 1rem;
    text-align: right;
    -webkit-appearance: none;
    flex-shrink: 0;
}
.inv-input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 2px rgba(255,107,0,0.15); }

/* ===== DOCUMENT ITEM ===== */
.doc-item {
    background: var(--dark-2);
    border: 1px solid var(--dark-4);
    border-radius: var(--radius);
    padding: 0.9rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.doc-icon { font-size: 1.5rem; flex-shrink: 0; }
.doc-body { flex: 1; min-width: 0; }
.doc-name { font-weight: 600; color: var(--white); font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-meta { color: var(--gray); font-size: 0.77rem; margin-top: 0.15rem; }
.doc-actions { flex-shrink: 0; display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* ===== LIVRAISON CARDS ===== */
.livraison-card {
    background: var(--dark-2);
    border: 1px solid var(--dark-4);
    border-left: 4px solid var(--yellow);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    margin-bottom: 0.75rem;
}
.livraison-ville { font-size: 1.05rem; font-weight: 700; color: var(--yellow); }
.livraison-zone  { color: var(--orange); font-size: 0.88rem; margin-top: 0.15rem; }
.livraison-note  { color: var(--gray); font-size: 0.82rem; margin-top: 0.4rem; line-height: 1.5; }

/* ===== CARTE PLACEHOLDER ===== */
.carte-placeholder {
    text-align: center;
    padding: 5rem 2rem 3rem;
    color: var(--gray);
}
.carte-placeholder .icon { font-size: 4rem; margin-bottom: 1rem; display: block; }
.carte-placeholder h3 { color: var(--white); font-size: 1.4rem; margin-bottom: 0.5rem; }

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray);
    background: var(--dark-2);
    border: 1px solid var(--dark-4);
    border-radius: var(--radius);
}
.empty-state .icon { font-size: 2.5rem; margin-bottom: 0.75rem; display: block; }
.empty-state p { font-size: 0.88rem; }
