:root {
  color-scheme: light;
  --bg: #f7f0e8;
  --bg-2: #efe2d3;
  --card: #fff8f0;
  --ink: #1d2a1f;
  --muted: #5c6b60;
  --accent: #ff6b4a;
  --accent-2: #1f7a6b;
  --accent-3: #d97706;
  --line: rgba(34, 44, 37, 0.12);
  --shadow: 0 14px 40px rgba(27, 35, 28, 0.12);
  --radius: 20px;
  --radius-sm: 12px;
  --font-display: 'Fraunces', serif;
  --font-body: 'Manrope', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: radial-gradient(circle at top left, #fff6ec 0%, var(--bg) 45%, #eef7f3 100%);
  position: relative;
}

body::before,
body::after {
  content: '';
  position: fixed;
  width: 320px;
  height: 320px;
  border-radius: 40% 60% 55% 45%;
  opacity: 0.25;
  z-index: 0;
}

body::before {
  background: linear-gradient(135deg, #ff9d7d 0%, #ffe0c2 100%);
  top: -80px;
  right: -60px;
}

body::after {
  background: linear-gradient(135deg, #a7e0d0 0%, #d1f3e8 100%);
  bottom: -120px;
  left: -80px;
}

.page {
  position: relative;
  z-index: 1;
  padding: 32px 48px 64px;
}

.login-page {
  min-height: 100vh;
}

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

.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent-2);
  margin-bottom: 10px;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 44px);
  font-weight: 700;
  margin-bottom: 8px;
}

.subhead {
  color: var(--muted);
  max-width: 520px;
}

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

.status {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(31, 122, 107, 0.15);
  color: var(--accent-2);
  font-weight: 600;
}

.status.offline {
  background: rgba(255, 107, 74, 0.15);
  color: var(--accent);
}

.layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 28px;
}

.login-layout {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 180px);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.stack.wide {
  min-width: 0;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 20px 22px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  animation: rise 0.5s ease;
}

.login-card {
  width: min(420px, 92vw);
}

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

h2 {
  font-family: var(--font-display);
  font-size: 20px;
}

.badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: #efe6d3;
  color: var(--muted);
  font-weight: 600;
}

.badge.accent {
  background: rgba(255, 107, 74, 0.18);
  color: var(--accent);
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

label {
  font-size: 12px;
  color: var(--muted);
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 14px;
  background: #fffdf9;
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(255, 107, 74, 0.2);
  border-color: var(--accent);
}

.actions {
  display: flex;
  gap: 10px;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(255, 107, 74, 0.3);
}

.btn.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(255, 107, 74, 0.4);
  box-shadow: none;
}

.btn.wide {
  width: 100%;
}

.helper {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

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

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

.plan-card {
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line);
  background: #fffaf3;
}

.plan-card h3 {
  font-family: var(--font-display);
  font-size: 16px;
  margin-bottom: 6px;
}

.plan-price {
  font-weight: 600;
  color: var(--accent-3);
  margin-bottom: 8px;
}

.plan-features {
  font-size: 13px;
  color: var(--muted);
  display: grid;
  gap: 4px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  justify-content: space-between;
}

.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid var(--line);
  background: #fffdf9;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
}

.chip.active {
  background: rgba(31, 122, 107, 0.16);
  color: var(--accent-2);
  border-color: rgba(31, 122, 107, 0.3);
}

.split {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 18px;
}

.license-list {
  display: grid;
  gap: 12px;
  max-height: 620px;
  overflow: auto;
  padding-right: 6px;
}

.license-card {
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  padding: 12px;
  background: #fffdf9;
  display: grid;
  gap: 6px;
  cursor: pointer;
  transition: border 0.2s ease, transform 0.2s ease;
}

.license-card:hover {
  border-color: rgba(31, 122, 107, 0.4);
  transform: translateY(-2px);
}

.license-card.active {
  border-color: var(--accent);
  box-shadow: 0 10px 20px rgba(255, 107, 74, 0.18);
}

.license-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

.status-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.status-pill.active {
  background: rgba(31, 122, 107, 0.18);
  color: var(--accent-2);
}

.status-pill.revoked,
.status-pill.paused {
  background: rgba(255, 107, 74, 0.15);
  color: var(--accent);
}

.detail-card {
  min-height: 620px;
}

.detail-section {
  display: grid;
  gap: 12px;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.detail-head h3 {
  font-family: var(--font-display);
  font-size: 22px;
}

.kv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  font-size: 13px;
}

.kv div {
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inline-actions .btn {
  padding: 8px 14px;
  font-size: 13px;
}

.mini {
  font-size: 12px;
  color: var(--muted);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 8px 6px;
}

.table th {
  color: var(--muted);
  font-weight: 600;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 18px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 10;
}

.toast.hidden {
  display: none;
}

.empty {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  padding: 40px 12px;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
  }

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

  .license-list,
  .detail-card {
    max-height: none;
  }
}

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

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

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

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
