:root {
  --orange: #FE4C1C;
  --orange-hover: #E44516;
  --orange-soft: #FFF1EC;
  --orange-line: #FFD5C8;
  --navy: #152844;
  --navy-2: #1C3558;
  --navy-3: #243F66;
  --ink: #3A4A63;
  --muted: #5B6B82;
  --line: #E4E9F0;
  --bg: #F5F7FA;
  --white: #fff;
  --ok: #1F7A4D;
  --ok-soft: #E8F6EE;
  --wait: #1C3558;
  --wait-soft: #EEF3F9;
  --down: #DC2626;
  --shadow: 0 8px 24px rgba(21, 40, 68, 0.08);
  --shadow-sm: 0 2px 8px rgba(21, 40, 68, 0.06);
  --sidebar: 248px;
  --sidebar-sm: 76px;
  --topbar: 64px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font: 400 15px/1.6 Archivo, system-ui, sans-serif;
  background: var(--bg);
  min-height: 100vh;
}
h1, h2, h3, h4 {
  font-family: Oswald, sans-serif;
  font-weight: 500;
  color: var(--navy);
  letter-spacing: .2px;
  line-height: 1.2;
  margin: 0;
}
a { color: var(--navy); }
a:hover { color: var(--orange); }
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

.demo-banner {
  background: var(--navy);
  color: #fff;
  font-size: 13px;
  text-align: center;
  padding: 8px 16px;
  letter-spacing: .02em;
  flex: 0 0 auto;
}
.demo-banner strong { color: #fff; font-weight: 600; }
.demo-banner em { color: #FFD5C8; font-style: normal; }

.brand-bar {
  height: 4px;
  background: var(--orange);
  border-radius: 0;
  flex: 0 0 4px;
}

/* Buttons, fields, badges */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--orange);
  color: #fff;
  border: 0;
  border-radius: 0;
  padding: 11px 20px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .02em;
  text-decoration: none;
}
.btn:hover { background: var(--orange-hover); color: #fff; }
.btn-block { width: 100%; }
.btn-ghost {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--orange); color: var(--orange); background: #fff; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
}
.field input, .field textarea {
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  padding: 10px 12px;
  outline: none;
}
.field input:focus, .field textarea:focus { border-color: var(--orange); }
.field textarea { min-height: 120px; resize: vertical; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 0;
  line-height: 1.3;
  white-space: nowrap;
}
.badge.demo { background: var(--orange-soft); color: var(--orange); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.plan { background: var(--wait-soft); color: var(--navy); }
.badge.progress { background: #FFF1EC; color: var(--orange); }
.badge.wait { background: #EEF3F9; color: var(--navy-2); }

/* ========== LOGIN ========== */
.login-page { background: var(--bg); }
.login-shell { width: min(1120px, calc(100% - 32px)); margin: 40px auto 56px; }
.login-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  min-height: 620px;
  background: #fff;
  box-shadow: var(--shadow);
}
.login-aside {
  background: var(--navy);
  color: #fff;
  padding: 48px 44px;
}
.login-logo img { height: 36px; width: auto; }
.login-kicker {
  margin: 28px 0 10px;
  font-family: Oswald, sans-serif;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--orange);
}
.login-aside h1 {
  color: #fff;
  font-size: 36px;
  max-width: 16ch;
}
.login-title-rule {
  width: 56px;
  height: 4px;
  background: var(--orange);
  border-radius: 0;
  margin: 18px 0 16px;
}
.login-aside .lead {
  margin: 0 0 28px;
  color: rgba(255,255,255,.82);
  font-size: 15px;
}
.benefit {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  align-items: flex-start;
}
.benefit .tick {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  background: var(--orange);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  border-radius: 0;
  margin-top: 2px;
}
.benefit strong { display: block; color: #fff; font-size: 14px; }
.benefit span span, .benefit div span { display: block; color: rgba(255,255,255,.72); font-size: 13px; line-height: 1.45; }
.login-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 44px;
  background: #fff;
}
.login-card { width: 100%; max-width: 400px; }
.login-card h2 { font-size: 28px; margin-bottom: 8px; }
.login-card .intro { margin: 0 0 16px; color: var(--muted); }
.demo-callout {
  background: var(--orange-soft);
  border-left: 4px solid var(--orange);
  border-radius: 0;
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 20px;
  color: var(--ink);
}
.login-card form { display: flex; flex-direction: column; gap: 14px; }
.login-foot { margin: 18px 0 0; color: var(--muted); font-size: 12px; }

/* ========== APP SHELL ========== */
.app-page { background: var(--bg); }
.app-frame {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.app-shell {
  flex: 1;
  display: flex;
  align-items: stretch;
  min-height: 0;
}
.sidebar {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  z-index: 30;
}
.sidebar-head {
  padding: 18px 18px 12px;
  position: relative;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.sidebar-brand .brand-mark {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: none;
}
.sidebar-brand .brand-word {
  height: 28px;
  width: auto;
}
.sidebar-kicker {
  margin: 10px 0 0;
  font-family: Oswald, sans-serif;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--orange);
}
.sidebar-close {
  display: none;
  position: absolute;
  top: 16px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: #fff;
  padding: 8px;
}
.sidebar-close svg { width: 100%; height: 100%; }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 12px 0;
  flex: 1;
}
.nav-group {
  margin: 14px 20px 6px;
  font-family: Oswald, sans-serif;
  font-weight: 500;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: rgba(255,255,255,.82);
  text-align: left;
  padding: 10px 18px 10px 20px;
  font-weight: 500;
  font-size: 14px;
}
.nav-item:hover { background: var(--navy-2); color: #fff; }
.nav-item.active {
  background: var(--navy-2);
  color: #fff;
  font-weight: 600;
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--orange);
  border-radius: 0;
}
.nav-ico {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: grid;
  color: inherit;
}
.nav-ico svg { width: 18px; height: 18px; display: block; }
.nav-item.active .nav-ico { color: var(--orange); }
.nav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--orange);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
  border-radius: 0;
}
.sidebar-foot {
  padding: 12px 16px 18px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar-collapse {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 0;
  color: rgba(255,255,255,.7);
  padding: 8px 4px;
  font-size: 13px;
  font-weight: 500;
}
.sidebar-collapse svg { width: 18px; height: 18px; }
.sidebar-collapse:hover { color: #fff; }
.sidebar-signout {
  color: rgba(255,255,255,.7);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 4px;
}
.sidebar-signout:hover { color: var(--orange); }

/* Collapsed desktop sidebar */
.app-page.nav-collapsed .sidebar {
  width: var(--sidebar-sm);
  flex-basis: var(--sidebar-sm);
}
.app-page.nav-collapsed .sidebar-brand .brand-word,
.app-page.nav-collapsed .sidebar-kicker,
.app-page.nav-collapsed .nav-label-text,
.app-page.nav-collapsed .nav-group,
.app-page.nav-collapsed .nav-badge,
.app-page.nav-collapsed .sidebar-collapse span,
.app-page.nav-collapsed .sidebar-signout { display: none; }
.app-page.nav-collapsed .sidebar-brand .brand-mark { display: block; }
.app-page.nav-collapsed .nav-item { justify-content: center; padding: 12px 0; }
.app-page.nav-collapsed .sidebar-collapse { justify-content: center; }
.app-page.nav-collapsed .sidebar-collapse svg { transform: rotate(180deg); }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(21, 40, 68, .5);
  z-index: 40;
}

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  min-height: var(--topbar);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.menu-toggle,
.topbar-mark { display: none; }
.menu-toggle {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--navy);
  padding: 8px;
  flex: 0 0 auto;
}
.menu-toggle svg { width: 100%; height: 100%; }
.topbar-mark img { width: 28px; height: 28px; }
.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--navy);
  font-weight: 500;
  font-size: 14px;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  flex: 0 0 auto;
}
.link-btn {
  background: none;
  border: 0;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  padding: 6px 0;
}
.link-btn:hover { color: var(--orange); }

