
:root {
  color-scheme: light;
  --ink: #14232b;
  --muted: #66747b;
  --paper: #f3f1eb;
  --surface: #fffef9;
  --line: #d7d8d2;
  --navy: #102b3a;
  --navy-2: #183d4d;
  --signal: #e86632;
  --signal-dark: #b9431c;
  --ok: #287a58;
  --warn: #9b681d;
  --danger: #a93e3e;
  --shadow: 0 16px 40px rgba(16, 43, 58, .10);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--paper); }

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(16, 43, 58, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 43, 58, .025) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  font-family: "Aptos", "Trebuchet MS", sans-serif;
  font-size: 15px;
}

a { color: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.shell { min-height: 100vh; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 32px;
  color: #fff;
  background:
    radial-gradient(circle at 12% -40%, rgba(232, 102, 50, .35), transparent 34%),
    var(--navy);
  border-bottom: 3px solid var(--signal);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  font-family: "Aptos Display", "Trebuchet MS", sans-serif;
  font-weight: 800;
  letter-spacing: .02em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  color: var(--navy);
  background: var(--signal);
  border-radius: 9px 2px 9px 2px;
  transform: rotate(-4deg);
}

.brand small {
  display: block;
  margin-top: 2px;
  color: #a8c0c9;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.operator {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #d7e3e7;
  font-size: 13px;
}

.operator form { margin: 0; }

.link-button {
  padding: 8px 12px;
  color: #fff;
  background: transparent;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 6px;
}

.main {
  width: min(1420px, calc(100% - 48px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.breadcrumb {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
}

.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { color: var(--signal-dark); }

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

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

h1 {
  margin-bottom: 6px;
  font-family: "Aptos Display", "Trebuchet MS", sans-serif;
  font-size: clamp(28px, 4vw, 43px);
  line-height: 1;
  letter-spacing: -.035em;
}

h2 {
  margin-bottom: 18px;
  font-size: 16px;
  letter-spacing: .01em;
}

.lede { margin-bottom: 0; color: var(--muted); }

.count {
  min-width: 100px;
  color: var(--muted);
  text-align: right;
}

.count strong {
  display: block;
  color: var(--navy);
  font-size: 28px;
}

.panel {
  background: rgba(255, 254, 249, .95);
  border: 1px solid var(--line);
  border-radius: 12px 3px 12px 3px;
  box-shadow: var(--shadow);
}

.filters {
  display: grid;
  grid-template-columns: minmax(210px, 1.8fr) repeat(3, minmax(160px, 1fr)) auto;
  gap: 12px;
  margin-bottom: 18px;
  padding: 18px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .035em;
}

input, select {
  width: 100%;
  min-height: 42px;
  padding: 8px 11px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #bcc5c7;
  border-radius: 6px;
  outline: none;
}

input:focus, select:focus {
  border-color: var(--signal);
  box-shadow: 0 0 0 3px rgba(232, 102, 50, .14);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 17px;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  background: var(--navy);
  border: 0;
  border-radius: 7px 2px 7px 2px;
  box-shadow: 0 5px 14px rgba(16, 43, 58, .16);
}

.button:hover { background: var(--navy-2); transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button.signal { background: var(--signal); }
.button.signal:hover { background: var(--signal-dark); }
.button.danger { background: var(--danger); }
.button.ghost {
  color: var(--navy);
  background: transparent;
  border: 1px solid #aeb9bd;
  box-shadow: none;
}
.filter-button { align-self: end; }

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

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  padding: 13px 16px;
  color: var(--muted);
  background: #e9e9e3;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: .07em;
  text-align: left;
  text-transform: uppercase;
}

td {
  padding: 16px;
  border-bottom: 1px solid #e4e4de;
  vertical-align: top;
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fff9f3; }

.account-link {
  display: inline-block;
  margin-bottom: 3px;
  color: var(--navy);
  font-weight: 800;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.secondary { color: var(--muted); font-size: 13px; }
.mono { font-family: "Cascadia Mono", "Courier New", monospace; font-size: 12px; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  background: #e9eceb;
  border-radius: 999px;
}

.status::before {
  width: 7px;
  height: 7px;
  background: currentColor;
  border-radius: 50%;
  content: "";
}

.status--active { color: var(--ok); background: #e2f1e9; }
.status--expired { color: var(--warn); background: #f8edd7; }
.status--disabled, .status--uninstalled { color: var(--danger); background: #f7e4e4; }
.status--blocked, .status--uninstalled { color: var(--danger); background: #f6e2df; }

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

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  gap: 18px;
}

.detail-column { display: grid; align-content: start; gap: 18px; }
.section { padding: 22px; }

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

.fact { min-width: 0; }
.fact dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .065em;
  text-transform: uppercase;
}
.fact dd { margin: 0; overflow-wrap: anywhere; }

.license-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--line);
}

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

.action-grid form, .action-grid button { width: 100%; }

.notice {
  margin-bottom: 18px;
  padding: 13px 16px;
  color: #245d45;
  background: #e1f1e8;
  border-left: 4px solid var(--ok);
  border-radius: 4px;
}

.timeline { display: grid; gap: 0; }

.event {
  position: relative;
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 18px;
  padding: 0 0 22px 22px;
  border-left: 1px solid #cbd1d1;
}

.event:last-child { padding-bottom: 0; }
.event::before {
  position: absolute;
  top: 3px;
  left: -5px;
  width: 9px;
  height: 9px;
  background: var(--signal);
  border: 2px solid var(--surface);
  border-radius: 50%;
  content: "";
}
.event time { color: var(--muted); font-size: 12px; }
.event strong { display: block; margin-bottom: 4px; }

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 20% 10%, rgba(232, 102, 50, .24), transparent 30%),
    linear-gradient(135deg, #0e2938 0%, #143948 62%, #0d2531 100%);
}

.login-card {
  width: min(440px, 100%);
  padding: 38px;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 16px 4px 16px 4px;
  box-shadow: 0 30px 80px rgba(0,0,0,.32);
}

.login-card .brand { margin-bottom: 34px; color: var(--navy); }
.login-card .brand small { color: var(--muted); }
.login-card h1 { font-size: 34px; }
.login-card form { display: grid; gap: 16px; margin-top: 28px; }
.login-error {
  padding: 11px 13px;
  color: #7d2828;
  background: #fae5e2;
  border-radius: 5px;
}

.footer-note {
  margin-top: 24px;
  color: #91a7b0;
  font-size: 11px;
  text-align: center;
}

@media (max-width: 980px) {
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters label:first-child { grid-column: 1 / -1; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .topbar { padding: 0 18px; }
  .operator span { display: none; }
  .main { width: min(100% - 24px, 1420px); padding-top: 22px; }
  .filters, .fact-grid, .action-grid { grid-template-columns: 1fr; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .count { text-align: left; }
  .event { grid-template-columns: 1fr; gap: 5px; }
  .login-card { padding: 28px 24px; }
}

@media (prefers-reduced-motion: no-preference) {
  .panel { animation: arrive .28s ease-out both; }
  .button { transition: background .15s ease, transform .15s ease; }
  @keyframes arrive {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }
}
