/* ================================================================
   ACCUEIL — UI Refresh
   Inspired by Orfeo / modern SaaS for performing arts
   ================================================================ */

/* ---- Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, sans-serif;

  /* Refined palette */
  --ink-900: #0f172a;
  --ink-700: #334155;
  --ink-500: #64748b;
  --ink-300: #cbd5e1;
  --ink-100: #f1f5f9;

  --blue-600: #2563eb;
  --blue-100: #dbeafe;

  --green-600: #16a34a;
  --green-100: #dcfce7;

  --amber-600: #d97706;
  --amber-100: #fef3c7;

  --red-600: #dc2626;
  --red-100: #fee2e2;

  /* Topbar */
  --topbar-h: 58px;
  /* Bottom nav (mobile only) */
  --bottomnav-h: 60px;
}

/* ---- Base typography ---- */
html, body {
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ================================================================
   TOPBAR — refinements
   ================================================================ */
.topbar {
  height: var(--topbar-h);
  background: linear-gradient(180deg, #0d1526, #111d35);
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.topbar .inner {
  height: var(--topbar-h);
  padding: 0 18px;
}

.brand {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.01em;
}

.nav a {
  font-size: 13.5px;
  font-weight: 500;
  padding: 7px 11px;
  border-radius: 8px;
  color: rgba(255,255,255,.75);
  transition: color .14s, background .14s;
}
.nav a:hover {
  color: rgba(255,255,255,.95);
  background: rgba(255,255,255,.08);
}
.nav a.active {
  color: #fff;
  background: rgba(255,255,255,.12);
  font-weight: 600;
}

.pill {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.88);
}

/* ================================================================
   BOTTOM NAVIGATION — mobile only
   ================================================================ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottomnav-h);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: linear-gradient(180deg, #0d1526, #111d35);
  border-top: 1px solid rgba(255,255,255,.08);
  z-index: 998;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

@media (max-width: 860px) {
  .bottom-nav { display: flex; }

  /* Espace sous le contenu pour ne pas masquer par la bottom nav */
  main.container {
    padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px) + 14px);
  }

  /* La bottom nav complète le burger — on garde les deux */
  /* Masquer "Plus" du burger dans la nav desktop */
  .nav { display: none !important; }
  body.nav-open .nav {
    display: flex !important;
    top: var(--topbar-h);
  }

  /* Grilles : repli 1 colonne sur mobile */
  .grid { grid-template-columns: 1fr !important; }

  /* Tables : scroll horizontal plutôt que débordement */
  table { display: block; overflow-x: auto; width: 100%; -webkit-overflow-scrolling: touch; }
}

.bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  color: rgba(255,255,255,.5);
  text-decoration: none;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .01em;
  min-height: 44px;
  transition: color .14s;
  border: none;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav__item:hover,
.bottom-nav__item.active {
  color: rgba(255,255,255,.95);
}

.bottom-nav__item.active {
  color: #60a5fa;
}

.bottom-nav__icon {
  font-size: 19px;
  line-height: 1;
  display: block;
}

/* ================================================================
   CARDS — refinements
   ================================================================ */
.card {
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,.08);
  background: #fff;
  box-shadow: 0 1px 3px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.05);
  transition: box-shadow .15s ease, border-color .15s ease;
}

.card:hover {
  box-shadow: 0 2px 6px rgba(15,23,42,.06), 0 16px 40px rgba(15,23,42,.08);
  border-color: rgba(15,23,42,.11);
  transform: none; /* remove jump on hover for content cards */
}

/* Only translate on explicitly clickable cards */
a.card:hover { transform: translateY(-1px); }

.card .hd {
  padding: 13px 16px 11px;
  border-bottom: 1px solid rgba(15,23,42,.07);
  background: linear-gradient(180deg, #fafbff, #fff);
  border-radius: 14px 14px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.card .hd h2,
.card .hd h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-900);
  letter-spacing: -.01em;
}

.card .bd {
  padding: 15px 16px;
}

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.13);
  background: #fff;
  color: var(--ink-900);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  min-height: 36px;
  box-shadow: 0 1px 2px rgba(15,23,42,.06);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease, background .12s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(15,23,42,.12);
  filter: brightness(1.02);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(15,23,42,.06);
}

.btn.primary {
  background: var(--blue-600);
  border-color: var(--blue-600);
  color: #fff;
  box-shadow: 0 1px 3px rgba(37,99,235,.35), 0 4px 12px rgba(37,99,235,.18);
}

