/* ════════════════════════════════════════
   THÈME ARDOISE & CRAIE — Liste de Courses
   ════════════════════════════════════════ */
:root {
    --slate:           #1e1e1e;
    --slate-mid:       #2a2a2a;
    --slate-light:     #333333;
    --slate-border:    #3a3a3a;
    --chalk:           #e8c97a;
    --chalk-light:     #f0dca0;
    --chalk-dark:      #c8a950;
    --chalk-muted:     rgba(232,201,122,0.10);
    --chalk-border:    rgba(232,201,122,0.22);
    --chalk-green:     #a8d8a8;
    --chalk-red:       #e07070;
    --chalk-red-muted: rgba(224,112,112,0.12);
    --text-bright:     #f0ebe0;
    --text-mid:        #b8b0a0;
    --text-dim:        #7a7060;
    --radius:          10px;
    --radius-sm:       7px;
    --transition:      0.15s ease;
}

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

body {
    background: var(--slate);
    font-family: 'DM Sans', sans-serif;
    color: var(--text-bright);
    min-height: 100vh;
    -webkit-tap-highlight-color: transparent;
}

/* ── ÉCRANS ── */
.screen { min-height: 100vh; }
.hidden { display: none !important; }

/* ══════════════ LOGIN ══════════════ */
.login-bg {
    position: fixed; inset: 0; z-index: 0;
    background-color: #1e1e1e;
    background-image:
        linear-gradient(to bottom, rgba(30,30,30,0.6) 0%, rgba(30,30,30,0.92) 55%, rgba(30,30,30,1) 100%),
        url('./hero-bg.jpg');
    background-position: center top;
    background-size: cover;
    background-repeat: no-repeat;
}
.login-card {
    position: relative; z-index: 1;
    width: 100%; max-width: 380px;
    margin: 0 auto;
    padding: 44px 36px 40px;
    top: 50vh; transform: translateY(-50%);
    background: rgba(42,42,42,0.92);
    border: 1px solid var(--slate-border);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.6);
    backdrop-filter: blur(12px);
    animation: fadeUp 0.4s ease;
}
@keyframes fadeUp {
    from { opacity:0; transform: translateY(calc(-50% + 20px)); }
    to   { opacity:1; transform: translateY(-50%); }
}
.login-icon {
    width: 64px; height: 64px;
    background: var(--chalk-muted);
    border: 1.5px solid var(--chalk-border);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; color: var(--chalk);
    margin: 0 auto 20px;
}
.login-title {
    font-family: 'Caveat', cursive;
    font-size: 32px; font-weight: 700;
    color: var(--chalk); text-align: center;
    margin-bottom: 4px;
}
.login-sub { color: var(--text-dim); font-size: 13px; text-align: center; margin-bottom: 28px; }

.input-wrap { position: relative; margin-bottom: 12px; }
.input-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--text-dim); font-size: 15px; pointer-events: none;
}
.input-wrap input, .field-input {
    width: 100%; padding: 11px 14px 11px 40px;
    background: var(--slate-light);
    border: 1.5px solid var(--slate-border);
    border-radius: var(--radius-sm);
    color: var(--text-bright); font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}
