:root {
  color-scheme: dark;
  --bg: #090706;
  --bg-soft: #100a08;
  --surface: rgba(28, 17, 13, 0.88);
  --surface-strong: #21120d;
  --surface-light: #2a1710;
  --border: rgba(255, 151, 87, 0.18);
  --border-strong: rgba(255, 133, 62, 0.42);
  --text: #fff9f4;
  --muted: #ad9f97;
  --orange: #ff713e;
  --gold: #ffb04f;
  --red: #f04435;
  --green: #48c889;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 80% -10%, rgba(207, 50, 20, 0.16), transparent 36rem),
    linear-gradient(145deg, #080605 0%, #0e0806 50%, #070606 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

.hidden {
  display: none !important;
}

.ambient {
  position: fixed;
  z-index: 0;
  width: 36rem;
  height: 36rem;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  opacity: 0.16;
}

.ambient-one {
  top: -16rem;
  right: -10rem;
  background: var(--red);
}

.ambient-two {
  bottom: -20rem;
  left: 10%;
  background: var(--orange);
  opacity: 0.08;
}

.auth-shell {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(100%, 460px);
  padding: clamp(28px, 6vw, 46px);
  border: 1px solid var(--border);
  border-radius: 30px;
  background:
    linear-gradient(150deg, rgba(255, 113, 62, 0.08), transparent 34%),
    rgba(22, 13, 10, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 42px;
}

.brand-lockup > span:last-child {
  display: flex;
  flex-direction: column;
}

.brand-lockup strong {
  font-size: 1.1rem;
}

.brand-lockup small {
  color: var(--muted);
  font-size: 0.76rem;
}

.brand-mark {
  display: inline-grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 17px;
  color: white;
  background: linear-gradient(145deg, var(--orange), var(--red));
  box-shadow: 0 12px 34px rgba(240, 68, 42, 0.22);
  font-weight: 900;
  font-size: 1.65rem;
  letter-spacing: -0.12em;
}

.brand-mark span {
  color: #fff6ea;
}

.brand-mark.small {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  font-size: 1.25rem;
}

.eyebrow {
  margin: 0 0 8px;
  color: #ff9366;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 5vw, 2.75rem);
  letter-spacing: -0.055em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  letter-spacing: -0.035em;
}

.muted {
  color: var(--muted);
  line-height: 1.6;
}

.small-copy {
  font-size: 0.78rem;
}

.form-stack {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.form-stack label {
  display: grid;
  gap: 8px;
  color: #d7cac2;
  font-size: 0.78rem;
  font-weight: 650;
}

.form-stack label small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 500;
}

.remember-device-row {
  display: flex !important;
  align-items: center;
  grid-template-columns: none !important;
  gap: 10px !important;
  cursor: pointer;
}

.remember-device-row input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--orange);
}

.saved-device-note {
  margin: -4px 0 0;
  color: #72dba7;
  font-size: 0.75rem;
  line-height: 1.45;
}

input,
select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.09);
  outline: none;
  color: var(--text);
  background: rgba(5, 5, 5, 0.46);
  transition: border 160ms ease, box-shadow 160ms ease;
}

input {
  height: 50px;
  padding: 0 15px;
  border-radius: 14px;
}

input:focus,
select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 113, 62, 0.14);
}

.primary-button,
.secondary-button,
.text-button,
.icon-button {
  cursor: pointer;
  border: 0;
}

.primary-button,
.secondary-button {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  font-weight: 760;
}

