/* varpX customer portal
   Colours and type follow the website (Website_New/styles.css) and Company Identity.
   Dark theme = logo on dark ground (cyan #00D4FF, mist #E4EBEF).
   Light theme = logo on light ground (cyan-deep #0099CC, slate #7E8C93). */

:root {
  --font-display: 'Quicksand', 'Nunito', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 16px;
  --radius-sm: 10px;
  --side-w: 252px;
  --gutter: clamp(16px, 3vw, 32px);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07090B;
  --bg-2: #0B0E11;
  --surface: #10151A;
  --surface-2: #161D23;
  --surface-3: #1D262D;
  --text: #F4F7F8;
  --text-2: #A9B6BD;
  --text-3: #7A8890;
  --line: rgba(228, 235, 239, .08);
  --line-2: rgba(228, 235, 239, .16);
  --accent: #00D4FF;
  --accent-text: #00D4FF;
  --accent-ink: #07090B;
  --accent-soft: rgba(0, 212, 255, .12);
  --mist: #E4EBEF;
  --ok: #3DD68C;   --ok-soft: rgba(61, 214, 140, .13);
  --warn: #F5B83D; --warn-soft: rgba(245, 184, 61, .14);
  --crit: #FF6B6B; --crit-soft: rgba(255, 107, 107, .14);
  --info: #8FB8FF; --info-soft: rgba(143, 184, 255, .13);
  --shadow: 0 20px 60px rgba(0, 0, 0, .45);
  --topbar: rgba(7, 9, 11, .72);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #F4F7F8;
  --bg-2: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F0F4F6;
  --surface-3: #E4EBEF;
  --text: #07090B;
  --text-2: #3E4B52;
  --text-3: #5E6C73;
  --line: rgba(7, 9, 11, .08);
  --line-2: rgba(7, 9, 11, .15);
  --accent: #0099CC;
  --accent-text: #00759E;
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(0, 153, 204, .10);
  --mist: #7E8C93;
  --ok: #10805A;   --ok-soft: rgba(16, 128, 90, .10);
  --warn: #9A5B00; --warn-soft: rgba(212, 136, 0, .13);
  --crit: #C42B2B; --crit-soft: rgba(196, 43, 43, .10);
  --info: #2D63C4; --info-soft: rgba(45, 99, 196, .10);
  --shadow: 0 20px 50px rgba(7, 9, 11, .14);
  --topbar: rgba(244, 247, 248, .82);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 14px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
html[lang="mk"] { --font-display: 'Nunito', system-ui, sans-serif; } /* Quicksand has no Cyrillic */
img, svg { display: block; max-width: 100%; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: clamp(22px, 2.4vw, 28px); line-height: 1.2; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: var(--accent-ink); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); font-size: 12.5px; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* Logos: one per theme */
:root[data-theme="dark"] .logo-on-light, :root[data-theme="light"] .logo-on-dark { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent;
  font: 600 14px/1 var(--font-body); cursor: pointer; white-space: nowrap; text-decoration: none !important;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { box-shadow: 0 0 0 5px var(--accent-soft); }
.btn-ghost { border-color: var(--line-2); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); }
.btn-danger { border-color: var(--crit); color: var(--crit); background: transparent; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-xs { height: 28px; padding: 0 11px; font-size: 12px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none;
  border-radius: 10px; border: 1px solid var(--line-2); background: transparent; cursor: pointer; color: var(--text-2);
  position: relative;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); }
.lang-link {
  display: inline-grid; place-items: center; width: 44px; height: 36px; border-radius: 10px;
  border: 1px solid var(--line-2); color: var(--text-2); font-size: 12px; font-weight: 600; letter-spacing: .08em; cursor: pointer;
}
.lang-link:hover { color: var(--text); border-color: var(--accent); text-decoration: none; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent-text); cursor: pointer; font-weight: 600; font-size: 13px; }
.link-btn:hover { text-decoration: underline; }

