/* ============================================================
   Concierge OS — feuille de style (maquette premium)
   Palette : fond clair, bleu nuit, accents dorés
   ============================================================ */

:root {
  --navy-900: #0d1730;
  --navy-800: #0f1b34;
  --navy-700: #17264a;
  --navy-600: #223764;
  --gold-500: #c9a24b;
  --gold-400: #d8b768;
  --gold-100: #f4ead1;

  --bg: #f5f6f9;
  --surface: #ffffff;
  --surface-2: #fafbfd;
  --border: #e7eaf1;
  --text: #1c2333;
  --text-soft: #5a6478;
  --text-mute: #8a93a7;

  --green: #2e9e6b;
  --green-bg: #e6f5ee;
  --red: #d9534f;
  --red-bg: #fbeae9;
  --amber: #d9962a;
  --amber-bg: #fbf1df;
  --blue: #2f6fb0;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 27, 52, 0.06), 0 1px 3px rgba(16, 27, 52, 0.05);
  --shadow-md: 0 8px 24px rgba(16, 27, 52, 0.08);
  --shadow-lg: 0 20px 50px rgba(16, 27, 52, 0.18);
  --sidebar-w: 264px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ---------- Bandeau démo ---------- */
.demo-banner {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  background: linear-gradient(90deg, var(--navy-800), var(--navy-600));
  color: #fff;
  font-size: 12.5px;
  letter-spacing: 0.2px;
}
.demo-banner strong { color: var(--gold-400); letter-spacing: 1.5px; font-size: 12px; }
.demo-banner__text { color: #d5dcec; }
.demo-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--gold-400);
  box-shadow: 0 0 0 rgba(216, 183, 104, 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(216, 183, 104, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(216, 183, 104, 0); }
  100% { box-shadow: 0 0 0 0 rgba(216, 183, 104, 0); }
}
.demo-banner__close {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.12);
  border: none; color: #fff; cursor: pointer;
  width: 22px; height: 22px; border-radius: 6px;
  font-size: 16px; line-height: 1;
}
.demo-banner__close:hover { background: rgba(255, 255, 255, 0.25); }
body.banner-hidden .demo-banner { display: none; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: calc(100vh - 37px); }

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--navy-800);
  color: #cfd7e8;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 37px;
  height: calc(100vh - 37px);
  z-index: 50;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.brand__logo {
  width: 42px; height: 42px; border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--gold-400), var(--gold-500));
  color: var(--navy-900);
  font-family: var(--serif); font-weight: 700; font-size: 22px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.3);
}
.brand__name { display: flex; flex-direction: column; }
.brand__title { font-family: var(--serif); font-size: 18px; color: #fff; font-weight: 600; }
.brand__sub { font-size: 11px; color: var(--gold-400); letter-spacing: 1px; text-transform: uppercase; }

.nav { padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav__item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  color: #b8c2d9; font-weight: 500; font-size: 14px;
  transition: background .15s, color .15s;
}
.nav__item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav__item.active {
  background: linear-gradient(90deg, rgba(201,162,75,0.18), rgba(201,162,75,0.04));
  color: #fff;
  box-shadow: inset 3px 0 0 var(--gold-500);
}
.nav__icon { width: 20px; height: 20px; opacity: .9; flex-shrink: 0; }

.sidebar__footer { padding: 14px 16px; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.user { display: flex; align-items: center; gap: 11px; }
.user__avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(145deg, var(--navy-600), var(--navy-700));
  color: var(--gold-400); display: grid; place-items: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
  border: 1px solid rgba(201,162,75,0.4);
}
.user__avatar--sm { width: 34px; height: 34px; font-size: 12px; }
.user__meta { display: flex; flex-direction: column; }
.user__name { color: #fff; font-size: 13.5px; font-weight: 600; }
.user__role { color: var(--text-mute); font-size: 11.5px; }

.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(13, 23, 48, 0.5); z-index: 45;
}

/* ---------- Main ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 37px; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 26px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar__title { font-family: var(--serif); font-size: 20px; font-weight: 600; }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar__burger { display: none; }

.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 8px 12px; border-radius: 10px; width: 240px;
}
.search__icon { width: 16px; height: 16px; opacity: .5; }
.search input { border: none; background: transparent; outline: none; font-size: 13px; width: 100%; color: var(--text); }

.icon-btn {
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; color: var(--text-soft);
  transition: background .15s, border-color .15s;
}
.icon-btn:hover { background: var(--surface-2); border-color: #d5d9e3; }
.topbar__burger span { display: block; width: 18px; height: 2px; background: var(--text); margin: 2px 0; border-radius: 2px; }

.content { padding: 26px; flex: 1; }

.footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 26px; color: var(--text-mute); font-size: 12.5px;
  border-top: 1px solid var(--border);
}
.footer__badge {
  background: var(--gold-100); color: #8a6d24;
  padding: 4px 10px; border-radius: 20px; font-weight: 600; font-size: 11.5px;
}

/* ---------- Page header ---------- */
.page-head { margin-bottom: 22px; }
.page-head h1 { font-family: var(--serif); font-size: 26px; font-weight: 600; letter-spacing: -0.2px; }
.page-head p { color: var(--text-soft); margin-top: 4px; }

/* ---------- Cards / grid ---------- */
.grid { display: grid; gap: 18px; }
.stats-grid { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card--pad { padding: 20px; }

.stat {
  padding: 20px; position: relative; overflow: hidden;
}
.stat__label { color: var(--text-soft); font-size: 12.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }
.stat__value { font-size: 30px; font-weight: 700; margin-top: 8px; font-family: var(--serif); }
.stat__value small { font-size: 15px; color: var(--text-mute); font-family: var(--font); font-weight: 500; }
.stat__delta { font-size: 12.5px; margin-top: 6px; font-weight: 600; display: inline-flex; gap: 4px; align-items: center; }
.stat__delta.up { color: var(--green); }
.stat__delta.down { color: var(--red); }
.stat__icon {
  position: absolute; top: 18px; right: 18px;
  width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--gold-100); color: var(--gold-500);
}
.stat__icon svg { width: 22px; height: 22px; }

/* ---------- Section titles ---------- */
.section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.section-title h2 { font-size: 16px; font-weight: 700; }
.section-title .hint { color: var(--text-mute); font-size: 12px; }

.two-col { grid-template-columns: 1.35fr 1fr; align-items: start; }

/* ---------- Chart ---------- */
.chart { display: flex; align-items: flex-end; gap: 14px; height: 210px; padding: 10px 4px 0; }
.chart__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.chart__bar {
  width: 60%; max-width: 46px; border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, var(--navy-600), var(--navy-800));
  position: relative; transition: height .6s cubic-bezier(.2,.8,.2,1);
  min-height: 4px;
}
.chart__col:last-child .chart__bar { background: linear-gradient(180deg, var(--gold-400), var(--gold-500)); }
.chart__val { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 600; color: var(--text-soft); white-space: nowrap; }
.chart__label { font-size: 12px; color: var(--text-soft); font-weight: 600; }
.chart__sub { font-size: 10.5px; color: var(--text-mute); }

