/* ============================================================
   Distribuidora Flores — Inteligencia Territorial
   Design system: dark luxury · gold accents · executive BI
   ============================================================ */

:root {
  /* Surfaces */
  --bg-0: #07090d;
  --bg-1: #111827;
  --card: #151b24;
  --card-2: #1b222d;
  --line: rgba(212, 166, 42, 0.14);
  --line-soft: rgba(255, 255, 255, 0.06);

  /* Gold */
  --gold: #d4a62a;
  --gold-hi: #f2c94c;
  --gold-soft: rgba(242, 201, 76, 0.12);

  /* Accents */
  --red: #d62828;
  --blue: #3b82f6;
  --orange: #e08a2e;
  --gray: #8b94a3;

  /* Text */
  --text: #f8fafc;
  --text-dim: #94a3b8;
  --text-faint: #5b6573;

  /* Effects */
  --glass: rgba(21, 27, 36, 0.72);
  --glass-brd: rgba(255, 255, 255, 0.08);
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
  --shadow-gold: 0 18px 50px -16px rgba(212, 166, 42, 0.35);

  --radius: 16px;
  --radius-sm: 10px;
  --topbar-h: 66px;
  --kpi-h: 84px;

  --font-display: "Fraunces", Georgia, serif;
  --font-ui: "Manrope", system-ui, sans-serif;
}

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

html, body { height: 100%; }

body {
  font-family: var(--font-ui);
  background: var(--bg-0);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font-family: inherit; }
code { font-family: "SFMono-Regular", ui-monospace, monospace; color: var(--gold-hi); }
::selection { background: var(--gold); color: #1a1306; }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(212,166,42,0.22); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(212,166,42,0.4); }

/* ---------- Logo / crest ---------- */
.df-logo { display: inline-flex; align-items: center; gap: 12px; }
.df-crest { filter: drop-shadow(0 4px 12px rgba(242,201,76,0.25)); }
.df-wordmark { display: flex; flex-direction: column; line-height: 1.05; }
.df-wordmark__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.2px;
  background: linear-gradient(100deg, #fbe9ad, var(--gold-hi) 55%, var(--gold));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.df-wordmark__sub {
  font-size: 0.62rem; letter-spacing: 3px; text-transform: uppercase;
  color: var(--text-dim); margin-top: 3px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 22px; border-radius: 12px; font-weight: 700; font-size: 0.92rem;
  letter-spacing: 0.2px; transition: transform .18s ease, box-shadow .25s ease, background .25s ease;
}
.btn--gold {
  color: #1a1306;
  background: linear-gradient(100deg, var(--gold-hi), var(--gold));
  box-shadow: var(--shadow-gold);
}
.btn--gold:hover { transform: translateY(-2px); box-shadow: 0 22px 55px -14px rgba(242,201,76,0.5); }
.btn--block { width: 100%; }
.btn--ghost {
  border: 1px solid var(--line); color: var(--text-dim); background: rgba(255,255,255,0.02);
}
.btn--ghost:hover { color: var(--text); border-color: var(--gold); background: var(--gold-soft); }
.btn--sm { padding: 9px 16px; font-size: 0.82rem; }

/* ---------- Glass ---------- */
.glass {
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--glass-brd);
}

/* ============================================================
   SPLASH
   ============================================================ */
