/* =========================================================
   Windowseco — Back-office Admin
   Branding windowseco.be — #1177bc / Roboto
   ========================================================= */

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

:root {
    --bg: #faf9f5;
    --surface: #ffffff;
    --surface-2: #f8f8f6;
    --surface-3: #f0f0ec;
    --border: #e4e4e0;
    --border-strong: #d0d0cb;
    --text: #3c3c3b;
    --text-2: #5a5a58;
    --text-3: #8a8a86;
    --text-4: #b0b0ac;

    --accent: #1177bc;
    --accent-2: #4499d0;
    --accent-soft: #e8f3fb;
    --accent-softer: #f2f8fd;
    --accent-ink: #0d4f84;

    --ok: #10b981;
    --ok-soft: #dcfce7;
    --ok-ink: #15803d;
    --warn: #f59e0b;
    --warn-soft: #fef3c7;
    --warn-ink: #92400e;
    --err: #dc2626;
    --err-soft: #fee2e2;
    --err-ink: #991b1b;

    --radius-sm: 4px;
    --radius: 6px;
    --radius-lg: 10px;
    --radius-xl: 14px;

    --shadow-sm: 0 1px 2px rgba(17, 119, 188, 0.04);
    --shadow-md: 0 1px 3px rgba(17, 119, 188, 0.06), 0 8px 24px -12px rgba(17, 119, 188, 0.08);
    --shadow-lg: 0 30px 80px -20px rgba(17, 119, 188, 0.25);

    --font-sans: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;

    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

body {
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent-ink); }
button, input, textarea, select { font-family: inherit; font-size: 14px; color: inherit; }
code { font-family: var(--font-mono); font-size: 12px; background: var(--surface-3); padding: 1px 6px; border-radius: 5px; color: var(--accent-ink); }

/* =========================================================
   Layout
   ========================================================= */
.admin-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
    background: var(--bg);
}
@media (max-width: 960px) {
    .admin-layout { grid-template-columns: 1fr; }
}

.admin-banner {
    grid-column: 1 / -1;
    padding: 12px 24px;
    background: var(--warn-soft);
    color: var(--warn-ink);
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid #fde68a;
    font-size: 13.5px;
    font-weight: 500;
}
.admin-banner .btn { margin-left: auto; }

/* =========================================================
   Sidebar
   ========================================================= */
.admin-sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 20px 14px 16px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: sticky;
    top: 0;
    gap: 2px;
}
@media (max-width: 960px) {
    .admin-sidebar { position: static; min-height: 0; padding: 14px 12px; }
}

.admin-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--text);
    color: white;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-family: var(--font-mono);
    margin: 0 0 14px 2px;
    width: fit-content;
}
.admin-brand-logo {
    width: 18px; height: 18px;
    border-radius: 5px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    display: grid; place-items: center;
    color: white;
    font-size: 10px;
    font-weight: 800;
}

.admin-nav-section {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0 12px;
    margin: 14px 0 8px;
    font-weight: 600;
}
.admin-nav-section:first-of-type { margin-top: 4px; }

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    border-radius: 10px;
    color: var(--text-2);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none !important;
    transition: all 0.15s var(--ease-out);
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    width: 100%;
    line-height: 1.3;
}
.admin-nav-item:hover { background: var(--surface-3); color: var(--text); }
.admin-nav-item.active {
    background: var(--accent-soft);
    color: var(--accent-ink);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(11,18,32,0.04);
}
.admin-nav-item svg { width: 16px; height: 16px; color: var(--text-3); flex-shrink: 0; }
.admin-nav-item.active svg { color: var(--accent); }
.admin-nav-pill {
    margin-left: auto;
    font-size: 10px;
    background: var(--accent);
    color: white;
    padding: 2px 7px;
    border-radius: 999px;
    font-weight: 700;
}

