:root {
  --ink-900: #14213d;
  --ink-700: #3b4a6b;
  --ink-500: #73809f;
  --surface-100: #f6f3eb;
  --surface-200: #fffdf7;
  --surface-300: #efe6d7;
  --surface-400: #dcc8a8;
  --accent: #d96c3f;
  --accent-dark: #ad4c24;
  --success-soft: #d9efe1;
  --danger-soft: #f7d0d0;
  --draft-soft: #e8e1ff;
  --shadow: 0 18px 36px rgba(20, 33, 61, 0.08);
  --radius: 22px;
}

html { font-size: 15px; }
body {
  margin: 0;
  color: var(--ink-900);
  background: radial-gradient(circle at top left, rgba(217,108,63,0.15), transparent 22rem), linear-gradient(180deg, #fffdfa 0%, #f4efe4 100%);
  min-height: 100vh;
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
}
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-select:focus, .form-check-input:focus { box-shadow: 0 0 0 0.2rem rgba(217,108,63,0.18); }
.app-shell { min-height: 100vh; }
.shell-grid { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
.app-sidebar { padding: 2rem 1.25rem; background: rgba(20,33,61,0.96); color: #fff; display: flex; flex-direction: column; gap: 2rem; }
.brand-mark { display: flex; align-items: center; gap: .85rem; color: #fff; text-decoration: none; }
.brand-mark strong { display: block; font-size: 1.1rem; }
.brand-mark small { color: rgba(255,255,255,.7); }
.brand-dot { width: 1rem; height: 1rem; border-radius: 999px; background: linear-gradient(135deg, #f4c95d, var(--accent)); box-shadow: 0 0 0 .35rem rgba(244,201,93,.14); }
.app-nav { gap: .35rem; }
.app-nav .nav-link { color: rgba(255,255,255,.78); border-radius: 14px; padding: .85rem 1rem; transition: all .2s ease; }
.app-nav .nav-link:hover, .app-nav .nav-link.active { color: #fff; background: rgba(255,255,255,.12); }
.main-column { display: flex; flex-direction: column; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 1.4rem 2rem 0; }
.topbar-actions { display: flex; align-items: center; gap: .75rem; }
.topbar-title { font-size: 1.05rem; font-weight: 600; }
.app-main { padding: 1.5rem 2rem 2rem; }
.app-footer { display: flex; justify-content: space-between; gap: 1rem; padding: 0 2rem 1.5rem; color: var(--ink-500); font-size: .92rem; }
.mobile-nav { display: none; }
.eyebrow { display: inline-block; text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; font-weight: 700; color: var(--accent-dark); }
.hero-panel, .content-card, .stat-card, .auth-card { background: rgba(255,253,247,.86); border: 1px solid rgba(220,200,168,.6); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.hero-panel { border-radius: calc(var(--radius) + 6px); padding: 2rem; display: flex; justify-content: space-between; gap: 2rem; align-items: end; }
.hero-panel h1, .section-heading h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 700; margin-top: .4rem; margin-bottom: .6rem; }
.hero-panel p, .section-heading p { max-width: 60rem; color: var(--ink-700); margin-bottom: 0; }
.hero-actions, .page-actions, .action-stack { display: flex; gap: .75rem; flex-wrap: wrap; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1rem; margin-top: 1.25rem; }
.stat-card { border-radius: var(--radius); padding: 1.4rem; }
.stat-card strong { display: block; font-size: 2rem; margin: .35rem 0; }
.stat-label { color: var(--ink-500); text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; font-weight: 700; }
.content-card { border-radius: var(--radius); padding: 1.5rem; margin-top: 1.25rem; }
.section-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: end; margin-bottom: 1rem; }
.section-heading.compact h2 { margin-bottom: 0; }
.stack-lg { display: flex; flex-direction: column; gap: 1.25rem; }
.empty-state { text-align: center; padding: 2.5rem 1rem; }
.badge-soft { display: inline-flex; align-items: center; justify-content: center; padding: .35rem .65rem; border-radius: 999px; font-weight: 600; font-size: .85rem; }
.badge-active, .badge-succeeded { background: var(--success-soft); color: #22543d; }
.badge-draft, .badge-pending { background: var(--draft-soft); color: #4938a3; }
.badge-disabled, .badge-failed { background: var(--danger-soft); color: #9c2f2f; }
.detail-grid { display: grid; grid-template-columns: 180px 1fr; gap: .75rem 1rem; margin: 0; }
.detail-grid dt { color: var(--ink-500); }
.detail-grid dd { margin: 0; font-weight: 500; }
.grid-two { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; }
.table > :not(caption) > * > * { background: transparent; }
.auth-shell { display: grid; place-items: center; padding: 2rem; }
.auth-stage { width: min(100%, 30rem); }
.auth-card { border-radius: 30px; padding: 2.4rem; }
.auth-brand { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 700; color: var(--accent-dark); }
.auth-card h1 { margin-top: .65rem; margin-bottom: .65rem; font-size: 2.2rem; }
.auth-copy, .auth-hint { color: var(--ink-700); }
.auth-form { margin-top: 1.5rem; }
.mfa-qr { max-width: 17rem; width: 100%; }
.mfa-qr svg { display: block; width: 100%; height: auto; }
.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover, .btn-primary:focus { background: var(--accent-dark); border-color: var(--accent-dark); }
.form-control, .form-select { border-radius: 14px; min-height: 3rem; border-color: rgba(20,33,61,.12); }
@media (max-width: 1100px) { .stats-grid, .grid-two { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) {
  .shell-grid { grid-template-columns: 1fr; }
  .app-sidebar, .app-footer, .topbar { display: none; }
  .mobile-nav { display: block; }
  .app-main { padding: 1rem; }
  .hero-panel, .section-heading { flex-direction: column; align-items: start; }
  .stats-grid, .grid-two, .detail-grid { grid-template-columns: 1fr; }
}