/* ---------- Forms ---------- */
label { display: grid; gap: 6px; font-size: 13px; color: var(--text-2); font-weight: 500; }
input, select, textarea {
  width: 100%; font: 400 14px/1.4 var(--font-body); color: var(--text);
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 10px 12px;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="checkbox"] { width: 16px; height: 16px; padding: 0; accent-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-error { color: var(--crit); font-size: 13px; min-height: 18px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 400; }
.dropzone {
  border: 1.5px dashed var(--line-2); border-radius: var(--radius-sm); padding: 18px; text-align: center; color: var(--text-2);
  cursor: pointer; display: block;
}
.dropzone:hover { border-color: var(--accent); }
.dropzone input { display: none; }
.file-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ---------- Toggle switch ---------- */
.switch { position: relative; display: inline-block; width: 36px; height: 20px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line-2); cursor: pointer; transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-2); transition: transform .15s, background .15s; }
.switch input:checked + span { background: var(--accent); border-color: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); background: var(--accent-ink); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Sign in ---------- */
.login { min-height: 100svh; display: grid; place-items: center; padding: 24px 16px; position: relative; overflow: hidden; }
.login-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.bg-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 60% 30%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 60% 30%, #000 20%, transparent 75%);
}
.bg-glow { position: absolute; width: 640px; height: 640px; right: -180px; top: -200px; border-radius: 50%; filter: blur(110px); background: var(--accent-soft); }
.login-card {
  position: relative; z-index: 1; width: min(420px, 100%); padding: 36px 32px 26px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 22px; box-shadow: var(--shadow);
  display: grid; gap: 14px;
}
.login-card .logo { height: 46px; width: auto; }
.slogan { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-text); font-weight: 600; margin-top: -4px; }
.login-card h1 { margin-top: 10px; }
.login-card form { display: grid; gap: 14px; margin-top: 6px; }
.login-help { font-size: 13px; color: var(--text-2); }
.login-foot { display: flex; gap: 8px; }
.demo-note { font-size: 12px; color: var(--text-3); border-top: 1px solid var(--line); padding-top: 12px; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100svh; }
.sidebar {
  position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; gap: 18px;
  background: var(--bg-2); border-right: 1px solid var(--line); padding: 22px 14px 18px; overflow-y: auto;
}
.side-brand { padding: 0 10px 6px; }
.side-brand .logo { height: 36px; width: auto; }
.side-nav { display: grid; gap: 2px; }
.side-nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: var(--text-2); font-weight: 500; text-decoration: none;
}
.side-nav a svg { width: 18px; height: 18px; flex: none; }
.side-nav a:hover { color: var(--text); background: var(--surface-2); }
.side-nav a.active { color: var(--text); background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.side-nav a.active svg { color: var(--accent-text); }
.side-nav .count { margin-left: auto; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
.side-nav .count.hot { background: var(--crit-soft); color: var(--crit); }
.side-help { margin-top: auto; display: grid; gap: 6px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); font-size: 13px; }
.side-help-title { font-weight: 600; color: var(--text); }
.side-help a:not(.btn) { color: var(--text-2); }
.side-help .btn { margin-top: 6px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 12px var(--gutter); background: var(--topbar); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.menu-btn { display: none; }
.org-switch { min-width: 0; flex: 0 1 auto; }
.org-switch select { width: auto; max-width: 280px; padding: 8px 32px 8px 12px; font-weight: 600; background-color: var(--surface); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.ems-link { gap: 6px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--mist)); color: var(--accent-ink); font-weight: 700; font-size: 13px;
}
:root[data-theme="light"] .avatar { color: #fff; }
.dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--crit); border: 2px solid var(--bg); }
.menu-wrap { position: relative; }
.popover {
  position: absolute; right: 0; top: calc(100% + 8px); width: 360px; max-width: calc(100vw - 32px); z-index: 40;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px;
}
.popover-sm { width: 240px; }
.popover h3 { padding: 8px 10px; display: flex; justify-content: space-between; align-items: center; }
.pop-item { display: grid; gap: 2px; padding: 10px; border-radius: 10px; color: var(--text); text-decoration: none !important; }
.pop-item:hover { background: var(--surface-2); }
.pop-item.unread { box-shadow: inset 3px 0 0 var(--accent); }
.pop-item small { color: var(--text-3); }
.pop-sep { height: 1px; background: var(--line); margin: 6px 0; }
.pop-btn { display: block; width: 100%; text-align: left; padding: 10px; border-radius: 10px; background: none; border: 0; cursor: pointer; color: var(--text); }
.pop-btn:hover { background: var(--surface-2); }

.demo-banner { padding: 7px var(--gutter); font-size: 12px; color: var(--text-2); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.content { padding: 26px var(--gutter) 40px; display: grid; gap: 22px; align-content: start; flex: 1; outline: none; }
.app-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 16px var(--gutter); border-top: 1px solid var(--line); font-size: 12px; color: var(--text-3); }
.app-foot a { color: var(--text-3); }