.btn.primary:hover {
  background: #1d52d6;
  border-color: #1d52d6;
  filter: none;
  box-shadow: 0 2px 6px rgba(37,99,235,.4), 0 8px 18px rgba(37,99,235,.22);
}

.btn.danger {
  background: var(--red-600);
  border-color: var(--red-600);
  color: #fff;
}

.btn.small {
  padding: 5px 11px;
  font-size: 12px;
  min-height: 30px;
  border-radius: 999px;
}

/* Touch-friendly on mobile */
@media (max-width: 860px) {
  .btn { min-height: 40px; padding: 9px 16px; }
  .btn.small { min-height: 34px; padding: 7px 12px; }
}

/* ================================================================
   FORMS — .lbl + .inp
   ================================================================ */
.lbl {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(15,23,42,.65);
  margin-bottom: 5px;
  letter-spacing: .01em;
}

.inp,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="password"],
input[type="search"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1.5px solid rgba(15,23,42,.12);
  background: #fff;
  font: inherit;
  font-size: 14px;
  color: var(--ink-900);
  box-shadow: inset 0 1px 2px rgba(15,23,42,.04);
  transition: border-color .14s, box-shadow .14s;
  -webkit-appearance: none;
  appearance: none;
}

.inp:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(37,99,235,.5);
  box-shadow: inset 0 1px 2px rgba(15,23,42,.04), 0 0 0 3px rgba(37,99,235,.14);
}

.inp::placeholder,
input::placeholder,
textarea::placeholder {
  color: rgba(15,23,42,.35);
}

textarea {
  min-height: 90px;
  resize: vertical;
  line-height: 1.5;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

/* ================================================================
   BADGES
   ================================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .01em;
  border: 1px solid rgba(15,23,42,.09);
  background: var(--ink-100);
  color: var(--ink-700);
}

.badge.ok, .badge.success {
  background: var(--green-100);
  color: #14532d;
  border-color: rgba(22,163,74,.18);
}

.badge.warn, .badge.warning {
  background: var(--amber-100);
  color: #78350f;
  border-color: rgba(217,119,6,.18);
}

.badge.danger, .badge.error {
  background: var(--red-100);
  color: #7f1d1d;
  border-color: rgba(220,38,38,.18);
}

/* Pulse on badge.danger removed (too distracting in lists) */
.badge.danger { animation: none; }

/* ================================================================
   NOTICES
   ================================================================ */
.notice {
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid rgba(15,23,42,.09);
  background: var(--ink-100);
  font-size: 13.5px;
  line-height: 1.45;
}

.notice.ok, .notice.success {
  background: #f0fdf4;
  border-color: rgba(22,163,74,.22);
  color: #14532d;
}

.notice.error, .notice.danger {
  background: #fef2f2;
  border-color: rgba(220,38,38,.22);
  color: #7f1d1d;
}

.notice.warning {
  background: #fffbeb;
  border-color: rgba(217,119,6,.22);
  color: #78350f;
}

/* ================================================================
   TABLES — better readability
   ================================================================ */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.table th {
  padding: 10px 12px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-500);
  background: rgba(15,23,42,.025);
  border-bottom: 1px solid rgba(15,23,42,.07);
}

.table td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(15,23,42,.06);
  vertical-align: middle;
  color: var(--ink-900);
}

.table tbody tr:last-child td { border-bottom: none; }

.table tbody tr:hover td {
  background: rgba(37,99,235,.03);
}

/* Horizontal scroll on mobile */
.card .bd { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 720px) {
  .table th, .table td { padding: 9px 8px; font-size: 13px; }
}

/* ================================================================
   KPI items
   ================================================================ */
.kpi { display: flex; gap: 10px; flex-wrap: wrap; }

.kpi .item {
  min-width: 130px;
  flex: 1;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(15,23,42,.09);
  background: linear-gradient(180deg, #fafbff, #fff);
}

.kpi .item .muted { font-size: 12px; }

.kpi .item > div:last-child {
  font-size: 19px;
  font-weight: 800;
  color: var(--ink-900);
  margin-top: 4px;
}

/* ================================================================
   LIST ITEMS (alerts / results)
   ================================================================ */
.list { display: flex; flex-direction: column; gap: 8px; }

.list-item {
  padding: 11px 13px;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15,23,42,.04);
  transition: border-color .14s, box-shadow .14s;
}

