:root {
  color-scheme: dark;
  --bg: #050706;
  --panel: #0c1110;
  --panel-2: #121817;
  --line: #26302d;
  --line-soft: #1a2320;
  --text: #f8fafc;
  --muted: #b7c2cc;
  --muted-2: #77858d;
  --olive: #78986a;
  --olive-dark: #556b2f;
  --teal: #1fd1c6;
  --cyan: #69e7ff;
  --red: #e45756;
  --amber: #d8a84e;
  --gold: #f1c75b;
  --green: #5fca88;
  --ink: #07100f;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --glow-teal: 0 0 0 1px rgba(31, 209, 198, 0.22), 0 0 34px rgba(31, 209, 198, 0.12);
  --glow-olive: 0 0 0 1px rgba(120, 152, 106, 0.22), 0 0 34px rgba(120, 152, 106, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background:
    linear-gradient(140deg, rgba(120, 152, 106, 0.16), transparent 38%),
    linear-gradient(220deg, rgba(216, 168, 78, 0.08), transparent 32%),
    var(--bg);
  color: var(--text);
}

body * {
  min-width: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
fieldset:disabled button {
  cursor: not-allowed;
  opacity: 0.58;
}

fieldset:disabled input,
fieldset:disabled select,
fieldset:disabled textarea {
  cursor: not-allowed;
  opacity: 0.68;
}

.hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 18%, rgba(31, 209, 198, 0.18), transparent 30%),
    radial-gradient(circle at 84% 18%, rgba(120, 152, 106, 0.16), transparent 26%),
    radial-gradient(circle at 72% 86%, rgba(31, 209, 198, 0.10), transparent 28%),
    linear-gradient(135deg, #020706, #071211 54%, #030706);
}

.login-stack {
  width: min(450px, 92vw);
  display: grid;
  justify-items: center;
  gap: 18px;
}

.login-card {
  width: 100%;
  padding: 34px;
  border: 1px solid rgba(31, 209, 198, 0.28);
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(15, 25, 24, 0.88), rgba(7, 13, 12, 0.94)),
    #0b1110;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow), 0 0 34px rgba(31, 209, 198, 0.24);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.brand-mark {
  width: 92px;
  height: 92px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.38);
  box-shadow: 0 0 28px rgba(31, 209, 198, 0.22), 0 14px 34px rgba(0, 0, 0, 0.22);
  padding: 7px;
}

.brand-mark img,
.sidebar-brand img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-copy {
  margin: 22px 0 24px;
  text-align: center;
}

.login-copy p,
#moduleEyebrow {
  margin: 0 0 5px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.login-copy h1,
.topbar h2 {
  margin: 0;
  letter-spacing: 0;
}

.login-copy h1 {
  font-size: clamp(2rem, 8vw, 2.85rem);
  line-height: 1;
}

.login-form,
.form-grid,
.filters {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
}

.login-form label {
  color: #d7fff9;
  font-size: 0.84rem;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  max-width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #08100f;
  color: var(--text);
  outline: none;
}

.login-form input {
  min-height: 48px;
  border: 1px solid rgba(31, 209, 198, 0.18);
  border-radius: 14px;
  padding: 13px 14px;
  background: rgba(2, 8, 7, 0.72);
  color: var(--text);
}

.login-form input::placeholder {
  color: rgba(183, 194, 204, 0.58);
}

textarea {
  min-height: 140px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(31, 209, 198, 0.13);
}

.login-form input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(31, 209, 198, 0.12);
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 58px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  display: inline-grid;
  place-items: center;
  transform: translateY(-50%);
  border: 1px solid rgba(31, 209, 198, 0.18);
  border-radius: 12px;
  background: rgba(31, 209, 198, 0.07);
  color: #d7fff9;
  padding: 0;
  touch-action: manipulation;
}

.password-toggle:hover {
  border-color: rgba(31, 209, 198, 0.34);
  background: rgba(31, 209, 198, 0.13);
}