.admin-sidebar-footer {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* =========================================================
   Main
   ========================================================= */
.admin-main {
    padding: 32px 40px 60px;
    min-width: 0;
}
@media (max-width: 960px) {
    .admin-main { padding: 22px 16px 40px; }
}

.admin-h {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.admin-title {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0;
    color: var(--text);
}
.admin-sub {
    font-size: 13px;
    color: var(--text-3);
    margin: 4px 0 0 0;
    font-weight: 400;
}
.admin-h-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.admin-flash {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 18px;
    font-size: 13.5px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s var(--ease-out);
}
.admin-flash.success { background: var(--ok-soft); color: var(--ok-ink); border: 1px solid #86efac; }
.admin-flash.error { background: var(--err-soft); color: var(--err-ink); border: 1px solid #fca5a5; }
.admin-flash.info { background: var(--accent-soft); color: var(--accent-ink); border: 1px solid #c7d0ff; }
@keyframes slideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   Panels & rows
   ========================================================= */
.panel {
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 14px;
}
.panel-h {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 14px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.panel-h small {
    color: var(--text-3);
    font-weight: 400;
    font-size: 12px;
}

.admin-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 14px; }
@media (max-width: 900px) { .admin-row { grid-template-columns: 1fr; } }

/* =========================================================
   KPI cards
   ========================================================= */
.admin-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}
.admin-kpis.kpis-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 800px) {
    .admin-kpis, .admin-kpis.kpis-3 { grid-template-columns: repeat(2, 1fr); }
}
.kpi {
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.kpi-l {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}
.kpi-v {
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-top: 6px;
    font-feature-settings: 'tnum' 1;
}
.kpi-d { font-size: 11px; color: var(--ok); margin-top: 6px; font-family: var(--font-mono); }
.kpi-d.down { color: var(--err); }

/* =========================================================
   Buttons
   ========================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13.5px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s var(--ease-out);
    white-space: nowrap;
    text-decoration: none !important;
    line-height: 1.2;
    font-family: inherit;
}
.btn svg { width: 15px; height: 15px; }
.btn-primary,
.btn.primary {
    background: linear-gradient(180deg, var(--accent) 0%, #2d4de8 100%);
    color: white;
    box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 4px 12px rgba(58, 91, 255, 0.3);
}
.btn-primary:hover,
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 8px 20px rgba(58, 91, 255, 0.4); color: white; }
.btn-primary:active,
.btn.primary:active { transform: translateY(0); }

.btn-secondary,
.btn.secondary { background: var(--surface-3); color: var(--text); border-color: var(--border); }
.btn-secondary:hover,
.btn.secondary:hover { background: var(--border); color: var(--text); }

.btn-outline,
.btn.outline { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-outline:hover,
.btn.outline:hover { background: var(--accent-softer); border-color: var(--accent); color: var(--accent-ink); }

.btn-ghost,
.btn.ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover,
.btn.ghost:hover { background: var(--surface-3); color: var(--text); }

.btn-danger { background: var(--err); color: white; }
.btn-danger:hover { background: #b91c1c; color: white; }
.btn-warning { background: var(--warn); color: white; }
.btn-warning:hover { background: #c2410c; color: white; }

.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { padding: 14px 22px; font-size: 15px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn.icon-btn { padding: 6px 8px; min-width: 0; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

.btn-row {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
    align-items: center;
}

/* =========================================================
   Forms
   ========================================================= */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.form-full { grid-column: 1 / -1; }
@media (max-width: 720px) {
    .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
}

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field-label,
.field > label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.field-label .opt,
.field > label .opt { color: var(--text-4); font-size: 11px; font-weight: 400; }

.field-input,
.field-textarea,
.field input[type=text],
.field input[type=email],
.field input[type=number],
.field input[type=password],
.field input[type=tel],
.field input[type=url],
.field input[type=date],
.field input[type=file],
.field textarea,
.field select {
    width: 100%;
    padding: 11px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    color: var(--text);
    font-family: inherit;
    transition: border 0.15s, box-shadow 0.15s;
}
.field-input:focus,
.field-textarea:focus,
.field input:focus,
.field textarea:focus,
.field select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(58, 91, 255, 0.12);
}
.field-textarea, .field textarea { resize: vertical; min-height: 88px; line-height: 1.5; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-4); }
.field input[type=file] { padding: 10px 12px; cursor: pointer; background: var(--surface-2); }
.field input[type=file]::file-selector-button {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 8px;
    margin-right: 12px;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    color: var(--text-2);
    transition: background 0.15s;
}
.field input[type=file]::file-selector-button:hover { background: var(--surface-3); }
.field-hint { font-size: 11.5px; color: var(--text-3); line-height: 1.45; }
.field-error { font-size: 11px; color: var(--err); font-family: var(--font-mono); }

/* Input with suffix (€ / %) */
.input-suffix {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    overflow: hidden;
    transition: border 0.15s, box-shadow 0.15s;
}
.input-suffix:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(58, 91, 255, 0.12);
}
.input-suffix input {
    border: 0; outline: 0;
    padding: 10px 12px;
    font-size: 14px;
    font-family: var(--font-mono);
    width: 110px;
    background: transparent;
    color: var(--text);
}
.input-suffix span {
    padding: 0 12px;
    display: grid; place-items: center;
    background: var(--surface-3);
    color: var(--text-3);
    font-size: 12px;
    border-left: 1px solid var(--border);
}
.input-suffix.wide { display: flex; }
.input-suffix.wide input { width: 100%; flex: 1; }

.color-row { display: flex; align-items: center; gap: 10px; }
.color-row input[type=color] { width: 52px; height: 44px; flex-shrink: 0; padding: 3px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.color-row input[type=text] { flex: 1; font-family: var(--font-mono); font-size: 13px; }

/* =========================================================
   Radio cards (Style visuel, Densité, Typo)
   ========================================================= */
.radio-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.radio-card {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
}
.radio-card:hover { border-color: var(--border-strong); background: var(--surface-2); }
.radio-card.active { border-color: var(--accent); background: var(--accent-softer); }
.radio-card input { display: none; }
.radio-dot {
    width: 16px; height: 16px;
    border-radius: 50%;
    border: 1.5px solid var(--border-strong);
    flex-shrink: 0;
    margin-top: 2px;
    display: grid; place-items: center;
    transition: all 0.15s;
}
.radio-card.active .radio-dot { border-color: var(--accent); }
.radio-card.active .radio-dot::after {
    content: '';
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
}
.radio-body { flex: 1; }
.radio-title { font-size: 13px; font-weight: 600; color: var(--text); }
.radio-desc { font-size: 11.5px; color: var(--text-3); margin-top: 2px; line-height: 1.4; }

/* =========================================================
   Switch (toggle)
   ========================================================= */
.switch { position: relative; display: inline-flex; cursor: pointer; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track {
    width: 38px; height: 22px;
    background: var(--border-strong);
    border-radius: 22px;
    position: relative;
    transition: background 0.18s;
    display: inline-block;
}
.switch-dot {
    position: absolute;
    top: 2px; left: 2px;
    width: 18px; height: 18px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.18s;
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track .switch-dot { transform: translateX(16px); }
.switch.small .switch-track { width: 32px; height: 18px; }
.switch.small .switch-dot { width: 14px; height: 14px; }
.switch.small input:checked + .switch-track .switch-dot { transform: translateX(14px); }

/* =========================================================
   Tables
   ========================================================= */
.tbl {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    font-size: 13.5px;
}
.tbl th {
    text-align: left;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    font-weight: 600;
}
.tbl td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: var(--surface-2); }

.td-actions { text-align: right; white-space: nowrap; }
.td-actions .btn { margin-left: 4px; }

.mono { font-family: var(--font-mono); }
.num { font-family: var(--font-mono); font-feature-settings: 'tnum' 1; }

/* Status pills */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    white-space: nowrap;
}
.status-pill .status-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.status-pill.hot { background: #fff0f3; border-color: #fbcfe1; color: #9f1239; }
.status-pill.hot .status-dot { background: #e11d48; box-shadow: 0 0 0 2px rgba(225, 29, 72, 0.15); }
.status-pill.standard { background: var(--accent-softer); border-color: #d4dcff; color: #1e40af; }
.status-pill.standard .status-dot { background: var(--accent); box-shadow: 0 0 0 2px rgba(58, 91, 255, 0.15); }
.status-pill.closed { background: var(--surface-2); border-color: var(--border); color: var(--text-3); }
.status-pill.closed .status-dot { background: #94a3b8; }
.status-pill.pending { background: var(--warn-soft); border-color: #fde68a; color: var(--warn-ink); }
.status-pill.pending .status-dot { background: var(--warn); }

.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-family: var(--font-mono);
    font-weight: 500;
}
.tag.ok { background: var(--ok-soft); color: var(--ok-ink); }
.tag.warn { background: var(--warn-soft); color: var(--warn-ink); }
.tag.neutral { background: var(--surface-3); color: var(--text-2); }
.tag.err { background: var(--err-soft); color: var(--err-ink); }
.tag.accent { background: var(--accent-soft); color: var(--accent-ink); }

/* =========================================================
   Leads table (expandable rows)
   ========================================================= */
.leads-tbl .lead-row td { transition: background 0.15s ease; }
.leads-tbl .lead-row.open td { background: var(--accent-softer); border-bottom-color: transparent; }
.leads-tbl .lead-row:hover td { background: var(--surface-2); }
.leads-tbl .lead-row.open:hover td { background: var(--accent-softer); }

.lead-name {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    text-align: left;
    font-family: inherit;
}
.lead-name:hover .lead-name-txt {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}
.lead-name-caret {
    display: inline-grid;
    place-items: center;
    width: 16px; height: 16px;
    border-radius: 4px;
    background: var(--surface-3);
    color: var(--text-2);
    transition: transform 0.2s ease, background 0.15s;
    font-size: 11px;
    line-height: 1;
    flex-shrink: 0;
}
.lead-row.open .lead-name-caret {
    background: var(--accent);
    color: white;
    transform: rotate(90deg);
}
.lead-name-caret svg { width: 12px; height: 12px; }

.lead-expand td {
    padding: 0 !important;
    background: var(--accent-softer);
    border-bottom: 1px solid var(--border);
}
.lead-expand-inner {
    padding: 18px 22px 20px;
    border-top: 1px dashed var(--border-strong);
    background: linear-gradient(180deg, var(--accent-softer) 0%, var(--surface-2) 100%);
}
.lead-contact-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px 20px;
}
@media (max-width: 900px) { .lead-contact-grid { grid-template-columns: repeat(2, 1fr); } }
.lead-contact-cell { min-width: 0; }
.lead-contact-label {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-bottom: 4px;
    font-weight: 600;
}
.lead-contact-val {
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lead-contact-val a { color: var(--accent); text-decoration: none; }
.lead-contact-val a:hover { text-decoration: underline; }
.lead-msg {
    margin-top: 14px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.lead-msg-txt {
    font-size: 13px;
    color: var(--text-2);
    font-style: italic;
    line-height: 1.55;
    margin-top: 2px;
}
.lead-expand-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

/* =========================================================
   Funnel chart (dashboard)
   ========================================================= */
.funnel { display: flex; flex-direction: column; gap: 10px; }
.funnel-row .funnel-top {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 4px;
}
.funnel-row .funnel-label { color: var(--text-2); font-weight: 500; }
.funnel-row .funnel-val { color: var(--text-3); font-family: var(--font-mono); }
.funnel-bar {
    height: 8px;
    background: var(--surface-3);
    border-radius: 4px;
    overflow: hidden;
}
.funnel-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* =========================================================
   Catalog product rows
   ========================================================= */
.product-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: opacity 0.15s, border-color 0.15s;
    margin-bottom: 10px;
}
.product-row:last-child { margin-bottom: 0; }
.product-row.inactive { opacity: 0.55; }
.product-thumb {
    width: 60px; height: 44px;
    background: var(--surface-3);
    border-radius: 8px;
    display: grid; place-items: center;
    flex-shrink: 0;
    color: var(--text-2);
}
.product-thumb svg { width: 30px; height: 30px; }
.product-info { flex: 1; min-width: 0; }
.product-title { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.product-meta { font-size: 12px; color: var(--text-3); }
.product-price {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-2);
    white-space: nowrap;
}

/* =========================================================
   Modal
   ========================================================= */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(11, 18, 32, 0.52);
    backdrop-filter: blur(4px);
    display: grid; place-items: center;
    z-index: 80;
    padding: 40px 20px;
    animation: adminFadeIn 0.18s ease;
}
.modal-backdrop[hidden] { display: none; }
@keyframes adminFadeIn { from { opacity: 0 } to { opacity: 1 } }
.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    width: min(820px, 100%);
    max-height: calc(100vh - 80px);
    display: flex; flex-direction: column;
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--border);
    animation: adminSlideUp 0.22s cubic-bezier(.2,.8,.2,1);
}
@keyframes adminSlideUp { from { opacity: 0; transform: translateY(14px) } to { opacity: 1; transform: none } }
.modal-h {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px;
}
.modal-body {
    padding: 18px 22px;
    overflow-y: auto;
    flex: 1;
    background: var(--surface-2);
}
.modal-f {
    padding: 14px 22px;
    border-top: 1px solid var(--border);
    display: flex; justify-content: flex-end; gap: 10px;
}

/* Variant rows in modal */
.variant-row {
    display: grid;
    grid-template-columns: 32px 1fr auto 32px;
    align-items: center;
    gap: 14px;
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.variant-label { font-size: 13px; color: var(--text); font-weight: 500; }
.variant-delta { display: flex; align-items: center; gap: 8px; }

/* =========================================================
   Promo panel (Promotions & règles)
   ========================================================= */
.promo-panel {
    background: linear-gradient(135deg, var(--accent-softer), var(--surface));
    border: 1px solid var(--accent-soft);
}
.promo-dot {
    display: inline-block;
    width: 8px; height: 8px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 0 4px var(--accent-soft);
    animation: promoPulse 1.8s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes promoPulse {
    0%, 100% { box-shadow: 0 0 0 4px var(--accent-soft) }
    50%      { box-shadow: 0 0 0 7px rgba(58,91,255,0.08) }
}
.promo-preview {
    margin-top: 14px;
    padding: 12px 14px;
    background: var(--accent-ink);
    color: #eef1ff;
    border-radius: 10px;
    font-size: 13px;
    display: flex; align-items: center; gap: 10px;
}
.promo-preview .promo-dot {
    background: #6b85ff;
    box-shadow: 0 0 0 4px rgba(107,133,255,0.25);
}

.rule-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 14px;
    margin-bottom: 6px;
}
.rule-title { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.rule-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.rule-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 12px;
    transition: opacity 0.15s;
}
.rule-body.inactive { opacity: 0.5; pointer-events: none; }
.rule-body.col-3 { grid-template-columns: 2fr 1fr 1fr; }
@media (max-width: 700px) {
    .rule-body, .rule-body.col-3 { grid-template-columns: 1fr; }
}

/* Simulation cards */
.sim-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
@media (max-width: 800px) { .sim-grid { grid-template-columns: repeat(2, 1fr); } }
.sim-card {
    padding: 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex; flex-direction: column; gap: 4px;
}
.sim-base {
    font-size: 11px;
    color: var(--text-3);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.sim-final {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    font-family: var(--font-mono);
    margin-top: 2px;
}
.sim-diff {
    font-size: 12px;
    font-family: var(--font-mono);
    font-weight: 600;
}
.sim-diff.up { color: var(--warn); }
.sim-diff.down { color: var(--ok); }
.sim-notes {
    display: flex; flex-wrap: wrap; gap: 4px;
    margin-top: 8px;
}
.sim-notes span {
    font-size: 10px;
    padding: 3px 7px;
    background: var(--surface-3);
    color: var(--text-2);
    border-radius: 20px;
    font-family: var(--font-mono);
}

/* =========================================================
   Swatches (Apparence — couleur accent)
   ========================================================= */
.swatches { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.swatch-big {
    width: 36px; height: 36px;
    border-radius: 10px;
    border: 2px solid var(--border);
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    padding: 0;
}
.swatch-big:hover { transform: scale(1.06); }
.swatch-big.active { border-color: var(--text); }
.swatch-big.active::after {
    content: '';
    position: absolute;
    inset: -5px;
    border: 1px solid var(--text);
    border-radius: 12px;
}
.swatch-custom-wrap {
    position: relative;
    display: inline-block;
}
.swatch-remove {
    position: absolute;
    top: -6px; right: -6px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--text);
    color: white;
    border: 2px solid var(--surface);
    font-size: 12px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.swatch-custom-wrap:hover .swatch-remove { display: flex; }
.swatch-add {
    width: 36px; height: 36px;
    border-radius: 10px;
    border: 2px dashed var(--border-strong);
    background: var(--surface-2);
    color: var(--text-3);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all 0.15s;
}
.swatch-add:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-softer);
    transform: scale(1.06);
}

/* =========================================================
   Logo upload pill
   ========================================================= */
.logo-pill {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px dashed var(--border-strong);
    border-radius: 10px;
    background: var(--surface-2);
}
.logo-mark {
    width: 40px; height: 40px;
    background: var(--text);
    color: white;
    border-radius: 8px;
    display: grid; place-items: center;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}
.logo-mark img { max-width: 100%; max-height: 100%; }
.logo-info { flex: 1; font-size: 12px; color: var(--text-3); min-width: 0; }
.logo-info strong { color: var(--text-2); font-weight: 500; }

/* =========================================================
   Team member row
   ========================================================= */
.member-row {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 10px;
}
.member-row:last-child { margin-bottom: 0; }
.member-avatar {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    border-radius: 50%;
    display: grid; place-items: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}
.member-info { flex: 1; min-width: 0; }
.member-name { font-weight: 600; font-size: 14px; }
.member-email { font-size: 12px; color: var(--text-3); }

/* =========================================================
   Code / snippet block
   ========================================================= */
.snippet {
    background: var(--text);
    color: #e7f0fb;
    padding: 16px 20px;
    border-radius: 10px;
    font-size: 12px;
    font-family: var(--font-mono);
    overflow: auto;
    margin: 0;
    line-height: 1.6;
    white-space: pre;
}
.snippet-wrap { position: relative; }

/* =========================================================
   Empty state
   ========================================================= */
.empty-state {
    text-align: center;
    padding: 44px 20px;
    color: var(--text-3);
}
.empty-state-icon {
    font-size: 40px;
    margin-bottom: 14px;
    opacity: 0.5;
}

/* =========================================================
   Login (unchanged visual identity)
   ========================================================= */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: radial-gradient(ellipse at top, var(--accent-softer), var(--bg) 70%);
    position: relative;
    overflow: hidden;
}
.login-container::before {
    content: '';
    position: absolute;
    top: -160px;
    right: -160px;
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, var(--accent-soft) 0%, transparent 65%);
    z-index: 0;
}
.login-container::after {
    content: '';
    position: absolute;
    bottom: -180px;
    left: -180px;
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, #e0e7ff 0%, transparent 65%);
    z-index: 0;
}
.login-box {
    position: relative;
    z-index: 1;
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 40px 36px 36px;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}
.login-logo {
    font-size: 22px;
    margin: 0 auto 16px;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    display: grid; place-items: center;
    color: white;
    font-weight: 800;
    box-shadow: 0 10px 24px -6px rgba(58, 91, 255, 0.5);
}
.login-title {
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    margin: 0 0 6px 0;
    letter-spacing: -0.02em;
}
.login-sub {
    text-align: center;
    color: var(--text-3);
    margin: 0 0 28px 0;
    font-size: 13.5px;
}
.login-error {
    background: var(--err-soft);
    color: var(--err-ink);
    padding: 11px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 13px;
    border: 1px solid #fca5a5;
}

/* =========================================================
   Help block (snippet explanations)
   ========================================================= */
.help-block {
    background: var(--accent-softer);
    border: 1px solid var(--accent-soft);
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 13px;
    color: var(--accent-ink);
    margin: 10px 0 0;
    line-height: 1.6;
}
.help-block code {
    background: var(--surface);
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 12px;
    color: var(--accent-ink);
    border: 1px solid #d5dcff;
}
.help-block strong { color: var(--accent-ink); }

/* Utilities */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-6 { gap: 6px; }
.gap-10 { gap: 10px; }
.gap-14 { gap: 14px; }
.mt-0 { margin-top: 0; }
.mt-4 { margin-top: 4px; }
.mt-14 { margin-top: 14px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0 !important; }

/* Scrollbar polish */
.admin-main ::-webkit-scrollbar, .modal-body::-webkit-scrollbar { height: 10px; width: 10px; }
.admin-main ::-webkit-scrollbar-track, .modal-body::-webkit-scrollbar-track { background: transparent; }
.admin-main ::-webkit-scrollbar-thumb, .modal-body::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; }
.admin-main ::-webkit-scrollbar-thumb:hover, .modal-body::-webkit-scrollbar-thumb:hover { background: var(--text-4); }
