:root {
  color-scheme: light;
  --ink: #18242c;
  --muted: #64717a;
  --surface: #ffffff;
  --surface-strong: #f4f7f6;
  --line: #d9e2df;
  --brand: #103641;
  --brand-2: #1f6a5e;
  --accent: #f2bd2f;
  --danger: #b84646;
  --success: #21845f;
  --shadow: 0 16px 45px rgba(19, 44, 49, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(16, 54, 65, 0.07), rgba(255, 255, 255, 0) 320px),
    var(--surface-strong);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid rgba(16, 54, 65, 0.08);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--brand);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 8px;
  background: var(--brand);
  color: var(--accent);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.1;
}

.brand small {
  color: var(--muted);
  margin-top: 0.2rem;
}

.top-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.main-surface {
  width: min(1180px, calc(100% - 2rem));
  margin: 2rem auto 4rem;
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 1.5rem;
  align-items: stretch;
  margin-bottom: 1.5rem;
}

.hero-copy {
  padding: clamp(1.5rem, 4vw, 3rem);
  background: var(--brand);
  color: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-copy h1,
.section-title,
.panel h2,
.panel h3 {
  margin: 0;
  letter-spacing: 0;
}

.hero-copy h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.02;
  max-width: 760px;
}

.hero-copy p {
  max-width: 680px;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.65;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.narrow-panel {
  max-width: 520px;
  margin: 0 auto;
}

.login-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.25rem;
  background: var(--surface-strong);
  border-radius: 8px;
}

.tab-button {
  border: 0;
  border-radius: 6px;
  padding: 0.75rem 0.9rem;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.tab-button.active {
  background: var(--surface);
  color: var(--brand);
  box-shadow: 0 4px 16px rgba(16, 54, 65, 0.08);
}

.form-grid {
  display: grid;
  gap: 0.85rem;
}

.form-grid h2 {
  margin: 0;
}

.form-grid label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.form-grid input,
.form-grid select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.75rem 0.8rem;
  background: #fff;
  color: var(--ink);
}

.form-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1.25rem 0;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.primary-button,
.secondary-button,
.danger-button,
.text-button,
.ghost-link {
  min-height: 2.6rem;
  border-radius: 6px;
  padding: 0.7rem 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  white-space: nowrap;
}

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

.secondary-button {
  background: #fff;
  color: var(--brand);
  border-color: var(--line);
}

.danger-button {
  background: #fff;
  color: var(--danger);
  border-color: rgba(184, 70, 70, 0.35);
}

.text-button,
.ghost-link {
  background: transparent;
  color: var(--brand);
  border-color: transparent;
}

.primary-button:hover,
.secondary-button:hover,
.danger-button:hover,
.text-button:hover,
.ghost-link:hover {
  transform: translateY(-1px);
}

.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled,
.text-button:disabled,
.ghost-link:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

.status-line {
  margin-top: 0.85rem;
  min-height: 1.3rem;
  color: var(--muted);
}

.status-line.error {
  color: var(--danger);
}

.dashboard-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.dashboard-head h1,
.loading-state h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
}

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

.grid {
  display: grid;
  gap: 1rem;
}

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

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

.license-card,
.metric-card,
.plan-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
}

.license-card header,
.plan-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brand);
  background: rgba(242, 189, 47, 0.2);
}

.badge.suspended,
.badge.failed {
  color: var(--danger);
  background: rgba(184, 70, 70, 0.12);
}

.badge.active,
.badge.processed {
  color: var(--success);
  background: rgba(33, 132, 95, 0.12);
}

.license-key {
  display: block;
  width: 100%;
  overflow-wrap: anywhere;
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 0.8rem;
  background: var(--surface-strong);
  margin: 0.85rem 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.data-table th,
.data-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 0.92rem;
}

.data-table th {
  color: var(--muted);
  font-weight: 700;
  background: var(--surface-strong);
}

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

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

.stack {
  display: grid;
  gap: 1rem;
}

.hidden {
  display: none !important;
}

@media (max-width: 820px) {
  .hero-band,
  .grid.two,
  .grid.three {
    grid-template-columns: 1fr;
  }

  .dashboard-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}
