/* ─────────────────────────────────────────────
   Sierra Ledger — Base Styles & Design Tokens
   ───────────────────────────────────────────── */

:root {
  --kernel-navy: #073B6F;
  --kernel-navy-deep: #042A50;
  --kernel-navy-soft: #14558D;
  --kernel-orange: #FF9814;
  --kernel-orange-action: #D86E00;
  --kernel-orange-deep: #B85800;
  --kernel-orange-wash: #FFF2DF;
  --kernel-cream: #F7FAFD;
  --navy: var(--kernel-navy);
  --navy-l: var(--kernel-navy-soft);
  --accent: var(--kernel-orange-action);
  --accent-strong: var(--kernel-orange-deep);
  --accent-soft: var(--kernel-orange-wash);
  /* Legacy aliases: older screens used "green" for their primary brand
     colour. Keep those screens on-brand without maintaining a second theme. */
  --green: var(--kernel-navy);
  --green-l: var(--kernel-navy-deep);
  --green-wash: #EAF2F8;
  /* Green itself is now reserved for genuine success states. */
  --success: #16815F;
  --success-wash: #E8F6F0;
  --border: #DCE5EE;
  --text: #142A3F;
  --muted: #60758A;
  --red: #E53E3E;
  --amber: var(--kernel-orange-action);
  --blue: var(--kernel-navy-soft);
  --white: #FFFFFF;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 2px 7px rgba(7,59,111,0.06);
  --shadow-md: 0 12px 30px rgba(7,59,111,0.10);
  --shadow-lg: 0 28px 70px rgba(4,42,80,0.22);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--kernel-cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

button { font-family: inherit; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
}

/* ── Shared buttons (used across landing + auth) ── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 6px 16px rgba(216,110,0,.18);
}
.btn-primary:hover { background: var(--accent-strong); transform: translateY(-1px); box-shadow: 0 9px 22px rgba(184,88,0,.22); }
.btn:focus-visible,
button:focus-visible,
a:focus-visible { outline: 3px solid rgba(255,152,20,.32); outline-offset: 2px; }

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 1.5px solid rgba(255,255,255,0.3);
}
.btn-outline:hover { border-color: rgba(255,255,255,0.6); background: rgba(255,255,255,0.05); }

.btn-lg { padding: 15px 32px; font-size: 16px; }
.btn-full { width: 100%; }

/* ── Alerts (shared by auth pages) ── */

.alert {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
}
.alert-error, .alert-danger { background: #FFF5F5; color: #9B2C2C; border: 1px solid #FEB2B2; }
.alert-success { background: var(--success-wash); color: var(--success); border: 1px solid #B7E4D2; }
.alert-info { background: #EBF8FF; color: #2B6CB0; border: 1px solid #BEE3F8; }
.alert-warning { background: #FFFAF0; color: #975A16; border: 1px solid #FBD38D; }

/* ── Scrollbar polish (optional, non-critical) ── */

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E0; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #A0AEC0; }

/* Shared list controls */
.sortable-column {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: inherit;
  white-space: nowrap;
}
.sortable-column:hover,
.sortable-column.active { color: var(--accent); }
.sortable-column i { font-size: 10px; }

.list-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-top: 1px solid var(--border);
  background: #fff;
}
.list-pagination__summary { color: var(--muted); font-size: 12.5px; }
.list-pagination__pages { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.list-page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font-size: 12.5px;
}
.list-page-btn:hover { background: #f3f4f6; }
.list-page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.list-page-ellipsis { color: var(--muted); padding: 0 3px; }

.bulk-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: #f8fafc;
}
.bulk-toolbar select {
  min-width: 180px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  font: inherit;
  font-size: 13px;
}
.bulk-selected-count { margin-left: auto; color: var(--muted); font-size: 12.5px; }
.row-check { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

@media (max-width: 640px) {
  .list-pagination { align-items: flex-start; flex-direction: column; }
  .bulk-toolbar { align-items: stretch; flex-direction: column; }
  .bulk-selected-count { margin-left: 0; }
}
