:root {
  --navy: #0c163e;
  --gold: #cc8503;
  --blue: #5394f7;
  --light-blue: #a7cbfb;
  --page: #f7faff;
  --white: #ffffff;
  --muted: #65708e;
  --border: #dce5f2;
  --danger: #a53434;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body {
  font-family: "Lexend", sans-serif;
  color: var(--navy);
  background: radial-gradient(circle at 80% 8%, rgba(167,203,251,.24), transparent 28%), var(--page);
}
button, input, select, textarea { font: inherit; }
.is-hidden { display: none !important; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 94px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px clamp(22px, 4vw, 58px);
  background: rgba(247,250,255,.94);
  border-bottom: 1px solid rgba(12,22,62,.08);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 16px; color: inherit; text-decoration: none; font-size: 14px; font-weight: 600; }
.brand img { width: 76px; height: 62px; object-fit: contain; }
.top-actions { display: flex; gap: 10px; }

main { width: min(1460px, calc(100% - 36px)); margin: 0 auto; padding: 48px 0 80px; }
.center-card {
  width: min(540px, 100%);
  margin: 10vh auto 0;
  padding: 48px;
  text-align: center;
  background: var(--white);
  border: 1px solid rgba(12,22,62,.09);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(12,22,62,.09);
}
.center-card h1 { margin: 0; font-size: 34px; }
.center-card p { color: var(--muted); line-height: 1.7; }
.gold-detail { width: 40px; height: 5px; margin: 0 auto 24px; background: var(--gold); border-radius: 999px; }
.spinner { width: 34px; height: 34px; margin: 0 auto 20px; border: 3px solid rgba(12,22,62,.14); border-top-color: var(--gold); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; margin-bottom: 28px; }
.page-heading h1 { margin: 8px 0 0; font-size: clamp(38px, 5vw, 64px); letter-spacing: -2px; line-height: 1.05; }
.page-heading p { max-width: 780px; margin: 18px 0 0; color: var(--muted); line-height: 1.75; }
.eyebrow { color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; }
.signed-in { color: var(--muted); font-size: 12px; text-align: right; }

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  transition: transform .08s linear, box-shadow .08s linear, border-color .08s linear;
}
.button:disabled { opacity: .58; cursor: wait; }
.button.primary { color: #fff; background: var(--navy); border: 1px solid var(--navy); }
.button.primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 9px 22px rgba(12,22,62,.2); }
.button.secondary { color: var(--navy); background: #fff; border: 1px solid #cbd5e3; }
.button.secondary:hover { border-color: var(--blue); }
.button.compact { min-height: 38px; padding: 8px 12px; font-size: 12px; }
.button.danger { color: var(--danger); background: #fff; border: 1px solid #e5bcbc; }

.status-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 26px; }
.status-card { padding: 18px 20px; background: #fff; border: 1px solid var(--border); border-radius: 15px; box-shadow: 0 8px 24px rgba(12,22,62,.045); }
.status-card strong { display: block; font-size: 25px; }
.status-card span { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.45; }

.tabs { display: flex; gap: 7px; margin-bottom: 18px; padding: 5px; background: rgba(12,22,62,.06); border-radius: 13px; width: fit-content; }
.tab { min-height: 42px; padding: 9px 16px; color: var(--muted); background: transparent; border: 0; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 12px; }
.tab.is-active { color: var(--navy); background: #fff; box-shadow: 0 5px 14px rgba(12,22,62,.1); }

.two-column { display: grid; grid-template-columns: minmax(310px,.72fr) minmax(520px,1.45fr); gap: 20px; align-items: start; }
.list-card, .editor-card, .maintenance-card {
  background: #fff;
  border: 1px solid rgba(12,22,62,.09);
  border-radius: 19px;
  box-shadow: 0 18px 55px rgba(12,22,62,.06);
}
.list-card { position: sticky; top: 112px; overflow: hidden; }
.list-toolbar { display: flex; justify-content: space-between; gap: 18px; align-items: center; padding: 22px; border-bottom: 1px solid var(--border); }
h2 { margin: 0; font-size: 22px; }
.list-toolbar p { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.search-input { width: calc(100% - 30px); min-height: 44px; margin: 15px; padding: 10px 13px; color: var(--navy); border: 1px solid #cbd5e3; border-radius: 10px; outline: none; }
.search-input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(83,148,247,.15); }
.record-list { max-height: calc(100vh - 310px); min-height: 360px; overflow-y: auto; padding: 0 10px 14px; }
.record-button { width: 100%; display: block; padding: 12px; text-align: left; color: #3f4864; background: transparent; border: 0; border-bottom: 1px solid rgba(12,22,62,.065); border-radius: 8px; cursor: pointer; }
.record-button:hover, .record-button.is-selected { background: rgba(83,148,247,.09); }
.record-button strong { display: block; font-size: 13px; line-height: 1.4; }
.record-button span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.record-button.inactive strong { color: #8d6b6b; text-decoration: line-through; }

.editor-card { padding: clamp(24px, 4vw, 42px); }
.editor-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 28px; padding-bottom: 22px; border-bottom: 1px solid var(--border); }
.editor-heading h2 { margin-top: 6px; font-size: 30px; }
.toggle-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 600; }
.toggle-label input { width: 18px; height: 18px; accent-color: var(--blue); }
label { display: block; margin-top: 18px; }
label > span, fieldset legend { display: block; margin-bottom: 8px; color: #4f5873; font-size: 11px; font-weight: 700; }
input, select, textarea { width: 100%; padding: 12px 13px; color: var(--navy); background: #fff; border: 1px solid #cbd5e3; border-radius: 10px; outline: none; }
textarea { resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(83,148,247,.15); }
.form-grid.two { display: grid; grid-template-columns: 1fr 180px; gap: 14px; }
fieldset { margin: 28px 0 0; padding: 20px; border: 1px solid var(--border); border-radius: 14px; }
.field-help { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.rating-grid { display: grid; gap: 10px; margin-top: 16px; }
.rating-row { display: grid; grid-template-columns: 42px 1fr; gap: 10px; align-items: center; }
.rating-number { width: 38px; height: 38px; display: grid; place-items: center; color: #fff; background: var(--navy); border-radius: 50%; font-weight: 700; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 26px; }
.form-actions .danger { margin-right: auto; }
.message { margin-top: 16px; padding: 12px 14px; color: #255739; background: #effaf3; border: 1px solid #bce1c8; border-radius: 10px; font-size: 12px; line-height: 1.5; }
.message.error { color: #7a271a; background: #fff4f1; border-color: #f2c9c0; }

.maintenance-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; }
.maintenance-card { padding: 30px; }
.maintenance-card h2 { margin-top: 8px; font-size: 26px; }
.maintenance-card p { color: var(--muted); line-height: 1.7; font-size: 13px; }
.maintenance-card .button { margin-top: 10px; }
.maintenance-card.wide { grid-column: 1 / -1; }
pre { max-height: 480px; overflow: auto; padding: 18px; color: #dce5f2; background: var(--navy); border-radius: 12px; white-space: pre-wrap; line-height: 1.55; font-size: 11px; }

@media (max-width: 1000px) {
  .status-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .two-column { grid-template-columns: 1fr; }
  .list-card { position: static; }
  .record-list { max-height: 420px; }
}
@media (max-width: 680px) {
  .topbar, .page-heading { align-items: flex-start; flex-direction: column; }
  .top-actions { width: 100%; flex-wrap: wrap; }
  .status-grid, .maintenance-grid { grid-template-columns: 1fr; }
  .maintenance-card.wide { grid-column: auto; }
  .tabs { width: 100%; overflow-x: auto; }
  .tab { white-space: nowrap; }
  .form-grid.two { grid-template-columns: 1fr; }
  .editor-card { padding: 22px 18px; }
  main { width: min(100% - 22px, 1460px); }
}
