/* ===== Plateforme SMS Orange — feuille de style unique ===== */
:root {
    --orange: #ef6a45;       /* corail Salott-IT (action principale / noeuds du logo) */
    --orange-d: #d9542f;
    --blue: #2497dd;         /* bleu Salott-IT (accents) */
    --ink: #0c2f5c;          /* navy Salott-IT (sidebar / titres) */
    --ink-2: #14396b;
    --bg: #f4f6fa;
    --card: #ffffff;
    --line: #e6e9f0;
    --text: #26303f;
    --muted: #7a869a;
    --ok: #14824a; --ok-bg: #e6f6ec;
    --err: #d13b3b; --err-bg: #fdecec;
    --wait: #9a6a12; --wait-bg: #fdf3e0;
    --info: #2f6fed; --info-bg: #eaf1fe;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(20,30,50,.08), 0 1px 2px rgba(20,30,50,.04);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
a { color: var(--orange-d); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .5rem; color: var(--ink); }
h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .85em; }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
.center { text-align: center; }

/* ===== Layout ===== */
.app { display: flex; min-height: 100vh; }
.sidebar {
    width: 230px; background: var(--ink); color: #c7d0de; flex-shrink: 0;
    display: flex; flex-direction: column; padding: 1rem .75rem;
}
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.content { padding: 1.5rem; max-width: 1100px; width: 100%; flex: 1; }
.app-foot { padding: .75rem 1.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; background: var(--card); }

.brand { display: flex; align-items: center; gap: .5rem; font-size: 1.15rem; color: #fff; padding: .25rem .5rem 1rem; }
.brand strong { color: var(--orange); }
.brand-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px rgba(239,106,69,.2); }
.brand-lg { font-size: 1.4rem; justify-content: center; }
.brand-logo { width: 34px; height: 34px; object-fit: contain; flex-shrink: 0; }
.auth-logo { display: block; width: 78%; max-width: 230px; height: auto; margin: 0 auto 1.25rem; }
.err-logo { width: 64px; height: 64px; margin: 0 auto .5rem; display: block; }

