:root {
  color-scheme: light;
  --ink: #1d252f;
  --muted: #687382;
  --line: #dce2ea;
  --panel: #ffffff;
  --page: #f4f7fa;
  --nav: #18212c;
  --nav-soft: #263444;
  --accent: #23716f;
  --accent-strong: #155c5a;
  --gold: #ad7a18;
  --red: #ad3b35;
  --blue: #3867a8;
  --green: #28704e;
  --shadow: 0 12px 30px rgba(24, 33, 44, 0.08);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
}

.login-page {
  background: var(--nav);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 272px 1fr;
}

.sidebar {
  background: var(--nav);
  color: #eef5f7;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 3px;
  color: #b7c4cf;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 8px;
  background: #21303e;
}

.brand-mark span {
  background: #5fd0bb;
}

.brand-mark span:nth-child(2) {
  background: #f2bd5b;
}

.brand-mark span:nth-child(3) {
  background: #77a7e0;
}

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

.nav-item {
  width: 100%;
  border: 0;
  color: #d9e4eb;
  background: transparent;
  text-align: left;
  padding: 12px 14px;
  border-radius: 6px;
}

.nav-item:hover,
.nav-item.active {
  background: var(--nav-soft);
  color: #ffffff;
}

.sidebar-panel {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.panel-kicker,
.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
}

.sidebar-panel .panel-kicker {
  color: #91e2d5;
}

.sidebar-panel p {
  margin: 8px 0 0;
  color: #c9d5df;
  line-height: 1.45;
}

.main {
  min-width: 0;
  padding: 28px;
}

.topbar,
.section-heading,
.panel-heading,
.dialog-heading,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 26px;
}

.eyebrow {
  margin: 0 0 6px;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
}

h2 {
  margin-bottom: 5px;
  font-size: 1.35rem;
}

h3 {
  margin-bottom: 0;
  font-size: 1rem;
}

.section-heading p {
  color: var(--muted);
  margin-bottom: 0;
}

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

.topbar-actions form {
  margin: 0;
}