.primary-button {
  background: linear-gradient(100deg, var(--red), #e85f20 70%, #f38a26);
  box-shadow: 0 12px 30px rgba(239, 71, 38, 0.2);
}

.secondary-button {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
}

.text-button {
  margin-top: 20px;
  padding: 8px 0;
  color: #cebbb0;
  background: transparent;
  font-size: 0.78rem;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.form-message {
  min-height: 20px;
  margin: 18px 0 0;
  color: #ffb59c;
  font-size: 0.8rem;
  line-height: 1.5;
}

.setup-key-panel {
  display: grid;
  gap: 14px;
  margin-top: 24px;
  padding: 18px;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: rgba(255, 113, 62, 0.06);
}

.setup-key-panel > div {
  display: grid;
  gap: 6px;
}

.setup-step {
  margin: 0;
  color: #e9dcd5;
  line-height: 1.5;
}

.field-caption {
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.setup-key-panel code {
  overflow-wrap: anywhere;
  color: var(--gold);
  font-size: 0.92rem;
  line-height: 1.6;
}

.compact-form {
  margin-top: 4px;
}

.dashboard-shell {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100vh;
  grid-template-columns: 244px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  padding: 28px 18px 22px;
  border-right: 1px solid rgba(255, 255, 255, 0.055);
  background: rgba(8, 7, 6, 0.82);
  backdrop-filter: blur(20px);
}

.sidebar-brand {
  margin: 0 8px 38px;
}

.nav-list {
  display: grid;
  gap: 7px;
}

.nav-item {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 13px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: #c7b9b1;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.nav-item.active {
  border-color: rgba(255, 113, 62, 0.16);
  color: white;
  background: linear-gradient(100deg, rgba(239, 68, 53, 0.18), rgba(255, 113, 62, 0.06));
}

.nav-item.planned {
  cursor: default;
  opacity: 0.52;
}

.nav-item small {
  margin-left: auto;
  font-size: 0.58rem;
}

.nav-icon {
  width: 20px;
  color: var(--orange);
  font-weight: 800;
  text-align: center;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  padding: 14px;
  color: var(--muted);
  font-size: 0.73rem;
}

.secure-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgba(72, 200, 137, 0.55);
}

.main-column {
  min-width: 0;
  padding: 0 clamp(20px, 4vw, 58px);
}

.topbar {
  display: flex;
  min-height: 116px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.topbar h1 {
  margin: 0;
  font-size: 1.9rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.range-control {
  display: flex;
  height: 44px;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 13px;
  color: var(--muted);
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.025);
}

.range-control select {
  width: auto;
  border: 0;
  background: transparent;
  font-weight: 700;
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 13px;
  color: var(--orange);
  background: rgba(255, 255, 255, 0.025);
  font-size: 1.25rem;
}

.compact-button {
  min-height: 44px;
}

.view {
  display: none;
  padding: 38px 0 48px;
}

.view.active-view {
  display: block;
}

.section-heading,
.chart-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.section-heading p,
.chart-heading p {
  margin-bottom: 0;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

#overview-view > .metric-grid,
#usage-view > .metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#customers-view > .metric-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-card,
.chart-card,
.table-card,
.manager-card,
.future-card {
  border: 1px solid rgba(255, 255, 255, 0.065);
  background:
    linear-gradient(145deg, rgba(255, 112, 61, 0.04), transparent 42%),
    rgba(23, 16, 13, 0.76);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.16);
}

.metric-card {
  display: grid;
  min-height: 144px;
  align-content: space-between;
  gap: 8px;
  padding: 23px;
  border-radius: 21px;
}

.metric-card.featured {
  border-color: var(--border-strong);
  background:
    linear-gradient(145deg, rgba(240, 68, 53, 0.2), rgba(255, 113, 62, 0.04) 60%),
    rgba(28, 16, 12, 0.9);
}

.metric-card.profit-card {
  border-color: rgba(72, 200, 137, 0.28);
  background:
    linear-gradient(145deg, rgba(72, 200, 137, 0.12), transparent 62%),
    rgba(23, 16, 13, 0.78);
}

.metric-card.profit-card strong {
  color: #8ce6b5;
}

.metric-card.top-user-card {
  border-color: rgba(255, 191, 99, 0.25);
}

.metric-card.top-user-card strong {
  overflow: hidden;
  color: var(--gold);
  font-size: clamp(1.25rem, 2.2vw, 1.9rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-card > span {
  color: #c4b6ae;
  font-size: 0.8rem;
}

.metric-card strong {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.05em;
}

.metric-card small {
  color: var(--muted);
  font-size: 0.69rem;
}

.quality-banner {
  margin-top: 16px;
  padding: 14px 17px;
  border: 1px solid rgba(255, 176, 79, 0.25);
  border-radius: 14px;
  color: #efc88f;
  background: rgba(255, 176, 79, 0.055);
  font-size: 0.78rem;
  line-height: 1.5;
}

.chart-card {
  margin-top: 18px;
  padding: 24px;
  border-radius: 24px;
}

.legend {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 0.68rem;
}

.legend span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 3px;
}

.legend-cash {
  background: linear-gradient(145deg, var(--orange), var(--red));
}

.legend-earned {
  background: var(--gold);
}

.chart-area {
  min-height: 330px;
  overflow-x: auto;
}

.chart-area svg {
  display: block;
  width: 100%;
  min-width: 680px;
  height: 330px;
}

.chart-empty {
  display: grid;
  min-height: 300px;
  place-items: center;
  color: var(--muted);
}

.calculating-state {
  padding: 24px;
  color: var(--gold);
  text-align: center;
}

.future-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.future-card {
  display: flex;
  min-height: 112px;
  align-items: flex-start;
  gap: 15px;
  padding: 20px;
  border-radius: 19px;
}

.future-index {
  color: var(--orange);
  font-size: 0.68rem;
  font-weight: 800;
}

.future-card strong {
  font-size: 0.86rem;
}

.future-card p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.5;
}

.live-summary-card strong {
  display: block;
  color: var(--gold);
  font-size: 1.05rem;
}

.analytics-split {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
  gap: 18px;
}

.rank-list,
.timeline-list,
.alert-list {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}

.rank-list:empty,
.timeline-list:empty,
.alert-list:empty {
  color: var(--muted);
  font-size: 0.75rem;
}

.rank-row {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  overflow: hidden;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.13);
}

.rank-row > i {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--red), var(--orange), var(--gold));
}

