
:root {
  --bg: #f4f4f1;
  --surface: #ffffff;
  --surface-2: #ecece8;
  --text: #151515;
  --muted: #72726e;
  --line: #ddddda;
  --accent: #151515;
  --accent-contrast: #ffffff;
  --success: #2f7d4a;
  --warning: #9b6815;
  --danger: #9f3434;
  --shadow: 0 16px 50px rgba(0, 0, 0, .07);
  --radius: 22px;
}

body.dark {
  --bg: #0d0d0d;
  --surface: #161616;
  --surface-2: #202020;
  --text: #f4f4f1;
  --muted: #a1a19c;
  --line: #2d2d2d;
  --accent: #f3f3ef;
  --accent-contrast: #111111;
  --shadow: 0 20px 60px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

button, input, select, textarea { font: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

button { cursor: pointer; }

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

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  z-index: 20;
}

.brand, .mini-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand { padding: 4px 8px 28px; }

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--accent-contrast);
  background: var(--accent);
  font-weight: 800;
  font-size: 20px;
}

.brand strong, .mini-profile strong {
  display: block;
  font-size: 14px;
}

.brand span, .mini-profile span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-link {
  width: 100%;
  border: 0;
  color: var(--muted);
  background: transparent;
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  transition: .2s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--text);
  background: var(--surface-2);
}

.nav-icon {
  width: 22px;
  text-align: center;
  font-weight: 700;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 16px;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--accent-contrast);
  background: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.ghost-button {
  width: 100%;
  padding: 10px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.main {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 30px 42px 70px;
}

.topbar {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.topbar h1 {
  margin: 4px 0 0;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -.04em;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
}

.topbar-actions, .hero-actions, .section-heading, .panel-head, .filters {
  display: flex;
  align-items: center;
}

.topbar-actions, .hero-actions { gap: 10px; }

.mobile-menu {
  display: none;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 24px;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
}

.primary-button, .secondary-button {
  min-height: 44px;
  border-radius: 13px;
  padding: 11px 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent);
  font-weight: 750;
  transition: transform .2s ease, opacity .2s ease;
}

.primary-button {
  color: var(--accent-contrast);
  background: var(--accent);
}

.secondary-button {
  color: var(--text);
  background: transparent;
  border-color: var(--line);
}

.primary-button:hover, .secondary-button:hover { transform: translateY(-1px); }

.compact { min-height: 40px; padding: 9px 14px; }

.full { width: 100%; }

.is-disabled {
  opacity: .45;
  pointer-events: none;
}

.view { display: none; animation: fade .25s ease; }
.view.active { display: block; }

@keyframes fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.hero-card {
  min-height: 350px;
  color: #f7f7f4;
  background:
    radial-gradient(circle at 82% 20%, rgba(255,255,255,.14), transparent 22%),
    linear-gradient(135deg, #151515, #292929 60%, #101010);
  border-radius: 30px;
  padding: clamp(28px, 5vw, 58px);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr);
  gap: 44px;
  align-items: center;
  box-shadow: var(--shadow);
}

.hero-copy h2 {
  max-width: 650px;
  margin: 18px 0 14px;
  font-size: clamp(38px, 6vw, 70px);
  line-height: .98;
  letter-spacing: -.065em;
}

.hero-copy p {
  max-width: 600px;
  margin: 0 0 28px;
  color: #bcbcb7;
  font-size: 17px;
  line-height: 1.65;
}

.pill {
  display: inline-flex;
  padding: 8px 12px;
  color: #f5f5f2;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.hero-card .primary-button {
  color: #111;
  background: #f3f3ef;
  border-color: #f3f3ef;
}

.hero-card .secondary-button {
  color: #f3f3ef;
  border-color: rgba(255,255,255,.22);
}

.token-panel {
  padding: 28px;
  display: grid;
  grid-template-columns: 144px 1fr;
  gap: 25px;
  align-items: center;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 24px;
  backdrop-filter: blur(10px);
}

.token-circle {
  --progress: 40%;
  width: 140px;
  height: 140px;
  position: relative;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(#f4f4ef var(--progress), rgba(255,255,255,.12) 0);
}

.token-circle::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: #242424;
}

.token-circle div {
  position: relative;
  z-index: 1;
  text-align: center;
}

.token-circle strong {
  display: block;
  font-size: 38px;
  letter-spacing: -.04em;
}

.token-circle span, .token-panel small, .muted {
  color: #aaa9a5;
}

.token-panel p { margin: 0 0 5px; }
.token-panel strong { font-size: 17px; }
.token-panel small { display: block; margin-top: 9px; }

.progress {
  height: 7px;
  margin-top: 15px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
}

.progress-bar {
  width: 40%;
  height: 100%;
  border-radius: inherit;
  background: #f2f2ee;
}

.stats-grid {
  margin: 24px 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stat-card, .panel, .table-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat-card {
  min-height: 146px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-card strong {
  font-size: 38px;
  letter-spacing: -.05em;
}

.stat-card .small-strong {
  font-size: 23px;
}

.stat-label, .stat-note {
  color: var(--muted);
  font-size: 12px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, .6fr);
  gap: 20px;
  margin-bottom: 20px;
}

.panel {
  padding: 24px;
}

.panel-head, .section-heading {
  justify-content: space-between;
  gap: 20px;
}

.panel-head { margin-bottom: 20px; }

.panel-head h3, .section-heading h2 {
  margin: 5px 0 0;
  letter-spacing: -.035em;
}

.panel-head h3 { font-size: 23px; }
.section-heading h2 { font-size: clamp(32px, 5vw, 54px); }

.section-heading {
  margin: 22px 0 26px;
}

.section-heading p:not(.eyebrow) {
  margin: 10px 0 0;
  color: var(--muted);
}

.text-button, .filter {
  color: var(--muted);
  background: transparent;
  border: 0;
  font-weight: 700;
}

.text-button:hover { color: var(--text); }

.project-list {
  display: grid;
  gap: 12px;
}

.project-line {
  padding: 15px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  background: var(--surface-2);
  border-radius: 15px;
}

.project-line strong { display: block; }
.project-line span, .project-line p {
  color: var(--muted);
  font-size: 12px;
}
.project-line p { margin: 5px 0 0; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.status.active { color: var(--warning); background: color-mix(in srgb, var(--warning) 12%, transparent); }
.status.delivered, .status.paid { color: var(--success); background: color-mix(in srgb, var(--success) 12%, transparent); }
.status.pending { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }

.appointment-card {
  margin-bottom: 20px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--surface-2);
  border-radius: 17px;
}

.date-block {
  min-width: 72px;
  height: 78px;
  display: grid;
  place-items: center;
  align-content: center;
  color: var(--accent-contrast);
  background: var(--accent);
  border-radius: 16px;
}

.date-block strong { font-size: 28px; line-height: 1; }
.date-block span { margin-top: 5px; font-size: 10px; font-weight: 800; }
.appointment-card p { margin: 6px 0; color: var(--muted); }
.appointment-card > div:last-child > span { color: var(--muted); font-size: 12px; }

.media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.media-grid.large {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.media-card-link {
  display: block;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  border-radius: 18px;
  outline: none;
}

.media-card-link:focus-visible {
  box-shadow: 0 0 0 3px var(--text);
}

.media-card-link:hover .media-card {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--text) 32%, var(--line));
}

.media-card-link:hover .media-open-indicator {
  opacity: 1;
  transform: translate(0, 0);
}

.media-card-link:hover .media-open-text {
  color: var(--text);
}

.media-open-indicator {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #111;
  background: rgba(255,255,255,.9);
  border-radius: 50%;
  font-size: 16px;
  font-weight: 800;
  opacity: 0;
  transform: translate(-3px, 3px);
  transition: .2s ease;
}

.media-open-text {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  transition: color .2s ease;
}

.media-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  transition: transform .2s ease, box-shadow .2s ease;
}


