/* ================================================================
   Limo - Design system
   CRM de gestion clients, prospects et rendez-vous
   ================================================================ */

:root {
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-light: #dbeafe;
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f4f6fb;
  --card: #ffffff;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --info: #0ea5e9;
  --info-bg: #e0f2fe;
  --violet: #7c3aed;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .05);
  --shadow: 0 4px 16px rgba(15, 23, 42, .07);
  --shadow-lg: 0 18px 40px rgba(15, 23, 42, .13);
  --nav-h: 66px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 { margin: 0 0 .4em; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
a { color: var(--brand); text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------------- Layout ---------------- */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 258px;
  flex: 0 0 258px;
  background: #0f172a;
  color: #cbd5e1;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 10px 20px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--brand), var(--violet));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.15rem;
  flex: 0 0 42px;
  box-shadow: 0 6px 18px rgba(37, 99, 235, .4);
}

.brand-text strong { display: block; color: #fff; font-size: 1.08rem; letter-spacing: -.02em; }
.brand-text span { font-size: .74rem; color: #94a3b8; text-transform: uppercase; letter-spacing: .1em; }

.nav-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .13em; color: #64748b; padding: 16px 12px 6px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 11px;
  color: #cbd5e1;
  font-size: .92rem;
  font-weight: 500;
  transition: background .16s, color .16s;
}

.nav-link svg { width: 19px; height: 19px; flex: 0 0 19px; }
.nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-link.active { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(37, 99, 235, .35); }

.sidebar-foot { margin-top: auto; padding-top: 18px; }
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .06);
}
.sidebar-user .avatar { width: 38px; height: 38px; }
.sidebar-user strong { display: block; color: #fff; font-size: .88rem; }
.sidebar-user span { font-size: .74rem; color: #94a3b8; }

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 14px 26px;
  padding-top: calc(14px + var(--safe-top));
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar > div:not(.topbar-actions) { min-width: 0; }
.topbar h1 { font-size: 1.28rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .sub { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

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

/* ---------------- Buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 11px;
  border: 1px solid transparent;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  font-size: .89rem;
  cursor: pointer;
  transition: transform .12s, box-shadow .18s, background .18s;
  white-space: nowrap;
}
.btn:hover { background: var(--brand-dark); box-shadow: 0 6px 18px rgba(37, 99, 235, .3); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; }
.btn.ghost { background: #fff; color: var(--ink-soft); border-color: var(--line); }
.btn.ghost:hover { background: #f8fafc; box-shadow: var(--shadow-sm); }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #b91c1c; box-shadow: 0 6px 18px rgba(220, 38, 38, .3); }
.btn.success { background: var(--success); }
.btn.success:hover { background: #15803d; box-shadow: 0 6px 18px rgba(22, 163, 74, .3); }
.btn.sm { padding: 7px 13px; font-size: .82rem; border-radius: 9px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* ---------------- Cards ---------------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px; }
.card-head {
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.card-head h3 { margin: 0; font-size: 1rem; }
.card-head .spacer { margin-left: auto; }
.card-body { padding: 18px 20px; }

/* ---------------- Stats ---------------- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 17px 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.stat .label { font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat .value { font-size: 1.7rem; font-weight: 800; letter-spacing: -.03em; margin: 6px 0 2px; }
.stat .delta { font-size: .78rem; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.stat .icon {
  position: absolute;
  top: 15px; right: 15px;
  width: 38px; height: 38px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
}
.stat .icon svg { width: 19px; height: 19px; }
.stat.blue .icon { background: var(--brand-light); color: var(--brand); }
.stat.green .icon { background: var(--success-bg); color: var(--success); }
.stat.amber .icon { background: var(--warning-bg); color: var(--warning); }
.stat.violet .icon { background: #ede9fe; color: var(--violet); }

.grid-2 { display: grid; grid-template-columns: 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 16px; }

/* ---------------- Forms ---------------- */

.field { margin-bottom: 14px; }
.field label { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  transition: border-color .16s, box-shadow .16s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}
.field textarea { min-height: 88px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr; gap: 12px; }
.field .hint { font-size: .76rem; color: var(--muted); margin-top: 5px; }

.search-box { position: relative; flex: 1; min-width: 0; }
.search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); }
.search-box input {
  width: 100%;
  padding: 10px 12px 10px 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}
.search-box input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .14); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.toolbar select { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 600;
  background: var(--brand-light);
  color: var(--brand-dark);
}
.chip .x { cursor: pointer; font-weight: 700; opacity: .6; }
.chip .x:hover { opacity: 1; }

/* ---------------- Badges ---------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .73rem;
  font-weight: 700;
  letter-spacing: .01em;
  white-space: nowrap;
}
.badge.prospect { background: var(--warning-bg); color: #92400e; }
.badge.client { background: var(--success-bg); color: #166534; }
.badge.nouveau { background: #e0f2fe; color: #075985; }
.badge.contacte { background: #ede9fe; color: #5b21b6; }
.badge.qualifie { background: #fef3c7; color: #92400e; }
.badge.negociation { background: #ffe4e6; color: #9f1239; }
.badge.gagne { background: var(--success-bg); color: #166534; }
.badge.perdu { background: #f1f5f9; color: #475569; }
.badge.prevu { background: var(--info-bg); color: #075985; }
.badge.termine { background: var(--success-bg); color: #166534; }
.badge.annule { background: var(--danger-bg); color: #991b1b; }
.badge.neutral { background: #f1f5f9; color: #475569; }

/* ---------------- Tables ---------------- */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.data th {
  text-align: left;
  padding: 12px 14px;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: #f8fafc; }

/* ---------------- Avatars ---------------- */

.avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 42px;
  background: var(--brand-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--brand-dark);
  font-size: .9rem;
  overflow: hidden;
}
.avatar.lg { width: 76px; height: 76px; flex: 0 0 76px; font-size: 1.5rem; }
.avatar.sm { width: 32px; height: 32px; flex: 0 0 32px; font-size: .78rem; }

.person { display: flex; align-items: center; gap: 11px; min-width: 0; }
.person .pinfo { min-width: 0; }
.person .pinfo strong { display: block; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .pinfo span { font-size: .78rem; color: var(--muted); }

/* ---------------- Pipeline kanban ---------------- */

.pipeline-board {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
  -webkit-overflow-scrolling: touch;
  align-items: flex-start;
}

.pipe-col {
  flex: 0 0 268px;
  background: #eef2f9;
  border-radius: var(--radius);
  padding: 12px;
  min-height: 180px;
  transition: background .18s;
}
.pipe-col.over { background: var(--brand-light); outline: 2px dashed var(--brand); outline-offset: -4px; }

.pipe-col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 12px;
}
.pipe-col-head .dot { width: 10px; height: 10px; border-radius: 50%; }
.pipe-col-head h3 { font-size: .85rem; margin: 0; text-transform: uppercase; letter-spacing: .05em; }
.pipe-col-head .count {
  margin-left: auto;
  font-size: .74rem;
  font-weight: 700;
  color: var(--muted);
  background: #fff;
  border-radius: 999px;
  padding: 2px 9px;
}
.pipe-col-head .sum { font-size: .72rem; color: var(--muted); display: block; }

.pipe-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 13px;
  margin-bottom: 10px;
  cursor: grab;
  box-shadow: var(--shadow-sm);
  transition: transform .14s, box-shadow .18s, opacity .18s;
}
.pipe-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.pipe-card.dragging { opacity: .45; transform: rotate(1.5deg) scale(.98); cursor: grabbing; }
.pipe-card .top { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.pipe-card .name { font-weight: 700; font-size: .9rem; }
.pipe-card .company { font-size: .77rem; color: var(--muted); }
.pipe-card .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 9px; }
.pipe-card .amount { font-weight: 800; color: var(--success); font-size: .9rem; }

/* ---------------- Agenda ---------------- */

.agenda-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.agenda-month { font-weight: 700; font-size: 1rem; min-width: 150px; text-align: center; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-dow { text-align: center; font-size: .68rem; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 6px 0; }
.cal-day {
  min-height: 66px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.cal-day:hover { border-color: var(--brand); }
.cal-day.out { opacity: .4; }
.cal-day.today { border-color: var(--brand); background: var(--brand-light); }
.cal-day.selected { outline: 2px solid var(--brand); outline-offset: -2px; }
.cal-day .dnum { font-size: .78rem; font-weight: 700; }
.cal-day .dot-row { display: flex; gap: 3px; flex-wrap: wrap; }
.cal-day .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }

.day-list { display: flex; flex-direction: column; gap: 11px; }
.event {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.event.termine { border-left-color: var(--success); }
.event.annule { border-left-color: var(--danger); opacity: .65; }
.event .etime { font-weight: 800; font-size: .84rem; min-width: 52px; }
.event .ebody { flex: 1; min-width: 0; }
.event .etitle { font-weight: 700; font-size: .9rem; }
.event .emeta { font-size: .78rem; color: var(--muted); }
.event .eact { display: flex; gap: 6px; align-items: center; }

/* ---------------- Activity feed ---------------- */

.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.feed-item:last-child { border-bottom: none; }
.feed-dot {
  width: 34px; height: 34px; flex: 0 0 34px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-light); color: var(--brand);
}
.feed-dot svg { width: 16px; height: 16px; }
.feed-body { min-width: 0; }
.feed-body .fmsg { font-size: .87rem; }
.feed-body .ftime { font-size: .74rem; color: var(--muted); }

/* ---------------- Modal ---------------- */

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(3px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.modal {
  background: #fff;
  width: 100%;
  max-width: 620px;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 20px 20px 0 0;
  box-shadow: var(--shadow-lg);
  animation: slideUp .22s ease;
  padding-bottom: var(--safe-bottom);
}
@keyframes slideUp { from { transform: translateY(28px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }

.modal-head {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: #fff; z-index: 2;
}
.modal-head h3 { margin: 0; font-size: 1.05rem; }
.modal-head .close {
  margin-left: auto;
  border: none; background: #f1f5f9;
  width: 34px; height: 34px; border-radius: 10px;
  cursor: pointer; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
}
.modal-head .close:hover { background: #e2e8f0; color: var(--ink); }
.modal-body { padding: 20px; }
.modal-foot {
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  display: flex; gap: 10px;
  position: sticky; bottom: 0; background: #fff;
}
.modal-foot .btn { flex: 1; }

/* ---------------- Toasts ---------------- */

.toast-wrap {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 14px);
  z-index: 400;
  display: flex; flex-direction: column; gap: 8px;
  width: min(92vw, 420px);
}
.toast {
  background: #0f172a; color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: .87rem;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  animation: toastIn .2s ease;
}
.toast.success { background: #15803d; }
.toast.error { background: #b91c1c; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ---------------- Empty state / loader ---------------- */

.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty svg { width: 46px; height: 46px; margin-bottom: 12px; opacity: .5; }
.empty h3 { color: var(--ink-soft); }

.loader { display: flex; justify-content: center; padding: 40px; }
.spinner {
  width: 30px; height: 30px;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- Bottom nav (mobile) ---------------- */

.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  display: flex;
  padding-bottom: var(--safe-bottom);
}
.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 2px 8px;
  color: var(--muted);
  font-size: .66rem;
  font-weight: 600;
  transition: color .15s;
}
.bottom-nav a svg { width: 21px; height: 21px; }
.bottom-nav a.active { color: var(--brand); }
.bottom-nav a.active svg { transform: translateY(-1px); }

/* ---------------- Login ---------------- */

.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  background: var(--bg);
}
.auth-brand {
  position: relative;
  padding: calc(30px + var(--safe-top)) 24px 34px;
  background: linear-gradient(150deg, #1e3a8a 0%, #2563eb 48%, #7c3aed 100%);
  color: #fff;
  overflow: hidden;
}
.auth-brand::after {
  content: '';
  position: absolute;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  right: -110px; bottom: -130px;
}
.auth-brand .brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.auth-brand .brand-mark { background: rgba(255, 255, 255, .2); box-shadow: none; }
.auth-brand h1 { font-size: 1.65rem; color: #fff; position: relative; }
.auth-brand p { color: rgba(255, 255, 255, .85); font-size: .93rem; position: relative; }
.auth-features { position: relative; display: flex; flex-direction: column; gap: 11px; margin-top: 22px; }
.auth-features .af { display: flex; align-items: center; gap: 10px; font-size: .87rem; color: rgba(255, 255, 255, .94); }
.auth-features .af svg { width: 18px; height: 18px; flex: 0 0 18px; }

.auth-panel {
  padding: 28px 22px calc(96px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  box-shadow: var(--shadow);
}
.auth-card h2 { font-size: 1.3rem; margin-bottom: 4px; }
.auth-card .sub { color: var(--muted); font-size: .87rem; margin-bottom: 20px; }
.auth-switch { text-align: center; font-size: .85rem; color: var(--muted); margin-top: 16px; }
.auth-switch a { font-weight: 600; }

/* ---------------- PWA install ---------------- */

.install-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: linear-gradient(120deg, #eff6ff, #f5f3ff);
  border: 1px solid var(--brand-light);
  margin-bottom: 16px;
}
.install-banner .ib-icon {
  width: 40px; height: 40px; flex: 0 0 40px;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.install-banner .ib-icon svg { width: 20px; height: 20px; }
.install-banner strong { display: block; font-size: .9rem; }
.install-banner span { font-size: .78rem; color: var(--muted); }

.store-logos { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: center; padding: 6px 0; }
.store-logos .sl { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .78rem; font-weight: 600; }
.store-logos svg { width: 20px; height: 20px; }

/* ---------------- Admin ---------------- */

.admin-gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(24px + var(--safe-top)) 18px calc(90px + var(--safe-bottom));
  background: linear-gradient(160deg, #0f172a, #1e3a8a);
}
.admin-gate .auth-card { border: none; box-shadow: var(--shadow-lg); }
.admin-gate .gate-brand { text-align: center; margin-bottom: 18px; }
.admin-gate .gate-brand .brand-mark { margin: 0 auto 12px; }
.admin-gate .gate-brand h2 { color: #fff; margin: 0; }
.admin-gate .gate-brand p { color: #94a3b8; font-size: .84rem; margin: 4px 0 0; }

.admin-header-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: #1e293b; color: #e2e8f0;
  font-size: .72rem; font-weight: 700;
  padding: 4px 11px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .06em;
}

/* ---------------- Utilities ---------------- */

.muted { color: var(--muted); }
.small { font-size: .82rem; }
.mb-0 { margin-bottom: 0; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.flex { display: flex; }
.between { justify-content: space-between; }
.center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.wrap { flex-wrap: wrap; }
.hide { display: none !important; }

.progress-bar { height: 9px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--violet)); border-radius: 999px; transition: width .5s; }

.chart-box { position: relative; height: 260px; width: 100%; }
.chart-box.sm { height: 190px; }

.legend { display: flex; flex-direction: column; gap: 9px; }
.legend .li { display: flex; align-items: center; gap: 9px; font-size: .84rem; }
.legend .li .sw { width: 11px; height: 11px; border-radius: 3px; flex: 0 0 11px; }
.legend .li .lv { margin-left: auto; font-weight: 700; }

/* ---------------- Responsive ---------------- */

@media (min-width: 640px) {
  .field-row { grid-template-columns: 1fr 1fr; }
}
}

@media (min-width: 768px) {
  .auth-wrap { grid-template-columns: 1.05fr 1fr; }
  .auth-brand { display: flex; flex-direction: column; justify-content: center; padding: 48px 46px; }
  .auth-panel { padding: 48px 40px; }
  .modal-backdrop { align-items: center; padding: 24px; }
  .modal { border-radius: var(--radius-lg); }
}

@media (min-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .grid-2 { grid-template-columns: 1.6fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1023px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 150;
    transform: translateX(-105%);
    transition: transform .25s ease;
    padding-top: calc(22px + var(--safe-top));
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, .5);
    z-index: 140;
  }
  .content { padding: 18px 16px calc(var(--nav-h) + var(--safe-bottom) + 26px); }
  .topbar { padding: 12px 16px; padding-top: calc(12px + var(--safe-top)); }
  .menu-btn {
    border: 1px solid var(--line); background: #fff;
    width: 40px; height: 40px; border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--ink-soft); flex: 0 0 40px;
  }
  .menu-btn svg { width: 20px; height: 20px; }
  .cal-day { min-height: 54px; padding: 4px; }
  .cal-day .dnum { font-size: .72rem; }
  .pipe-col { flex: 0 0 244px; }
}

@media (min-width: 1024px) {
  .bottom-nav { display: none; }
  .menu-btn { display: none; }
}

@media (max-width: 480px) {
  .stats-grid { gap: 10px; }
  .stat { padding: 13px 13px; }
  .stat .label { font-size: .7rem; letter-spacing: .03em; }
  .stat .value { font-size: 1.32rem; }
  .stat .icon { width: 32px; height: 32px; top: 11px; right: 11px; }
  .stat .icon svg { width: 16px; height: 16px; }
  .cal-grid { gap: 3px; }
  .cal-day { min-height: 46px; }
  .auth-brand h1 { font-size: 1.4rem; }
  .topbar .btn.ghost span { display: none; }
  .topbar .btn.ghost { padding: 9px 11px; }
}
}
