/* Activi Drive — admin panel and landing page. Same font and colours as the app. */
@font-face { font-family: "Helvetica Neue LT GEO"; src: url(fonts/hngeo-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Helvetica Neue LT GEO"; src: url(fonts/hngeo-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Helvetica Neue LT GEO"; src: url(fonts/hngeo-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Helvetica Neue LT GEO"; src: url(fonts/hngeo-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Helvetica Neue LT GEO"; src: url(fonts/hngeo-800.woff2) format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --bg: #F3F5F9; --card: #FFFFFF; --card-2: #F7F9FC; --text: #0F172A; --muted: #64748B; --line: #E4E8F0;
  --brand: #2F6BFF; --brand-soft: #E8EFFF; --ok: #15803D; --ok-soft: #E3F5E9; --warn: #B45309; --warn-soft: #FDF1DC;
  --bad: #DC2626; --bad-soft: #FDE7E7; --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1117; --card: #171B24; --card-2: #1C212C; --text: #E6EAF2; --muted: #8B95A8; --line: #262C38;
    --brand: #5B8CFF; --brand-soft: #1D2742; --ok: #4ADE80; --ok-soft: #14271C; --warn: #FBBF24; --warn-soft: #2B2312;
    --bad: #F87171; --bad-soft: #2E1717; --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 "Helvetica Neue LT GEO", system-ui, "Segoe UI", Roboto, sans-serif; }
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* shell */
.shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 100vh; }
aside { background: var(--card); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 17px; padding: 0 6px; }
.brand .muted { font-size: 13px; }
.logo { width: 34px; height: 34px; display: block; flex: none; }
#menu { display: flex; flex-direction: column; gap: 2px; flex: 1; }
#menu a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--text); font-weight: 600; }
#menu a:hover { background: var(--card-2); }
#menu a.on { background: var(--brand-soft); color: var(--brand); }
.me { display: flex; justify-content: space-between; align-items: center; padding: 8px 6px 0; border-top: 1px solid var(--line); font-size: 13px; }
main#page { padding: 22px 26px 60px; min-width: 0; }
h1 { font-size: 22px; margin: 0 0 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h2 { font-size: 16px; margin: 22px 0 10px; }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  aside { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; padding: 10px; }
  #menu { flex-direction: row; overflow-x: auto; flex: 1 1 100%; order: 3; }
  #menu a { white-space: nowrap; padding: 8px 10px; }
  .me { border: 0; padding: 0; margin-left: auto; gap: 10px; }
  main#page { padding: 16px; }
}

/* blocks */
.card { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 16px; }
.grid { display: grid; gap: 12px; }
.kpis { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.kpi b { display: block; font-size: 24px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--muted); font-size: 12.5px; }
.kpi.brand { background: var(--brand); color: #fff; }
.kpi.brand span { color: rgba(255, 255, 255, .8); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 1100px) { .cols { grid-template-columns: 1fr; } }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 10px; border: 0; background: var(--brand); color: #fff; font-weight: 650; cursor: pointer; }
.btn.block { width: 100%; }
.btn.plain { background: var(--card-2); color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn.sm { min-height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.big { min-height: 52px; padding: 0 24px; font-size: 16px; border-radius: 14px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
button.link { background: none; border: 0; color: var(--brand); cursor: pointer; padding: 0; font-weight: 600; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 7px; background: var(--card-2); color: var(--muted); white-space: nowrap; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.brand { background: var(--brand-soft); color: var(--brand); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--line); }
.dot.on { background: #22C55E; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
.dot.today { background: #F59E0B; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
th { font-size: 12px; color: var(--muted); font-weight: 600; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--card-2); }
td.wrap { white-space: normal; }

/* forms */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar input, .toolbar select, .form input, .form select, .form textarea {
  min-height: 38px; padding: 7px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); outline: none;
}
.toolbar input:focus, .form input:focus, .form select:focus, .form textarea:focus { border-color: var(--brand); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { min-height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-weight: 600; font-size: 13px; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.form { display: grid; gap: 10px; }
.form label { display: grid; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.form label > * { color: var(--text); font-weight: 400; font-size: 14px; }
.form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form .row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.form textarea { min-height: 80px; resize: vertical; }
.check { display: flex !important; align-items: center; gap: 8px; grid-template-columns: none !important; }
.check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--brand); }
.err { color: var(--bad); font-weight: 600; font-size: 13px; min-height: 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }

/* charts */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; height: 100%; justify-content: flex-end; }
.bars .b i { width: 100%; max-width: 34px; background: var(--brand); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.bars .b span { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.bars .b em { font-style: normal; font-size: 10.5px; font-weight: 700; }

/* maps */
.map { height: 420px; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); background: var(--card-2); z-index: 0; }
.map.tall { height: calc(100vh - 140px); min-height: 420px; }
.leaflet-container { font: inherit; }
.pin { width: 16px; height: 16px; border-radius: 50%; background: var(--brand); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.pin.on { background: #22C55E; }
.pin.radar { background: #DC2626; }

/* plans */
.plans { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.plan .price { color: var(--brand); font-weight: 800; font-size: 20px; }
.plan ul { margin: 10px 0; padding-left: 18px; font-size: 13px; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: #111827; color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 600; opacity: 0; pointer-events: none; transition: all .2s; z-index: 2000; }
#toast.show { opacity: 1; transform: translateX(-50%); }
.modal-bg { position: fixed; inset: 0; background: rgba(5, 10, 20, .45); z-index: 1500; display: grid; place-items: center; padding: 16px; }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; }
.modal h3 { margin: 0 0 12px; font-size: 18px; }

/* login + landing */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login form { width: 100%; max-width: 360px; display: grid; gap: 12px; }
.login label { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); }
.login input { min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card-2); font-size: 15px; color: var(--text); }
.landing main { max-width: 560px; margin: 0 auto; padding: 80px 20px; text-align: center; }
.landing h1 { justify-content: center; font-size: 32px; margin: 18px 0 10px; }
.landing p { font-size: 16px; color: var(--muted); }
.landing .btn.big { margin: 18px 0; }
.landing .lockup { width: 100%; max-width: 440px; height: auto; display: block; margin: 0 auto 12px; }
@media (prefers-color-scheme: dark) { .landing .lockup { border-radius: 16px; } }