.splash {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  background: radial-gradient(circle at 50% 40%, #0e1320, var(--bg-0) 70%);
  transition: opacity .6s ease, visibility .6s ease;
}
.splash.is-hidden { opacity: 0; visibility: hidden; }
.splash__crest { animation: floatUp .9s cubic-bezier(.2,.8,.2,1) both; }
.splash__name {
  font-family: var(--font-display); font-size: 1.6rem; letter-spacing: 1px;
  color: var(--gold-hi); animation: floatUp .9s .1s cubic-bezier(.2,.8,.2,1) both;
}
.splash__bar { width: 180px; height: 3px; border-radius: 4px; background: rgba(255,255,255,0.08); overflow: hidden; }
.splash__bar span { display: block; height: 100%; width: 40%; border-radius: 4px;
  background: linear-gradient(90deg, transparent, var(--gold-hi), transparent);
  animation: sweep 1.1s ease-in-out infinite; }
@keyframes sweep { 0% { transform: translateX(-120%); } 100% { transform: translateX(380%); } }
@keyframes floatUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ============================================================
   LOGIN
   ============================================================ */
.login-body { overflow-x: hidden; }
.login-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; background:
   radial-gradient(1200px 700px at 80% -10%, #131b2c, transparent 60%),
   radial-gradient(900px 600px at -5% 100%, #1a1206, transparent 55%),
   var(--bg-0); }
.login-bg__glow { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; }
.login-bg__glow--gold { width: 520px; height: 520px; top: -120px; right: -80px;
  background: radial-gradient(circle, rgba(242,201,76,0.5), transparent 70%); }
.login-bg__glow--red { width: 460px; height: 460px; bottom: -160px; left: -100px;
  background: radial-gradient(circle, rgba(214,40,40,0.4), transparent 70%); }
.login-bg__grid { position: absolute; inset: 0; opacity: .5;
  background-image:
    linear-gradient(rgba(212,166,42,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212,166,42,0.05) 1px, transparent 1px);
  background-size: 54px 54px;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 30%, transparent 80%);
          mask-image: radial-gradient(circle at 50% 50%, #000 30%, transparent 80%); }

.login-shell {
  position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh;
  display: grid; grid-template-columns: minmax(360px, 460px) 1fr; align-items: center;
  gap: 48px; padding: 6vh 7vw; max-width: 1280px; margin: 0 auto;
}
.login-card {
  border-radius: 22px; padding: 40px 38px 26px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
  animation: floatUp .8s .2s cubic-bezier(.2,.8,.2,1) both;
}
.login-card::before { content: ""; position: absolute; inset: 0; border-radius: 22px; padding: 1px;
  background: linear-gradient(140deg, rgba(242,201,76,0.6), transparent 40%, transparent 70%, rgba(242,201,76,0.25));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.login-card__crest { display: flex; justify-content: center; margin-bottom: 14px; }
.login-card__title { font-family: var(--font-display); font-size: 1.85rem; text-align: center;
  letter-spacing: .3px; background: linear-gradient(100deg,#fbe9ad,var(--gold-hi) 60%,var(--gold));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.login-card__sub { text-align: center; color: var(--text-dim); font-size: .8rem;
  letter-spacing: 3px; text-transform: uppercase; margin: 8px 0 26px; }

.login-alert {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px;
  background: rgba(214,40,40,0.12); border: 1px solid rgba(214,40,40,0.4); color: #ffb4b4;
  font-size: .86rem; margin-bottom: 18px;
}

.login-form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field__label { font-size: .74rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-dim); }
.field__wrap { display: flex; align-items: center; gap: 10px; padding: 0 14px;
  background: rgba(7,9,13,0.6); border: 1px solid var(--line-soft); border-radius: 12px;
  transition: border-color .2s ease, box-shadow .2s ease; }
.field__wrap:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.field__wrap > i { color: var(--gold); font-size: .9rem; }
.field__wrap input { flex: 1; background: none; border: none; outline: none; color: var(--text);
  padding: 14px 0; font-size: .98rem; }
.field__wrap input::placeholder { color: var(--text-faint); }
.field__toggle { color: var(--text-faint); padding: 6px; }
.field__toggle:hover { color: var(--gold); }
.login-form .btn { margin-top: 6px; }

.login-hint { text-align: center; font-size: .78rem; color: var(--text-faint); margin: 20px 0 6px;
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.login-hint code { background: rgba(255,255,255,0.05); padding: 2px 7px; border-radius: 6px; }

.login-aside { color: var(--text); animation: floatUp .8s .35s cubic-bezier(.2,.8,.2,1) both; }
.login-aside__eyebrow { font-size: .74rem; letter-spacing: 3px; text-transform: uppercase; color: var(--gold); }
.login-aside__headline { font-family: var(--font-display); font-weight: 400; font-size: 3.1rem;
  line-height: 1.1; margin: 16px 0 30px; }
.login-aside__headline em { font-style: italic; color: var(--gold-hi); }
.login-aside__list { list-style: none; display: flex; flex-direction: column; gap: 16px; }
.login-aside__list li { display: flex; align-items: center; gap: 14px; color: var(--text-dim); font-size: 1.02rem; }
.login-aside__list i { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  background: var(--gold-soft); color: var(--gold-hi); font-size: .95rem; }

/* ============================================================
   APP SHELL
   ============================================================ */
.app-body { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.app-body--scroll { overflow: auto; height: auto; min-height: 100vh; display: block; }

/* ---------- Topbar ---------- */
.topbar {
  height: var(--topbar-h); flex: 0 0 var(--topbar-h);
  display: flex; align-items: center; gap: 24px; padding: 0 24px;
  background: linear-gradient(180deg, rgba(17,24,39,0.96), rgba(7,9,13,0.92));
  border-bottom: 1px solid var(--line); backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 1200;
}
.topbar__brand { display: flex; align-items: center; }
.topbar__nav { display: flex; gap: 6px; margin-left: 12px; }
.topbar__link { display: flex; align-items: center; gap: 9px; padding: 9px 16px; border-radius: 10px;
  color: var(--text-dim); font-weight: 600; font-size: .9rem; transition: all .18s ease; }
.topbar__link:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.topbar__link.is-active { color: var(--gold-hi); background: var(--gold-soft); }
.topbar__user { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar__avatar { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--gold), var(--gold-hi)); color: #1a1306; font-size: 1rem; }
.topbar__userinfo { display: flex; flex-direction: column; line-height: 1.2; }
.topbar__username { font-weight: 700; font-size: .9rem; }
.topbar__role { font-size: .72rem; color: var(--text-dim); }
.topbar__logout { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  color: var(--text-dim); border: 1px solid var(--line-soft); transition: all .18s ease; }
.topbar__logout:hover { color: var(--red); border-color: rgba(214,40,40,0.5); background: rgba(214,40,40,0.08); }

/* ---------- KPI ribbon (dashboard) ---------- */
.kpi-ribbon {
  flex: 0 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border-bottom: 1px solid var(--line);
}
.kpi { display: flex; align-items: center; gap: 16px; padding: 16px 26px; background: var(--bg-1); }
.kpi__icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(255,255,255,0.04); color: var(--text-dim); font-size: 1.1rem; }
.kpi__icon--gold { background: var(--gold-soft); color: var(--gold-hi); }
.kpi__body { display: flex; flex-direction: column; }
.kpi__value { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600;
  font-variant-numeric: tabular-nums; color: var(--text); line-height: 1.1; }
.kpi__value--sm { font-size: 1.1rem; }
.kpi__label { font-size: .72rem; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); margin-top: 3px; }

/* ============================================================
   MAP
   ============================================================ */
.map-stage { position: relative; flex: 1 1 auto; min-height: 0; }
.map { position: absolute; inset: 0; background: #0a0d12; }
.leaflet-container { background: #0a0d12; font-family: var(--font-ui); }
.leaflet-control-attribution { background: rgba(7,9,13,0.7) !important; color: var(--text-faint) !important; }
.leaflet-control-attribution a { color: var(--text-dim) !important; }
.leaflet-bar a { background: var(--card) !important; color: var(--text) !important; border-color: var(--line) !important; }
.leaflet-bar a:hover { background: var(--card-2) !important; }

/* Loader */
.map-loader { position: absolute; inset: 0; z-index: 800; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px; background: rgba(7,9,13,0.85);
  backdrop-filter: blur(4px); transition: opacity .4s ease, visibility .4s ease; }
.map-loader.is-hidden { opacity: 0; visibility: hidden; }
.map-loader__spinner { width: 46px; height: 46px; border-radius: 50%;
  border: 3px solid rgba(242,201,76,0.18); border-top-color: var(--gold-hi); animation: spin .8s linear infinite; }
.map-loader__text { color: var(--text-dim); letter-spacing: 1px; font-size: .9rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Floating controls */
.map-controls { position: absolute; top: 16px; left: 16px; z-index: 900; display: flex; gap: 10px; flex-wrap: wrap; }
.map-search { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 44px;
  border-radius: 12px; background: var(--glass); backdrop-filter: blur(18px);
  border: 1px solid var(--glass-brd); box-shadow: var(--shadow); width: 270px; max-width: 60vw; }
.map-search i { color: var(--gold); }
.map-search input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: .9rem; }
.map-search input::placeholder { color: var(--text-faint); }

.seg { display: flex; padding: 4px; gap: 3px; border-radius: 12px; height: 44px;
  background: var(--glass); backdrop-filter: blur(18px); border: 1px solid var(--glass-brd); box-shadow: var(--shadow); }
.seg__btn { display: flex; align-items: center; gap: 7px; padding: 0 14px; border-radius: 9px;
  color: var(--text-dim); font-size: .84rem; font-weight: 600; transition: all .18s ease; }
.seg__btn:hover { color: var(--text); }
.seg__btn.is-active { color: #1a1306; background: linear-gradient(100deg, var(--gold-hi), var(--gold)); }

.map-filter { position: absolute; top: 16px; right: 16px; z-index: 900; padding: 10px 14px;
  border-radius: 12px; background: var(--glass); backdrop-filter: blur(18px);
  border: 1px solid var(--glass-brd); box-shadow: var(--shadow); }
.map-filter__label { display: block; font-size: .68rem; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 6px; }
.map-filter__label i { color: var(--gold); }
.map-filter__select, .filters select, .filters input {
  background: rgba(7,9,13,0.6); color: var(--text); border: 1px solid var(--line-soft);
  border-radius: 9px; padding: 8px 12px; font-size: .88rem; outline: none; min-width: 180px; }
.map-filter__select:focus, .filters select:focus, .filters input:focus { border-color: var(--gold); }
.map-filter__select option, .filters option { background: var(--card); }

/* Legend */
.legend { position: absolute; bottom: 18px; left: 16px; z-index: 900; padding: 14px 16px;
  border-radius: 12px; background: var(--glass); backdrop-filter: blur(18px);
  border: 1px solid var(--glass-brd); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.legend__title { font-size: .7rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-dim); margin-bottom: 2px; }
.legend__row { display: flex; align-items: center; gap: 9px; font-size: .82rem; color: var(--text-dim); }
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; box-shadow: 0 0 8px currentColor; }
.dot--premium { background: var(--gold-hi); color: var(--gold-hi); }
.dot--high { background: var(--orange); color: var(--orange); }
.dot--medium { background: var(--blue); color: var(--blue); }
.dot--low { background: var(--gray); color: var(--gray); }

/* Custom markers */
.df-marker { display: grid; place-items: center; border-radius: 50%; color: #07090d;
  font-weight: 800; border: 2px solid rgba(255,255,255,0.85);
  box-shadow: 0 4px 14px rgba(0,0,0,0.5); transition: transform .15s ease; }
.df-marker:hover { transform: scale(1.18); z-index: 1000; }
.df-marker--premium { background: var(--gold-hi); box-shadow: 0 0 18px rgba(242,201,76,0.7); }
.df-marker--high { background: var(--orange); }
.df-marker--medium { background: var(--blue); color: #fff; }
.df-marker--low { background: var(--gray); }

/* Cluster bubbles */
.df-cluster { display: grid; place-items: center; border-radius: 50%; font-weight: 800; color: #1a1306;
  background: radial-gradient(circle at 35% 30%, var(--gold-hi), var(--gold));
  border: 2px solid rgba(255,255,255,0.55); box-shadow: 0 0 22px rgba(242,201,76,0.45); }
.df-cluster span { font-family: var(--font-ui); font-variant-numeric: tabular-nums; }

/* ============================================================
   DRAWER / BOTTOM SHEET
   ============================================================ */
.drawer-overlay { position: fixed; inset: 0; z-index: 1400; background: rgba(3,5,8,0.5);
  opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s ease; backdrop-filter: blur(2px); }
.drawer-overlay.is-open { opacity: 1; visibility: visible; }
.drawer { position: fixed; top: 0; right: 0; height: 100vh; height: 100dvh; width: 420px; max-width: 92vw;
  z-index: 1500; background: linear-gradient(180deg, var(--card), var(--bg-0));
  border-left: 1px solid var(--line); box-shadow: var(--shadow); transform: translateX(105%);
  transition: transform .35s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; }
.drawer.is-open { transform: none; }
.drawer__close { position: absolute; top: 16px; right: 16px; z-index: 2; width: 36px; height: 36px;
  border-radius: 10px; display: grid; place-items: center; color: var(--text-dim);
  background: rgba(255,255,255,0.05); border: 1px solid var(--line-soft); }
.drawer__close:hover { color: var(--text); background: rgba(255,255,255,0.1); }
.drawer__inner { overflow-y: auto; padding: 30px 26px 26px; flex: 1; }

.cust-head { margin-bottom: 20px; padding-right: 40px; }
.cust-badge { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; margin-bottom: 12px; }
.cust-badge--premium { background: var(--gold-soft); color: var(--gold-hi); }
.cust-badge--high { background: rgba(224,138,46,0.15); color: var(--orange); }
.cust-badge--medium { background: rgba(59,130,246,0.15); color: #8fb8ff; }
.cust-badge--low { background: rgba(139,148,163,0.15); color: #b8c0cc; }
.cust-name { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.15; }
.cust-acct { color: var(--text-dim); font-size: .85rem; margin-top: 4px; }

.cust-sales { margin: 18px 0; padding: 18px; border-radius: 14px;
  background: linear-gradient(135deg, var(--gold-soft), transparent); border: 1px solid var(--line); }
.cust-sales__label { font-size: .72rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-dim); }
.cust-sales__value { font-family: var(--font-display); font-size: 2.1rem; color: var(--gold-hi);
  font-variant-numeric: tabular-nums; margin-top: 4px; }

.cust-section { margin-top: 22px; }
.cust-section__title { font-size: .72rem; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--gold); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.cust-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cust-item { background: rgba(255,255,255,0.02); border: 1px solid var(--line-soft);
  border-radius: 11px; padding: 12px 14px; }
.cust-item__k { font-size: .68rem; letter-spacing: 1px; text-transform: uppercase; color: var(--text-faint); }
.cust-item__v { font-size: .96rem; font-weight: 600; margin-top: 5px; }

.cust-list { display: flex; flex-direction: column; gap: 8px; }
.cust-row { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 14px; border-radius: 10px; background: rgba(255,255,255,0.02); border: 1px solid var(--line-soft); }
.cust-row__main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cust-row__title { font-size: .9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cust-row__sub { font-size: .76rem; color: var(--text-dim); }
.cust-row__amt { font-weight: 700; color: var(--gold-hi); font-variant-numeric: tabular-nums; white-space: nowrap; }

.cust-actions { display: flex; gap: 10px; margin-top: 24px; }
.cust-actions .btn { flex: 1; }

.cust-empty { color: var(--text-faint); font-size: .86rem; padding: 8px 0; }

/* Skeleton */
.skel { background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.1), rgba(255,255,255,0.04));
  background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skel-line { height: 14px; margin: 10px 0; }

/* ============================================================
   REPORTES
   ============================================================ */
.report { max-width: 1320px; margin: 0 auto; padding: 30px 28px 60px; }
.report__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.report__eyebrow { font-size: .74rem; letter-spacing: 3px; text-transform: uppercase; color: var(--gold); }
.report__title { font-family: var(--font-display); font-size: 2.3rem; margin-top: 6px; }

.kpi-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 22px; }
.kpi-card { border-radius: var(--radius); padding: 22px; position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.kpi-card::after { content: ""; position: absolute; top: -40px; right: -40px; width: 120px; height: 120px;
  border-radius: 50%; background: var(--gold-soft); filter: blur(20px); }
.kpi-card__icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(255,255,255,0.04); color: var(--text-dim); font-size: 1.05rem; margin-bottom: 12px; position: relative; }
.kpi-card__icon--gold { background: var(--gold-soft); color: var(--gold-hi); }
.kpi-card__value { font-family: var(--font-display); font-size: 2rem; font-weight: 600;
  font-variant-numeric: tabular-nums; position: relative; }
.kpi-card__value--text { font-size: 1.5rem; }
.kpi-card__label { font-size: .76rem; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); position: relative; }

.filters { border-radius: var(--radius); padding: 18px 20px; display: grid;
  grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 22px; box-shadow: var(--shadow); }
.filters__field { display: flex; flex-direction: column; gap: 7px; }
.filters__field label { font-size: .7rem; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-dim); }
.filters__field select, .filters__field input { width: 100%; min-width: 0; }

.charts { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; margin-bottom: 22px; }
.chart-card { border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.chart-card--wide { grid-column: 1 / -1; }
.charts > .chart-card--wide:first-child { grid-column: 1 / 2; }
.chart-card__title { font-size: 1rem; font-weight: 700; margin-bottom: 18px; }
.chart-card__canvas { position: relative; height: 280px; }

.table-card { border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.table-card__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.table-card__count { font-size: .82rem; color: var(--text-dim); }
.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line-soft); }
.data-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.data-table th { text-align: left; padding: 13px 16px; font-size: .72rem; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text-dim); background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--line-soft); cursor: pointer; user-select: none; white-space: nowrap; }
.data-table th.num { text-align: right; }
.data-table th:hover { color: var(--gold-hi); }
.data-table td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); color: var(--text); white-space: nowrap; }
.data-table td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--gold-hi); }
.data-table tbody tr { transition: background .15s ease; }
.data-table tbody tr:hover { background: rgba(242,201,76,0.05); }
.data-table .company-cell { font-weight: 600; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; }
.pill--premium { background: var(--gold-soft); color: var(--gold-hi); }
.pill--high { background: rgba(224,138,46,0.15); color: var(--orange); }
.pill--medium { background: rgba(59,130,246,0.15); color: #8fb8ff; }
.pill--low { background: rgba(139,148,163,0.15); color: #b8c0cc; }
.table-card__foot { display: flex; justify-content: center; margin-top: 16px; }

/* ============================================================
   FOOTER
   ============================================================ */
.df-footer { text-align: center; padding: 18px; color: var(--text-faint); font-size: .78rem; letter-spacing: .5px; }
.df-footer strong { color: var(--gold); font-weight: 700; }
.df-footer--floating { position: absolute; bottom: 14px; right: 18px; z-index: 900; padding: 6px 12px;
  border-radius: 8px; background: rgba(7,9,13,0.55); backdrop-filter: blur(8px); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1080px) {
  .login-shell { grid-template-columns: 1fr; gap: 28px; align-items: start; padding-top: 5vh; padding-bottom: 6vh; }
  .login-aside { order: -1; }
  .login-aside__headline { font-size: 2.2rem; }
  .charts { grid-template-columns: 1fr; }
  .charts > .chart-card--wide:first-child { grid-column: 1 / -1; }
  .kpi-cards { grid-template-columns: repeat(2, 1fr); }
  .filters { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .topbar { gap: 10px; padding: 0 14px; }
  .topbar__nav .topbar__link span { display: none; }
  .df-wordmark__sub { display: none; }
  .topbar__userinfo { display: none; }
  .kpi-ribbon { grid-template-columns: repeat(2, 1fr); }
  .kpi { padding: 12px 16px; gap: 12px; }
  .kpi__value { font-size: 1.3rem; }
  .kpi__icon { width: 38px; height: 38px; }

  .map-controls { top: 12px; left: 12px; right: 12px; }
  .map-search { width: 100%; max-width: none; }
  .seg { width: 100%; }
  .seg__btn { flex: 1; justify-content: center; }
  .seg__btn span { display: none; }
  .map-filter { top: auto; bottom: 76px; right: 12px; left: 12px; }
  .map-filter__select { width: 100%; }
  .legend { display: none; }

  /* Drawer -> bottom sheet */
  .drawer { top: auto; bottom: 0; right: 0; left: 0; width: 100%; max-width: 100%;
    height: 82vh; height: 82dvh; border-left: none; border-top: 1px solid var(--line);
    border-radius: 22px 22px 0 0; transform: translateY(105%); }
  .drawer.is-open { transform: none; }

  .report { padding: 20px 16px 50px; }
  .report__title { font-size: 1.7rem; }
  .kpi-cards { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kpi-card { padding: 16px; }
  .kpi-card__value { font-size: 1.5rem; }
  .filters { grid-template-columns: 1fr; }
  .cust-grid { grid-template-columns: 1fr; }
}

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

@media (max-width: 560px) {
  .topbar { gap: 8px; padding: 0 12px; }
  .topbar__brand .df-wordmark { display: none; }
  .topbar__nav { margin-left: 4px; gap: 4px; }
  .topbar__link { padding: 9px 12px; }
  .topbar__user { gap: 8px; }
  .topbar__avatar, .topbar__logout { width: 36px; height: 36px; }
}
