/*
 * PalmPay console.
 *
 * "Ocean Breeze": white ground, a deep twilight navy, one bright teal blue for everything you
 * can press, turquoise and two icy tints for accents — the same five colours as the terminal and
 * the wallet app. Hairline borders, system fonts. Nothing is loaded from a CDN — these pages are
 * served by the platform itself and have to work on a campus network with no route to the
 * internet, which is exactly where the terminals live.
 *
 *   #03045E  Deep Twilight     #0077B6  Bright Teal Blue     #00B4D8  Turquoise Surf
 *   #90E0EF  Frosted Blue      #CAF0F8  Light Cyan
 */

:root {
  --brand: #0077b6;
  --brand-hover: #00659b;
  --brand-deep: #03045e;
  --brand-bright: #00b4d8;
  --brand-frost: #90e0ef;
  --brand-cyan: #caf0f8;
  --brand-wash: #eaf7fc;
  --brand-line: #a9e3f1;
  --brand-grad: linear-gradient(135deg, #03045e 0%, #023e8a 55%, #0077b6 100%);

  --ink: #07123a;
  --ink-2: #26365a;
  --muted: #4f5f7d;
  --faint: #8592ac;
  --line: #dbe7f0;
  --line-soft: #edf3f8;
  --surface: #f4f9fc;
  --white: #ffffff;

  --danger: #c62e39;
  --danger-soft: #fdecee;
  --warn: #9a5b00;
  --warn-soft: #fff4de;
  --info: #023e8a;
  --info-soft: #e6f1fb;

  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(3, 4, 94, 0.05), 0 12px 32px -18px rgba(3, 4, 94, 0.35);

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.011em; }
h1 { font-size: 26px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0 0 12px; }

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); font-size: 0.92em; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.hidden { display: none !important; }

/* ---------------------------------------------------------------- shell */

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 60px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 40;
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -0.02em; font-size: 17px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--brand-grad); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 4px 12px -4px rgba(0, 119, 182, 0.55);
}
.brand .mark svg { width: 17px; height: 17px; }

.topbar .spacer { flex: 1; }
.topbar nav { display: flex; gap: 4px; }
.topbar nav a {
  padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; font-size: 14px;
}
.topbar nav a:hover { background: var(--surface); color: var(--ink); text-decoration: none; }
.topbar nav a.on { background: var(--brand-wash); color: var(--brand-deep); }