/* ---------- Page header ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
.page-head .lead { color: var(--text-2); margin-top: 6px; max-width: 70ch; }
.crumbs { font-size: 12.5px; color: var(--text-3); margin-bottom: 6px; }
.crumbs a { color: var(--text-3); }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Cards & grids ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head .faint { margin-left: auto; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .card-head { padding: 16px 18px 0; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.span2 { grid-column: span 2; }

.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.kpis.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 4px; text-decoration: none !important; color: var(--text); }
a.kpi:hover { border-color: var(--line-2); }
.kpi-label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.kpi-value { font: 700 26px/1.15 var(--font-display); font-variant-numeric: tabular-nums; }
.kpi-value small { font: 500 13px var(--font-body); color: var(--text-2); margin-left: 3px; }
.kpi-sub { font-size: 12px; color: var(--text-3); }
.kpi-sub.bad { color: var(--crit); }
.kpi-sub.warnc { color: var(--warn); }

/* EMS card */
.ems-card {
  position: relative; overflow: hidden; display: grid; gap: 12px; align-content: start; align-self: start;
  background: radial-gradient(120% 140% at 100% 0%, var(--accent-soft), transparent 60%), var(--surface);
  border: 1px solid var(--line-2);
}
.ems-card .btn { justify-self: start; }

/* Site status tiles */
.site-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.site-tile { display: grid; gap: 10px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none !important; }
.site-tile:hover { border-color: var(--line-2); }
.site-tile .top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.site-tile h3 { font-size: 15px; }
.site-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--text-2); }
.bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.bar.ok i { background: var(--ok); } .bar.warn i { background: var(--warn); } .bar.crit i { background: var(--crit); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px;
  font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-3); color: var(--text-2);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.crit { background: var(--crit-soft); color: var(--crit); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.accent { background: var(--accent-soft); color: var(--accent-text); }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
button.tag { border: 0; cursor: pointer; font-family: inherit; }
button.tag:hover { color: var(--text); }
.tag.accent { background: var(--accent-soft); color: var(--accent-text); }
.lvl { display: inline-grid; place-items: center; width: 28px; height: 22px; border-radius: 6px; font-size: 11px; font-weight: 700; background: var(--surface-3); color: var(--text-2); }
.lvl.on { background: var(--accent); color: var(--accent-ink); }

/* ---------- Lists ---------- */
.list { display: grid; }
.list-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); color: var(--text); text-decoration: none !important; }
.list-item:first-child { border-top: 0; padding-top: 2px; }
button.list-item { width: 100%; text-align: left; background: none; border-left: 0; border-right: 0; border-bottom: 0; cursor: pointer; font: inherit; }
.list-item:hover .li-title { color: var(--accent-text); }
.li-main { min-width: 0; flex: 1; display: grid; gap: 2px; }
.li-title { font-weight: 600; }
.li-sub { font-size: 12.5px; color: var(--text-2); }
.li-side { margin-left: auto; display: grid; justify-items: end; gap: 4px; flex: none; }
.date-chip { flex: none; width: 46px; text-align: center; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); padding: 5px 0; line-height: 1.1; }
.date-chip b { display: block; font: 700 17px var(--font-display); }
.date-chip span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); }
.empty { color: var(--text-3); padding: 14px 0; font-size: 13px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-weight: 600; font-size: 12px; color: var(--text-3); padding: 10px 14px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover td { background: var(--surface-2); }
td .sub { display: block; font-size: 12px; color: var(--text-3); }
th.r, td.r { text-align: right; }
.card.flush .table-wrap { padding: 4px 4px 4px; }

/* ---------- Toolbar, tabs, filters ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar select, .toolbar input { width: auto; min-width: 160px; padding: 8px 12px; }
.toolbar input[type="search"] { min-width: 220px; }
.toolbar input[type="checkbox"] { min-width: 0; width: 16px; }
.toolbar .spacer { flex: 1; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button {
  background: none; border: 0; padding: 10px 14px; cursor: pointer; color: var(--text-2); font-weight: 600; font-size: 13.5px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.tabs .count { font-size: 11px; color: var(--text-3); margin-left: 4px; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button { background: none; border: 0; padding: 6px 12px; border-radius: 999px; cursor: pointer; color: var(--text-2); font-weight: 600; font-size: 12.5px; }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.15); }

/* ---------- Detail layouts ---------- */
.dl { display: grid; grid-template-columns: minmax(120px, 40%) 1fr; gap: 8px 16px; font-size: 13.5px; }
.dl dt { color: var(--text-3); }
.dl dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.spec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.spec { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; }
.spec span { display: block; font-size: 12px; color: var(--text-3); }
.spec b { font: 700 18px var(--font-display); }

.timeline { display: grid; gap: 0; }
.tl-item { display: grid; grid-template-columns: 18px 1fr; gap: 12px; position: relative; padding-bottom: 16px; }
.tl-item::before { content: ""; position: absolute; left: 8px; top: 18px; bottom: 0; width: 2px; background: var(--line-2); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--surface); margin-top: 2px; }
.tl-item.customer .tl-dot { border-color: var(--mist); }
.tl-item.varpx .tl-dot { border-color: var(--accent); background: var(--accent-soft); }
.tl-item.system .tl-dot { border-color: var(--text-3); }
.tl-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; font-size: 12.5px; color: var(--text-3); }
.tl-head b { color: var(--text); font-size: 13.5px; }
.tl-body { margin-top: 3px; }

