:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --panel: #ffffff;
  --ink: #1f2521;
  --muted: #66706a;
  --line: #dde3dd;
  --green: #0f7b63;
  --green-dark: #095d4b;
  --red: #bd3d35;
  --amber: #b7791f;
  --blue: #2d5f9a;
  --shadow: 0 18px 40px rgba(31, 37, 33, 0.08);
  font-family: Inter, Segoe UI, system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

body:not(.is-authenticated) .app-shell {
  display: none;
}

body:not(.is-authenticated) {
  overflow: hidden;
}

body.is-authenticated .login-screen {
  display: none;
}

.login-screen {
  height: 100dvh;
  display: grid;
  place-items: stretch;
  padding: 0;
  background:
    radial-gradient(circle at 90% 84%, rgba(255, 255, 255, 0.82) 0 16px, transparent 17px),
    linear-gradient(135deg, #e9f4f2 0%, #f7fbfa 48%, #e5f0ee 100%);
}

.login-panel {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 380px);
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.login-visual {
  position: relative;
  min-height: 100%;
  background: #0b7067;
}

.login-visual img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: left center;
}

.login-form-panel {
  display: grid;
  place-items: center;
  min-height: 0;
  overflow-y: auto;
  padding: clamp(22px, 4vw, 48px);
}

.login-card {
  width: min(100%, 360px);
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.login-card#login-form h1,
.login-card#login-form .login-subtitle {
  display: none;
}

.login-card h1 {
  margin: 0 0 4px;
  color: #071733;
  font-size: 36px;
  line-height: 1.12;
  font-weight: 950;
  text-align: center;
}

.login-card h1 span {
  display: block;
}

.login-card label {
  display: grid;
  gap: 9px;
  color: #071733;
  font-weight: 800;
}

.login-card input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #c8d1cf;
  border-radius: 8px;
  background: #fff;
  padding: 0 13px;
  font-size: 14px;
  outline: none;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 9px;
  width: 18px;
  height: 12px;
  border: 2px solid #71817d;
  border-radius: 50%;
}

.password-toggle::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 13px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #71817d;
}

.password-toggle.active {
  background: rgba(15, 123, 99, 0.1);
}

.password-toggle.active::before {
  border-color: var(--green);
}

.password-toggle.active::after {
  background: var(--green);
}

.login-card input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(15, 123, 99, 0.13);
}

.login-card .button.primary {
  min-height: 44px;
  border-radius: 8px;
  font-weight: 900;
  margin-top: 8px;
}

.reset-code-fields {
  display: grid;
  gap: 14px;
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 2px;
}

.login-logo strong {
  display: block;
  color: #071733;
  font-size: 29px;
  font-weight: 950;
  line-height: 1;
}

.login-logo small,
.login-create,
.login-link {
  color: #00a85a;
  font-weight: 900;
}

.login-subtitle,
.login-or {
  margin: 0;
  color: #52617a;
  text-align: center;
  font-weight: 900;
}

.login-link,
.login-create {
  border: 0;
  background: transparent;
  text-align: right;
  font: inherit;
  cursor: pointer;
}

.login-link {
  font-size: 13px;
}

.login-create,
.login-or {
  text-align: center;
}

.login-or {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 13px;
  color: #7d8986;
  font-size: 13px;
  font-weight: 700;
}

.login-or::before,
.login-or::after {
  content: "";
  height: 1px;
  background: #dfe6e4;
}

.logo-check {
  width: 52px;
  height: 32px;
  position: relative;
  display: inline-block;
}

.logo-check::before,
.logo-check::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 36px;
  border-radius: 6px;
  transform: rotate(-42deg);
  transform-origin: bottom center;
}

.logo-check::before {
  left: 7px;
  top: 0;
  background: #2dbb75;
}

.logo-check::after {
  left: 25px;
  top: -5px;
  background: #3f7df3;
  transform: rotate(42deg);
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
  transition: grid-template-columns 0.2s ease;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 76px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #202020;
  color: #f4f7f2;
  padding: 18px 10px;
  overflow: hidden;
}

body.sidebar-collapsed .nav-item,
body.sidebar-collapsed .logout-nav,
body.sidebar-collapsed .profile-meta {
  font-size: 0;
}

.profile-chip {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  padding: 10px 8px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.profile-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: #e0b15f;
  color: #17231f;
  font-weight: 900;
}

.profile-meta {
  min-width: 0;
}

.profile-meta strong,
.profile-meta small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-meta small {
  color: #b7c2ba;
}

