:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #10131b;
  color: #eef1f7;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 12% 0%, rgba(53, 103, 190, .13), transparent 38%),
    #10131b;
}

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

.topbar {
  height: 76px;
  padding: 0 max(24px, calc((100% - 1420px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #262c39;
  background: rgba(16, 19, 27, .92);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: 14px; }
.brand small { margin-top: 3px; color: #858fa2; font-size: 12px; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 15px;
  color: white;
  font-size: 17px;
  font-weight: 850;
  letter-spacing: -1px;
  background: linear-gradient(145deg, #3478e5, #20458d);
  box-shadow: 0 8px 28px rgba(35, 95, 194, .25);
}

.brand-mark.small { width: 40px; height: 40px; border-radius: 11px; font-size: 13px; }

.container { max-width: 1420px; margin: 0 auto; padding: 42px 24px 30px; }

.page-heading, .section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.page-heading { margin-bottom: 28px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(27px, 4vw, 35px); letter-spacing: -1.2px; }
h2 { margin-bottom: 0; font-size: 19px; letter-spacing: -.3px; }
h3 { font-size: 16px; }
.muted, .hint { color: #8e98aa; }
.muted { margin-bottom: 0; font-size: 14px; }
.eyebrow { margin-bottom: 8px; color: #659af0; font-size: 10px; font-weight: 800; letter-spacing: 1.5px; }

.panel, .stat-card {
  border: 1px solid #293142;
  border-radius: 15px;
  background: linear-gradient(145deg, #191f2b, #171c26);
  box-shadow: 0 12px 35px rgba(0, 0, 0, .12);
}

.panel { padding: 25px; margin-bottom: 22px; }
.section-heading { margin-bottom: 23px; }

.online-indicator {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #a8b5c9;
  font-size: 12px;
  white-space: nowrap;
}

.online-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #36c98b;
  box-shadow: 0 0 12px rgba(54, 201, 139, .55);
}

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 22px; }
.stat-card { padding: 21px; }
.stat-card span { display: block; color: #8e98aa; font-size: 12px; }
.stat-card strong { display: block; margin-top: 10px; font-size: 29px; letter-spacing: -.8px; }

.create-form { display: grid; grid-template-columns: 1.4fr 1fr 1fr .8fr auto; align-items: end; gap: 13px; }
label { display: grid; gap: 8px; color: #aeb8c9; font-size: 12px; font-weight: 650; }

input, select {
  width: 100%;
  min-width: 0;
  height: 43px;
  padding: 0 12px;
  border: 1px solid #343e50;
  border-radius: 8px;
  outline: none;
  color: #eef1f7;
  background: #111620;
}

input:focus, select:focus { border-color: #4c8be9; box-shadow: 0 0 0 3px rgba(76, 139, 233, .12); }
button { border: 0; border-radius: 8px; padding: 11px 16px; font-weight: 700; font-size: 12px; }
.primary { color: white; background: #3478df; }
.primary:hover { background: #4388ef; }
.secondary { color: #d7deea; border: 1px solid #343e50; background: #202735; }
.small-button { padding: 9px 13px; }
.create-button { height: 43px; white-space: nowrap; }
.hint { margin: 15px 0 0; font-size: 11px; }

.count-label { color: #8994a8; font-size: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; text-align: left; }
th { padding: 12px 13px; color: #8995a9; border-bottom: 1px solid #30394a; font-size: 10px; text-transform: uppercase; letter-spacing: .8px; }
td { padding: 16px 13px; border-bottom: 1px solid #272f3d; color: #b8c1d0; font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
td strong { color: #eef1f7; }

.status { display: inline-block; padding: 5px 9px; border-radius: 20px; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.status.active { color: #65d9a6; background: rgba(47, 183, 125, .12); }
.status.revoked { color: #ff8585; background: rgba(224, 74, 74, .12); }
.status.expired { color: #e6bd75; background: rgba(210, 157, 67, .12); }

.actions { display: flex; align-items: center; gap: 13px; }
.actions form { margin: 0; }
.text-button { padding: 0; color: #9eabc0; background: transparent; font-size: 11px; }
.text-button:hover { color: white; }
.danger-text { color: #f17f86; }
.success-text { color: #65d9a6; }

.alert { margin-bottom: 20px; padding: 13px 15px; border: 1px solid #315b92; border-radius: 9px; color: #b9d5ff; background: rgba(48, 105, 183, .12); font-size: 13px; }
.alert.error { border-color: #81444b; color: #ffaaaa; background: rgba(150, 48, 58, .12); }

.new-key-panel { border-color: #356baf; background: linear-gradient(130deg, #1b2a40, #191f2b); }
.new-key-panel h2 { margin-bottom: 7px; }
.key-copy { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.key-copy code { flex: 1; min-width: 220px; padding: 13px; border: 1px solid #344b69; border-radius: 8px; color: #c8dcff; background: #111a28; font-size: 13px; overflow-wrap: anywhere; }

.empty-state { padding: 35px 15px; text-align: center; color: #929db0; }
.empty-state h3 { margin-bottom: 8px; color: #e8edf6; }
.empty-state p { margin-bottom: 0; font-size: 13px; }

.site-footer { display: flex; justify-content: space-between; gap: 15px; padding: 20px 2px; color: #6f7b90; font-size: 11px; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-panel { width: min(100%, 420px); padding: 35px; }
.login-panel .brand-mark { margin-bottom: 24px; }
.login-panel h1 { font-size: 27px; }
.stack { display: grid; gap: 18px; margin-top: 28px; }
.stack button { height: 45px; }
.footer-note { margin: 25px 0 0; color: #6f7b90; font-size: 11px; text-align: center; }

@media (max-width: 1000px) {
  .create-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .create-button { grid-column: 1 / -1; }
}
@media (max-width: 650px) {
  .container { padding: 28px 14px; }
  .topbar { padding: 0 14px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 16px; }
  .stat-card strong { font-size: 24px; }
  .panel { padding: 18px; }
  .create-form { grid-template-columns: 1fr; }
  .create-button { grid-column: auto; }
  .site-footer { flex-direction: column; }
}