.nav { display: flex; flex-direction: column; gap: 2px; margin-top: .5rem; }
.nav-link { color: #c7d0de; padding: .55rem .75rem; border-radius: 8px; font-weight: 500; }
.nav-link:hover { background: var(--ink-2); color: #fff; text-decoration: none; }
.nav-link.active { background: var(--orange); color: #fff; }
.sidebar-foot { margin-top: auto; padding: .5rem; color: #64708a; font-size: .8rem; }

.topbar {
    background: var(--card); border-bottom: 1px solid var(--line);
    padding: .75rem 1.5rem; display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 5;
}
.topbar-title { font-weight: 600; color: var(--ink); }
.topbar-right { display: flex; align-items: center; gap: .75rem; }
.who { color: var(--muted); font-size: .9rem; }

/* ===== Cards / stats ===== */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; margin-bottom: 1.25rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.25rem; }
.stat-num { font-size: 1.9rem; font-weight: 700; color: var(--ink); line-height: 1; }
.stat-mode { font-size: 1.4rem; color: var(--orange-d); }
.stat-label { color: var(--muted); font-size: .85rem; margin-top: .35rem; }

/* ===== Tables ===== */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .02em; }
.table tbody tr:hover { background: #fafbfe; }
.row-actions { display: flex; gap: .75rem; align-items: center; }

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem 1rem; border-radius: 8px; border: 1px solid transparent; font-size: .92rem; font-weight: 600; cursor: pointer; background: #eef1f6; color: var(--text); }
.btn:hover { text-decoration: none; filter: brightness(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-d); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-danger { background: var(--err-bg); color: var(--err); }
.btn-danger:hover { background: #f9dede; }
.btn-sm { padding: .35rem .7rem; font-size: .82rem; }
.btn-block { width: 100%; justify-content: center; }
.inline { display: inline; }
.link { color: var(--orange-d); font-weight: 600; }

/* ===== Forms ===== */
.form { display: flex; flex-direction: column; gap: 1rem; max-width: 560px; }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field > span { font-weight: 600; font-size: .9rem; color: var(--ink); }
.input { width: 100%; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; color: var(--text); }
.input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(239,106,69,.18); }
.textarea { resize: vertical; min-height: 90px; }
.hint { color: var(--muted); font-size: .82rem; }
.actions { display: flex; gap: .75rem; align-items: center; }
.radio { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.check-inline { display: inline-flex; align-items: center; gap: .4rem; }
.sep { border: none; border-top: 1px solid var(--line); margin: 1.25rem 0; }
.kv { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.kv li { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px dashed var(--line); padding-bottom: .4rem; }
.kv span { color: var(--muted); }

/* ===== Badges / pills / tags ===== */
.badge { padding: .25rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.badge-sim { background: var(--wait-bg); color: var(--wait); }
.badge-live { background: var(--ok-bg); color: var(--ok); }
.pill { display: inline-block; padding: .2rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-err { background: var(--err-bg); color: var(--err); }
.pill-wait { background: var(--wait-bg); color: var(--wait); }
.tag { background: #eef1f6; color: var(--muted); padding: .1rem .45rem; border-radius: 6px; font-size: .72rem; font-weight: 700; text-transform: uppercase; }

/* ===== Flash ===== */
.flash { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid transparent; font-size: .92rem; }
.flash-success { background: var(--ok-bg); color: var(--ok); border-color: #bfe6cd; }
.flash-error { background: var(--err-bg); color: var(--err); border-color: #f3c9c9; }
.flash-info { background: var(--info-bg); color: var(--info); border-color: #c9dcfb; }

/* ===== Progress bar ===== */
.bar { background: #eef1f6; border-radius: 999px; height: 12px; overflow: hidden; margin: 1rem 0; }
.bar-sm { height: 7px; margin: .25rem 0; }
.bar-fill { height: 100%; background: var(--orange); transition: width .3s ease; }

/* ===== Import preview ===== */
.apercu { margin-top: 1.25rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.apercu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; max-width: 480px; }
.apercu-box { background: #f7f9fc; border: 1px solid var(--line); border-radius: 8px; padding: .8rem; text-align: center; display: flex; flex-direction: column; gap: .2rem; }
.apercu-box.ok { background: var(--ok-bg); border-color: #bfe6cd; }
.apercu-box.err { background: var(--err-bg); border-color: #f3c9c9; }
.apercu-num { font-size: 1.6rem; font-weight: 700; }
.apercu-list { margin-top: .75rem; }
.apercu-list .mono { color: var(--err); }

/* ===== Checklist (membres) ===== */
.toolbar { display: flex; gap: .75rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.toolbar .input { max-width: 260px; }
.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .35rem; max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: .6rem; }
.check-item { display: flex; align-items: center; gap: .5rem; padding: .3rem .4rem; border-radius: 6px; }
.check-item:hover { background: #f7f9fc; }

/* ===== Campaign send ===== */
.msg-preview { background: #f7f9fc; border: 1px solid var(--line); border-left: 3px solid var(--orange); border-radius: 8px; padding: .9rem 1rem; margin-bottom: 1rem; }
.msg-sender { font-weight: 700; color: var(--ink); margin-bottom: .25rem; }
.send-stats { display: grid; grid-template-columns: repeat(4, auto); gap: 1.5rem; }
.send-num { display: flex; flex-direction: column; }
.send-num span { font-size: 1.5rem; font-weight: 700; color: var(--ink); }
.send-num.err span { color: var(--err); }
.send-num small { color: var(--muted); }
.test-result { margin-top: 1rem; padding: .8rem 1rem; border-radius: 8px; font-size: .9rem; }
.test-result.ok { background: var(--ok-bg); color: var(--ok); }
.test-result.err { background: var(--err-bg); color: var(--err); }

/* ===== Auth ===== */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #1b2330, #33405a); }
.auth-card { background: var(--card); border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.25); padding: 2rem; width: 360px; max-width: 92vw; }
.auth-title { text-align: center; }
.auth-sub { text-align: center; color: var(--muted); margin-top: 0; }
.auth-product { text-align: center; color: var(--muted); font-size: .9rem; margin: -.5rem 0 1.25rem; }
.auth-foot { text-align: center; color: var(--muted); font-size: .8rem; margin: 1rem 0 0; }
.err-code { font-size: 3rem; color: var(--orange); margin: 0; }

/* ===== Responsive ===== */
@media (max-width: 800px) {
    .app { flex-direction: column; }
    .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; padding: .5rem; }
    .nav { flex-direction: row; flex-wrap: wrap; margin: 0; }
    .sidebar-foot { display: none; }
    .stats, .grid-2, .apercu-grid { grid-template-columns: 1fr 1fr; }
    .send-stats { gap: 1rem; }
}
@media (max-width: 520px) {
    .stats, .grid-2 { grid-template-columns: 1fr; }
    .content { padding: 1rem; }
}