.search {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.search input,
label input,
label select {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
}

.search input {
  min-width: 260px;
  padding: 10px 12px;
}

.primary-action,
.secondary-action,
.quiet-action,
.icon-action,
.danger-action {
  border-radius: 6px;
  min-height: 40px;
  border: 1px solid transparent;
  padding: 0 14px;
  font-weight: 800;
}

.primary-action {
  background: var(--accent);
  color: #ffffff;
}

.primary-action:hover {
  background: var(--accent-strong);
}

.secondary-action,
.quiet-action {
  background: #ffffff;
  border-color: var(--line);
  color: var(--ink);
}

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

.icon-action {
  width: 40px;
  padding: 0;
  background: #ffffff;
  border-color: var(--line);
}

.danger-action {
  min-height: 34px;
  padding: 0 10px;
  color: var(--red);
  background: #ffffff;
  border-color: #efc4c1;
}

.compact-action {
  min-height: 34px;
  padding: 0 10px;
}

.danger-action:hover {
  color: #ffffff;
  background: var(--red);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hidden {
  display: none !important;
}

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

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

.metric-card {
  padding: 18px;
}

.metric-card span {
  color: var(--muted);
  font-weight: 800;
  font-size: 0.78rem;
}

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

.metric-card small {
  color: var(--muted);
}

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

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

.panel-heading {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.panel-heading span {
  color: var(--muted);
  font-size: 0.85rem;
}

.product-list,
.attention-list,
.activity-stream {
  display: grid;
  gap: 10px;
}

.product-list,
.attention-list {
  margin-top: 14px;
}

.product-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.product-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #ffffff;
  font-weight: 900;
  background: var(--blue);
}

.product-card:nth-child(2n) .product-icon {
  background: var(--accent);
}

.product-card:nth-child(3n) .product-icon {
  background: var(--gold);
}

.product-card strong,
.product-card small {
  display: block;
}

.product-card small {
  margin-top: 3px;
  color: var(--muted);
}

.status-pill {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: capitalize;
  white-space: nowrap;
}

.status-active,
.status-ready {
  color: var(--green);
  background: #e8f5ee;
}

.status-trial,
.status-planned {
  color: var(--blue);
  background: #eaf1fb;
}

.status-expiring,
.status-licensing-needed {
  color: var(--gold);
  background: #fff4dd;
}

.status-suspended {
  color: var(--red);
  background: #fae9e8;
}

.attention-item {
  border-bottom: 1px solid var(--line);
  padding-bottom: 11px;
}

.attention-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.attention-item strong,
.attention-item span {
  display: block;
}

.attention-item span {
  margin-top: 4px;
  color: var(--muted);
}

.table-wrap {
  margin-top: 18px;
  overflow-x: auto;
}

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

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

th {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

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

.license-key {
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.82rem;
}

.segmented {
  display: inline-flex;
  background: #e9eef4;
  border-radius: 7px;
  padding: 4px;
}

.segment {
  border: 0;
  background: transparent;
  border-radius: 5px;
  padding: 8px 11px;
  font-weight: 800;
  color: var(--muted);
}

.segment.active {
  color: var(--ink);
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(24, 33, 44, 0.12);
}

.activity-stream {
  margin-top: 18px;
}

.settings-panel {
  margin-top: 18px;
  max-width: 760px;
}

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

.nested-heading {
  margin-top: 20px;
}

.settings-copy {
  color: var(--muted);
  line-height: 1.45;
  margin: 16px 0 0;
}

.settings-ok {
  color: var(--green) !important;
  font-weight: 900;
}

.settings-needed {
  color: var(--gold) !important;
  font-weight: 900;
}

.generated-secret {
  display: grid;
  gap: 7px;
  margin: 2px 0 18px;
  padding: 12px;
  border: 1px solid #c4d8ee;
  border-radius: 7px;
  background: #f0f6fc;
}

.generated-secret span {
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.generated-secret code {
  overflow-wrap: anywhere;
  font-family: "Cascadia Mono", Consolas, monospace;
  color: var(--ink);
}

.activity-item {
  padding: 16px;
  display: grid;
  gap: 4px;
}

.activity-item span {
  color: var(--muted);
}

dialog {
  border: 0;
  border-radius: 8px;
  width: min(720px, calc(100vw - 28px));
  padding: 0;
  box-shadow: 0 30px 80px rgba(24, 33, 44, 0.28);
}

dialog::backdrop {
  background: rgba(24, 33, 44, 0.42);
}

dialog form {
  padding: 22px;
}

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

label {
  display: grid;
  gap: 7px;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 800;
}

label input,
label select {
  min-height: 42px;
  padding: 9px 10px;
  color: var(--ink);
  font-weight: 500;
}

.checkbox-label {
  min-height: 42px;
  align-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.checkbox-label input {
  width: 18px;
  height: 18px;
  min-height: 0;
  padding: 0;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 22px;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.24);
}

.login-brand {
  color: var(--ink);
}

.login-brand small {
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form .primary-action {
  width: 100%;
}

.login-error {
  padding: 11px 12px;
  color: var(--red);
  background: #fae9e8;
  border: 1px solid #efc4c1;
  border-radius: 6px;
  font-weight: 800;
}

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

  .sidebar {
    min-height: auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }

  .nav-list {
    display: flex;
    flex-wrap: wrap;
  }

  .sidebar-panel {
    display: none;
  }

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

@media (max-width: 720px) {
  .main {
    padding: 18px;
  }

  .topbar,
  .topbar-actions,
  .section-heading,
  .split-layout,
  .metric-grid,
  .form-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .search input {
    min-width: 0;
    width: 100%;
  }

  .product-card {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .product-card .status-pill {
    grid-column: 1 / -1;
    width: fit-content;
  }
}
