:root {
  --bg: #F4F7F7;
  --bg-elev: #ffffff;
  --bg-muted: #ECF3F2;
  --ink: #0B1F1E;
  --ink-soft: #4B635F;
  --line: #D7E4E1;
  --brand: #0F766E;
  --brand-2: #14B8A6;
  --brand-ink: #042F2E;
  --accent: #F59E0B;
  --danger: #E11D48;
  --ok: #059669;
  --warn: #D97706;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 12px 32px rgba(15, 118, 110, .08);
  --radius: 16px;
  --sidebar: 268px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
[data-theme="dark"] {
  --bg: #071110;
  --bg-elev: #0E1C1B;
  --bg-muted: #122422;
  --ink: #E7F6F3;
  --ink-soft: #9BB6B1;
  --line: #1E3330;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 16px 40px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.45;
}
a { color: var(--brand); text-decoration: none; }
img { max-width: 100%; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px; z-index: 9; }

.app-shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  background: var(--brand-ink);
  color: #D1FAE5;
  padding: 20px 14px;
  position: sticky; top: 0; height: 100vh; overflow: auto;
}
.sidebar .brand { display: flex; gap: 10px; align-items: center; padding: 6px 10px 18px; color: #fff; font-weight: 700; letter-spacing: -.02em; font-size: 17px; }
.sidebar .brand img { height: 36px; width: 36px; flex: 0 0 36px; border-radius: 10px; background: transparent; object-fit: contain; }
.nav-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #5EEAD4; padding: 12px 12px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px; color: #CCFBF1; font-size: 14px;
}
.nav-link:hover, .nav-link.active { background: rgba(20,184,166,.18); color: #fff; }
.main { min-width: 0; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 24px; border-bottom: 1px solid var(--line); background: var(--bg-elev);
  position: sticky; top: 0; z-index: 5;
}
.page { padding: 24px; max-width: 1280px; }
.h1 { font-size: 28px; letter-spacing: -.03em; margin: 0 0 4px; }
.lead { color: var(--ink-soft); margin: 0 0 20px; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
}
.kpi .label { font-size: 12px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .06em; }
.kpi .value { font-size: 26px; font-weight: 700; letter-spacing: -.03em; margin-top: 6px; }
.kpi .delta { font-size: 12px; color: var(--ok); }
.btn {
  display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer;
  background: var(--brand); color: #fff; border-radius: 12px; padding: 10px 14px;
  font-weight: 600; font-size: 14px;
}
.btn:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-accent { background: var(--accent); color: #422006; }
.btn-danger { background: var(--danger); }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 9px; }
.input, select, textarea {
  width: 100%; border: 1px solid var(--line); background: var(--bg-elev); color: var(--ink);
  border-radius: 12px; padding: 10px 12px; font: inherit;
}
label { display: block; font-size: 13px; font-weight: 600; margin: 0 0 6px; }
.field { margin-bottom: 14px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; color: var(--ink-soft); font-weight: 600; padding: 10px 8px; border-bottom: 1px solid var(--line); }
td { padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 8px; font-size: 12px; font-weight: 600; }
.badge-ok { background: #D1FAE5; color: #065F46; }
.badge-off { background: #FEE2E2; color: #9F1239; }
.badge-warn { background: #FEF3C7; color: #92400E; }
.badge-info { background: #CCFBF1; color: #115E59; }
.empty {
  text-align: center; padding: 48px 16px; color: var(--ink-soft);
}
.empty h3 { color: var(--ink); margin-bottom: 8px; }
.skel { background: linear-gradient(90deg, var(--bg-muted), var(--line), var(--bg-muted)); background-size: 200% 100%; animation: shine 1.2s infinite; border-radius: 8px; height: 14px; }
@keyframes shine { to { background-position: -200% 0; } }
.toast {
  position: fixed; right: 16px; bottom: 16px; background: var(--brand-ink); color: #fff;
  padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); z-index: 50;
}
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-on { background: #34D399; box-shadow: 0 0 0 4px rgba(52,211,153,.2); }
.dot-off { background: #FB7185; }
.map { height: 360px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
pre.script {
  background: #042F2E; color: #99F6E4; padding: 16px; border-radius: 12px; overflow: auto; font-size: 12px;
}
.landing { background: #042F2E; color: #ECFDF5; }
.landing-nav { display: flex; justify-content: space-between; align-items: center; padding: 18px 8vw; }
.hero { padding: 72px 8vw 48px; display: grid; grid-template-columns: 1.2fr .9fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(36px, 5vw, 58px); letter-spacing: -.04em; line-height: 1.05; margin: 0 0 16px; color: #fff; }
.hero p { color: #99F6E4; font-size: 18px; max-width: 540px; }
.hero-card { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 24px; padding: 22px; }
.section { padding: 64px 8vw; }
.section.light { background: #F8FAFC; color: #0B1F1E; }
.price { font-size: 36px; font-weight: 800; }
.faq details { background: var(--bg-elev); border-radius: 12px; padding: 14px 16px; margin-bottom: 8px; color: var(--ink); }
.lang-switch a { color: inherit; opacity: .7; margin-left: 8px; }
.lang-switch a.active { opacity: 1; font-weight: 700; }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1200px 600px at 10% -10%, #14B8A6 0%, #042F2E 45%, #021716 100%); }
.auth-card { width: min(420px, 92vw); background: #fff; color: #0B1F1E; border-radius: 24px; padding: 28px; box-shadow: var(--shadow); }
.portal-preview { min-height: 520px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1024px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .grid-4, .grid-3, .hero, .split { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media print {
  .sidebar, .topbar, .btn { display: none !important; }
  .app-shell { display: block; }
}
@font-face {
  font-family: "Inter";
  src: local("Inter"), local("Segoe UI");
  font-display: swap;
}
.icon { display: inline-block; vertical-align: -3px; flex: 0 0 auto; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg-elev); color: var(--ink); display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative;
}
.icon-btn:hover { border-color: var(--brand-2); color: var(--brand); }
.icon-btn .badge-dot {
  position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger);
}
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.nav-link .icon { opacity: .9; }
.menu-toggle { display: none; }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.filters .field { margin: 0; min-width: 140px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; font-size: 13px; }
.modal-bg { position: fixed; inset: 0; background: rgba(4,47,46,.45); display: grid; place-items: center; z-index: 40; padding: 16px; }
.modal { background: var(--bg-elev); border-radius: 16px; padding: 22px; width: min(520px, 100%); box-shadow: var(--shadow); }
.row-actions { display: flex; gap: 6px; }
.store-page { background: #042F2E; color: #ECFDF5; min-height: 100vh; }
.store-page .hero { padding-bottom: 24px; }
.store-plans { padding: 0 8vw 64px; }
.store-plans .card { color: #0B1F1E; }
[data-theme="dark"] .badge-ok { background: #064E3B; color: #A7F3D0; }
[data-theme="dark"] .badge-off { background: #4C0519; color: #FECDD3; }
[data-theme="dark"] .badge-warn { background: #451A03; color: #FDE68A; }
[data-theme="dark"] .badge-info { background: #134E4A; color: #99F6E4; }
[data-theme="dark"] .auth-card { background: #0E1C1B; color: #E7F6F3; }
.err { color: var(--danger); font-size: 13px; margin-top: 4px; }
.leaflet-container img.leaflet-marker-icon { max-width: none; }
@media (max-width: 1024px) {
  .menu-toggle { display: inline-flex; }
  .sidebar { display: none; position: fixed; z-index: 30; width: min(280px, 86vw); }
  .sidebar.open { display: block; }
  .topbar { padding: 12px 14px; }
  .page { padding: 16px; }
  .store-plans { padding: 0 5vw 48px; }
}
