/* ancien.css — styles des pages pas encore refaites (repris de l'ancien base.html). */
:root {
    --neutral:        #56616e;
    --neutral-dark:   #121a24;
    --neutral-medium: #56616e;
    --neutral-light:  #eef1f4;
    --neutral-border: #dde3ea;
    --neutral-text:   #121a24;

    --section-color:  #56616e;
    --section-light:  #eef1f4;
    --section-border: #dde3ea;
    --section-text:   #121a24;
}

body {
    font-family: 'Barlow', system-ui, sans-serif;
    color: var(--neutral-text);
    background: var(--neutral-light);
}

.nav-bg { background: var(--neutral-dark); }

.section-header { background: var(--section-color) !important; color: white; }
.section-btn    { background: var(--section-color); color: white; cursor: pointer; }
.section-btn:hover { opacity: 0.85; }
.section-badge  { background: var(--section-light); color: var(--section-text); border: 1px solid var(--section-border); }
.section-border { border-left: 4px solid var(--section-color); }
.section-link   { color: var(--section-color); }
.section-tag    { background: var(--section-light); color: var(--section-text); padding: 2px 8px; border-radius: 4px; font-size: 0.75rem; }

.n-bg        { background: var(--neutral-light); }
.n-card      { background: white; border-radius: 0.75rem; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.n-border    { border: 1px solid var(--neutral-border); }
.n-text      { color: var(--neutral-text); }
.n-text-soft { color: var(--neutral-medium); }
.n-input     {
    border: 1px solid var(--neutral-border);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    width: 100%;
    font-family: 'Barlow', system-ui, sans-serif;
    color: var(--neutral-text);
}
.n-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--section-border);
}
.n-btn-outline {
    border: 1px solid var(--neutral-border);
    border-radius: 0.5rem;
    padding: 0.5rem 1.5rem;
    color: var(--neutral-text);
    background: white;
    cursor: pointer;
}
.n-btn-outline:hover { background: var(--neutral-light); }
.n-divider   { border-top: 1px solid var(--neutral-border); }
.n-row-hover:hover { background: var(--neutral-light); }

.ts-wrapper .ts-control {
    border: 1px solid var(--neutral-border);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-family: 'Barlow', system-ui, sans-serif;
    color: var(--neutral-text);
}
.ts-wrapper.focus .ts-control {
    outline: none;
    box-shadow: 0 0 0 2px var(--section-border);
}

.nav-suppliers { color: #2452b8; }
.nav-products  { color: #2452b8; }
.nav-recipes   { color: #2452b8; }
.nav-params    { color: #2452b8; }

/* Inline row edit */
.row-editable { cursor: pointer; }
.row-edit-form { display: none; background: var(--neutral-light); }
.row-edit-form.active { display: table-row; }

/* Quick create catégorie */
.quick-create-panel {
    display: none;
    background: white;
    border: 1px solid var(--neutral-border);
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-top: 0.5rem;
}
.quick-create-panel.active { display: block; }

/* ─── OPTGROUP ────────────────────────────────────────────── */
optgroup {
    font-style: normal;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
optgroup[label^="⚖"] { color: #4a8a5e; }
optgroup[label^="💧"] { color: #3a6a9e; }
optgroup[label^="🔢"] { color: #a0644d; }
optgroup[label^="🍽"] { color: #7a5aa0; }

/* ─── RESPONSIVE MOBILE ─────────────────────────────────── */
/* Tableaux : scroll horizontal sur mobile */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
/* Colonnes à cacher sur mobile */
/* ─── MOBILE < 640px ──────────────────────────────────────── */
@media (max-width: 640px) {
    .hide-mobile { display: none !important; }
    .show-mobile { display: block !important; }
    .n-input { font-size: 1rem !important; min-height: 2.75rem; padding: 0.5rem 0.75rem; }
    .section-btn, .n-btn-outline { min-height: 2.75rem; padding: 0.5rem 1rem; }
    main { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
    body { font-size: 0.9375rem; }
    td, th { padding: 0.4rem 0.4rem !important; font-size: 0.8125rem !important; }
    .mobile-stack { grid-template-columns: 1fr !important; }
    .mobile-stack-2 { grid-template-columns: 1fr 1fr !important; }
    .inline-editable { padding: 6px 4px; min-height: 2rem; display: inline-block; }
    #delete-modal > div { width: 95% !important; max-height: 90vh !important; }
    #mobile-menu a { padding: 0.75rem 0; font-size: 1.1rem; border-bottom: 1px solid rgba(255,255,255,0.1); }
    .header-grid { grid-template-columns: 1fr !important; gap: 0.75rem !important; }
    .detail-cols { grid-template-columns: 1fr !important; }
    .scale-bar { flex-wrap: wrap !important; gap: 0.5rem !important; }
    .stat-grid { grid-template-columns: 1fr 1fr !important; }
}
/* ─── TABLETTE 641-1024px ──────────────────────────────────── */
@media (max-width: 1024px) {
    .hide-tablet { display: none !important; }
    .n-input { min-height: 2.5rem; }
    .tablet-stack { grid-template-columns: 1fr !important; }
    td, th { padding: 0.5rem 0.5rem !important; }
}
/* ─── TABLES SCROLLABLES ───────────────────────────────────── */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-responsive table { min-width: 480px; }

/* ─── Harmonisation des pages pas encore refaites avec la nouvelle interface ─── */
body.ui .ancien { --section-color: #121a24; --section-light: #e4ebf7; --section-border: #dde3ea; --section-text: #1b3f8f; }
body.ui .ancien .n-card { border-radius: 14px; box-shadow: 0 1px 2px rgba(60,40,20,.06), 0 1px 3px rgba(60,40,20,.08); }
body.ui .ancien .n-input, body.ui .ancien select.n-input, body.ui .ancien .ts-wrapper .ts-control {
    min-height: 46px; border: 1.5px solid #dde3ea; border-radius: 8px; font-size: 16px; padding: 10px 12px; }
body.ui .ancien .n-input:focus { border-color: #2452b8; box-shadow: 0 0 0 3px rgba(36,82,184,.18); }
body.ui .ancien .section-btn { background: #121a24; color: #fff; border-radius: 8px; min-height: 44px; font-weight: 650;
    display: inline-flex; align-items: center; justify-content: center; padding-left: 18px; padding-right: 18px; }
body.ui .ancien .n-btn-outline { border: 1.5px solid #dde3ea; border-radius: 8px; min-height: 44px; font-weight: 600; }
body.ui .ancien .section-header { background: #e4e9f0 !important; color: #1b3f8f !important; font-weight: 700; }
body.ui .ancien h1 { color: #121a24; letter-spacing: -.01em; }
body.ui .ancien .section-link { color: #121a24; }
body.ui .ancien table { border-collapse: collapse; }
body.ui .ancien td, body.ui .ancien th { border-color: #e4e9f0; }
body.ui .ancien a.section-link:hover { text-decoration: underline; }
@media (max-width: 640px) {
    body.ui .ancien h1 { font-size: 22px; }
    body.ui .ancien .n-card { border-radius: 8px; }
}