.list-item:hover {
  border-color: rgba(37,99,235,.2);
  box-shadow: 0 2px 8px rgba(15,23,42,.07);
}

/* ================================================================
   GRID
   ================================================================ */
.grid { display: grid; grid-template-columns: 1.2fr .9fr; gap: 16px; }

@media (max-width: 1000px) { .grid { grid-template-columns: 1fr; } }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 720px) { .row { grid-template-columns: 1fr; } }

/* ================================================================
   CONTAINER spacing
   ================================================================ */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 16px;
}

@media (max-width: 640px) {
  .container { padding: 12px 12px; }
  .card .hd { padding: 11px 13px 9px; }
  .card .bd { padding: 12px 13px; }
}

/* ================================================================
   MUTED + small
   ================================================================ */
.muted, small { color: var(--ink-500); font-size: 13px; }

/* ================================================================
   EMPTY STATES
   ================================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  text-align: center;
  gap: 10px;
}

.empty-state__icon {
  font-size: 36px;
  opacity: .55;
  line-height: 1;
}

.empty-state__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-700);
}

.empty-state__sub {
  font-size: 13px;
  color: var(--ink-500);
  max-width: 320px;
  line-height: 1.45;
}

/* ================================================================
   SECTION HEADERS (page-level titles)
   ================================================================ */
.page-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.page-hd h1, .page-hd__title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--ink-900);
}

@media (max-width: 640px) {
  .page-hd h1, .page-hd__title { font-size: 17px; }
}

/* ================================================================
   SEARCH / FILTER bar
   ================================================================ */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
}

.filter-bar .inp, .filter-bar input, .filter-bar select {
  max-width: 260px;
  flex: 1;
}

@media (max-width: 640px) {
  .filter-bar .inp,
  .filter-bar input,
  .filter-bar select { max-width: none; width: 100%; }
  .filter-bar { flex-direction: column; align-items: stretch; }
}

/* ================================================================
   MODAL (generic)
   ================================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8,12,22,.48);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-box {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(8,12,22,.28);
  border: 1px solid rgba(15,23,42,.09);
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 40px);
  overflow: auto;
}

.modal-box .modal-hd {
  padding: 14px 18px 12px;
  border-bottom: 1px solid rgba(15,23,42,.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal-box .modal-hd h2, .modal-box .modal-hd h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.modal-box .modal-bd {
  padding: 16px 18px;
}

/* ================================================================
   STATUS DOTS (calendar)
   ================================================================ */
.dash-status-dot.is-confirmed { background: #22c55e; }
.dash-status-dot.is-option { background: #f59e0b; }
.dash-status-dot.is-cancelled { background: #ef4444; }
.dash-status-dot.is-other { background: #94a3b8; }

/* ================================================================
   RESPONSIVE helpers
   ================================================================ */
@media (max-width: 640px) {
  .hide-mobile { display: none !important; }
}

@media (min-width: 641px) {
  .show-mobile { display: none !important; }
}

/* ================================================================
   FOOTER ACTIONS (forms)
   ================================================================ */
.footer-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(15,23,42,.07);
}

/* ================================================================
   STEPPER (progression contrat / workflow)
   ================================================================ */
.stepper {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin: 0 0 18px 0;
  overflow-x: auto;
}
.stepper .step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 64px;
  position: relative;
}
/* trait horizontal entre les étapes */
.stepper .step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 11px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: #e2e8f0;
  z-index: 0;
}
.stepper .step.done:not(:last-child)::after,
.stepper .step.current:not(:last-child)::after {
  background: var(--blue, #2563eb);
}
.stepper .dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  background: #fff;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  transition: background .2s, border-color .2s;
}
.stepper .step.done .dot {
  background: var(--blue, #2563eb);
  border-color: var(--blue, #2563eb);
}
.stepper .step.current .dot {
  border-color: var(--blue, #2563eb);
  box-shadow: 0 0 0 4px rgba(37,99,235,.15);
}
.stepper .label {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  text-align: center;
  line-height: 1.25;
}
.stepper .step.done .label  { color: var(--blue, #2563eb); }
.stepper .step.current .label { color: #0f172a; }

/* ================================================================
   PRINT
   ================================================================ */
@media print {
  .bottom-nav, .burger, .topbar, .nav, .btn, .flash { display: none !important; }
  body { background: #fff !important; padding: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #e2e8f0 !important; }
  main.container { padding-bottom: 0 !important; }
}