.field-input { padding-left: 14px; }
.input-wrap input:focus, .field-input:focus {
    border-color: var(--chalk-dark);
    box-shadow: 0 0 0 3px rgba(232,201,122,0.12);
}
.login-error {
    color: var(--chalk-red); font-size: 12.5px;
    margin-bottom: 10px; text-align: center;
    animation: shake 0.3s ease;
}
@keyframes shake {
    0%,100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* ══════════════ BOUTONS ══════════════ */
.btn-chalk {
    display: inline-flex; align-items: center; gap: 7px;
    background: var(--chalk); color: var(--slate) !important;
    border: none; padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 13.5px; font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer; transition: all var(--transition);
    white-space: nowrap;
}
.btn-chalk:hover {
    background: var(--chalk-light);
    box-shadow: 0 0 16px rgba(232,201,122,0.30);
}
.btn-chalk:active { transform: scale(0.97); }
.btn-chalk.btn-sm { padding: 7px 14px; font-size: 12.5px; }

.btn-outline {
    display: inline-flex; align-items: center; gap: 7px;
    background: transparent;
    border: 1.5px solid var(--slate-border);
    color: var(--text-mid); padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 13.5px; font-family: 'DM Sans', sans-serif;
    cursor: pointer; transition: all var(--transition);
}
.btn-outline:hover { border-color: var(--chalk-border); color: var(--chalk); }
.btn-outline.btn-sm { padding: 7px 13px; font-size: 12.5px; }

.btn-danger {
    display: inline-flex; align-items: center; gap: 7px;
    background: var(--chalk-red-muted);
    border: 1.5px solid rgba(224,112,112,0.3);
    color: var(--chalk-red); padding: 7px 13px;
    border-radius: var(--radius-sm);
    font-size: 12.5px; font-family: 'DM Sans', sans-serif;
    cursor: pointer; transition: all var(--transition);
}
.btn-danger:hover { background: rgba(224,112,112,0.2); border-color: var(--chalk-red); }
.btn-danger.btn-sm { padding: 7px 13px; font-size: 12.5px; }
.btn-danger-outline { color: var(--chalk-red); border-color: rgba(224,112,112,0.3); }
.btn-danger-outline:hover { border-color: var(--chalk-red); color: var(--chalk-red); background: var(--chalk-red-muted); }

.btn-icon {
    background: none; border: none; cursor: pointer;
    color: var(--text-dim); font-size: 17px;
    padding: 6px; border-radius: 7px;
    transition: all var(--transition);
    display: inline-flex; align-items: center; justify-content: center;
}
.btn-icon:hover { color: var(--chalk); background: var(--chalk-muted); }

.w100 { width: 100%; justify-content: center; }

/* ══════════════ NAVBAR ══════════════ */
.app-navbar {
    background: #141414;
    height: 62px;
    display: flex; align-items: center;
    padding: 0 16px;
    position: sticky; top: 0; z-index: 100;
    border-bottom: 1px solid var(--slate-border);
    box-shadow: 0 2px 20px rgba(0,0,0,0.5);
    gap: 12px;
}
.brand {
    font-family: 'Caveat', cursive;
    font-size: 21px; font-weight: 700;
    color: var(--chalk);
    display: flex; align-items: center; gap: 9px;
    flex-shrink: 0;
}
.brand-icon {
    width: 34px; height: 34px;
    background: var(--chalk-muted);
    border: 1.5px solid var(--chalk-border);
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px;
}
.nav-tabs {
    display: flex; align-items: center; gap: 2px;
    flex: 1; margin-left: 8px;
}
.nav-tab {
    display: flex; align-items: center; gap: 6px;
    background: none; border: 1px solid transparent;
    color: var(--text-mid); font-size: 13px;
    font-family: 'DM Sans', sans-serif;
    padding: 7px 12px; border-radius: 8px;
    cursor: pointer; transition: all var(--transition);
    white-space: nowrap;
}
.nav-tab:hover { color: var(--chalk); background: var(--chalk-muted); }
.nav-tab.active {
    color: var(--chalk); background: var(--chalk-muted);
    border-color: var(--chalk-border);
}
.nav-right { margin-left: auto; }

/* ══════════════ FOND HERO GLOBAL ══════════════ */
#screen-app {
    position: relative;
    min-height: 100vh;
}
#screen-app::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    background-image:
        linear-gradient(to bottom,
            rgba(20,20,20,0.55) 0%,
            rgba(20,20,20,0.72) 40%,
            rgba(20,20,20,0.88) 70%,
            rgba(20,20,20,0.97) 100%),
        url('./hero-bg.jpg');
    background-position: center top;
    background-size: cover;
    background-repeat: no-repeat;
    pointer-events: none;
}

/* La navbar doit passer devant le pseudo-element */
.app-navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(14,14,14,0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--slate-border);
    box-shadow: 0 2px 20px rgba(0,0,0,0.5);
}