.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 0;
  overflow-y: auto;
  padding-right: 0;
}

.nav-group {
  display: grid;
  gap: 4px;
  padding: 10px 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.nav-group:last-child {
  border-bottom: 0;
}

.nav-icon {
  width: 18px;
  display: inline-grid;
  place-items: center;
  color: #dce4df;
  font-size: 14px;
}

.nav-subitems {
  display: grid;
  gap: 8px;
  margin: -2px 0 2px 28px;
  color: #ededed;
  font-size: 12px;
  font-weight: 800;
}

.nav-subitems span {
  line-height: 1.15;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 18px;
}

.sidebar-app-name {
  margin-top: 10px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #f4f7f2;
  font-size: 15px;
  font-weight: 900;
  text-align: center;
}

body.sidebar-collapsed .sidebar-app-name {
  font-size: 0;
}

body.sidebar-collapsed .nav-subitems,
body.sidebar-collapsed .nav-config span:not(.nav-icon) {
  display: none;
}

.logout-nav {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 11px 12px;
  text-align: center;
  background: rgba(189, 61, 53, 0.16);
  color: #ffd7d7;
  font-weight: 900;
  cursor: pointer;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 6px;
  padding: 7px 10px;
  text-align: left;
  color: #f2f2f2;
  background: transparent;
  cursor: pointer;
  font-weight: 850;
}

.nav-config {
  align-items: flex-start;
  padding-bottom: 2px;
}

.nav-config strong,
.nav-config small {
  display: block;
}

.nav-config small {
  margin-top: 2px;
  color: #f2f2f2;
  font-size: 11px;
  font-weight: 800;
}

.nav-item:hover,
.nav-item.active,
.logout-nav:hover {
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
}

.nav-item.locked {
  color: #d9c28a;
  opacity: 0.94;
}

.nav-item.locked::before {
  content: "♛";
  display: block;
  color: #e0b15f;
  font-size: 13px;
  line-height: 1;
  margin-bottom: 3px;
}

.nav-item.locked.active {
  background: rgba(224, 177, 95, 0.14);
}

.nav-item.locked::before {
  content: none !important;
  display: none !important;
}

.nav-item.locked::after {
  content: "♛";
  display: inline-block;
  color: #e0b15f;
  font-size: 13px;
  line-height: 1;
  margin-left: auto;
}

body.sidebar-collapsed .nav-item.locked::after {
  content: none;
}

.logout-nav:hover {
  background: rgba(189, 61, 53, 0.28);
  color: #fff;
}

.menu-toggle {
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  min-height: 36px;
  padding: 7px 11px;
  cursor: pointer;
}

.content {
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 26px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 20px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.1;
}

h2 {
  font-size: 21px;
}

h3 {
  font-size: 16px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.dynamic-filters {
  display: contents;
}

select,
input,
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  min-height: 40px;
  padding: 9px 11px;
}

textarea {
  min-height: 76px;
  resize: vertical;
}

.button,
.icon-button {
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 40px;
  padding: 9px 14px;
  cursor: pointer;
}

.button.primary {
  background: var(--green);
  color: #fff;
}

.button.primary:hover {
  background: var(--green-dark);
}

.button.ghost,
.icon-button {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.view-root {
  display: grid;
  gap: 16px;
}

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

.metric,
.panel,
.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  padding: 18px;
}

.metric-filter {
  width: 100%;
  border: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
}

.metric-filter.active {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(15, 123, 99, 0.12), var(--shadow);
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 25px;
}

.metric .good {
  color: var(--green);
}

.metric .bad {
  color: var(--red);
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 16px;
}

.panel {
  min-width: 0;
  padding: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.inline-actions.compact {
  margin: 0 0 12px;
}

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

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.table-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.sort-field {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.sort-field select {
  min-width: 210px;
}

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.th-sort {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.th-sort span {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--green);
  font-size: 11px;
  line-height: 1;
}

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

.total-row td,
.fixed-row td {
  font-weight: 950;
  background: #f4faf7;
  color: #071733;
}

.total-row td {
  border-top: 2px solid var(--green);
  color: var(--green-dark);
}

.fixed-row td {
  background: #fff8e8;
}

.row-action {
  border: 0;
  color: var(--green);
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.checks-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf8;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
}

.check-item input {
  width: auto;
  min-height: auto;
}

.access-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.plan-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(10, 20, 35, 0.26);
}

.plan-card {
  width: min(610px, 100%);
  display: grid;
  gap: 14px;
  padding: 22px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.22);
}

.plan-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.plan-options {
  display: grid;
  gap: 10px;
}

.plan-option,
.plan-block {
  min-height: 42px;
  border: 1px solid #2abb75;
  border-radius: 10px;
  background: #fff;
  color: #08a75b;
  font-weight: 900;
}

.plan-option.selected {
  background: #eafaf1;
  outline: 2px solid #2abb75;
}

.license-plan-options {
  display: grid;
  gap: 10px;
}

.license-plan-option {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid #2abb75;
  border-radius: 10px;
  background: #fff;
  color: #08a75b;
  font-weight: 900;
  text-align: center;
  cursor: pointer;
}

.license-plan-option input {
  width: 16px;
  height: 16px;
  min-height: 0;
  accent-color: #2abb75;
}

.license-plan-option.selected,
.license-plan-option:has(input:checked) {
  background: #eafaf1;
  outline: 2px solid #2abb75;
}

.history-box {
  padding: 16px;
  border-radius: 12px;
  background: #f5f7fb;
  color: #667085;
}

.history-box div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.related-panel {
  margin-top: 18px;
}

.settings-layout {
  display: grid;
  gap: 20px;
}

.settings-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.settings-tab {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.settings-tab.active {
  border-color: var(--green);
  background: #eafaf1;
  color: var(--green-dark);
}

.settings-tab.locked {
  border-color: #e0b15f;
  color: #9d741e;
}

.settings-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.settings-head.compact {
  align-items: start;
}

.settings-head h3 {
  margin: 0;
  font-size: 19px;
}

.settings-card .table-wrap {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.settings-card table {
  min-width: 620px;
}

.settings-card th,
.settings-card td {
  border-color: var(--line);
  color: var(--ink);
}

.settings-card th {
  color: var(--muted);
}

.button.pill {
  border-radius: 999px;
}

.row-action.purple {
  color: #b892ff;
}

.row-action.danger {
  color: #ff5555;
}

.subcategory-list {
  display: grid;
}

.subcategory-row {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.subcategory-row:last-child {
  border-bottom: 0;
}

.inline-actions.end {
  justify-content: flex-end;
}

.chart-bars {
  min-height: 210px;
  display: grid;
  grid-template-columns: repeat(12, minmax(38px, 1fr));
  align-items: end;
  gap: 10px;
  overflow-x: auto;
}

.chart-item {
  display: grid;
  justify-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.chart-value {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
}

.chart-column {
  width: 22px;
  min-height: 8px;
  border-radius: 8px 8px 2px 2px;
  background: var(--green);
}

.chart-column.bad {
  background: var(--red);
}

.pie-layout {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}

.pie-chart {
  width: min(260px, 100%);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 10px solid #fff;
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow);
}

.pie-legend {
  display: grid;
  gap: 10px;
}

.pie-legend-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  color: var(--muted);
}

.pie-legend-row span {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.pie-legend-row strong {
  color: var(--ink);
}

.pie-legend-row em {
  font-style: normal;
  font-weight: 800;
}

.pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.pending-access {
  max-width: 680px;
  margin: 80px auto 0;
  display: grid;
  gap: 14px;
  text-align: center;
}

.pending-access .badge {
  justify-self: center;
}

.pending-access h2 {
  color: #071733;
  font-size: 28px;
}

.pending-access p {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.5;
}

.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  background: #eef2ef;
  color: #34413a;
}

.badge.green {
  background: #e5f5ef;
  color: var(--green-dark);
}

.badge.red {
  background: #fae9e7;
  color: var(--red);
}

.badge.amber {
  background: #fff3d9;
  color: var(--amber);
}

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

.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: #eef1ed;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--blue);
}

.dialog {
  width: min(760px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.22);
}

.dialog:not([open]) {
  display: none;
}

.dialog::backdrop {
  background: rgba(23, 35, 31, 0.46);
}

.dialog form {
  padding: 20px;
}

.dialog-head,
.dialog-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dialog-head {
  justify-content: space-between;
  margin-bottom: 16px;
}

.dialog-actions {
  margin-top: 18px;
}

.spacer {
  flex: 1;
}

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

.field {
  display: grid;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.launch-dialog {
  width: min(720px, calc(100vw - 24px));
  background: #222;
  color: #f7f7f7;
}

.launch-dialog .dialog-head {
  margin-bottom: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.launch-dialog .dialog-head h2,
.launch-dialog .eyebrow {
  display: none;
}

.launch-dialog .icon-button,
.launch-dialog .button.ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.22);
  color: #f7f7f7;
}

.launch-dialog .dialog-actions {
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

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

.launch-form {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.95fr);
  gap: 16px 12px;
}

.launch-form .full {
  grid-column: 1 / -1;
}

.launch-form-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
}

.launch-form-head h3 {
  margin: 0;
  font-size: 22px;
}

.launch-form-head p {
  margin: 4px 0 0;
  color: #d7d7d7;
}

.launch-dialog .field label,
.launch-type-field > label,
.launch-amount-card label {
  color: #c8c8c8;
  font-weight: 800;
}

.launch-dialog select,
.launch-dialog input,
.launch-dialog textarea {
  min-height: 40px;
  border-color: rgba(255, 255, 255, 0.2);
  background: #232323;
  color: #f7f7f7;
}

.launch-dialog textarea {
  min-height: 66px;
}

.launch-type-field {
  display: grid;
  gap: 7px;
}

.launch-type-options {
  display: flex;
  gap: 8px;
}

.launch-type-option {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 950;
}

.launch-type-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.launch-type-option.income {
  color: #5ed174;
  border-color: #45b462;
}

.launch-type-option.expense {
  color: #ff6969;
  border-color: #c94d4d;
}

.launch-type-option.selected.income {
  background: rgba(69, 180, 98, 0.18);
}

.launch-type-option.selected.expense {
  background: rgba(201, 77, 77, 0.2);
}

.launch-amount-card {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 9px;
  background: #171717;
}

.launch-amount-card input {
  min-height: 30px;
  border: 0;
  padding: 0;
  background: transparent;
  color: #5ed174;
  font-size: 22px;
  font-weight: 950;
}

.launch-amount-card strong {
  color: #5ed174;
  font-size: 13px;
}

.launch-amount-card.expense strong {
  color: #ff6969;
}

.launch-amount-card.expense input {
  color: #ff6969;
}

.launch-amount-card span {
  color: #c8c8c8;
  font-size: 12px;
}

.installment-box {
  display: grid;
  gap: 0;
  border-radius: 9px;
  background: #171717;
}

.installment-toggle {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  cursor: pointer;
}

.installment-toggle span {
  display: grid;
  gap: 3px;
}

.installment-toggle small {
  color: #d7d7d7;
}

.installment-toggle input {
  width: 16px;
  height: 16px;
  min-height: 0;
  accent-color: #5ed174;
}

.installment-details {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 10px;
  padding: 0 12px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.installment-box.active .installment-details {
  display: grid;
}

.installment-summary {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.installment-summary div {
  display: grid;
  gap: 4px;
  place-items: center;
  min-height: 62px;
  padding: 10px;
  border-radius: 8px;
  background: #252525;
}

.installment-summary span {
  color: #c8c8c8;
  font-size: 12px;
  font-weight: 800;
}

.installment-summary strong {
  font-size: 20px;
}

.installment-summary div:last-child strong {
  color: #5ed174;
}

.empty {
  padding: 26px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 920px) {
  .login-screen {
    padding: 0;
  }

  .login-panel {
    height: 100dvh;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
  }

  .login-visual {
    min-height: 0;
  }

  .login-form-panel {
    padding: 24px 22px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 12px;
  }

  .nav {
    display: flex;
    overflow-x: auto;
  }

  .nav-group {
    display: flex;
    align-items: center;
    border-bottom: 0;
    padding: 0;
  }

  .nav-subitems {
    display: none;
  }

  .nav-item {
    white-space: nowrap;
  }

  .topbar,
  .grid-2 {
    display: grid;
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: start;
  }

  .toolbar {
    width: 100%;
    justify-content: flex-start;
  }

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

  table {
    min-width: 680px;
  }
}

@media (max-width: 620px) {
  body:not(.is-authenticated) {
    overflow: auto;
  }

  .login-screen {
    height: auto;
    min-height: 100vh;
    padding: 0;
    background: #fff;
  }

  .login-panel {
    width: 100%;
    height: auto;
    min-height: 100vh;
    grid-template-columns: 1fr;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .login-visual {
    height: 34vh;
    min-height: 220px;
  }

  .login-form-panel {
    align-items: start;
    padding: 28px 20px 36px;
  }

  .login-card {
    width: 100%;
  }

  .content {
    padding: 16px;
  }

  .toolbar,
  .toolbar select,
  .toolbar input,
  .toolbar button,
  .metrics,
  .form-grid {
    width: 100%;
  }

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

  .table-wrap {
    margin-inline: -2px;
  }

  table {
    min-width: 620px;
  }

  th,
  td {
    padding: 10px 11px;
  }
}
