:root {
  --steel: #1f4f7a;
  --steel-dark: #14344f;
  --bg: #f4f6f8;
  --card: #ffffff;
  --muted: #6b7280;
  --line: #e4eaf1;
  --content-gutter: clamp(34px, 4.2vw, 72px);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: #17202a; font-family: 'Segoe UI', Tahoma, sans-serif; overflow: hidden; }
.app-shell { height: 100vh; display: grid; grid-template-columns: 300px minmax(0, 1fr); overflow: hidden; }
.sidebar { position: sticky; top: 0; align-self: start; height: 100vh; overflow: visible; background: linear-gradient(180deg, var(--steel-dark), #0d2438); color: white; padding: 24px 22px; box-shadow: 18px 0 42px rgba(13, 36, 56, .16); display: flex; flex-direction: column; z-index: 30; }
.sidebar::after { content: ""; position: absolute; top: 0; right: -18px; width: 18px; height: 100%; background: linear-gradient(90deg, rgba(13, 36, 56, .14), transparent); pointer-events: none; }
.brand-mark { width: 56px; height: 56px; border-radius: 18px; background: #fff; color: var(--steel); display: grid; place-items: center; font-weight: 900; letter-spacing: .5px; box-shadow: 0 14px 30px rgba(0,0,0,.18); }
.brand-title { margin-top: 16px; font-size: 1.18rem; font-weight: 900; }
.brand-subtitle { color: rgba(255,255,255,.68); font-size: .9rem; }
.side-nav { display: grid; gap: 6px; margin-top: 28px; }
.side-nav a { color: rgba(255,255,255,.86); text-decoration: none; padding: 10px 14px; border-radius: 12px; transition: .15s; font-weight: 600; font-size: .95rem; }
.side-nav a:hover { background: rgba(255,255,255,.13); color: #fff; transform: translateX(2px); }
.sidebar-user { margin-top: auto; padding: 12px; border-radius: 16px; background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.10); display: flex; align-items: center; gap: 12px; }
.sidebar-avatar { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.95); color: var(--steel-dark); display: grid; place-items: center; font-weight: 900; font-size: 1.05rem; }
.sidebar-user-meta { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sidebar-name { color: #fff; font-weight: 800; font-size: .92rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-role { color: rgba(255,255,255,.55); font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-actions { flex: 0 0 auto; }
.sidebar-gear { background: transparent; border: none; color: rgba(255,255,255,.65); padding: 6px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; transition: .15s; line-height: 1; }
.sidebar-gear:hover { color: #fff; background: rgba(255,255,255,.14); }
.sidebar-gear:focus { outline: none; box-shadow: 0 0 0 3px rgba(255,255,255,.18); }
.sidebar .dropdown-menu { background: #0d2438; border-color: rgba(255,255,255,.14); min-width: 160px; }
.sidebar .dropdown-item { color: rgba(255,255,255,.86); font-size: .9rem; }
.sidebar .dropdown-item:hover { background: rgba(255,255,255,.12); color: #fff; }
.sidebar .dropdown-divider { border-color: rgba(255,255,255,.14); }
.content-area { min-width: 0; height: 100vh; overflow-y: auto; overflow-x: hidden; padding-left: var(--content-gutter); padding-right: var(--content-gutter); scroll-behavior: smooth; }
.content-area::-webkit-scrollbar { width: 10px; }
.content-area::-webkit-scrollbar-thumb { background: #c9d6e2; border-radius: 999px; border: 3px solid var(--bg); }
.content-area::-webkit-scrollbar-track { background: transparent; }
.topbar { position: sticky; top: 0; z-index: 20; height: 78px; background: rgba(255,255,255,.84); border: 1px solid var(--line); border-radius: 0 0 22px 22px; display: flex; align-items: center; justify-content: flex-end; gap: 16px; padding: 0 28px; backdrop-filter: blur(12px); }
.container-fluid { max-width: 1480px; padding-left: 0; padding-right: 0; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin: 8px 0 26px; }
.page-heading h1 { margin: 0; font-weight: 900; letter-spacing: -.02em; color: #162433; }
.page-heading p { margin: 6px 0 0; color: var(--muted); }
.card, .data-card, .filter-card, .kpi-card { border: 1px solid rgba(226, 232, 240, .82); border-radius: 22px; box-shadow: 0 16px 44px rgba(15, 23, 42, .07); }
.filter-card { background: #fff; padding: 18px; }
.data-card { overflow: hidden; }
.card-body { padding: 22px; }
.kpi-card { background: #fff; padding: 22px; min-height: 118px; position: relative; overflow: hidden; }
.kpi-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: linear-gradient(180deg, var(--steel), #79b9e7); opacity: .72; }
.kpi-card.primary { background: linear-gradient(135deg, var(--steel), #2d7db8); color: white; }
.kpi-card span { display: block; color: var(--muted); font-size: .9rem; }
.kpi-card.primary span { color: rgba(255,255,255,.8); }
.kpi-card b { font-size: 2.1rem; letter-spacing: -.03em; }
.table { margin-bottom: 0; }
.table td, .table th { vertical-align: middle; padding: .9rem 1rem; }
.table thead th { color: #587086; font-size: .78rem; text-transform: uppercase; letter-spacing: .045em; background: #f8fafc; }
.table-hover tbody tr { cursor: pointer; }
.table-hover tbody tr:hover { background: #f3f8fd; }
.readonly-list dt { color: var(--muted); }
.timeline-item { border-left: 3px solid var(--steel); padding-left: 12px; margin-bottom: 14px; }
.timeline-item small { color: var(--muted); }
.btn { border-radius: 12px; font-weight: 650; }
.form-control, .form-select { border-radius: 12px; border-color: #d8e2ec; }
.toast-stack { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1080; min-width: 320px; }
.login-screen { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at top left, #dbeafe, transparent 35%), linear-gradient(135deg, #f8fafc, #e8eef5); padding: 24px; }
.login-card { width: min(480px, 100%); background: white; border-radius: 28px; padding: 36px; }
.login-card h1 { font-weight: 900; margin: 0; }
.demo-users { background: #f1f5f9; border-radius: 14px; padding: 12px; color: #475569; font-size: .9rem; }
.hint-card { background: #eef6ff; }
.print-only { display: none; }
.mobile-menu-btn, .sidebar-backdrop { display: none; }
@media (max-width: 900px) {
  body { overflow: auto; }
  .mobile-menu-btn { display: grid; place-items: center; position: fixed; top: 16px; left: 16px; z-index: 80; width: 46px; height: 46px; border: 0; border-radius: 14px; background: var(--steel); color: #fff; font-size: 1.35rem; box-shadow: 0 10px 26px rgba(15, 23, 42, .22); }
  .sidebar-backdrop { display: none; position: fixed; inset: 0; z-index: 60; background: rgba(15, 23, 42, .42); backdrop-filter: blur(2px); }
  body.sidebar-open .sidebar-backdrop { display: block; }
  .app-shell { height: auto; min-height: 100vh; grid-template-columns: 1fr; overflow: visible; }
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: min(320px, 86vw); height: 100vh; transform: translateX(-105%); transition: transform .22s ease; z-index: 70; overflow-y: auto; }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar::after { display: none; }
  .content-area { height: auto; min-height: 100vh; overflow: visible; padding-left: 18px; padding-right: 18px; }
  .topbar { min-height: 72px; height: 72px; padding-left: 70px; border-radius: 0 0 18px 18px; }
  .page-heading { flex-direction: column; gap: 14px; margin-top: 2px; }
  .page-heading > div:last-child { width: 100%; display: flex; flex-wrap: wrap; gap: 8px; }
  .table { min-width: 680px; }
  .card-body { padding: 18px; }
}
@media print {
  body { background: #fff !important; overflow: visible !important; }
  .sidebar, .topbar, .mobile-menu-btn, .sidebar-backdrop, .no-print, .btn, .toast-container { display: none !important; }
  .app-shell { display: block !important; height: auto !important; overflow: visible !important; }
  .content-area { height: auto !important; overflow: visible !important; padding: 0 !important; }
  .container-fluid { max-width: none !important; padding: 0 !important; }
  .card, .data-card, .filter-card, .kpi-card { box-shadow: none !important; border: 1px solid #ccc !important; border-radius: 0 !important; }
  .page-heading { margin: 0 0 16px !important; }
  a { color: #000 !important; text-decoration: none !important; }
}