.who { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.who strong { color: var(--ink); font-weight: 600; display: block; font-size: 13.5px; }

.page { max-width: 1180px; margin: 0 auto; padding: 26px 22px 64px; }
.page.narrow { max-width: 760px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .spacer { flex: 1; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

/* ---------------------------------------------------------------- cards */

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
}
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-head .spacer { flex: 1; }
.card-head h2, .card-head h3 { margin: 0; }
.card-sub { color: var(--muted); font-size: 13px; margin: -8px 0 14px; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stat { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; background: var(--white); }
.stat .label { font-size: 12.5px; color: var(--muted); font-weight: 500; letter-spacing: 0.01em; }
.stat .value { font-size: 27px; font-weight: 600; letter-spacing: -0.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .foot { font-size: 12.5px; color: var(--faint); margin-top: 4px; }
.stat.accent { background: var(--brand-grad); border-color: transparent; }
.stat.accent .value { color: #fff; }
.stat.accent .label { color: var(--brand-frost); }
.stat.accent .foot { color: rgba(202, 240, 248, 0.8); }
.stat.ok { background: var(--brand-wash); border-color: var(--brand-line); }
.stat.ok .value, .stat.ok .label { color: var(--brand-deep); }
.stat.warn { background: var(--warn-soft); border-color: #f2dfb4; }
.stat.warn .value, .stat.warn .label { color: var(--warn); }

/* ---------------------------------------------------------------- form */

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 550; color: var(--ink-2); margin-bottom: 5px; }
.field .hint { font-size: 12.5px; color: var(--faint); margin-top: 5px; }
.field .err { font-size: 12.5px; color: var(--danger); margin-top: 5px; display: none; }
.field.bad .err { display: block; }
.field.bad input, .field.bad select, .field.bad textarea { border-color: var(--danger); }

input[type=text], input[type=email], input[type=tel], input[type=password],
input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%;
  padding: 9px 11px;
  font: inherit;
  font-size: 14.5px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.14);
}
input::placeholder { color: var(--faint); }
input:disabled, select:disabled { background: var(--surface); color: var(--muted); }
textarea { min-height: 72px; resize: vertical; }
select { appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 8l3-3.5' fill='none' stroke='%234f5f7d' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; background-size: 12px 12px; padding-right: 32px; }

.row { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.checkline { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); }
.checkline input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--brand); }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px;
  font: inherit; font-size: 14px; font-weight: 550;
  border-radius: var(--radius);
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  white-space: nowrap;
}
.btn:hover { background: var(--brand-hover); border-color: var(--brand-hover); text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }

.btn.ghost { background: var(--white); color: var(--ink-2); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.danger { background: var(--white); color: var(--danger); border-color: #e8bdb8; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.sm { padding: 6px 11px; font-size: 13px; }
.btn.lg { padding: 12px 20px; font-size: 15px; }
.btn.block { width: 100%; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- table */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  text-align: left; font-weight: 550; font-size: 12.5px; color: var(--muted);
  padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--line);
  white-space: nowrap; letter-spacing: 0.01em;
}
tbody td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap + .table-foot { display: flex; align-items: center; gap: 12px; padding: 12px 2px; font-size: 13px; color: var(--muted); }
.table-foot .spacer { flex: 1; }

/* ---------------------------------------------------------------- pills & notes */

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 550; letter-spacing: 0.01em;
  background: var(--surface); color: var(--muted); border: 1px solid var(--line);
}
.pill.ok { background: var(--brand-wash); color: var(--brand-deep); border-color: var(--brand-line); }
.pill.bad { background: var(--danger-soft); color: var(--danger); border-color: #edc7c2; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: #ecd9ad; }
.pill.info { background: var(--info-soft); color: var(--info); border-color: #c7dcf3; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.note {
  border: 1px solid var(--line); border-left: 3px solid var(--muted);
  background: var(--surface); border-radius: 8px;
  padding: 12px 14px; font-size: 13.5px; color: var(--ink-2); margin-bottom: 16px;
}
.note.ok { border-left-color: var(--brand); background: var(--brand-wash); border-color: var(--brand-line); color: var(--brand-deep); }
.note.bad { border-left-color: var(--danger); background: var(--danger-soft); border-color: #edc7c2; color: #7d1c14; }
.note.warn { border-left-color: var(--warn); background: var(--warn-soft); border-color: #ecd9ad; color: #6b4600; }
.note.info { border-left-color: var(--info); background: var(--info-soft); border-color: #c7dcf3; color: var(--info); }
.note strong { font-weight: 600; }

.empty { padding: 40px 20px; text-align: center; color: var(--faint); font-size: 14px; }
.empty strong { display: block; color: var(--muted); font-weight: 550; margin-bottom: 4px; font-size: 15px; }

/* ---------------------------------------------------------------- chart */

.chart { display: flex; align-items: flex-end; gap: 3px; height: 132px; padding-top: 8px; }
.chart .bar { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.chart .fill { background: linear-gradient(180deg, var(--brand-bright), var(--brand)); border-radius: 3px 3px 0 0; min-height: 2px; transition: height 0.2s; }
.chart .bar:hover .fill { background: var(--brand-deep); }
.chart-axis { display: flex; gap: 3px; margin-top: 6px; }
.chart-axis span { flex: 1; min-width: 0; text-align: center; font-size: 10.5px; color: var(--faint); overflow: hidden; white-space: nowrap; }

/* ---------------------------------------------------------------- tabs */

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs button {
  padding: 10px 14px; font: inherit; font-size: 14px; font-weight: 550;
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--muted); cursor: pointer; white-space: nowrap;
}
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--brand-deep); border-bottom-color: var(--brand); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filters .field { margin: 0; min-width: 140px; }
.filters .spacer { flex: 1; }

/* ---------------------------------------------------------------- modal */

.modal-bg {
  position: fixed; inset: 0; background: rgba(3, 4, 94, 0.38);
  display: grid; place-items: center; padding: 20px; z-index: 100;
}
.modal {
  background: var(--white); border-radius: var(--radius-lg);
  width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow); padding: 20px;
}
.modal.wide { max-width: 720px; }
.modal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.modal-head .spacer { flex: 1; }
.icon-btn {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--white); color: var(--muted); cursor: pointer; display: grid; place-items: center;
}
.icon-btn:hover { background: var(--surface); color: var(--ink); }
.icon-btn svg { width: 15px; height: 15px; }

/* ---------------------------------------------------------------- key/value */

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 9px 16px; font-size: 14px; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; color: var(--ink); }

.section-title {
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  letter-spacing: 0.04em; text-transform: uppercase;
  margin: 26px 0 12px; padding-bottom: 7px; border-bottom: 1px solid var(--line-soft);
}
.section-title:first-child { margin-top: 0; }

.copybox {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--brand-line); background: var(--brand-wash);
  border-radius: var(--radius); padding: 12px 14px;
}
.copybox code { font-family: var(--mono); font-size: 20px; font-weight: 600; color: var(--brand-deep); letter-spacing: 0.12em; flex: 1; }

/* ---------------------------------------------------------------- auth pages */

.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side {
  background:
    radial-gradient(circle at 85% 12%, rgba(0, 180, 216, 0.35), transparent 42%),
    radial-gradient(circle at 10% 95%, rgba(144, 224, 239, 0.18), transparent 38%),
    var(--brand-grad);
  color: #fff; padding: 48px 44px; display: flex; flex-direction: column;
}
.auth-side .brand { color: #fff; }
.auth-side .brand .mark { background: rgba(255, 255, 255, 0.16); }
.auth-side h1 { font-size: 32px; margin-top: auto; max-width: 15ch; line-height: 1.2; }
.auth-side p { color: rgba(202, 240, 248, 0.85); max-width: 42ch; margin-top: 14px; font-size: 15px; }
.auth-points { margin-top: 28px; display: grid; gap: 12px; }
.auth-points div { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: rgba(255, 255, 255, 0.88); }
.auth-points svg { width: 17px; height: 17px; flex: none; margin-top: 2px; color: var(--brand-frost); }
.auth-main { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-size: 22px; margin-bottom: 6px; }
.auth-card > p { color: var(--muted); font-size: 14px; margin-bottom: 22px; }

@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  .row, .row.three { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
}

@media (max-width: 600px) {
  .grid.cols-4 { grid-template-columns: 1fr; }
  .topbar { padding: 0 14px; gap: 10px; }
  .topbar nav a { padding: 7px 9px; }
  .page { padding: 18px 14px 48px; }
  .who span { display: none; }
}