/* ---------- List (interactions) ---------- */
.ilist { display: flex; flex-direction: column; }
.ilist__row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--border); }
.ilist__row:last-child { border-bottom: none; }
.ilist__dot { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--navy-600); flex-shrink: 0; }
.ilist__main { flex: 1; min-width: 0; }
.ilist__topic { font-weight: 600; font-size: 13.5px; }
.ilist__meta { color: var(--text-mute); font-size: 12px; }
.ilist__time { color: var(--text-soft); font-size: 12px; white-space: nowrap; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  text-align: left; padding: 12px 16px; color: var(--text-soft);
  font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .4px;
  border-bottom: 1px solid var(--border); background: var(--surface-2);
  white-space: nowrap;
}
tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border); }
tbody tr { transition: background .12s; cursor: pointer; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }
.cell-strong { font-weight: 600; }
.cell-sub { color: var(--text-mute); font-size: 12px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge--green { background: var(--green-bg); color: var(--green); }
.badge--red { background: var(--red-bg); color: var(--red); }
.badge--amber { background: var(--amber-bg); color: var(--amber); }
.badge--navy { background: #e9eefa; color: var(--blue); }
.badge--plain { background: var(--surface-2); color: var(--text-soft); }
.badge--plain::before { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 9px 16px; border-radius: 10px; font-size: 13px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent; transition: all .15s; font-family: inherit;
}
.btn--primary { background: var(--navy-800); color: #fff; }
.btn--primary:hover { background: var(--navy-700); }
.btn--gold { background: linear-gradient(145deg, var(--gold-400), var(--gold-500)); color: var(--navy-900); }
.btn--gold:hover { filter: brightness(1.05); }
.btn--ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--sm { padding: 6px 12px; font-size: 12.5px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.chip {
  padding: 7px 14px; border-radius: 20px; font-size: 13px; font-weight: 500;
  background: var(--surface); border: 1px solid var(--border); cursor: pointer; color: var(--text-soft);
}
.chip.active { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }

/* ---------- Services cards ---------- */
.svc-grid { grid-template-columns: repeat(3, 1fr); }
.svc {
  padding: 20px; display: flex; flex-direction: column; gap: 12px;
  transition: transform .15s, box-shadow .15s;
}
.svc:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.svc__top { display: flex; align-items: center; justify-content: space-between; }
.svc__icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--gold-100); color: var(--gold-500); }
.svc__icon svg { width: 24px; height: 24px; }
.svc__cat { font-size: 11px; color: var(--text-mute); text-transform: uppercase; letter-spacing: .6px; font-weight: 600; }
.svc__title { font-size: 16px; font-weight: 700; }
.svc__desc { color: var(--text-soft); font-size: 13px; flex: 1; }
.svc__foot { display: flex; align-items: center; justify-content: space-between; padding-top: 6px; border-top: 1px solid var(--border); }

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; cursor: pointer; }
.switch input { display: none; }
.switch__track { position: absolute; inset: 0; background: #cbd2e0; border-radius: 20px; transition: .2s; }
.switch__track::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: var(--shadow-sm); }
.switch input:checked + .switch__track { background: var(--green); }
.switch input:checked + .switch__track::before { transform: translateX(18px); }

/* ---------- Integrations ---------- */
.int-grid { grid-template-columns: repeat(2, 1fr); }
.int { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.int__head { display: flex; align-items: center; gap: 12px; }
.int__logo { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 16px; }
.int__name { font-weight: 700; font-size: 15px; }
.int__type { color: var(--text-mute); font-size: 12px; }
.int__quota-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-soft); margin-bottom: 6px; }
.progress { height: 8px; background: var(--surface-2); border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.progress__bar { height: 100%; border-radius: 6px; transition: width .6s; }
.int__foot { display: flex; align-items: center; justify-content: space-between; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; }
.modal.open { display: block; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(13, 23, 48, 0.55); backdrop-filter: blur(3px); }
.modal__dialog {
  position: relative; max-width: 560px; width: calc(100% - 32px);
  margin: 6vh auto; background: var(--surface); border-radius: 18px;
  box-shadow: var(--shadow-lg); max-height: 86vh; overflow-y: auto;
  animation: modalIn .25s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.modal__close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 34px; height: 34px; border-radius: 9px; border: none;
  background: var(--surface-2); cursor: pointer; font-size: 20px; color: var(--text-soft);
}
.modal__close:hover { background: var(--border); }
.modal__body { padding: 26px; }

.detail-head { display: flex; gap: 16px; align-items: center; margin-bottom: 20px; }
.detail-head__logo { width: 58px; height: 58px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(145deg, var(--navy-600), var(--navy-800)); color: var(--gold-400); font-family: var(--serif); font-size: 24px; font-weight: 700; }
.detail-head h3 { font-family: var(--serif); font-size: 22px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0; }
.detail-item { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.detail-item__label { color: var(--text-mute); font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; }
.detail-item__value { font-weight: 600; font-size: 15px; margin-top: 3px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-soft); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); font-family: inherit; font-size: 13.5px; color: var(--text); outline: none;
}
.field input:focus, .field textarea:focus { border-color: var(--gold-500); background: #fff; }
.modal__actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--navy-800); color: #fff; padding: 12px 16px; border-radius: 11px;
  box-shadow: var(--shadow-lg); font-size: 13.5px; display: flex; align-items: center; gap: 10px;
  animation: toastIn .3s ease; max-width: 320px;
}
.toast__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold-400); flex-shrink: 0; }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ---------- Utilities ---------- */
.mt-24 { margin-top: 24px; }
.muted { color: var(--text-mute); }
.right { text-align: right; }
.spin { display: inline-block; width: 13px; height: 13px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .svc-grid { grid-template-columns: repeat(2, 1fr); }
  .int-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .sidebar {
    position: fixed; left: 0; top: 0; height: 100vh;
    transform: translateX(-100%); transition: transform .25s ease;
    box-shadow: var(--shadow-lg);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-overlay { display: block; }
  .topbar__burger { display: grid; place-items: center; }
  .topbar { top: 0; }
  .demo-banner__text { display: none; }
  .search { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .svc-grid { grid-template-columns: 1fr; }
  .content { padding: 18px 16px; }
  .detail-grid { grid-template-columns: 1fr; }
  .stat__value { font-size: 26px; }
}
@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr; }
}