.rank-number {
  color: var(--orange);
  font-size: 0.66rem;
  font-weight: 850;
}

.rank-row > div {
  display: grid;
  gap: 4px;
}

.rank-row strong {
  overflow: hidden;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-row small {
  color: var(--muted);
  font-size: 0.64rem;
}

.rank-row b {
  color: var(--gold);
  font-size: 0.76rem;
}

.reliability-target-grid {
  margin-top: 18px;
}

.target-state {
  font-weight: 800;
  letter-spacing: 0.06em;
}

.target-up {
  color: #8ce6b5 !important;
}

.target-down {
  color: #ff9d86 !important;
}

.target-waiting {
  color: var(--muted) !important;
}

.timeline-row {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: start;
  gap: 13px;
  padding: 15px 16px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 15px;
  background: rgba(0, 0, 0, 0.13);
}

.timeline-row > i {
  width: 9px;
  height: 9px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgba(72, 200, 137, 0.35);
}

.timeline-row.severity-warning > i {
  background: var(--gold);
  box-shadow: 0 0 12px rgba(255, 176, 79, 0.35);
}

.timeline-row.severity-critical > i {
  background: var(--red);
  box-shadow: 0 0 12px rgba(240, 68, 53, 0.4);
}

.timeline-row > div {
  display: grid;
  gap: 5px;
}

.timeline-row strong {
  font-size: 0.8rem;
}

.timeline-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.45;
}

.timeline-row time {
  color: #81736c;
  font-size: 0.62rem;
  white-space: nowrap;
}

.table-card {
  overflow: hidden;
  border-radius: 22px;
}

.finance-grid {
  margin-bottom: 18px;
}

.manager-card {
  margin-top: 18px;
  padding: 24px;
  border-radius: 24px;
}

.compact-heading {
  align-items: flex-start;
}

.expense-form {
  display: grid;
  grid-template-columns: 1.4fr .8fr 1fr 1fr 1fr 1fr;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.13);
}

.expense-form label {
  display: grid;
  align-content: start;
  gap: 7px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.expense-form input,
.expense-form select {
  height: 44px;
  padding: 0 12px;
  border-radius: 12px;
}

.expense-form-actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
  gap: 10px;
}

.compact-primary {
  min-height: 44px;
}

.inline-message {
  min-height: 20px;
  margin: 12px 2px 4px;
  color: #efc88f;
  font-size: 0.74rem;
}

.expense-table-wrap {
  margin-top: 8px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 17px;
}

.expense-table {
  min-width: 720px;
}

.expense-table td:first-child {
  display: grid;
  gap: 5px;
}

.expense-table td:first-child small {
  color: var(--muted);
  font-size: 0.62rem;
  text-transform: capitalize;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.mini-button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: #dfd2cb;
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  font-size: 0.68rem;
}

.danger-button {
  color: #ff9d86;
  border-color: rgba(255, 100, 72, 0.2);
}

.empty-cell {
  padding: 32px;
  color: var(--muted);
  text-align: center !important;
}

.provider-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.provider-card {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 17px;
  background: rgba(0, 0, 0, 0.13);
}

.provider-card > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.provider-card strong {
  font-size: 0.82rem;
}

.provider-card span,
.provider-card p {
  color: var(--muted);
  font-size: 0.67rem;
}

.provider-card p {
  margin: 10px 0 0;
  line-height: 1.5;
}

.provider-bar {
  height: 7px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.055);
}

.provider-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), var(--orange), var(--gold));
}

.compact-chart,
.compact-chart svg {
  min-height: 250px;
  height: 250px;
}