/* Project switcher — top of the top bar */
.switcher { position: relative; min-width: 0; }
.switcher-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 7px 12px;
  min-width: 280px;
  max-width: 420px;
  color: var(--navy);
  font-weight: 500;
  text-align: left;
}
.switcher-btn:hover, .switcher-btn[aria-expanded="true"] {
  border-color: var(--orange);
}
.sw-mark {
  width: 28px;
  height: 28px;
  border-radius: 0;
  background: var(--navy);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: Oswald, sans-serif;
  font-weight: 600;
  font-size: 13px;
  flex: 0 0 auto;
}
.sw-mark.store { background: #1C3558; }
.sw-mark.law { background: #243F66; }
.switcher-btn .sw-text { flex: 1; min-width: 0; }
.switcher-btn .sw-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.2;
}
.switcher-btn .sw-name {
  display: block;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}
.switcher-btn .chev {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  margin-top: -4px;
  flex: 0 0 auto;
}
.switcher-btn[aria-expanded="true"] .chev { transform: rotate(-135deg); margin-top: 2px; }
.switcher-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  width: max(100%, 340px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: var(--shadow);
  z-index: 40;
  padding: 6px 0 8px;
}
.switcher-menu[hidden] { display: none; }
.switcher-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.switcher-menu button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 10px 14px;
  text-align: left;
  position: relative;
}
.switcher-menu button:hover { background: var(--orange-soft); }
.switcher-menu button.active { background: var(--orange-soft); }
.switcher-menu button.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--orange);
  border-radius: 0;
}
.sw-meta { display: flex; flex-direction: column; min-width: 0; }
.sw-meta strong {
  font-family: Archivo, sans-serif;
  font-weight: 600;
  color: var(--navy);
  font-size: 14px;
}
.sw-meta em {
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
}

