/* CoteCars — mise en page des outils pros (espace pro, studio photo, boutique, admin) */
body { background: #f8f9fb; }
.shell { display: grid; grid-template-columns: 346px 1fr; min-height: calc(100 * var(--vh)); }
.side { background: #fff; border-right: 1px solid var(--border); position: sticky; top: 0; height: calc(100 * var(--vh)); display: flex; flex-direction: column; }
.side .brand { height: 100px; display: flex; align-items: center; padding: 0 28px; border-bottom: 1px solid #f1f3f6; font-size: 26px; font-weight: 800; color: var(--blue); letter-spacing: -.02em; }
.side .who { display: flex; align-items: center; gap: 16px; padding: 22px 22px; border-bottom: 1px solid var(--border); background: #fcfcfd; }
.avatar { width: 50px; height: 50px; border-radius: 50%; background: var(--blue-50); border: 1px solid var(--blue-100); color: var(--blue); display: grid; place-items: center; font-weight: 700; font-size: 17px; flex-shrink: 0; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.who b { display: block; font-size: 16px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { display: block; font-size: 13.5px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side nav { flex: 1; overflow-y: auto; padding: 22px 16px; display: flex; flex-direction: column; gap: 6px; }
.nav-i { display: flex; align-items: center; gap: 16px; height: 54px; padding: 0 18px; border-radius: 12px; border: 0; background: none; font-size: 18px; font-weight: 500; color: var(--text); text-align: left; width: 100%; transition: background .12s; }
.nav-i svg { color: var(--text3); }
.nav-i:hover { background: #f5f7fa; }
.nav-i.on { background: var(--blue); color: #fff; font-weight: 600; box-shadow: 0 6px 18px rgba(26, 71, 216, .3); }
.nav-i.on svg { color: #fff; }
.nav-i .cnt { margin-left: auto; min-width: 26px; height: 26px; border-radius: 99px; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--orange); color: #fff; padding: 0 7px; }
.nav-i.on .cnt { background: #fff; color: var(--blue); }
.side .foot { border-top: 1px solid var(--border); padding: 18px 16px; }
.side .foot .nav-i { color: var(--red); font-weight: 600; }
.side .foot .nav-i svg { color: var(--red); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 78px; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 32px 0 44px; position: sticky; top: 0; z-index: 30; gap: 14px; }
.topbar h1 { margin: 0; font-size: 27px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar a { color: var(--blue); font-weight: 600; font-size: 18px; white-space: nowrap; }
.burger { display: none; }
.content { padding: 46px 32px 60px 44px; max-width: 1680px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 34px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 31px; font-weight: 700; color: var(--ink); letter-spacing: -.02em; display: flex; align-items: center; gap: 12px; }
.page-head p { margin: 6px 0 0; font-size: 19px; color: var(--text2); }
.page-head .acts { display: flex; gap: 14px; flex-wrap: wrap; }
.page-head .btn { height: 50px; font-size: 18px; padding: 0 22px; border-radius: 12px; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin-bottom: 34px; }
.kpi { padding: 26px 28px 26px; border-radius: 20px; min-height: 180px; display: flex; flex-direction: column; }
.kpi .h { display: flex; align-items: center; gap: 16px; font-size: 17.5px; color: var(--text2); font-weight: 500; }
.kpi .v { font-size: 44px; font-weight: 700; color: var(--ink); letter-spacing: -.02em; margin-top: auto; line-height: 1; }
.kpi .row { display: flex; align-items: flex-end; justify-content: space-between; margin-top: auto; gap: 10px; }
.trend { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 10px; background: var(--green-50); color: var(--green); font-weight: 700; font-size: 16px; }
.trend.down { background: var(--red-50); color: var(--red); }
.trend.flat { background: #f3f4f6; color: var(--text3); }
.two { display: grid; grid-template-columns: minmax(0, 1fr) 506px; gap: 34px; align-items: start; }
.tbl-card { border-radius: 20px; overflow: hidden; }
.tbl-card .th { display: flex; justify-content: space-between; align-items: center; padding: 30px 34px; }
.tbl-card h3 { margin: 0; font-size: 23px; font-weight: 700; color: var(--ink); }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 18px; font-weight: 600; color: var(--text2); background: #fafbfc; padding: 18px 34px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); white-space: nowrap; }
table.t td { padding: 18px 34px; border-bottom: 1px solid #f1f3f6; font-size: 18px; color: var(--ink); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr:hover td { background: #fbfcfe; }
table.t .r { text-align: right; }
.veh { display: flex; align-items: center; gap: 16px; max-width: 330px; }
.veh img, .veh .ph { width: 56px; height: 44px; border-radius: 6px; object-fit: cover; background: #eef1f5; flex-shrink: 0; display: grid; place-items: center; color: var(--text3); }
.veh span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.st { display: inline-block; padding: 5px 11px; border-radius: 8px; font-size: 16px; font-weight: 500; }
.st.on { background: var(--green-50); color: var(--green); }
.st.sold { background: var(--blue-50); color: var(--blue); }
.st.off { background: #f3f4f6; color: var(--text2); }
.perf { border-radius: 24px; padding: 34px; color: #fff; background: radial-gradient(circle at 10% 110%, rgba(124, 58, 237, .45), transparent 45%), linear-gradient(160deg, #0d1f63 0%, #0b1b52 100%); box-shadow: var(--shadow-lg); }
.perf .hd { display: flex; align-items: center; gap: 16px; margin-bottom: 40px; }
.perf .hd .ic { width: 50px; height: 50px; border-radius: 12px; background: rgba(255,255,255,.1); display: grid; place-items: center; color: #9ab4ff; }
.perf .hd b { font-size: 24px; flex: 1; }
.perf .chip { background: rgba(255,255,255,.12); padding: 7px 14px; border-radius: 99px; font-size: 15px; font-weight: 600; }
.perf .lbl { font-size: 18px; opacity: .8; }
.perf .big { font-size: 52px; font-weight: 800; letter-spacing: -.02em; display: flex; align-items: center; gap: 14px; margin: 6px 0 18px; }
.perf .big small { font-size: 24px; font-weight: 600; }
.perf .tag { background: rgba(16, 185, 129, .18); color: #34d399; font-size: 15px; font-weight: 700; padding: 5px 10px; border-radius: 8px; display: inline-flex; align-items: center; gap: 5px; }
.perf .tag.bad { background: rgba(245, 158, 11, .18); color: #fbbf24; }
.perf .bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.12); overflow: hidden; }
.perf .bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #a855f7, #ec4899); }
.perf .bar.blue i { background: linear-gradient(90deg, #60a5fa, #818cf8); }
.perf .foot { display: flex; justify-content: space-between; font-size: 16px; opacity: .85; margin-top: 16px; }
.perf .sep { height: 1px; background: rgba(255,255,255,.08); margin: 34px 0; }

/* Demandes */
.tabs { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 34px; }
.tab { height: 44px; padding: 0 17px; border-radius: 10px; border: 1px solid var(--border2); background: #fff; font-weight: 600; font-size: 16px; color: var(--text2); display: inline-flex; align-items: center; gap: 10px; }
.tab:hover { border-color: var(--text3); color: var(--ink); }
.tab.on { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 4px 12px rgba(26, 71, 216, .25); }
.tab small { font-size: 13px; font-weight: 700; }
.req-list { display: flex; flex-direction: column; gap: 18px; }
.req-card { border-radius: 20px; overflow: hidden; transition: box-shadow .15s; }
.req-card.new { border: 1.5px solid #fbe39a; box-shadow: 0 0 0 3px rgba(253, 230, 138, .25), var(--shadow); }
.req-top { display: flex; align-items: center; gap: 22px; padding: 22px 30px; cursor: pointer; background: none; border: 0; width: 100%; text-align: left; }
.req-top .ic { width: 56px; height: 56px; border-radius: 14px; background: #f3f4f6; display: grid; place-items: center; color: var(--text2); flex-shrink: 0; }
.req-top .t { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 20px; font-weight: 700; color: var(--ink); }
.req-top .m { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 6px; color: var(--text2); font-size: 17px; }
.req-top .m span { display: inline-flex; align-items: center; gap: 6px; }
.req-top .m .est { color: var(--blue); font-weight: 700; }
.req-top .chev { margin-left: auto; color: var(--text2); transition: transform .15s; }
.req-top .chev.open { transform: rotate(180deg); }
.req-body { border-top: 1px solid var(--border); padding: 28px 30px 30px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; background: #fcfcfd; }
.req-body h4 { margin: 0 0 14px; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--text3); font-weight: 700; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; font-size: 15.5px; margin: 0; }
.dl dt { color: var(--text2); }
.dl dd { margin: 0; color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.contact-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.timeline { list-style: none; margin: 14px 0 0; padding: 0; font-size: 14px; color: var(--text2); display: flex; flex-direction: column; gap: 8px; }
.timeline li { display: flex; gap: 10px; }
.timeline li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--blue-100); margin-top: 6px; flex-shrink: 0; }

/* Divers */
.panel { padding: 30px; border-radius: 20px; }
.panel h3 { margin: 0 0 6px; font-size: 21px; color: var(--ink); }
.panel .sub { margin: 0 0 24px; color: var(--text2); }
.ann-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.ann { border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; }
.ann .ph { aspect-ratio: 16/9; background: #eef1f5; position: relative; display: grid; place-items: center; color: var(--text3); }
.ann .ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ann .ph .st { position: absolute; top: 12px; left: 12px; font-size: 14px; }
.ann .bd { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.ann .bd b { font-size: 18px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ann .meta { display: flex; gap: 14px; color: var(--text2); font-size: 14px; flex-wrap: wrap; }
.ann .meta span { display: inline-flex; align-items: center; gap: 5px; }
.ann .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; }
.bars { display: flex; flex-direction: column; gap: 12px; }
.bars .r { display: grid; grid-template-columns: 220px 1fr 60px; gap: 14px; align-items: center; font-size: 15px; }
.bars .r span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars .track { height: 12px; border-radius: 99px; background: #eef1f5; overflow: hidden; }
.bars .track i { display: block; height: 100%; border-radius: 99px; background: var(--blue); }
.engs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.eng { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border: 1px solid var(--border2); border-radius: 14px; cursor: pointer; background: #fff; transition: all .12s; }
.eng:hover { border-color: var(--text3); }
.eng.on { border-color: var(--blue); background: var(--blue-50); }
.eng .check { padding: 0; }
.eng b { display: block; color: var(--ink); font-size: 15.5px; }
.eng small { color: var(--text2); font-size: 13.5px; }
.gate { max-width: 520px; margin: calc(12 * var(--vh)) auto; text-align: center; padding: 44px 36px; }
.csv-drop { border: 2px dashed var(--border2); border-radius: 16px; padding: 36px; text-align: center; color: var(--text2); cursor: pointer; transition: all .12s; }
.csv-drop:hover, .csv-drop.drag { border-color: var(--blue); background: var(--blue-50); color: var(--blue); }
.scroll-x { overflow-x: auto; }

@media (max-width: 1500px) { .two { grid-template-columns: minmax(0, 1fr); } .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .req-body { grid-template-columns: 1fr 1fr; } }
@media (max-width: 1024px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; width: 300px; z-index: 120; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .side.open { transform: none; }
  .side-back { position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 110; }
  .burger { display: grid; }
  .topbar { padding: 0 16px; height: 64px; } .topbar h1 { font-size: 19px; } .topbar a { font-size: 15px; }
  .content { padding: 24px 16px 40px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 14px; } .kpi { min-height: 140px; padding: 20px; } .kpi .v { font-size: 34px; }
  .req-body { grid-template-columns: 1fr; padding: 20px; } .req-top { padding: 18px; gap: 14px; } .req-top .t { font-size: 17px; } .req-top .m { font-size: 14.5px; gap: 12px; }
  .page-head h2 { font-size: 24px; } .page-head p { font-size: 16px; } .page-head .btn { height: 44px; font-size: 15px; }
  table.t th, table.t td { padding: 14px 16px; font-size: 15px; }
  .engs { grid-template-columns: 1fr; } .bars .r { grid-template-columns: 110px 1fr 40px; }
}
/* Téléphone : indicateurs sur 2 colonnes compactes (moins de défilement) */
@media (max-width: 560px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 24px; }
  .kpi { padding: 16px; min-height: 0 !important; border-radius: 16px; gap: 10px; }
  .kpi .h { font-size: 14px; gap: 8px; line-height: 1.3; }
  .kpi .h svg { width: 18px; height: 18px; }
  .kpi .v { font-size: 28px !important; }
  .kpi .row { flex-wrap: wrap; gap: 6px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 0 16px 4px; gap: 8px; }
  .tabs > * { flex-shrink: 0; }
}

.side .brand .pro-chip { color: var(--ink); font-weight: 600; font-size: 16px; margin-left: 8px; align-self: center; padding: 3px 8px; background: var(--blue-50); border-radius: 6px; }

/* ── Téléphone et tablette : interface « app » (barre d'onglets en bas, menu en feuille, tableaux en cartes) ── */
.app-tabs { display: none; }
.only-app { display: none; }
@media (max-width: 1024px) {
  .app-tabs { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; background: rgba(255,255,255,.97); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 24px rgba(15,23,42,.06); }
  .app-tabs button { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 0; padding: 2px; color: var(--text3); font-size: 12px; font-weight: 600; -webkit-tap-highlight-color: transparent; }
  .app-tabs .ic { position: relative; width: 56px; height: 30px; border-radius: 99px; display: grid; place-items: center; transition: background .15s, color .15s; }
  .app-tabs .on { color: var(--blue); }
  .app-tabs .on .ic { background: var(--blue-50); }
  .app-tabs .lb { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .app-tabs .cnt { position: absolute; top: -3px; right: 6px; min-width: 18px; height: 18px; border-radius: 99px; background: var(--orange); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }
  .shell .content { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
  .shell .burger { display: none; }
  .shell .hide-app { display: none !important; }
  .shell .only-app { display: inline; }
  .kpi-link { font-size: 14.5px !important; }
  .shell ~ .toast, .shell .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .topbar { height: 56px; padding: 0 16px; background: rgba(255,255,255,.95); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
  .topbar h1 { font-size: 18px; }
  .topbar a { font-size: 14.5px; }
  /* Menu complet : feuille qui monte du bas */
  .side { left: 0; right: 0; top: auto; bottom: 0; width: 100%; height: auto; max-height: calc(86 * var(--vh)); border-radius: 22px 22px 0 0; border-right: 0; transform: translateY(105%); visibility: hidden; transition: transform .24s cubic-bezier(.2,.8,.2,1), visibility 0s .24s; padding-bottom: env(safe-area-inset-bottom); }
  .side.open { visibility: visible; transition: transform .24s cubic-bezier(.2,.8,.2,1); }
  .side::before { content: ""; display: block; width: 42px; height: 5px; border-radius: 99px; background: var(--border2); margin: 10px auto 2px; flex-shrink: 0; }
  .side .brand { height: 52px; font-size: 20px; padding: 0 20px; border-bottom: 0; }
  .side .who { padding: 12px 20px; }
  .side nav { padding: 10px 12px; gap: 2px; }
  .nav-i { height: 48px; font-size: 16px; gap: 14px; padding: 0 14px; }
  .nav-i svg { width: 21px; height: 21px; }
  .side .foot { padding: 8px 12px 12px; }
  .side-back { animation: fade .15s; }
  /* Grilles à colonnes fixées dans le code : une seule colonne */
  .shell .two { grid-template-columns: minmax(0, 1fr) !important; gap: 18px; }
}
@media (max-width: 640px) {
  .content { padding: 18px 14px 40px; }
  .tabs { margin-left: -14px; margin-right: -14px; padding-left: 14px; padding-right: 14px; margin-bottom: 18px; }
  .tab { height: 40px; font-size: 14.5px; padding: 0 14px; }
  .page-head { margin-bottom: 18px; gap: 12px; }
  .page-head h2 { font-size: 22px; }
  .page-head p { font-size: 14.5px; margin-top: 4px; }
  .page-head .acts { width: 100%; gap: 8px; }
  .page-head .acts .btn { flex: 1 1 auto; height: 42px; font-size: 14.5px; padding: 0 12px; }
  .page-head .acts .btn svg { width: 18px; height: 18px; }
  .tbl-card, .panel, .req-card { border-radius: 16px; }
  .tbl-card .th { padding: 16px; }
  .tbl-card h3 { font-size: 18px; }
  .panel { padding: 18px 16px; }
  .panel h3 { font-size: 18px; }
  .filters { padding: 12px 14px !important; gap: 8px !important; }
  .filters > .input, .filters > .select, .filters > input, .filters > select { max-width: none !important; width: 100% !important; flex: 1 1 100%; }
  .filters > span[style*="margin-left"] { margin-left: 0 !important; font-size: 13.5px; }
  /* Tableaux → cartes empilées (titre de colonne à gauche, valeur à droite) */
  .shell .scroll-x { overflow-x: visible; }
  .shell table.t, .shell table.t tbody, .shell table.t tr { display: block; width: 100%; }
  .shell table.t thead { display: none; }
  .shell table.t tr { padding: 10px 14px; border-bottom: 1px solid var(--border); }
  .shell table.t tbody tr:hover td { background: none; }
  .shell table.t td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0 !important; border: 0 !important; font-size: 14.5px !important; white-space: normal !important; max-width: none !important; text-align: right; min-height: 26px; overflow-wrap: anywhere; }
  .shell table.t td::before { content: attr(data-label); color: var(--text3); font-size: 12.5px; font-weight: 500; text-align: left; flex-shrink: 0; max-width: 45%; }
  .shell table.t td[data-label=""] { justify-content: flex-start; text-align: left; }
  .shell table.t td[data-label=""]::before { display: none; }
  .shell table.t td:first-child { font-size: 15px !important; }
  .shell table.t td:has(.veh) { justify-content: flex-start; text-align: left; }
  .shell table.t td:has(.veh)::before { display: none; }
  .shell table.t .veh { max-width: 100%; min-width: 0; }
  .shell table.t .veh span { white-space: normal; font-weight: 600; }
  .req-top { padding: 14px; gap: 12px; }
  .req-top .ic { width: 42px; height: 42px; border-radius: 12px; }
  .req-top .t { font-size: 16px; }
  .req-body { padding: 16px; gap: 18px; }
  .perf { padding: 22px 18px; border-radius: 18px; }
  .perf .hd { margin-bottom: 22px; }
  .perf .big { font-size: 38px; }
  .perf .sep { margin: 22px 0; }
  .ann-grid { grid-template-columns: 1fr; gap: 12px; }
  .bars .r { grid-template-columns: 118px 1fr 30px; font-size: 13.5px; }
  .csv-drop { padding: 22px; }
  .shell .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .shell .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
  .rech-row { grid-template-columns: minmax(0, 1fr) 76px 40px !important; }
  .rech-row > .field:nth-child(2) { grid-column: 1 / -1; grid-row: 1; }
}

/* Page d'accueil de l'espace pro (non connecté) sur téléphone */
@media (max-width: 640px) {
  .pro-hero { margin-top: 18px !important; padding: 26px 20px !important; border-radius: 18px !important; }
  .pro-hero .soft-tag { display: none; }
  .pro-hero h1 { margin-top: 0 !important; font-size: 28px !important; }
  .pro-hero p { font-size: 16px !important; }
  .pro-hero .btn-lg { height: 46px; font-size: 15.5px; }
  .pro-feats { grid-template-columns: minmax(0, 1fr) !important; gap: 10px !important; }
  .pro-feat { padding: 14px 16px !important; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 2px 12px; align-items: center; }
  .pro-feat > span { width: 40px !important; height: 40px !important; margin: 0 !important; border-radius: 12px !important; }
  .pro-feat h3 { margin: 0 !important; font-size: 16.5px !important; }
  .pro-feat p { grid-column: 2; font-size: 14px; line-height: 1.5 !important; }
  .pro-cta { padding: 20px 18px !important; }
  .pro-cta .btn { width: 100%; }
}