.collector-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-badge {
  padding: 8px 11px;
  border: 1px solid rgba(255, 176, 79, 0.25);
  border-radius: 999px;
  color: #efc88f;
  background: rgba(255, 176, 79, 0.07);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.status-badge[data-state="HEALTHY"] {
  border-color: rgba(72, 200, 137, 0.3);
  color: #8ce6b5;
  background: rgba(72, 200, 137, 0.08);
}

.status-badge[data-state="FAILED"] {
  border-color: rgba(255, 100, 72, 0.28);
  color: #ff9d86;
  background: rgba(255, 100, 72, 0.08);
}

.status-badge[data-state="DOWN"] {
  border-color: rgba(255, 100, 72, 0.28);
  color: #ff9d86;
  background: rgba(255, 100, 72, 0.08);
}

.status-badge[data-state="PARTIAL"],
.status-badge[data-state="CHECKING"],
.status-badge[data-state="COLLECTING"] {
  border-color: rgba(255, 176, 79, 0.25);
  color: #efc88f;
  background: rgba(255, 176, 79, 0.07);
}

.collector-card h2 {
  margin-bottom: 18px;
}

.policy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.policy-grid p {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 15px;
  background: rgba(0, 0, 0, 0.13);
}

.policy-grid strong {
  font-size: 0.78rem;
}

.policy-grid span {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.45;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
}

th,
td {
  padding: 17px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  text-align: right;
  font-size: 0.78rem;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.018);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

td {
  color: #e8ddd7;
}

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

.positive {
  color: var(--green);
}

.negative {
  color: #ff8e72;
}

.dashboard-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 0 34px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: #746962;
  font-size: 0.66rem;
}

.recovery-dialog {
  width: min(90vw, 520px);
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  color: var(--text);
  background: #180e0b;
  box-shadow: var(--shadow);
}

.recovery-dialog::backdrop {
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(10px);
}

.recovery-dialog > div {
  padding: 28px;
}

.recovery-dialog pre {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 15px;
  color: var(--gold);
  background: #0d0907;
  font-size: 0.85rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 900px) {
  .dashboard-shell {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .sidebar {
    padding-inline: 12px;
  }

  .sidebar-brand > span:last-child,
  .nav-item:not(.active) small,
  .nav-item {
    font-size: 0;
  }

  .sidebar-brand {
    justify-content: center;
    margin-inline: 0;
  }

  .nav-item {
    justify-content: center;
    padding: 0;
  }

  .nav-icon {
    font-size: 1.1rem;
  }

  .sidebar-footer span:last-child {
    display: none;
  }

  .metric-grid,
  .future-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #overview-view > .metric-grid,
  #usage-view > .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .analytics-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .dashboard-shell {
    display: block;
    padding-bottom: 76px;
  }

  .sidebar {
    position: fixed;
    z-index: 5;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    height: 72px;
    flex-direction: row;
    align-items: center;
    padding: 8px 14px max(8px, env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-right: 0;
    background: rgba(9, 7, 6, 0.96);
  }

  .sidebar-brand,
  .sidebar-footer {
    display: none;
  }

  .nav-list {
    width: 100%;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
  }

  .nav-item {
    min-height: 52px;
    border-radius: 12px;
  }

  .main-column {
    padding-inline: 16px;
  }

  .topbar {
    min-height: 94px;
    align-items: flex-end;
    padding-bottom: 14px;
  }

  .topbar .eyebrow,
  .range-control > span,
  .topbar .compact-button {
    display: none;
  }

  .topbar h1 {
    font-size: 1.55rem;
  }

  .topbar-actions {
    gap: 7px;
  }

  .range-control {
    padding-inline: 9px;
  }

  .view {
    padding-top: 28px;
  }

  .section-heading,
  .chart-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .metric-grid,
  .future-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .metric-card {
    min-height: 126px;
    padding: 17px;
  }

  .metric-card strong {
    font-size: 1.45rem;
  }

  .metric-card small {
    line-height: 1.35;
  }

  .chart-card {
    padding: 18px 14px;
  }

  .manager-card {
    padding: 18px 14px;
  }

  .expense-form {
    grid-template-columns: 1fr 1fr;
    padding: 14px;
  }

  .expense-form-actions {
    grid-column: 1 / -1;
  }

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

  .collector-actions {
    width: 100%;
    justify-content: space-between;
  }

  .legend {
    flex-wrap: wrap;
  }

  .future-card {
    min-height: 130px;
    padding: 16px;
  }

  .dashboard-footer {
    flex-direction: column;
  }

  .timeline-row {
    grid-template-columns: 9px minmax(0, 1fr);
  }

  .timeline-row time {
    grid-column: 2;
  }

  .dialog-actions {
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  .metric-grid,
  .future-grid {
    grid-template-columns: 1fr;
  }

  #overview-view > .metric-grid,
  #usage-view > .metric-grid,
  #customers-view > .metric-grid {
    grid-template-columns: 1fr;
  }

  .expense-form {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