/* Content */
.content {
  flex: 1;
  padding: 28px 32px 16px;
  width: 100%;
  max-width: 1180px;
}
.view[hidden] { display: none; }
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.page-head h1 { font-size: 28px; margin-bottom: 6px; }
.page-head p { margin: 0; color: var(--muted); max-width: 62ch; }
.page-head .sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  margin-top: 8px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 16px 16px 14px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.kpi::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: var(--orange);
  border-radius: 0;
}
.kpi .label { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi .num {
  font-family: Oswald, sans-serif;
  font-weight: 500;
  font-size: 28px;
  color: var(--navy);
  margin: 4px 0 2px;
  letter-spacing: .3px;
}
.kpi .delta { font-size: 12px; font-weight: 600; }
.kpi .delta.up { color: var(--ok); }
.kpi .delta.down { color: var(--down); }
.kpi .note { font-size: 11px; color: var(--muted); margin-top: 4px; }

.split {
  display: grid;
  grid-template-columns: 1.4fr .9fr;
  gap: 16px;
  margin-bottom: 16px;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.panel h3 { font-size: 18px; margin-bottom: 4px; }
.panel-sub { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.table-panel { padding: 0; overflow: auto; }
.table-panel h3, .table-panel .panel-sub { padding-left: 20px; padding-right: 20px; }
.table-panel h3 { padding-top: 18px; }
.chart-svg { width: 100%; height: auto; display: block; }

.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--navy);
}
.list li:first-child { border-top: 0; padding-top: 0; }
.list .dot {
  width: 8px;
  height: 8px;
  background: var(--orange);
  border-radius: 0;
  margin-top: 7px;
  flex: 0 0 8px;
}
.list .when { color: var(--muted); font-size: 12px; margin-top: 2px; }

.week-block {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.week-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--orange-soft);
}
.week-head h3 { font-size: 16px; }

.task-table, .kw-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.task-table th, .kw-table th {
  text-align: left;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.task-table td, .kw-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  color: var(--navy);
}
.task-table tr:last-child td, .kw-table tr:last-child td { border-bottom: 0; }
.kw-table .pos { font-weight: 700; font-family: Oswald, sans-serif; font-size: 18px; }
.kw-table .chg.up { color: var(--ok); font-weight: 600; }
.kw-table .chg.down { color: var(--down); font-weight: 600; }
.kw-table .chg.flat { color: var(--muted); }

.report-list, #file-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.report-item, .file-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.report-item h4, .file-item h4 {
  font-family: Archivo, sans-serif;
  font-weight: 600;
  font-size: 15px;
  margin: 0 0 2px;
}
.report-item p, .file-item p { margin: 0; color: var(--muted); font-size: 13px; }
.report-item .grow, .file-item .grow, .report-item > div:first-child { flex: 1; min-width: 0; }
.file-ico {
  width: 40px;
  height: 40px;
  background: var(--orange);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .04em;
  flex: 0 0 40px;
  border-radius: 0;
}

.embed-frame {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--orange);
  border-radius: 0;
  min-height: 180px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 32px 24px;
  color: var(--muted);
}
.embed-frame strong { display: block; color: var(--navy); font-size: 16px; margin-bottom: 6px; }
.embed-frame p { margin: 0; }

