/* ==========================================================================
   Page Training — Ottawa Public Library
   Minimalist White Theme Design System
   ========================================================================== */

:root {
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-hover: #f8fafc;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --accent: #0f766e;
  --accent-hover: #115e59;
  --accent-soft: #f0fdfa;
  --accent-border: #99f6e4;

  --success: #15803d;
  --success-bg: #f0fdf4;
  --success-border: #bbf7d0;

  --warning: #b45309;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;

  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;

  --info: #1d4ed8;
  --info-bg: #eff6ff;
  --info-border: #bfdbfe;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --header-h: 64px;
  --sidebar-w: 280px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Accessibility Helpers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 1000;
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  left: 8px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  height: 100%;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  color: var(--text-primary);
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  display: grid;
  place-items: center;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-text strong {
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Primary Nav */
.primary-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.primary-nav::-webkit-scrollbar {
  display: none;
}

.nav-pill {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 7px 13px;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-pill:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.nav-pill.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-border);
  font-weight: 600;
}

/* Search */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 11px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 220px;
  height: 36px;
  padding: 0 12px 0 34px;
  font: inherit;
  font-size: 0.85rem;
  color: var(--text-primary);
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  transition: border-color 0.15s ease, width 0.2s ease, background-color 0.15s ease;
}

.search-box input:focus {
  background: var(--bg-surface);
  border-color: var(--accent);
  width: 270px;
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

/* Layout Shell */
.app-shell {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  align-items: start;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
}

.sidebar-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.badge-soft {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}

.progress-track {
  height: 6px;
  margin: 0 8px 4px;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-full);
  transition: width 0.25s ease;
}

.module-nav {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.nav-group-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 4px 8px;
}

.nav-group-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.module-nav-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.84rem;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.module-nav-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.module-nav-btn.is-current {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.module-nav-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.module-code {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.module-nav-btn.is-current .module-code {
  color: var(--accent);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  flex-shrink: 0;
}

.status-dot.is-done {
  background: var(--success);
  border-color: var(--success);
}

.sidebar-footer {
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

/* Main Content */
.main-content {
  padding: 28px 36px 56px;
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
}

.main-content:focus {
  outline: none;
}

/* Typography & Section Headers */
.page-hero {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow-xs);
  margin-bottom: 24px;
}

.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 6px;
}

h1 {
  margin: 0 0 8px;
  font-size: 1.85rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h2 {
  margin: 0 0 12px;
  font-size: 1.28rem;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

h3 {
  margin: 0 0 8px;
  font-size: 1.02rem;
  line-height: 1.35;
  color: var(--text-primary);
}

.lead {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.98rem;
  max-width: 68ch;
}

/* Cards & Grids */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-xs);
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-value {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 4px;
  line-height: 1.2;
}

.stat-note {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-xs);
  margin-bottom: 18px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.module-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.module-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.module-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

.tag-done {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.tag-accent {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}

.tag-warn {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning-border);
}

.module-card p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
}

.btn-success {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success-border);
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
}

.btn-danger:hover {
  background: #991b1b;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
}

.icon-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.2rem;
}

.icon-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.text-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
}

.text-btn:hover {
  color: var(--danger);
  background: var(--danger-bg);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

/* Study Content Styling */
.study-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.rule-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-xs);
}