.eye-icon {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-toggle:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.password-toggle[aria-pressed="true"] {
  border-color: rgba(120, 152, 106, 0.54);
  background: rgba(120, 152, 106, 0.16);
  color: var(--text);
}

.primary-btn,
.ghost-btn,
.icon-text-btn,
.icon-btn,
.danger-btn,
.mini-btn {
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid transparent;
  color: var(--text);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.primary-btn {
  background: linear-gradient(135deg, var(--olive), var(--teal));
  color: var(--ink);
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(31, 209, 198, 0.2);
}

.primary-btn:hover:not(:disabled),
.ghost-btn:hover:not(:disabled),
.icon-text-btn:hover:not(:disabled),
.icon-btn:hover:not(:disabled),
.mini-btn:hover:not(:disabled) {
  border-color: rgba(31, 209, 198, 0.42);
  box-shadow: var(--glow-teal);
  transform: translateY(-1px);
}

.ghost-btn,
.icon-text-btn,
.mini-btn {
  background: #0c1412;
  border-color: var(--line);
}

.danger-btn {
  background: rgba(228, 87, 86, 0.16);
  border-color: rgba(228, 87, 86, 0.55);
}

.icon-btn {
  width: 42px;
  background: #0c1412;
  border-color: var(--line);
}

.icon-text-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
}

.mini-btn {
  padding: 0 10px;
  min-height: 32px;
}

.form-error,
.module-error {
  min-height: 20px;
  color: #ffb3b3;
}

.form-error:not(:empty) {
  padding: 11px 12px;
  border: 1px solid rgba(228, 87, 86, 0.26);
  border-radius: 14px;
  background: rgba(228, 87, 86, 0.08);
  box-shadow: 0 0 18px rgba(228, 87, 86, 0.08);
}

.login-submit {
  min-height: 49px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
  border: 0;
  border-radius: 14px;
  font-size: 0.98rem;
  font-weight: 950;
}

.mini-spinner {
  width: 16px;
  height: 16px;
  display: inline-block;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: var(--teal);
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

.primary-btn .mini-spinner {
  border-color: rgba(7, 16, 15, 0.24);
  border-top-color: var(--ink);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.powered,
.powered-brand {
  width: min(260px, 70vw);
  max-height: 86px;
  object-fit: contain;
  border-radius: 18px;
  opacity: 0.94;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
}

.app-shell {
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.main-content {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: rgba(5, 7, 6, 0.92);
  backdrop-filter: blur(14px);
  min-width: 0;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 84px minmax(0, 1fr);
}

.app-shell.sidebar-collapsed .sidebar-brand div,
.app-shell.sidebar-collapsed .module-btn span:not(.module-icon),
.app-shell.sidebar-collapsed .module-btn small,
.app-shell.sidebar-collapsed .sidebar-user,
.app-shell.sidebar-collapsed .sidebar-footer .ghost-btn {
  display: none;
}

.app-shell.sidebar-collapsed .module-btn {
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 10px 6px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #f8fafc;
}

.sidebar-brand strong,
.sidebar-brand span,
.sidebar-user strong,
.sidebar-user span {
  display: block;
}

.sidebar-brand span,
.sidebar-user span {
  color: var(--muted);
  font-size: 0.78rem;
}

.module-nav {
  display: grid;
  align-content: start;
  gap: 8px;
  overflow-y: auto;
}

.module-btn {
  width: 100%;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 11px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.module-btn strong {
  color: var(--text);
  font-weight: 750;
}

.module-btn small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  line-height: 1.25;
}

.module-btn.active {
  border-color: rgba(31, 209, 198, 0.38);
  background: rgba(31, 209, 198, 0.09);
  box-shadow: var(--glow-teal);
}

.module-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(31, 209, 198, 0.12), rgba(120, 152, 106, 0.14));
  color: var(--text);
  font-size: 1.05rem;
}

.sidebar-footer {
  display: grid;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.main-area {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  padding: 18px 20px 34px;
}

.topbar {
  min-height: 68px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.chip,
.user-chip {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: #0a1110;
  white-space: nowrap;
}

.chip {
  color: var(--teal);
  border-color: rgba(31, 209, 198, 0.32);
}

.write-notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(216, 168, 78, 0.48);
  border-radius: 8px;
  background: rgba(216, 168, 78, 0.1);
  color: #f0d9a4;
}

.module-root {
  display: grid;
  gap: 16px;
  min-width: 0;
  max-width: 100%;
}

.home-panel {
  min-height: calc(100vh - 128px);
  display: grid;
  align-content: start;
  gap: 24px;
  padding: clamp(8px, 2vw, 18px) 0 24px;
}

.home-heading {
  display: grid;
  gap: 4px;
}

.home-heading h3 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
}

.home-kicker {
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.home-card {
  min-height: 158px;
  display: grid;
  align-content: space-between;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(31, 209, 198, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(18, 24, 23, 0.94), rgba(8, 14, 13, 0.96)),
    var(--panel);
  color: var(--text);
  text-align: left;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.18);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.home-card:hover {
  transform: translateY(-3px);
  border-color: rgba(31, 209, 198, 0.42);
  box-shadow: var(--shadow), var(--glow-teal);
}

.home-card-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(31, 209, 198, 0.12);
  font-size: 1.45rem;
}

.home-card strong {
  font-size: 1.08rem;
}

.home-card small {
  color: var(--muted);
  line-height: 1.4;
}

.toolbar,
.tabbar,
.section-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.surface,
.section-card {
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 17, 16, 0.82);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.16);
}