.media-thumb {
  aspect-ratio: 16 / 10;
  position: relative;
  overflow: hidden;
  background: #2b2b2b;
}

.media-thumb::before, .media-thumb::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(4px);
}

.media-thumb::before {
  width: 65%;
  height: 65%;
  top: -15%;
  right: -5%;
  background: var(--tone-1, #c8a96a);
}

.media-thumb::after {
  width: 52%;
  height: 60%;
  bottom: -20%;
  left: -8%;
  background: var(--tone-2, #565f5c);
}

.media-icon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 2;
  color: rgba(255,255,255,.9);
  font-size: 42px;
  font-weight: 800;
}

.media-content { padding: 16px; }
.media-content h4 { margin: 0 0 7px; font-size: 15px; }
.media-content p { margin: 0; color: var(--muted); font-size: 12px; }
.media-meta { margin-top: 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.media-meta a { font-size: 12px; font-weight: 800; }

.filters {
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.filter {
  padding: 9px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.filter.active {
  color: var(--accent-contrast);
  background: var(--accent);
  border-color: var(--accent);
}

.project-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

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

.project-card-top, .project-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.project-card h3 { margin: 18px 0 7px; font-size: 23px; }
.project-card p { margin: 0; color: var(--muted); }

.project-card-footer {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.project-card-footer span { color: var(--muted); font-size: 12px; }

.table-card { overflow: hidden; }

.invoice-row {
  min-height: 72px;
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 1.3fr .9fr .8fr .8fr auto;
  gap: 18px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.invoice-row:last-child { border-bottom: 0; }

.invoice-head {
  min-height: 50px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.download-button {
  padding: 8px 11px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 700;
}

.form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr);
  gap: 20px;
  align-items: start;
}

.request-form {
  display: grid;
  gap: 18px;
}

.request-form label {
  display: grid;
  gap: 8px;
  font-size: 13px;
  font-weight: 750;
}

.request-form input, .request-form select, .request-form textarea {
  width: 100%;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 13px;
  padding: 13px 14px;
  outline: none;
}

.request-form input:focus, .request-form select:focus, .request-form textarea:focus {
  border-color: var(--text);
}

.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.checkbox-label {
  grid-template-columns: auto 1fr !important;
  align-items: center;
}

.checkbox-label input { width: auto; }

.form-status {
  min-height: 20px;
  margin: 0;
  color: var(--success);
  font-size: 13px;
}

.support-panel h3 { font-size: 28px; margin: 10px 0; }
.support-panel p:not(.eyebrow) { color: var(--muted); line-height: 1.65; }
.ghost-link { display: block; margin: 20px 0; font-weight: 800; }
.support-note { padding: 16px; background: var(--surface-2); border-radius: 14px; }
.support-note strong, .support-note span { display: block; }
.support-note span { margin-top: 4px; color: var(--muted); font-size: 12px; }

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  padding: 14px 18px;
  color: var(--accent-contrast);
  background: var(--accent);
  border-radius: 13px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px);
  transition: .25s ease;
  z-index: 50;
}

.toast.show {
  opacity: 1;
  transform: none;
}

@media (max-width: 1100px) {
  .hero-card { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
  .media-grid, .media-grid.large { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0;
    transform: translateX(-105%);
    transition: transform .25s ease;
    box-shadow: var(--shadow);
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu { display: block; }
  .main { padding: 20px 18px 50px; }
  .topbar { align-items: flex-start; }
  .topbar-actions .compact { display: none; }
  .project-cards, .form-layout { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .hero-card { padding: 28px 22px; border-radius: 22px; }
  .hero-copy h2 { font-size: 42px; }
  .token-panel { grid-template-columns: 1fr; }
  .token-circle { margin: auto; }
  .stats-grid, .media-grid, .media-grid.large { grid-template-columns: 1fr; }
  .two-cols { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .invoice-row {
    grid-template-columns: 1fr 1fr;
  }
  .invoice-head { display: none; }
}


/* Description dynamique des prestations */
.service-details {
  padding: 19px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.service-details-placeholder {
  color: var(--muted);
  font-size: 13px;
}

.service-details-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.service-details-head strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
}

.service-details-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}

.service-token-badge {
  flex: 0 0 auto;
  padding: 7px 10px;
  color: var(--accent-contrast);
  background: var(--accent);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.service-details p {
  margin: 14px 0 12px;
  color: var(--muted);
  line-height: 1.6;
}

.service-details ul {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

/* Vraies miniatures venant de media.preview_url */
.media-thumb.has-preview {
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.media-thumb.has-preview::before,
.media-thumb.has-preview::after,
.media-thumb.has-preview .media-icon {
  display: none;
}

.media-thumb.has-preview::after {
  content: "";
  display: block;
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.16), transparent 55%);
  filter: none;
  border-radius: 0;
}


/* Options bonus des demandes */
.bonus-options {
  margin: 0;
  padding: 18px;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.bonus-options legend {
  padding: 0 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.bonus-options legend span {
  margin-left: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.bonus-intro {
  margin: -2px 0 4px;
  color: var(--muted);
  font-size: 13px;
}

.request-form .bonus-option {
  min-height: 64px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color .2s ease, transform .2s ease, background .2s ease;
}

.request-form .bonus-option:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.request-form .bonus-option:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.request-form .bonus-option input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--accent);
}

.bonus-option span {
  min-width: 0;
}

.bonus-option strong,
.bonus-option small {
  display: block;
}

.bonus-option strong {
  color: var(--text);
  font-size: 13px;
}

.bonus-option small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.bonus-option b {
  padding: 5px 8px;
  color: var(--accent-contrast);
  background: var(--accent);
  border-radius: 999px;
  font-size: 11px;
}

.request-estimate {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--text);
  color: var(--surface);
}

.request-estimate span,
.request-estimate strong {
  display: block;
}

.request-estimate > div > span {
  margin-bottom: 4px;
  opacity: .66;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.request-estimate > div > strong {
  font-size: 13px;
}

.request-estimate-total {
  flex: 0 0 auto;
  font-size: 20px;
  font-weight: 900;
}

body.dark .request-estimate {
  background: #f4f4f1;
  color: #151515;
}

@media (max-width: 600px) {
  .request-form .bonus-option {
    grid-template-columns: auto 1fr;
  }

  .bonus-option b {
    grid-column: 2;
    justify-self: start;
  }

  .request-estimate {
    align-items: flex-start;
    flex-direction: column;
  }
}
