/* ==========================================================
   Bwania Libala — Admin BwaniaTech
   navy #0D2B6E · or #F5A623 · bleu #1A56DB
   ========================================================== */
@font-face { font-family: "Inter"; src: url("../fonts/inter-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --navy: #0D2B6E; --navy-2: #0A2259; --gold: #F5A623; --blue: #1A56DB; --blue-50: #EBF2FF;
  --bg: #F4F6FB; --card: #FFFFFF; --line: #E4E8F1; --text: #0F172A; --muted: #64748B;
  --ok: #0E9F6E; --ok-50: #E7F7F0; --warn: #C27803; --warn-50: #FFF6E0; --err: #E02424; --err-50: #FDECEC;
  --wa: #25D366; --radius: 14px; --shadow: 0 1px 2px rgba(15,23,42,.05), 0 4px 16px rgba(15,23,42,.05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--blue); text-decoration: none; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 750; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 650; }
.muted { color: var(--muted); }
small { font-size: 12.5px; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Structure ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%); color: #DCE4F7; display: flex; flex-direction: column; padding: 22px 16px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 12px; align-items: center; color: #fff; padding: 4px 8px 22px; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--gold); color: var(--navy); font-weight: 800; letter-spacing: -.04em; }
.brand strong { display: block; font-size: 16px; }
.brand small { color: #9FB0D9; }
.side-nav a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; color: #C7D2EE; font-weight: 550; }
.side-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-nav a.on { background: rgba(245,166,35,.16); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.side-wedding { margin-top: 22px; padding: 14px; border-radius: 12px; background: rgba(255,255,255,.06); }
.side-wedding small { color: var(--gold); text-transform: uppercase; letter-spacing: .08em; font-size: 10.5px; font-weight: 700; }
.side-wedding strong { display: block; color: #fff; margin: 2px 0; }
.side-wedding span { font-size: 13px; color: #9FB0D9; }
.side-foot { margin-top: auto; display: flex; justify-content: space-between; font-size: 13px; padding: 10px 8px 0; border-top: 1px solid rgba(255,255,255,.1); }
.side-foot a { color: var(--gold); }
.main { padding: 28px clamp(16px, 3vw, 40px) 80px; min-width: 0; max-width: 1400px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; }
  .brand { padding: 0; flex: 1; }
  .side-nav { display: flex; gap: 4px; }
  .side-nav a { padding: 8px 10px; font-size: 13px; }
  .side-wedding, .side-foot { display: none; }
  .main { padding-top: 18px; }
}

/* ---------- En-tête mariage & onglets ---------- */
.w-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.back { font-size: 13px; color: var(--muted); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--navy); border-color: var(--gold); }

/* ---------- Composants ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card + .card { margin-top: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 760px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; background: var(--blue); color: #fff; transition: transform .08s, background .15s, box-shadow .15s; white-space: nowrap; }
.btn:hover { background: #1749C0; box-shadow: 0 4px 14px rgba(26,86,219,.25); }
.btn:active { transform: translateY(1px); }
.btn.gold { background: var(--gold); color: var(--navy); }
.btn.gold:hover { background: #E89810; box-shadow: 0 4px 14px rgba(245,166,35,.35); }
.btn.ghost { background: #fff; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: #F8FAFD; box-shadow: none; }
.btn.danger { background: #fff; color: var(--err); border-color: #F5C2C2; }
.btn.sm { min-height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.wa { background: var(--wa); color: #fff; }
.btn.wa:hover { background: #1EBE5A; box-shadow: 0 4px 14px rgba(37,211,102,.3); }
.btn.wa.done { background: var(--ok-50); color: var(--ok); border-color: #BDE8D5; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--blue); font: inherit; cursor: pointer; }
.linkbtn.danger { color: var(--err); }

label { display: block; font-size: 13px; font-weight: 600; color: #334155; margin-bottom: 6px; }
.field { margin-bottom: 14px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; font-weight: 400; }
input[type=text], input[type=password], input[type=date], input[type=time], input[type=number], input[type=tel], input[type=search], select, textarea {
  width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid #D5DBE7; border-radius: 10px; font: inherit; color: var(--text); background: #fff; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(26,86,219,.12); }
input[type=color] { width: 44px; height: 42px; padding: 3px; border: 1px solid #D5DBE7; border-radius: 10px; background: #fff; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--blue); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #EEF1F7; color: #475569; white-space: nowrap; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; }
.b-oui, .st-envoye { background: var(--ok-50); color: var(--ok); }
.b-non { background: var(--err-50); color: var(--err); }
.b-attente, .st-preparation { background: var(--warn-50); color: var(--warn); }
.st-termine { background: var(--blue-50); color: var(--blue); }

.toast { margin-bottom: 18px; padding: 12px 16px; border-radius: 12px; font-weight: 550; border: 1px solid; animation: toastIn .35s ease; }
.toast.ok { background: var(--ok-50); border-color: #BDE8D5; color: #046C4E; }
.toast.warn { background: var(--warn-50); border-color: #F8DFA4; color: #8E5A00; }
.toast.error { background: var(--err-50); border-color: #F5C2C2; color: #9B1C1C; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- Statistiques ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 26px; font-weight: 750; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: 13px; }
.stat .bar { height: 5px; border-radius: 3px; background: #EEF1F7; margin-top: 10px; overflow: hidden; }
.stat .bar i { display: block; height: 100%; background: var(--blue); border-radius: 3px; }

/* ---------- Liste des mariages ---------- */
.w-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.w-card { display: block; color: inherit; background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s; }
.w-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(13,43,110,.12); }
.w-cover { height: 170px; background: linear-gradient(135deg, var(--navy), #2B4A9A); background-size: cover; background-position: center 25%; position: relative; }
.w-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(5,10,30,.75)); }
.w-cover .names { position: absolute; left: 18px; bottom: 14px; z-index: 1; color: #fff; font-size: 22px; font-weight: 750; }
.w-cover .days { position: absolute; right: 14px; top: 14px; z-index: 1; background: rgba(255,255,255,.92); color: var(--navy); padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.w-body { padding: 14px 18px 16px; }
.w-meta { display: flex; gap: 16px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.w-meta b { color: var(--text); }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .big { font-size: 46px; }

/* ---------- Formulaire du mariage ---------- */
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 26px; align-items: start; }
@media (max-width: 1200px) { .form-layout { grid-template-columns: 1fr; } .preview-col { display: none; } }
.section-title { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.section-title .n { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue); font-size: 13px; font-weight: 750; }
.cer { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 12px; background: #FBFCFE; position: relative; }
.cer .remove { position: absolute; top: 12px; right: 12px; }
.photos { display: flex; gap: 10px; flex-wrap: wrap; }
.photos figure { margin: 0; width: 96px; position: relative; }
.photos img { width: 96px; height: 120px; object-fit: cover; border-radius: 10px; display: block; }
.photos button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; }
.cover-prev { width: 100%; max-width: 220px; aspect-ratio: 3/4; object-fit: cover; border-radius: 12px; display: block; margin-bottom: 10px; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.swatch { position: relative; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; }
.swatch span { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; font-weight: 600; background: #fff; }
.swatch i { width: 24px; height: 24px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); }
.swatch input:checked + span { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26,86,219,.15); }
.sticky-save { position: sticky; bottom: 0; background: linear-gradient(180deg, rgba(244,246,251,0), var(--bg) 35%); padding: 18px 0 6px; margin-top: 10px; display: flex; gap: 10px; z-index: 5; }

/* Aperçu téléphone */
.preview-col { position: sticky; top: 20px; }
.phone { width: 360px; height: 740px; border-radius: 46px; padding: 12px; background: #0B0B0F; box-shadow: 0 30px 60px rgba(13,43,110,.25), inset 0 0 0 2px #2A2A33; position: relative; margin: 0 auto; }
.phone::before { content: ""; position: absolute; top: 20px; left: 50%; transform: translateX(-50%); width: 92px; height: 24px; border-radius: 14px; background: #0B0B0F; z-index: 2; }
.phone iframe { width: 100%; height: 100%; border: 0; border-radius: 36px; background: #141114; }
.preview-col p { text-align: center; font-size: 13px; color: var(--muted); }

/* ---------- Tableau des invités ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input[type=search] { flex: 1 1 220px; }
.toolbar select { width: auto; flex: 0 1 180px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; padding: 11px 14px; background: #F8FAFD; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list td { padding: 11px 14px; border-bottom: 1px solid #EEF1F6; vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr:hover td { background: #FAFBFE; }
.g-name strong { display: block; }
.g-name small { color: var(--muted); }
.actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: #475569; cursor: pointer; }
.icon-btn:hover { background: #F4F6FB; color: var(--blue); }
@media (max-width: 760px) {
  table.list thead { display: none; }
  table.list tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 12px 14px; border-bottom: 1px solid #EEF1F6; }
  table.list td { padding: 0; border: 0; }
  table.list td.hide-m { display: none; }
  table.list td.actions-cell { grid-column: 1 / -1; }
  .actions { justify-content: flex-start; flex-wrap: wrap; }
}

details.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; }
details.panel summary { cursor: pointer; padding: 15px 20px; font-weight: 650; list-style: none; display: flex; align-items: center; gap: 10px; }
details.panel summary::-webkit-details-marker { display: none; }
details.panel summary::after { content: "+"; margin-left: auto; font-size: 20px; color: var(--muted); transition: transform .2s; }
details.panel[open] summary::after { transform: rotate(45deg); }
details.panel .panel-body { padding: 0 20px 20px; }
.report { font-size: 13px; background: #F8FAFD; border-radius: 10px; padding: 12px 16px; margin-top: 10px; max-height: 220px; overflow: auto; }
.report li { margin: 2px 0; }

/* Tables */
.t-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.t-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.t-card .fill { height: 6px; border-radius: 3px; background: #EEF1F7; margin: 10px 0; overflow: hidden; }
.t-card .fill i { display: block; height: 100%; background: var(--ok); }
.t-card .fill i.over { background: var(--err); }
.t-card ul { list-style: none; padding: 0; margin: 0; font-size: 13.5px; }
.t-card li { display: flex; justify-content: space-between; gap: 6px; padding: 5px 0; border-top: 1px dashed #EEF1F6; align-items: center; }
.t-card li select { width: auto; min-height: 30px; padding: 2px 6px; font-size: 12.5px; }

/* Liens */
.link-box { display: flex; gap: 8px; align-items: center; background: #F8FAFD; border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 8px 14px; }
.link-box code { flex: 1; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Connexion */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 10% -10%, #2B4A9A 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, rgba(245,166,35,.35) 0%, transparent 60%), var(--navy); }
.login .card { width: 100%; max-width: 400px; padding: 34px; border-radius: 22px; }
.login .brand { color: var(--navy); padding: 0 0 24px; }
.login .brand small { color: var(--muted); }