.surface-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.surface-header h3,
.surface-header p {
  margin: 0;
}

.surface-header p {
  color: var(--muted);
  font-size: 0.86rem;
}

.surface-body {
  padding: 16px;
  min-width: 0;
  max-width: 100%;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 10px;
}

.kpi-card {
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(18, 24, 23, 0.96), rgba(9, 15, 14, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 12px 30px rgba(0, 0, 0, 0.12);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--teal);
  opacity: 0.8;
}

.kpi-card.tone-success::before {
  background: var(--green);
}

.kpi-card.tone-danger::before {
  background: var(--red);
}

.kpi-card.tone-info::before {
  background: var(--cyan);
}

.kpi-card.tone-accent::before {
  background: var(--gold);
}

.kpi-card.tone-money::before {
  background: linear-gradient(90deg, var(--gold), var(--green));
}

.kpi-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kpi-card span {
  color: var(--muted);
  font-size: 0.78rem;
}

.kpi-icon {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text) !important;
  font-size: 0.98rem !important;
}

.kpi-card strong {
  display: block;
  margin-top: 10px;
  font-size: 1.45rem;
  line-height: 1.1;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.filter-bar {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}

.filter-bar label {
  min-width: 0;
  gap: 5px;
  font-size: 0.78rem;
}

.filter-bar input,
.filter-bar select {
  min-height: 36px;
  padding: 8px 10px;
}

.filter-actions {
  align-self: end;
  justify-content: flex-end;
}

.filter-actions button {
  min-height: 36px;
  padding: 0 12px;
}

.table-meta {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.table-wrap,
.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  max-height: min(520px, 60vh);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

.module-subsection {
  display: grid;
  gap: 10px;
}

.module-subsection + .module-subsection {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.module-subsection h4 {
  margin: 0;
  font-size: 0.98rem;
}

.data-table,
table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
  font-size: 0.88rem;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #101715;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.015);
}

tr.group-0 td {
  background: rgba(31, 209, 198, 0.025);
}

tr.group-1 td {
  background: rgba(216, 168, 78, 0.035);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-badge.ok {
  border-color: rgba(95, 202, 136, 0.42);
  background: rgba(95, 202, 136, 0.12);
  color: #b9f8cf;
}

.status-badge.danger {
  border-color: rgba(228, 87, 86, 0.48);
  background: rgba(228, 87, 86, 0.14);
  color: #ffc3c3;
}

.status-badge.info {
  border-color: rgba(105, 231, 255, 0.42);
  background: rgba(105, 231, 255, 0.1);
  color: #c9f8ff;
}

.status-badge.warn {
  border-color: rgba(216, 168, 78, 0.48);
  background: rgba(216, 168, 78, 0.12);
  color: #f7dea4;
}

.empty-state,
.loading-state {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.loading-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.chart {
  display: grid;
  gap: 10px;
}

.vertical-chart,
.grouped-chart,
.line-chart {
  min-width: 0;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 220px) minmax(0, 1fr) 84px;
  gap: 10px;
  align-items: center;
}

.bar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.bar-track {
  height: 24px;
  border-radius: 8px;
  background: #07100f;
  overflow: hidden;
  border: 1px solid var(--line-soft);
}

.bar-fill {
  height: 100%;
  min-width: 2px;
  background: linear-gradient(90deg, var(--olive-dark), var(--teal));
}

.bar-fill.red {
  background: linear-gradient(90deg, var(--red), var(--amber));
}

.line-chart {
  display: grid;
  gap: 8px;
}

.chart-description {
  margin: 4px 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.chart-svg {
  width: 100%;
  height: 280px;
  overflow: visible;
}

.chart-grid {
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 1;
}

.chart-axis {
  fill: var(--muted);
  font-size: 12px;
}

.chart-axis-line {
  stroke: rgba(255, 255, 255, 0.26);
  stroke-width: 1.2;
}

.chart-y-label,
.chart-x-axis-title,
.chart-x-label,
.chart-value {
  fill: var(--muted);
  font-size: 12px;
}

.chart-y-label {
  font-weight: 800;
  letter-spacing: 0;
}

.chart-x-axis-title {
  font-weight: 800;
}

.chart-value {
  fill: var(--text);
  font-size: 11px;
}

.svg-bar {
  fill: var(--teal);
  filter: drop-shadow(0 0 10px rgba(31, 209, 198, 0.22));
}

.svg-bar.red {
  fill: var(--red);
  filter: drop-shadow(0 0 10px rgba(228, 87, 86, 0.18));
}

.chart-line {
  fill: none;
  stroke: var(--teal);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line.red {
  stroke: var(--amber);
}

.chart-point {
  fill: var(--teal);
  stroke: #07100f;
  stroke-width: 2;
}

.chart-point.red {
  fill: var(--amber);
}

.line-labels,
.chart-legend {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
}

.chart-legend {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.line-labels {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
}

.line-labels strong {
  color: var(--muted);
  text-align: center;
}

.line-labels span:last-child {
  text-align: right;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--teal);
}

.legend-dot.red {
  background: var(--amber);
}

.grouped-chart {
  display: grid;
  gap: 12px;
}

.grouped-row {
  display: grid;
  grid-template-columns: minmax(120px, 220px) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.grouped-bars {
  display: grid;
  gap: 6px;
}

.grouped-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px;
  gap: 8px;
  align-items: center;
}

.grouped-track {
  height: 16px;
  border-radius: 8px;
  background: #07100f;
  overflow: hidden;
  border: 1px solid var(--line-soft);
}

.grouped-item span {
  color: var(--text);
  text-align: right;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.bar-value {
  color: var(--text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.tab-btn {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0a1110;
  color: var(--muted);
}

.tab-btn.active {
  color: var(--ink);
  border-color: transparent;
  background: var(--teal);
  font-weight: 800;
}

.inline-notice {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(216, 168, 78, 0.45);
  border-radius: 8px;
  background: rgba(216, 168, 78, 0.1);
  color: #f3dca9;
  font-size: 0.86rem;
}

.split-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.muted {
  color: var(--muted);
}

fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}

@media (max-width: 980px) {
  .app-shell,
  .app-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    z-index: 20;
    inset: 0 auto 0 0;
    width: min(320px, 88vw);
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  .app-shell.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .topbar-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .filter-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .main-area {
    padding: 14px 12px 28px;
  }

  .surface-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .bar-row {
    grid-template-columns: 1fr;
  }

  .grouped-row {
    grid-template-columns: 1fr;
  }

  .grouped-item {
    grid-template-columns: minmax(0, 1fr) 70px;
  }

  .chart-svg {
    height: 220px;
  }

  .bar-value {
    text-align: left;
  }

  .filter-bar {
    grid-template-columns: 1fr;
  }

  .filter-actions button {
    flex: 1 1 auto;
  }

  .home-grid {
    grid-template-columns: 1fr;
  }

  .home-card {
    min-height: 136px;
  }
}