.form-grid { display: flex; flex-direction: column; gap: 14px; }
.form-note { margin: 0; color: var(--muted); font-size: 13px; }
.thread-title { font-size: 18px; margin: 0 0 12px; }
.thread { display: flex; flex-direction: column; gap: 10px; }
.msg {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 14px 16px;
}
.msg .who { font-weight: 600; color: var(--navy); font-size: 14px; }
.msg .who span { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 8px; }
.msg p { margin: 6px 0 0; font-size: 14px; }

.billing-plan {
  display: grid;
  grid-template-columns: 1.2fr .8fr .8fr;
  gap: 14px;
  margin-bottom: 16px;
}
.plan-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.plan-card.featured::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: var(--orange);
  border-radius: 0;
}
.plan-card .label { font-size: 12px; color: var(--muted); font-weight: 500; }
.plan-card .value {
  font-family: Oswald, sans-serif;
  font-size: 26px;
  color: var(--navy);
  margin-top: 4px;
}
.plan-card .hint { font-size: 13px; color: var(--muted); margin-top: 4px; }

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--navy);
  cursor: pointer;
}
.toggle-row:first-of-type { border-top: 0; }
.toggle-row input { accent-color: var(--orange); width: 16px; height: 16px; }

.site-foot {
  padding: 16px 32px 24px;
  color: var(--muted);
  font-size: 12px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .billing-plan { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform .2s ease;
    z-index: 50;
    box-shadow: none;
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow); }
  .sidebar-backdrop { display: block; }
  .sidebar-backdrop[hidden] { display: none; }
  .sidebar-close { display: grid; }
  .menu-toggle, .topbar-mark { display: grid; }
  .sidebar-collapse { display: none; }
  .app-page.nav-collapsed .sidebar {
    width: var(--sidebar);
    flex-basis: var(--sidebar);
  }
  .app-page.nav-collapsed .sidebar-brand .brand-word,
  .app-page.nav-collapsed .sidebar-kicker,
  .app-page.nav-collapsed .nav-label-text,
  .app-page.nav-collapsed .nav-group,
  .app-page.nav-collapsed .nav-badge,
  .app-page.nav-collapsed .sidebar-signout { display: unset; }
  .app-page.nav-collapsed .nav-group { display: block; }
  .app-page.nav-collapsed .sidebar-brand .brand-mark { display: none; }
  .app-page.nav-collapsed .nav-item {
    justify-content: flex-start;
    padding: 10px 18px 10px 20px;
  }
  .split { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid .kpi:last-child { grid-column: 1 / -1; }
  .content { padding: 20px 16px 12px; }
  .site-foot { padding: 12px 16px 24px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .switcher-btn { min-width: 0; width: 100%; max-width: none; padding: 6px 10px; }
  .switcher { flex: 1; }
  .switcher-menu { width: min(340px, calc(100vw - 24px)); left: 0; right: auto; }
  .link-btn { display: none; }
  .user-chip .name { display: none; }
  .login-grid { grid-template-columns: 1fr; }
  .login-shell { margin: 20px auto 40px; }
  .login-aside, .login-main { padding: 32px 24px; }
  .login-aside h1 { font-size: 30px; }
}

@media (max-width: 560px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .page-head { flex-direction: column; }
  .page-head h1 { font-size: 24px; }
  .task-table, .kw-table { font-size: 13px; }
  .switcher-btn .sw-label { display: none; }
  .report-item, .file-item { flex-wrap: wrap; }
}

body.sidebar-open { overflow: hidden; }

@media (max-width: 960px) {
  .menu-toggle {
    background: var(--bg);
    border: 1px solid var(--line);
  }
}

/* Live portal extras */
.oh-alert {
  border: 1px solid var(--line);
  border-left: 4px solid var(--orange);
  background: #fff;
  padding: 12px 14px;
  margin: 0 0 16px;
  color: var(--navy);
  font-size: 14px;
}
.oh-alert.error { border-left-color: var(--down); }
.oh-alert.ok { border-left-color: var(--ok); }
.login-error { color: var(--down); font-size: 14px; margin: 0 0 12px; }
.embed-frame iframe {
  width: 100%;
  min-height: 420px;
  border: 0;
  display: block;
  background: #fff;
}
.empty-state {
  background: #fff;
  border: 1px solid var(--line);
  padding: 36px 24px;
  text-align: center;
}
.empty-state h1 { margin-bottom: 8px; }
.login-foot a { color: var(--orange); }
