/* ---------- Tableau de bord ABN — thème noir & or ---------- */
.admin { background: #0b0b0b; }
.admin .grain { display: none; }

/* ---------- Connexion ---------- */
.login { position: relative; min-height: 100vh; display: grid; place-items: center; padding: 16px; overflow: hidden; }
.login-glow { position: absolute; inset: 0; background: radial-gradient(ellipse 50% 40% at 50% 40%, rgba(212, 175, 55, .14), transparent 70%); animation: breathe 8s ease-in-out infinite; }
.login-card { position: relative; width: min(420px, 100%); background: #111; border: 1px solid var(--line-gold); padding: 40px 36px; display: grid; gap: 18px; animation: rise 1s var(--ease); }
.login-logo { height: 120px; width: auto; margin: 0 auto 4px; }
.login-card h1 { font-family: var(--serif); font-weight: 600; font-size: 2rem; text-align: center; }
.login-card > p { text-align: center; font-size: .9rem; }
.login-card .back { text-align: center; color: var(--muted); font-size: .85rem; }
.login-card .back:hover { color: var(--gold); }
.login-card.shake { animation: shake .4s; }
@keyframes rise { from { opacity: 0; transform: translateY(30px); } }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

/* ---------- Mise en page ---------- */
.dash { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { background: #080808; border-inline-end: 1px solid var(--line); padding: 26px 16px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.side-logo { height: 92px; width: auto; margin: 0 auto 28px; }
.tab { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border: 0; border-inline-start: 2px solid transparent; background: none; color: var(--muted); cursor: pointer; text-align: start; font-size: .88rem; font-weight: 500; transition: .3s; }
.tab .ti { width: 18px; text-align: center; color: var(--gold); opacity: .7; }
.tab:hover { color: var(--text); background: rgba(212, 175, 55, .04); }
.tab.active { color: var(--gold-light); border-color: var(--gold); background: linear-gradient(90deg, rgba(212, 175, 55, .12), transparent); }
.tab.logout { margin-top: auto; }
.count { margin-inline-start: auto; background: var(--gold); color: #0a0a0a; font-size: .7rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.count:empty { display: none; }
.main { padding: 34px; min-width: 0; }
.mode-warn { border: 1px solid var(--line-gold); color: var(--gold-light); background: rgba(212, 175, 55, .06); padding: 12px 16px; margin-bottom: 24px; font-size: .85rem; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 34px; }
.kpi { background: #0f0f0f; padding: 22px 24px; animation: rise .8s var(--ease) both; }
.kpi:nth-child(2) { animation-delay: .08s; } .kpi:nth-child(3) { animation-delay: .16s; } .kpi:nth-child(4) { animation-delay: .24s; }
.kpi span { color: var(--muted); font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; }
.kpi b { display: block; font-family: 'Cormorant Garamond', serif; font-size: 2.8rem; font-weight: 600; line-height: 1.1; }
.kpi.ok b { color: var(--ok); } .kpi.ko b { color: var(--ko); } .kpi.acc b { color: var(--gold); }

.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.panel-head h2 { font-family: var(--serif); font-weight: 600; font-size: 2.1rem; }
.panel-sub { margin: -10px 0 22px; }
.panel-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.search { padding: 10px 14px; border: 1px solid var(--line); background: #0f0f0f; outline: none; min-width: 190px; color-scheme: dark; border-radius: 2px; }
.search:focus { border-color: var(--gold); }

/* ---------- Voitures ---------- */
.admin-cars, .admin-packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.a-car, .a-pack { background: #111; border: 1px solid var(--line); overflow: hidden; transition: border-color .4s, transform .5s var(--ease); animation: rise .7s var(--ease) both; }
.a-car:hover, .a-pack:hover { transform: translateY(-4px); border-color: var(--line-gold); }
.a-car .car-media { height: 150px; }
.a-car.offc .car-media > * { opacity: .35; filter: grayscale(1); }
.a-car-body { padding: 18px; display: grid; gap: 14px; }
.a-car-top { display: flex; justify-content: space-between; gap: 10px; }
.a-car-top h3 { font-family: var(--serif); font-weight: 600; font-size: 1.4rem; line-height: 1.2; }
.a-car-top .cat { color: var(--muted); font-size: .78rem; }
.a-car-top b { color: var(--gold-light); white-space: nowrap; font-family: 'Cormorant Garamond', serif; font-size: 1.3rem; }

/* Bouton disponible / pas disponible */
.dispo { width: 100%; border: 1px solid; padding: 12px; font-weight: 700; font-size: .72rem; letter-spacing: .18em; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 12px; transition: background .4s, color .4s, border-color .4s, transform .15s; background: transparent; }
.dispo:active { transform: scale(.97); }
.dispo.on { color: var(--ok); border-color: rgba(127, 191, 127, .4); background: rgba(127, 191, 127, .07); }
.dispo.off { color: var(--ko); border-color: rgba(217, 119, 107, .4); background: rgba(217, 119, 107, .07); }
.dispo .knob { width: 40px; height: 22px; border-radius: 999px; background: currentColor; position: relative; opacity: .9; }
.dispo .knob::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #111; transition: transform .4s var(--ease); }
.dispo.on .knob::after { transform: translateX(18px); }
.a-actions { display: flex; gap: 8px; }
.a-actions button { flex: 1; padding: 9px; border: 1px solid var(--line); background: none; cursor: pointer; font-size: .78rem; color: var(--muted); transition: .3s; }
.a-actions button:hover:not(:disabled) { color: var(--gold-light); border-color: var(--gold); }
.a-actions button:disabled { opacity: .3; cursor: default; }
.a-actions .del:hover { border-color: var(--ko) !important; color: var(--ko) !important; }
.a-actions [data-pup] { flex: 0 0 42px; }

/* ---------- Packs ---------- */
.a-pack { padding: 22px; display: grid; gap: 14px; align-content: start; }
.a-pack.feat { border-color: var(--line-gold); }
.a-pack.hiddenp { opacity: .55; }
.a-pack-head { display: flex; gap: 14px; align-items: center; }
.a-pack-head .pack-ico { width: 40px; height: 40px; flex-shrink: 0; color: var(--gold); }
.a-pack-head h3 { font-family: var(--serif); font-weight: 600; font-size: 1.4rem; line-height: 1.15; }
.a-pack-head .ar-name { color: var(--muted); font-family: 'Cairo', sans-serif; font-size: .85rem; }
.a-pack-head b { margin-inline-start: auto; text-align: end; color: var(--gold-light); font-family: 'Cormorant Garamond', serif; font-size: 1.35rem; white-space: nowrap; }
.a-pack-head b small { display: block; font-family: var(--sans); font-size: .7rem; color: var(--muted); }
.a-feats { list-style: none; display: grid; gap: 4px; font-size: .84rem; color: #cfc8b8; }
.a-feats li::before { content: '◆ '; color: var(--gold); font-size: .55rem; vertical-align: middle; }
.icon-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.ip { width: 52px; height: 52px; display: grid; place-items: center; border: 1px solid var(--line); background: #0d0d0d; color: var(--muted); cursor: pointer; transition: .3s; }
.ip .pack-ico { width: 30px; height: 30px; }
.ip:hover { color: var(--gold-light); }
.ip.sel { border-color: var(--gold); color: var(--gold); background: rgba(212, 175, 55, .08); }
.switches { display: flex; flex-wrap: wrap; gap: 14px 30px; }

/* ---------- Réservations ---------- */
.resa-list { display: grid; gap: 12px; }
.resa { background: #111; border: 1px solid var(--line); border-inline-start: 3px solid var(--muted); padding: 20px; display: grid; grid-template-columns: 1.3fr 1fr auto; gap: 18px; align-items: center; animation: rise .7s var(--ease) both; }
.resa.s-nouvelle { border-inline-start-color: var(--gold); }
.resa.s-confirmée { border-inline-start-color: var(--ok); }
.resa.s-annulée { border-inline-start-color: var(--ko); opacity: .65; }
.resa h4 { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; }
.resa .meta { color: var(--muted); font-size: .84rem; }
.resa .when b { color: var(--gold-light); font-family: 'Cormorant Garamond', serif; font-size: 1.25rem; }
.resa-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.resa-actions select, .resa-actions a, .resa-actions button { padding: 8px 12px; border: 1px solid var(--line); background: #0b0b0b; font-size: .8rem; cursor: pointer; color-scheme: dark; transition: .3s; }
.resa-actions a.wa { color: var(--gold-light); border-color: var(--line-gold); }
.resa-actions a.wa:hover { background: var(--gold); color: #0a0a0a; }
.resa-actions .lock { color: var(--ko); border-color: rgba(217, 119, 107, .35); }
.empty-box { text-align: center; padding: 60px 20px; color: var(--muted); border: 1px dashed var(--line); grid-column: 1 / -1; }

/* ---------- Fenêtres (ajout / modification) ---------- */
.modal { margin: auto; border: 1px solid var(--line-gold); background: #111; color: var(--text); width: min(540px, calc(100% - 32px)); padding: 0; }
.modal-wide { width: min(760px, calc(100% - 32px)); }
.modal::backdrop { background: rgba(0, 0, 0, .7); backdrop-filter: blur(4px); }
.modal[open] { animation: rise .5s var(--ease); }
.modal-body { padding: 30px; display: grid; gap: 20px; }
.modal-body h3 { font-family: var(--serif); font-size: 1.8rem; font-weight: 600; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.field input[type=color] { height: 44px; padding: 4px 0; cursor: pointer; }
.switch-row { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: .9rem; }
.switch-row input { display: none; }
.switch { width: 44px; height: 24px; border-radius: 999px; background: #2a2a2a; position: relative; transition: background .4s; flex-shrink: 0; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #f3eee3; transition: transform .4s var(--ease); }
.switch-row input:checked + .switch { background: var(--gold); }
.switch-row input:checked + .switch::after { transform: translateX(20px); background: #0a0a0a; }

/* ---------- Logo & textes ---------- */
.custom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.box { background: #111; border: 1px solid var(--line); padding: 26px; display: grid; gap: 16px; align-content: start; animation: rise .7s var(--ease) both; }
.box h3 { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; }
.logo-previews { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lp { height: 130px; display: grid; place-items: center; padding: 14px; border: 1px solid var(--line); }
.lp img { max-height: 100px; max-width: 100%; object-fit: contain; }
.lp.dark { background: #050505; }
.lp.light { background: #f3eee3; }
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.file-btn { cursor: pointer; }
.tgroup { border: 1px solid var(--line); margin-bottom: 10px; }
.tgroup summary { cursor: pointer; padding: 15px 18px; font-weight: 600; font-size: .9rem; background: #0d0d0d; list-style: none; display: flex; justify-content: space-between; }
.tgroup summary::after { content: '+'; color: var(--gold); transition: transform .4s var(--ease); }
.tgroup[open] summary::after { transform: rotate(45deg); }
.trow { display: grid; grid-template-columns: 180px 1fr 1fr; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--line); align-items: start; }
.tlabel { font-size: .85rem; padding-top: 24px; color: var(--muted); }
.tcell { display: grid; gap: 4px; }
.tcell > span { font-size: .7rem; color: var(--muted); }
.tinput { position: relative; }
.tinput textarea { width: 100%; padding: 10px 38px 10px 12px; border: 1px solid var(--line); background: #0b0b0b; resize: vertical; outline: none; font-size: .9rem; color-scheme: dark; }
.tinput textarea[dir=rtl] { padding: 10px 12px 10px 38px; font-family: 'Cairo', sans-serif; }
.tinput textarea:focus { border-color: var(--gold); }
.treset { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border: 1px solid var(--line); background: #111; color: var(--gold); cursor: pointer; }
.tinput textarea[dir=rtl] + .treset { right: auto; left: 6px; }
.treset:hover { background: var(--gold); color: #0a0a0a; }

@media (max-width: 900px) {
  .dash { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; overflow-x: auto; padding: 8px; gap: 4px; border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .side-logo { display: none; }
  .tab { white-space: nowrap; padding: 10px 12px; border-inline-start: 0; border-bottom: 2px solid transparent; }
  .tab.active { border-color: var(--gold); }
  .tab.logout { margin-top: 0; }
  .main { padding: 20px 16px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .resa { grid-template-columns: 1fr; }
  .resa-actions { justify-content: flex-start; }
  .custom-grid, .trow { grid-template-columns: 1fr; }
  .tlabel { padding-top: 0; }
}
