:root {
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg0: #e8eef7;
  --bg1: #f4f6fb;
  --surface: #ffffff;
  --surface-elevated: rgba(255, 255, 255, 0.92);
  --text: #0f172a;
  --text-secondary: #475569;
  --muted: #64748b;
  --line: rgba(15, 23, 42, 0.08);
  --line-strong: rgba(15, 23, 42, 0.12);
  --accent: #0d9488;
  --accent-hover: #0f766e;
  --accent-soft: rgba(13, 148, 136, 0.12);
  --accent-glow: rgba(13, 148, 136, 0.35);
  --amber: #ea580c;
  --red: #dc2626;
  --blue: #2563eb;
  --violet: #7c3aed;
  --sidebar-bg: #0f172a;
  --sidebar-surface: rgba(255, 255, 255, 0.06);
  --sidebar-border: rgba(255, 255, 255, 0.1);
  --sidebar-text: #e2e8f0;
  --sidebar-muted: #94a3b8;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.07), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.1), 0 4px 12px rgba(15, 23, 42, 0.05);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  color: var(--text);
  background: var(--bg0);
  font-family: var(--font);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(165deg, var(--bg0) 0%, var(--bg1) 45%, #eef1f8 100%);
  background-attachment: fixed;
}

button,
input,
select {
  font: inherit;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  background: linear-gradient(180deg, #0f172a 0%, #111c33 55%, #0f172a 100%);
  color: var(--sidebar-text);
  padding: 24px 20px 28px;
  border-right: 1px solid var(--sidebar-border);
  box-shadow: 4px 0 32px rgba(0, 0, 0, 0.12);
}

.sidebar::-webkit-scrollbar {
  width: 8px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
}

.brand {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--sidebar-border);
}

.brandIcon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, var(--accent) 0%, #0f766e 100%);
  border-radius: var(--radius);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.brandText {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.brandText strong {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.searchInputWrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.searchInputWrap input {
  flex: 1;
  min-width: 0;
}

.clearBtn {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--sidebar-border);
  background: var(--sidebar-surface);
  color: var(--sidebar-text);
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

.clearBtn:hover {
  background: rgba(220, 38, 38, 0.15);
  border-color: rgba(220, 38, 38, 0.3);
  color: #f87171;
}

.addAllBtn {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--sidebar-border);
  background: var(--sidebar-surface);
  color: var(--sidebar-text);
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  font-size: 22px;
}

.addAllBtn:hover {
  background: rgba(20, 184, 166, 0.14);
  border-color: rgba(20, 184, 166, 0.35);
  color: #5eead4;
}

.panelHeader {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  outline: none;
}

.panelHeader .panelTitle {
  margin-bottom: 0;
}

.chevron {
  color: var(--muted);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.panel.is-collapsed .chevron,
.tablePanel.is-collapsed .chevron,
.chartBlock.is-collapsed .chevron {
  transform: rotate(-180deg);
}

.panelContent {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s, margin-top 0.3s;
  opacity: 1;
}

.panelContent > * {
  overflow: hidden;
}

.is-collapsed .panelContent {
  grid-template-rows: 0fr;
  opacity: 0;
  margin-top: 0 !important;
}

.is-collapsed .panelContent > * {
  margin: 0;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.field span {
  font-size: 12px;
  font-weight: 600;
  color: var(--sidebar-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field input,
.field select {
  height: 44px;
  width: 100%;
  border: 1px solid var(--sidebar-border);
  background: var(--sidebar-surface);
  color: var(--sidebar-text);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  outline: 0;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.field input::placeholder {
  color: var(--sidebar-muted);
  opacity: 0.85;
}

.field input:focus,
.field select:focus {
  border-color: rgba(13, 148, 136, 0.55);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.field select option {
  color: #0f172a;
  background: var(--surface);
}

.pointList {
  display: grid;
  gap: 4px;
}

.point {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: pointer;
  color: var(--sidebar-text);
  transition: background 0.12s, border-color 0.12s, transform 0.12s;
}

.point span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.point b {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.12s;
}

.point.active b {
  opacity: 1;
}

.point:hover {
  background: rgba(255, 255, 255, 0.06);
}

.point.active {
  color: #5eead4;
  background: rgba(13, 148, 136, 0.18);
  border-color: rgba(45, 212, 191, 0.35);
}

.content {
  min-width: 0;
  padding: 28px 32px 40px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
  padding: 14px 16px;
  background: var(--surface-elevated);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
  background: linear-gradient(120deg, var(--text) 0%, #334155 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
  max-width: 52ch;
  line-height: 1.35;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.actionRow {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.actions input,
.actions select {
  height: 38px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  outline: 0;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.actions input:focus,
.actions select:focus {
  border-color: rgba(13, 148, 136, 0.45);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.actions input {
  width: 180px;
}

.actions select {
  width: 110px;
}

.primary {
  height: 42px;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.12s, box-shadow 0.15s, background 0.15s;
}

.primary {
  color: white;
  background: linear-gradient(135deg, var(--accent) 0%, #0f766e 100%);
  box-shadow: 0 4px 14px var(--accent-glow);
}

.primary:hover {
  background: linear-gradient(135deg, var(--accent-hover) 0%, #115e59 100%);
  box-shadow: 0 6px 20px var(--accent-glow);
  transform: translateY(-1px);
}

.primary:active {
  transform: translateY(0);
}

.iconBtn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}

.iconBtn:hover {
  color: var(--red);
  border-color: rgba(220, 38, 38, 0.25);
  background: #fef2f2;
}

.logoutBtn {
  color: var(--muted);
}

.logoutBtn:hover {
  color: var(--red);
}

.kpis {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.kpi,
.panel,
.tablePanel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.kpi:hover,
.panel:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(15, 23, 42, 0.1);
}

.kpi {
  min-height: 120px;
  padding: 16px 18px;
}

.kpi span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi strong {
  display: block;
  margin-top: 12px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.kpi em {
  display: block;
  margin-top: 10px;
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
}

.kpiCount {
  display: grid;
  place-items: center;
}

.kpiCount strong {
  margin-top: 0;
  font-size: 44px;
}

.chartBlock {
  margin-bottom: 16px;
}

.blockHeader {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.blockHeader span {
  font-size: 15px;
  font-weight: 800;
}

.chartBlockContent {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s, margin-bottom 0.3s;
  opacity: 1;
}

.chartBlockContent > * {
  overflow: hidden;
}

.chartBlock.is-collapsed {
  margin-bottom: 8px;
}

.chartBlock.is-collapsed .chartBlockContent {
  grid-template-rows: 0fr;
  opacity: 0;
}

.chartBlock.is-collapsed .chartBlockContent > * {
  margin: 0;
}

.up,
.positive {
  color: var(--accent);
}

.down,
.negative {
  color: var(--red);
}

.grid {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.grid.two {
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.75fr);
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel,
.tablePanel {
  min-width: 0;
  padding: 20px 22px;
}

.panelTitle {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
  color: var(--text);
}

.tableHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.tableHead .panelTitle {
  margin-bottom: 0;
}

.segment {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  background: #f1f5f9;
  border-radius: var(--radius-sm);
}

.segment button {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 0 12px;
  cursor: pointer;
  color: var(--muted);
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.12s, background 0.12s, box-shadow 0.12s;
}

.segment button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.7);
}

.segment button.active {
  color: var(--accent-hover);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.chart {
  height: 330px;
  width: 100%;
}

.chart.small {
  height: 260px;
}

.chart svg {
  width: 100%;
  height: 100%;
  display: block;
}

.axis text {
  fill: var(--muted);
  font-size: 12px;
}

.gridLine {
  stroke: rgba(15, 23, 42, 0.06);
  stroke-dasharray: 4 4;
}

.breakdown {
  display: grid;
  gap: 14px;
}

.breakRow {
  padding: 6px;
  margin: -6px;
  border-radius: var(--radius-sm);
  cursor: default;
}

.breakRow:hover {
  background: #f8fafc;
}

.breakRow span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.breakText {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.breakStats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
}

.breakStats strong {
  white-space: nowrap;
  font-weight: 600;
}

.breakStats em {
  white-space: nowrap;
  font-size: 11px;
  font-style: normal;
  color: var(--muted);
  opacity: 0.72;
}

.breakStats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
}

.breakRow i {
  display: block;
  height: 8px;
  margin-top: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #2dd4bf);
}

.metricPopup {
  position: fixed;
  z-index: 50;
  width: 320px;
  max-width: calc(100vw - 20px);
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-lg);
  pointer-events: none;
}

.popupTitle {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
}

.metricPopup table {
  font-size: 12px;
}

.metricPopup th,
.metricPopup td {
  padding: 6px 7px;
  border-bottom: 0;
}

.metricPopup thead tr {
  background: #eef7f5;
}

.metricPopup tbody tr:nth-child(odd) {
  background: #fbf8ef;
}

.metricPopup tbody tr:nth-child(even) {
  background: #f2f8fb;
}

.metricPopup tbody tr:hover {
  background: #eef7f5;
}

.neutral {
  color: var(--muted);
}

.tableWrap {
  overflow: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: #f8fafc;
}

th:first-child,
td:first-child,
th:nth-child(2),
td:nth-child(2) {
  text-align: left;
}

tbody tr {
  transition: background 0.1s;
}

tbody tr:hover {
  background: #f8fafc;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.metricCell {
  cursor: default;
  border-radius: 6px;
}

.metricCell:hover {
  background: #eef7f5;
}

.muted {
  color: var(--muted);
}

@media (max-width: 1200px) {
  .app {
    grid-template-columns: 280px 1fr;
  }

  .kpis,
  .grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grid.two {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 820px) {
  .app {
    display: block;
  }

  .sidebar {
    position: relative;
    height: auto;
    max-height: 58vh;
    border-right: 0;
    border-bottom: 1px solid var(--sidebar-border);
  }

  .topbar {
    flex-direction: column;
  }

  .actions {
    width: 100%;
    justify-content: stretch;
  }

  .actionRow {
    display: grid;
    grid-template-columns: 1fr;
  }

  .actions input,
  .actions select {
    width: 100%;
    flex: 1;
    min-width: 0;
  }

  .tableHead {
    display: grid;
  }

  .segment {
    overflow-x: auto;
    max-width: 100%;
  }

  .kpis,
  .grid.three {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 18px 16px 28px;
  }
}

body.auth-locked {
  overflow: hidden;
}

body.auth-locked #appShell {
  display: none;
}

#authScreen.is-hidden {
  display: none;
}

.authScreen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(13, 148, 136, 0.2), transparent 34%),
    radial-gradient(circle at bottom right, rgba(124, 58, 237, 0.15), transparent 30%),
    linear-gradient(165deg, var(--bg0) 0%, var(--bg1) 45%, #eef1f8 100%);
}

.authCard {
  width: min(100%, 440px);
  padding: 28px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(18px);
}

.authBrand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.authBrand p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
}

.authBrand strong {
  display: block;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.authForm {
  display: grid;
  gap: 14px;
}

.authForm .field {
  margin-bottom: 0;
}

.authForm .field input,
.authForm .field select {
  background: #fff;
  color: var(--text);
  border-color: rgba(15, 23, 42, 0.14);
}

.passwordField {
  display: flex;
  align-items: center;
  gap: 8px;
}

.passwordField input {
  flex: 1;
  min-width: 0;
}

.passwordToggle {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: #fff;
  color: var(--muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.passwordToggle:hover {
  color: var(--text);
  border-color: rgba(13, 148, 136, 0.45);
  background: #f8fafc;
}

.authSubmit {
  width: 100%;
  justify-content: center;
}

.authHint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.authError {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(220, 38, 38, 0.1);
  color: var(--red);
  font-size: 13px;
}

.ghost {
  height: 42px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0 16px;
  cursor: pointer;
  font-weight: 600;
}

.sourceBadge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mobileSidebarToggle {
  display: none;
}

.adminPanel {
  margin-top: 18px;
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(15, 23, 42, 0.1);
}

.adminSummary p {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.adminSupervisorList {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.adminSupervisor {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
}

.adminSupervisor strong,
.adminSupervisor span {
  display: block;
}

.adminSupervisor strong {
  font-size: 14px;
  margin-bottom: 4px;
}

.adminSupervisor span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.adminSupervisor.selected {
  border-color: rgba(13, 148, 136, 0.55);
  background: rgba(13, 148, 136, 0.1);
}

.adminEditor {
  display: grid;
  gap: 12px;
}

.adminToggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 13px;
}

.adminToolbar {
  display: grid;
  gap: 10px;
}

.adminToolbar input {
  height: 42px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: #fff;
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0 12px;
}

.adminToolbarButtons {
  display: flex;
  gap: 8px;
}

.adminToolbarButtons button,
.adminActions button {
  height: 38px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: #fff;
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  cursor: pointer;
  font-weight: 600;
}

.adminToolbarButtons button:hover,
.adminActions button:hover {
  background: #f8fafc;
}

.adminActions {
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.adminActions .primary {
  flex: 1;
}

.adminPointList {
  display: grid;
  gap: 6px;
  max-height: 280px;
  overflow: auto;
  padding-right: 4px;
}

.adminPointItem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  border: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 13px;
}

.adminPointItem input {
  accent-color: var(--accent);
}

@media (max-width: 1200px) {
  .mobileSidebarToggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 820px) {
  #appShell {
    position: relative;
  }

  #appShell.sidebar-open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.44);
    backdrop-filter: blur(1px);
    z-index: 18;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(88vw, 340px);
    max-height: none;
    z-index: 20;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 12px 0 40px rgba(15, 23, 42, 0.22);
  }

  #appShell.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .topbar {
    gap: 12px;
  }

  .actions {
    width: 100%;
    justify-content: stretch;
  }

  .actionRow {
    width: 100%;
    justify-content: stretch;
  }

  .actionRow .ghost,
  .actionRow .primary,
  .actionRow .sourceBadge,
  .actionRow .mobileSidebarToggle {
    flex: 1;
    justify-content: center;
  }

  .passwordField {
    flex-wrap: nowrap;
  }

  .mobileSidebarToggle {
    display: inline-flex;
  }

  .logoutBtn {
    width: 38px;
    padding: 0;
    justify-content: center;
  }

  .adminActions {
    flex-direction: column;
  }

  .adminPanel {
    background: rgba(255, 255, 255, 0.98);
  }
}