.rule-section h2 {
  font-size: 1.12rem;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.rule-list {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.94rem;
}

.rule-list strong {
  color: var(--text-primary);
}

.callout {
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-top: 14px;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
}

.callout-title {
  font-weight: 700;
  margin-bottom: 4px;
  display: block;
}

.callout.is-warn {
  background: var(--warning-bg);
  border-color: var(--warning-border);
  color: #78350f;
}

.callout.is-tip {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: #134e4a;
}

.callout.is-danger {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: #7f1d1d;
}

.callout.is-info {
  background: var(--info-bg);
  border-color: var(--info-border);
  color: #1e3a8a;
}

/* Spine Labels & Code Chips */
.mono {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.spine-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.spine-label {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  box-shadow: var(--shadow-xs);
}

.spine-label .spine-caption {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 6px;
  border-top: 1px dashed var(--border);
  padding-top: 4px;
  width: 100%;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  background: var(--bg-surface);
}

th,
td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  background: var(--bg-page);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

tr:last-child td {
  border-bottom: none;
}

/* Sub-tabs (Practice Labs & Quiz filters) */
.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.tab-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.tab-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.tab-btn.is-active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  font-weight: 600;
}

/* Shelf Ordering Lab */
.shelf-list {
  list-style: none;
  margin: 14px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shelf-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  cursor: grab;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.shelf-item:active {
  cursor: grabbing;
}

.shelf-item.is-dragging {
  opacity: 0.5;
  border-style: dashed;
}

.shelf-item.is-correct {
  background: var(--success-bg);
  border-color: var(--success-border);
}

.shelf-item.is-wrong {
  background: var(--danger-bg);
  border-color: var(--danger-border);
}

.shelf-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.shelf-pos {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.shelf-spine {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.94rem;
  color: var(--text-primary);
}

.shelf-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.shelf-controls {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* Choice Options (Labs & Quiz) */
.option-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0;
}

.option-btn {
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font: inherit;
  font-size: 0.92rem;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}

.option-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.option-btn:disabled {
  cursor: default;
}

.option-btn.is-correct {
  background: var(--success-bg);
  border-color: var(--success);
  color: #14532d;
  font-weight: 600;
}

.option-btn.is-wrong {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: #7f1d1d;
}

.feedback-box {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  border: 1px solid var(--border);
}

.feedback-box.is-correct {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: #14532d;
}

.feedback-box.is-wrong {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: #7f1d1d;
}

/* Flashcard */
.flashcard {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  margin: 16px 0;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
}

.flashcard-code {
  font-family: var(--font-mono);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.03em;
}

.flashcard-answer {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.flashcard-detail {
  margin-top: 6px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

/* Checklist Items */
.checklist {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.check-item label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.check-item label:hover {
  background: var(--bg-page);
}

.check-item input[type="checkbox"] {
  margin-top: 4px;
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.check-item.is-checked span {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Timer Widget */
.timer-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 18px;
}

.timer-display {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Search Results Overlay */
.search-overlay {
  background: var(--bg-surface);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}

.search-result-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 10px 8px;
  cursor: pointer;
  display: block;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: var(--bg-page);
}

/* Native Dialog */
.modal-dialog {
  border: none;
  padding: 0;
  border-radius: var(--radius-lg);
  background: transparent;
  max-width: 440px;
  width: calc(100% - 32px);
  box-shadow: var(--shadow-md);
}

.modal-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.dialog-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.dialog-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.dialog-body {
  margin: 0 0 18px;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Footer */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  margin-top: auto;
}

.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-inner p {
  margin: 0;
}

/* Details disclosure */
details {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  background: var(--bg-surface);
  margin-bottom: 10px;
}

summary {
  font-weight: 600;
  cursor: pointer;
  color: var(--text-primary);
}

details[open] summary {
  margin-bottom: 10px;
}

/* Mobile Responsive */
.mobile-only {
  display: none;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 40;
}

@media (max-width: 960px) {
  .mobile-only {
    display: grid;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: var(--header-h);
    width: 280px;
    z-index: 45;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-md);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .main-content {
    padding: 20px 16px 48px;
  }

  .search-box input {
    width: 150px;
  }

  .search-box input:focus {
    width: 190px;
  }
}

@media (max-width: 680px) {
  .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 14px;
  }

  .site-header {
    height: auto;
  }

  .primary-nav {
    order: 3;
    width: 100%;
    padding-top: 4px;
  }

  .page-hero {
    padding: 20px;
  }

  h1 {
    font-size: 1.45rem;
  }
}