.checklist { display: grid; }
.cl-row { display: flex; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.cl-row:first-child { border-top: 0; }
.cl-row .ic { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; flex: none; font-size: 13px; font-weight: 700; }
.ic.ok { background: var(--ok-soft); color: var(--ok); }
.ic.issue { background: var(--warn-soft); color: var(--warn); }
.ic.na { background: var(--surface-3); color: var(--text-3); }
.ic.todo { border: 1.5px solid var(--line-2); }

.esc { display: grid; gap: 4px; }
.esc-arrow { display: none; }
.esc-step { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; font-size: 12.5px; color: var(--text-3); }
.esc-step.done { color: var(--text-2); }
.esc-step.cur { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.esc-arrow { color: var(--text-3); padding: 0 2px; }

.sla { display: grid; gap: 6px; }
.sla-row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }

.callout { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; }
.callout.warn { background: var(--warn-soft); border-color: transparent; }
.callout.accent { background: var(--accent-soft); border-color: transparent; }
.callout .btn { margin-left: auto; flex: none; }

.feature-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; }
.feature-list li { display: flex; gap: 8px; }
.feature-list li::before { content: "✓"; color: var(--accent-text); font-weight: 700; }
.feature-list li.off { color: var(--text-3); }
.feature-list li.off::before { content: "–"; color: var(--text-3); }

.perm { text-align: center; font-weight: 700; }
.perm.y { color: var(--ok); } .perm.v { color: var(--info); } .perm.n { color: var(--text-3); }

/* ---------- Chart ---------- */
.chart { position: relative; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .gridline { stroke: var(--line); }
.chart .axis-label { fill: var(--text-3); font-size: 11px; font-family: var(--font-body); }
.chart .barm { fill: var(--accent); }
.chart .barm.below { fill: var(--mist); }
.chart .target { stroke: var(--text-2); stroke-dasharray: 4 4; stroke-width: 1.5; }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover + .barm, .chart .barm.hover { opacity: .8; }
.tip { position: absolute; pointer-events: none; background: var(--surface-3); color: var(--text); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 10px; font-size: 12px; white-space: nowrap; transform: translate(-50%, -110%); box-shadow: var(--shadow); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- Modal, toast ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px 16px; background: rgba(0, 0, 0, .55); overflow-y: auto; }
.modal-card { position: relative; width: min(760px, 100%); max-height: calc(100svh - 40px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 20px; box-shadow: var(--shadow); padding: 26px; display: grid; gap: 18px; }
.modal-card.wide { width: min(960px, 100%); }
#modal-body { display: grid; gap: 18px; min-width: 0; }
.modal-close { position: absolute; top: 16px; right: 16px; }
.modal h2 { font-size: 20px; padding-right: 44px; }
.modal-sec { display: grid; gap: 10px; align-content: start; }
.modal-sec > h3 { font-size: 13px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; font-family: var(--font-body); font-weight: 600; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 16px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 80;
  background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 13.5px; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .g-main, .g3 { grid-template-columns: minmax(0, 1fr); }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(var(--side-w), 84vw); z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow); }
  .scrim { position: fixed; inset: 0; z-index: 45; background: rgba(0,0,0,.45); }
  .menu-btn { display: inline-grid; }
  .ems-link span { display: none; }
  .ems-link { width: 36px; padding: 0; }
  .g2 { grid-template-columns: minmax(0, 1fr); }
  .span2 { grid-column: auto; }
  .org-switch { flex: 1 1 0; }
  .org-switch select { max-width: 100%; width: 100%; min-width: 0; }
}
@media (max-width: 600px) {
  .kpis, .kpis.k3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g4 { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .top-actions { gap: 6px; }
  .topbar { gap: 8px; }
  .kpi-value { font-size: 22px; overflow-wrap: anywhere; }
  .top-actions .lang-link { display: none; }
  .modal-card { padding: 20px 16px; }
  .toolbar select, .toolbar input, .toolbar input[type="search"] { min-width: 0; flex: 1 1 140px; }
  .dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .dl dd { margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Sign-in extras and two-step sign-in */
.form-info { color: var(--ok); font-size: 13px; min-height: 0; }
.form-info:empty { display: none; }
.login-forgot { display: block; margin: 12px auto 0; }
#login-code-row small { display: block; margin-top: 6px; font-weight: 400; }
.form-grid.one { grid-template-columns: 1fr; }
.steps { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 4px; color: var(--text-2); }
.qr { width: 184px; height: 184px; margin: 8px auto; padding: 8px; background: #fff; border-radius: 10px; }
.qr svg { width: 100%; height: 100%; display: block; }
.center { text-align: center; }
