:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-alt: #f0ede4;
  --border: #d9d4c4;
  --border-strong: #b8b09c;
  --text: #1f2328;
  --text-muted: #5b6169;
  --accent: #8a5a2b;
  --accent-strong: #6a3f15;
  --accent-soft: #e9dcc4;
  --danger: #a63b2f;
  --danger-soft: #f3d8d4;
  --success: #2f6f4a;
  --success-soft: #d5e8dc;
  --shadow-sm: 0 1px 2px rgba(31, 35, 40, 0.06);
  --shadow-md: 0 6px 20px rgba(31, 35, 40, 0.08);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }

.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: -9999px; top: 0; background: var(--accent-strong); color: #fff;
  padding: 8px 12px; border-radius: 0 0 var(--radius-sm) var(--radius-sm); z-index: 100;
}
.skip-link:focus { left: 16px; top: 0; }

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

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: var(--radius-md);
  background: var(--accent-soft); color: var(--accent-strong);
  display: inline-flex; align-items: center; justify-content: center;
}
.brand-title { font-weight: 700; font-size: 1.05rem; color: var(--text); }
.brand-sub { font-size: 0.8rem; color: var(--text-muted); }

.top-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.top-nav a {
  color: var(--text); font-size: 0.92rem; font-weight: 500;
  padding: 6px 2px; border-bottom: 2px solid transparent;
}
.top-nav a:hover { color: var(--accent-strong); border-bottom-color: var(--accent); text-decoration: none; }

.layout {
  display: grid; grid-template-columns: 280px 1fr; gap: 24px;
  padding-top: 28px; padding-bottom: 48px;
}

.sidebar { display: flex; flex-direction: column; gap: 18px; }
.sidebar-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px;
  box-shadow: var(--shadow-sm);
}
.sidebar-title { font-size: 0.95rem; margin: 0 0 10px; color: var(--text); }
.sidebar-text { margin: 0; font-size: 0.9rem; color: var(--text-muted); }
.sidebar-meta { margin-top: 12px; font-size: 0.78rem; color: var(--text-muted); display: flex; justify-content: space-between; }
.sidebar-list { margin: 0; padding-left: 18px; font-size: 0.9rem; color: var(--text-muted); }
.sidebar-list li { margin-bottom: 6px; }

.quick-actions { display: flex; flex-direction: column; gap: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 9px 14px; font-size: 0.9rem; font-weight: 500; cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  font-family: inherit;
}
.btn-primary { background: var(--accent-strong); color: #fff; }
.btn-primary:hover { background: #553210; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-alt); border-color: var(--accent); }
.btn-ghost { background: transparent; color: var(--accent-strong); border-color: transparent; }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--border-strong); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-sm { padding: 5px 10px; font-size: 0.8rem; }

.content { display: flex; flex-direction: column; gap: 24px; min-width: 0; }

.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  box-shadow: var(--shadow-sm);
}
.panel-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.panel-header h1, .panel-header h2 { margin: 0; font-size: 1.35rem; }
.panel-sub { margin: 4px 0 0; color: var(--text-muted); font-size: 0.92rem; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card {
  background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px;
}
.stat-label { font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.stat-value { font-size: 1.5rem; font-weight: 700; margin-top: 4px; color: var(--text); }
.stat-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.chart-card {
  background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px;
}
.chart-card.wide { grid-column: 1 / -1; }
.chart-title { font-size: 0.95rem; margin: 0 0 12px; }
.chart-empty { color: var(--text-muted); font-size: 0.88rem; padding: 12px 0; }

.bar-chart { display: flex; flex-direction: column; gap: 8px; min-height: 40px; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-label { width: 130px; min-width: 130px; font-size: 0.85rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; height: 14px; background: var(--bg); border-radius: 999px; overflow: hidden; position: relative; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 999px; min-width: 2px; transition: width 0.3s ease; }
.bar-count { font-size: 0.82rem; color: var(--text-muted); width: 30px; text-align: right; }

.form-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px; align-items: end;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.85rem; font-weight: 500; color: var(--text); }
.field input, .field select {
  padding: 9px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 0.92rem; font-family: inherit; background: var(--surface); color: var(--text);
}
.field input:focus, .field select:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent);
}
.form-actions { flex-direction: row; gap: 8px; align-items: center; }

.recent-table-wrap { margin-top: 20px; }
.recent-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.recent-header h3 { margin: 0; font-size: 1rem; }
.muted { color: var(--text-muted); font-size: 0.85rem; }
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th, .data-table td {
  padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.data-table th { background: var(--surface-alt); font-weight: 600; color: var(--text); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.03em; }
.data-table tbody tr:hover { background: var(--surface-alt); }
.col-actions { width: 60px; text-align: right; }

.empty-state {
  padding: 18px; background: var(--surface-alt); border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md); color: var(--text-muted); font-size: 0.9rem;
}
.empty-state p { margin: 0; }

.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form input { flex: 1; min-width: 180px; padding: 9px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: 0.92rem; font-family: inherit; }

.chip-list { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-soft); color: var(--accent-strong);
  padding: 6px 10px; border-radius: 999px; font-size: 0.85rem; font-weight: 500;
}
.chip button {
  background: transparent; border: none; color: var(--accent-strong); cursor: pointer;
  font-size: 1rem; line-height: 1; padding: 0 2px;
}
.chip button:hover { color: var(--danger); }

.date-range { display: flex; align-items: center; gap: 6px; font-size: 0.88rem; color: var(--text-muted); }
.date-range select { padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-family: inherit; background: var(--surface); }

.walkthrough { margin: 0 0 18px; padding-left: 22px; }
.walkthrough li { margin-bottom: 10px; color: var(--text); font-size: 0.93rem; }
.guide-list { margin: 0 0 18px; padding-left: 20px; color: var(--text-muted); font-size: 0.92rem; }
.guide-list li { margin-bottom: 6px; }
.faq-list { margin: 0; }
.faq-list dt { font-weight: 600; color: var(--text); margin-top: 12px; }
.faq-list dd { margin: 4px 0 0; color: var(--text-muted); font-size: 0.92rem; }

.site-footer {
  margin-top: 40px; border-top: 1px solid var(--border);
  background: var(--surface); padding: 22px 0;
}
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-title { font-weight: 600; color: var(--text); }
.footer-sub { font-size: 0.85rem; color: var(--text-muted); }
.footer-nav { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-nav a { color: var(--text-muted); font-size: 0.88rem; }
.footer-nav a:hover { color: var(--accent-strong); }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { order: 2; }
  .content { order: 1; }
  .bar-label { width: 100px; min-width: 100px; }
}
@media (max-width: 560px) {
  .header-inner { flex-direction: column; align-items: flex-start; }
  .top-nav { gap: 12px; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .form-actions { flex-direction: column; align-items: stretch; }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