/* ══════════════ CONTENU TABS ══════════════ */
.tab-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto;
    padding: 24px 16px 80px;
}
@media (max-width: 768px) {
    .tab-content {
        max-width: 100%;
        padding: 16px 10px 120px;
    }
}

.page-header {
    display: flex; align-items: flex-start;
    justify-content: space-between; gap: 12px;
    margin-bottom: 18px;
}
.page-title {
    font-family: 'Caveat', cursive;
    font-size: 26px; font-weight: 700;
    color: var(--chalk); line-height: 1.1;
}
.page-sub { color: var(--text-dim); font-size: 12.5px; margin-top: 2px; }
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }

/* ══════════════ BARRE D'AJOUT ══════════════ */
.add-block {
    display: flex; flex-direction: column; gap: 8px;
    margin-bottom: 16px;
}
.add-row-name { display: flex; gap: 8px; }
.add-row-qty  { display: flex; gap: 8px; align-items: stretch; }

.add-bar { display: flex; gap: 8px; margin-bottom: 16px; align-items: center; }
.add-bar.mini { margin-bottom: 12px; }

.add-input-wrap {
    flex: 1; display: flex; align-items: center;
    background: rgba(42,42,42,0.88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1.5px solid var(--slate-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.add-input-wrap:focus-within {
    border-color: var(--chalk-dark);
    box-shadow: 0 0 0 3px rgba(232,201,122,0.10);
}
.add-icon { padding: 0 14px; color: var(--text-dim); font-size: 22px; flex-shrink: 0; }

/* Ligne 1 : nom */
.add-input-wrap input[type="text"] {
    flex: 1; background: none; border: none;
    color: var(--text-bright); font-size: 20px;
    font-family: 'DM Sans', sans-serif;
    padding: 16px 12px; outline: none; min-width: 0;
}
.add-input-wrap input[type="text"]::placeholder { color: var(--text-dim); }

/* Ligne 2 : quantité + unité */
.add-input-wrap.qty-line { flex: 1; }
.add-input-wrap.qty-line input[type="number"] {
    flex: 1; background: none; border: none;
    color: var(--chalk); font-size: 20px;
    font-family: 'DM Sans', sans-serif;
    padding: 14px 12px; outline: none; text-align: left; min-width: 0;
}
.add-input-wrap.qty-line select {
    background: var(--slate-light); border: none;
    border-left: 1px solid var(--slate-border);
    color: var(--text-mid); font-size: 18px;
    font-family: 'DM Sans', sans-serif;
    padding: 0 12px; outline: none; cursor: pointer;
    min-width: 110px;
}
.btn-add {
    flex-shrink: 0;
    font-size: 18px !important;
    padding: 14px 20px !important;
    border-radius: var(--radius-sm) !important;
}

/* Ancien qty-wrap conservé pour les modales */
.qty-wrap {
    display: flex; align-items: stretch;
    border-left: 1px solid var(--slate-border);
    flex-shrink: 0;
}
.qty-wrap input[type="number"] {
    width: 52px; background: none; border: none;
    color: var(--chalk); font-size: 18px;
    font-family: 'DM Sans', sans-serif;
    padding: 0 8px; outline: none; text-align: center;
}
.qty-wrap select {
    background: var(--slate-light); border: none;
    border-left: 1px solid var(--slate-border);
    color: var(--text-mid); font-size: 16px;
    font-family: 'DM Sans', sans-serif;
    padding: 0 8px; outline: none; cursor: pointer;
    max-width: 90px;
}

/* ══════════════ LISTE D'ARTICLES ══════════════ */
.item-list { display: flex; flex-direction: column; gap: 0; }
.item-list.mini { margin-top: 8px; }

.item-row {
    display: flex; align-items: center; gap: 16px;
    background: rgba(25,25,25,0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: none;
    border-bottom: 1px solid var(--slate-border);
    border-radius: 0;
    padding: 22px 14px;
    transition: all 0.25s ease;
    animation: slideIn 0.2s ease;
    cursor: default;
}
.item-list .item-row:first-child { border-top: 1px solid var(--slate-border); border-radius: 14px 14px 0 0; }
.item-list .item-row:last-child  { border-radius: 0 0 14px 14px; }
.item-list .item-row:only-child  { border-radius: 14px; }
@keyframes slideIn {
    from { opacity:0; transform: translateY(-6px); }
    to   { opacity:1; transform: translateY(0); }
}
.item-row:hover { border-color: var(--chalk-border); }
.item-row.checked {
    opacity: 0.5;
    border-color: var(--slate-border);
}
.item-row.checked .item-name { text-decoration: line-through; color: var(--text-dim); }

/* Checkbox custom */
.item-check {
    width: 52px; height: 52px; border-radius: 14px;
    border: 2.5px solid rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.05);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: all var(--transition);
    color: transparent; font-size: 24px;
}
.item-check:hover { border-color: var(--chalk); }
.item-check.done {
    background: var(--chalk); border-color: var(--chalk);
    color: var(--slate);
}
.item-check.done::after { content: '✓'; font-weight: 700; }

.item-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}
.item-name { font-size: 24px; font-weight: 500; min-width: 0; line-height: 1.2; }
.item-qty {
    font-size: 15px; color: var(--chalk);
    background: var(--chalk-muted);
    border: 1px solid var(--chalk-border);
    border-radius: 8px; padding: 5px 13px;
    white-space: nowrap;
    align-self: flex-start;
    display: inline-block;
}
.item-delete {
    background: none; border: none; cursor: pointer;
    color: var(--text-dim); font-size: 24px;
    min-width: 52px; min-height: 52px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 12px; transition: all var(--transition);
    flex-shrink: 0;
}
.item-delete:hover { color: var(--chalk-red); background: var(--chalk-red-muted); }

/* État vide */
.empty-state {
    text-align: center; padding: 60px 20px;
    color: var(--text-dim);
}
.empty-state i { font-size: 48px; display: block; margin-bottom: 14px; opacity: 0.4; }
.empty-state p { font-size: 14px; }

/* ══════════════ MODÈLES ══════════════ */
.templates-grid { display: flex; flex-direction: column; gap: 10px; }

.template-card {
    background: rgba(42,42,42,0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1.5px solid var(--slate-border);
    border-radius: var(--radius);
    padding: 14px 16px;
    transition: border-color var(--transition);
    animation: slideIn 0.2s ease;
}
.template-card:hover { border-color: var(--chalk-border); }
.template-card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px;
}
.template-card-title {
    font-family: 'Caveat', cursive;
    font-size: 20px; color: var(--chalk);
}
.template-card-meta { font-size: 12px; color: var(--text-dim); margin-bottom: 10px; }
.template-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.template-preview {
    font-size: 12px; color: var(--text-mid);
    display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px;
}
.template-preview-tag {
    background: var(--slate-light);
    border: 1px solid var(--slate-border);
    border-radius: 4px; padding: 2px 7px;
}

/* ══════════════ HISTORIQUE ══════════════ */
.search-wrap {
    position: relative; margin-bottom: 14px;
}
.search-icon {
    position: absolute; left: 12px; top: 50%;
    transform: translateY(-50%); color: var(--text-dim); font-size: 14px;
    pointer-events: none;
}
.search-wrap input {
    width: 100%; padding: 9px 12px 9px 36px;
    background: var(--slate-mid);
    border: 1.5px solid var(--slate-border);
    border-radius: var(--radius-sm);
    color: var(--text-bright); font-size: 13.5px;
    font-family: 'DM Sans', sans-serif; outline: none;
    transition: border-color var(--transition);
}
.search-wrap input:focus { border-color: var(--chalk-dark); }

.history-item {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    background: rgba(42,42,42,0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1.5px solid var(--slate-border);
    border-radius: var(--radius); padding: 9px 12px;
    transition: border-color var(--transition);
    animation: slideIn 0.2s ease;
}
.history-item:hover { border-color: var(--chalk-border); }
.history-item-name { font-size: 14px; flex: 1; }
.history-item-date { font-size: 11px; color: var(--text-dim); }
.history-add-btn {
    background: var(--chalk-muted);
    border: 1px solid var(--chalk-border);
    color: var(--chalk); font-size: 13px;
    border-radius: var(--radius-sm); padding: 4px 10px;
    cursor: pointer; transition: all var(--transition);
    font-family: 'DM Sans', sans-serif; white-space: nowrap;
}
.history-add-btn:hover { background: var(--chalk); color: var(--slate); }
.history-item.selected-for-add { border-color: var(--chalk); background: rgba(232,201,122,0.06); }
.history-item.selected-for-add .history-add-btn { background: var(--chalk); color: var(--slate); }

/* ══════════════ MODALES ══════════════ */
.modal-overlay {
    position: fixed; inset: 0; z-index: 500;
    background: rgba(0,0,0,0.65);
    display: flex; align-items: center; justify-content: center;
    padding: 20px; backdrop-filter: blur(4px);
    animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

.modal-card {
    background: var(--slate-mid);
    border: 1.5px solid var(--slate-border);
    border-radius: 16px;
    width: 100%; max-width: 500px;
    max-height: 85vh;
    display: flex; flex-direction: column;
    box-shadow: 0 24px 60px rgba(0,0,0,0.6);
    animation: slideUp 0.2s ease;
}
@keyframes slideUp {
    from { transform: translateY(16px); opacity:0; }
    to   { transform: translateY(0); opacity:1; }
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--slate-border);
}
.modal-title {
    font-family: 'Caveat', cursive;
    font-size: 22px; color: var(--chalk);
    display: flex; align-items: center; gap: 8px;
}
.modal-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--slate-border);
    display: flex; justify-content: flex-end; gap: 10px;
}

.field-label { display: block; font-size: 11.5px; color: var(--text-dim); margin-bottom: 5px; }
.field-label.mt { margin-top: 16px; }

/* ══════════════ TOAST ══════════════ */
.toast {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    background: var(--slate-light);
    border: 1.5px solid var(--chalk-border);
    color: var(--text-bright); padding: 10px 20px;
    border-radius: 30px; font-size: 13px;
    z-index: 9999; box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    animation: toastIn 0.2s ease;
    white-space: nowrap;
}
@keyframes toastIn {
    from { opacity:0; transform: translateX(-50%) translateY(10px); }
    to   { opacity:1; transform: translateX(-50%) translateY(0); }
}

/* ══════════════ RESPONSIVE MOBILE ══════════════ */

/* Agrandir dès 768px (toutes les tablettes et téléphones) */
@media (max-width: 768px) {

    /* ── Navbar ── */
    .app-navbar { height: 58px; padding: 0 10px; gap: 4px; }
    .brand-name { display: none; }
    .brand-icon { width: 36px; height: 36px; font-size: 17px; }
    .nav-tabs { margin-left: 4px; gap: 0; }
    .nav-tab { padding: 10px 14px; }
    .nav-tab span { font-size: 14px; }
    .nav-tab i { font-size: 18px; }
    .btn-icon { font-size: 20px; padding: 8px; }

    /* ── Contenu ── */
    .tab-content { padding: 18px 14px 120px; }
    .page-title { font-size: 28px; }
    .page-sub { font-size: 13px; margin-top: 2px; }

    /* ── Barre d'ajout ── */
    .add-bar { gap: 10px; margin-bottom: 18px; }
    .add-input-wrap { border-radius: 12px; }
    .add-input-wrap input[type="text"] {
        font-size: 17px;
        padding: 15px 8px;
    }
    .add-icon { font-size: 20px; padding: 0 14px; }
    .qty-wrap input[type="number"] {
        width: 52px; font-size: 16px; padding: 0 8px;
    }
    .qty-wrap select { font-size: 15px; padding: 0 8px; max-width: 80px; }
    .btn-chalk { padding: 15px 20px; font-size: 20px; border-radius: 12px; }

    /* ── Liste d'articles ── */
    .item-list { gap: 8px; }
    .item-row {
        padding: 18px 14px;
        gap: 16px;
        border-radius: 12px;
        border-width: 1px;
        border-left: none;
        border-right: none;
        border-radius: 0;
    }
    .item-list .item-row:first-child { border-radius: 12px 12px 0 0; }
    .item-list .item-row:last-child  { border-radius: 0 0 12px 12px; }
    .item-list .item-row:only-child  { border-radius: 12px; }

    /* ── Case à cocher ── */
    .item-check {
        width: 46px !important;
        height: 46px !important;
        min-width: 46px;
        border-radius: 12px !important;
        border-width: 2px !important;
        font-size: 20px !important;
        align-self: center;
    }
    .item-check.done::after { font-size: 19px; }

    /* ── Corps article (nom + qty) ── */
    .item-body { gap: 6px; }
    .item-name { font-size: 22px; font-weight: 500; }
    .item-qty { font-size: 14px; padding: 5px 12px; border-radius: 7px; }

    /* ── Bouton supprimer ── */
    .item-delete {
        font-size: 22px;
        padding: 10px 12px;
        min-width: 46px;
        min-height: 46px;
        display: flex; align-items: center; justify-content: center;
        border-radius: 10px;
        align-self: center;
    }

    /* ── Header actions ── */
    .header-actions { gap: 8px; }
    .btn-danger { font-size: 13px; padding: 10px 13px; }
    .btn-outline.btn-sm { padding: 10px 14px; font-size: 14px; }
    .btn-chalk.btn-sm { padding: 10px 16px; font-size: 14px; }

    /* ── Historique ── */
    .history-item { padding: 14px 12px; }
    .history-item-name { font-size: 16px; }
    .history-item-date { display: none; }
    .history-add-btn { padding: 10px 14px; font-size: 15px; min-height: 40px; border-radius: 9px; }

    /* ── Modèles ── */
    .template-card { padding: 18px; border-radius: 14px; }
    .template-card-title { font-size: 24px; }
    .template-card-meta { font-size: 13px; }
    .template-preview-tag { font-size: 13px; padding: 3px 9px; }

    /* ── Search ── */
    .search-wrap input { font-size: 16px; padding: 13px 12px 13px 38px; }
    .search-icon { font-size: 16px; }

    /* ── Modales ── */
    .modal-overlay { padding: 0; align-items: flex-end; }
    .modal-card {
        max-height: 92vh;
        border-radius: 22px 22px 0 0;
        border-bottom: none;
    }
    .modal-title { font-size: 24px; }
    .modal-header { padding: 20px 20px 14px; }
    .modal-body { padding: 16px 20px; }
    .modal-footer { padding: 14px 20px; gap: 12px; }
    .modal-footer .btn-chalk,
    .modal-footer .btn-outline { padding: 13px 20px; font-size: 15px; flex: 1; justify-content: center; }

    /* ── Champs de formulaire ── */
    .field-input { font-size: 16px; padding: 13px 14px; }
    .field-label { font-size: 13px; }

    /* ── Barre d'ajout dans modale ── */
    .add-bar.mini .add-input-wrap input[type="text"] { font-size: 16px; padding: 12px 6px; }
    .item-list.mini .item-row { padding: 12px 10px; }
    .item-list.mini .item-name { font-size: 15px; }
}

/* Très petits écrans (< 380px) */
@media (max-width: 380px) {
    .nav-tab span { display: none; }
    .nav-tab i { font-size: 20px; }
    .nav-tab { padding: 10px 12px; }
    .page-title { font-size: 26px; }
    .item-name { font-size: 16px; }
    .header-actions { gap: 6px; }
}

/* ══════════════ SYNC INDICATOR ══════════════ */
.sync-dot {
    width: 7px; height: 7px;
    border-radius: 50%; margin-left: 8px;
    display: inline-block; flex-shrink: 0;
    background: var(--chalk-green);
    box-shadow: 0 0 6px var(--chalk-green);
    transition: background 0.3s;
}
.sync-dot.syncing { background: var(--chalk); box-shadow: 0 0 6px var(--chalk); animation: pulse 0.8s infinite; }
.sync-dot.error { background: var(--chalk-red); box-shadow: 0 0 6px var(--chalk-red); }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.4; } }
