:root {
    --ink: #17324f;
    --muted: #60738a;
    --paper: #f3f7fb;
    --card: #ffffff;
    --line: #dce6ef;
    --green: #073d8f;
    --green-dark: #06285d;
    --sand: #f15a24;
    --danger: #b63824;
    --shadow: 0 10px 30px rgba(6, 40, 93, .08);
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 15px/1.5 "Segoe UI", Arial, sans-serif; }
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); }
.topbar { position: fixed; z-index: 10; top: 0; left: 0; right: 0; height: 72px; display: flex; align-items: center; gap: 30px; padding: 0 30px; color: var(--ink); background: white; border-bottom: 1px solid var(--line); box-shadow: 0 3px 14px rgba(6,40,93,.08); }
.brand { display: flex; align-items: center; gap: 12px; min-width: 220px; color: var(--green-dark); font-size: 15px; font-weight: 800; }
.brand:hover { color: var(--green); }
.brand img { display: block; width: 154px; height: 58px; object-fit: contain; }
.brand-product { padding-left: 12px; border-left: 1px solid var(--line); letter-spacing: .12em; }
.global-search { flex: 1; max-width: 600px; }
.global-search input { width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: var(--paper); }
.global-search input::placeholder { color: var(--muted); }
.user-menu { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.user-menu form { margin: 0; }
.link-button { padding: 0; border: 0; color: var(--green); background: none; cursor: pointer; }
.sidebar { position: fixed; top: 72px; left: 0; bottom: 0; width: 220px; padding: 30px 18px; background: #eaf1f8; border-right: 1px solid var(--line); }
.sidebar a { display: block; margin-bottom: 5px; padding: 11px 14px; border-radius: 6px; color: #173f70; font-weight: 600; }
.sidebar a:hover { background: #d9e6f2; }
.content { max-width: 1500px; margin: 72px 0 0 220px; padding: 38px 42px 70px; }
.login-content { min-height: 100vh; display: grid; place-items: center; padding: 90px 20px 30px; background: linear-gradient(135deg, #e8f0f8, #fff4ef); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
h1, h2 { margin: 0; letter-spacing: -.02em; }
h1 { font-size: 32px; font-weight: 650; }
h2 { font-size: 18px; }
.eyebrow { margin: 0 0 3px; color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.muted, small { color: var(--muted); }
.button { display: inline-flex; justify-content: center; align-items: center; padding: 10px 16px; border: 1px solid #b9c6c0; border-radius: 6px; color: var(--ink); background: white; font-weight: 650; cursor: pointer; }
.button.primary { color: white; background: var(--green); border-color: var(--green); }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 24px; }
.metric { display: flex; flex-direction: column; min-height: 118px; padding: 22px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--card); box-shadow: var(--shadow); }
.metric span { color: var(--muted); }
.metric strong { margin-top: auto; color: var(--green); font-size: 34px; }
.dashboard-grid, .detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.panel { overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--card); box-shadow: var(--shadow); }
.panel-head { display: flex; justify-content: space-between; align-items: center; min-height: 58px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.panel-head a { font-weight: 600; }
.full-width { grid-column: 1 / -1; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 14px 20px; color: var(--ink); border-bottom: 1px solid #edf0ee; }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: #f8faf9; }
.list-row.static:hover { background: transparent; }
.list-row div { min-width: 0; }
.list-row strong, .list-row small { display: block; }
.align-right { text-align: right; }
.danger { color: var(--danger); font-weight: 650; }
.empty { padding: 20px; color: var(--muted); }
.filter-bar { display: grid; grid-template-columns: minmax(280px, 1fr) 220px auto; gap: 10px; margin-bottom: 18px; }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid #bfcac5; border-radius: 5px; color: var(--ink); background: white; font: inherit; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(29,98,80,.14); border-color: var(--green); }
textarea { min-height: 110px; resize: vertical; }
.table-panel { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 18px; text-align: left; border-bottom: 1px solid #e7ece9; vertical-align: middle; }
th { color: var(--muted); background: #f8faf9; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
td small { display: block; }
.badge { display: inline-block; padding: 3px 8px; border-radius: 20px; color: #073d8f; background: #e4eef8; font-size: 12px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 22px; }
.detail-actions a { padding: 7px 11px; border-radius: 5px; background: #e3edf7; font-weight: 600; }
.facts { display: grid; grid-template-columns: 120px 1fr; gap: 13px; padding: 20px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.notes { margin: 0 20px 20px; padding: 16px; background: #f5f7f6; border-radius: 5px; }
.activity { display: grid; grid-template-columns: 38px 1fr; gap: 12px; padding: 16px 20px; border-bottom: 1px solid #edf0ee; }
.activity-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: white; background: var(--green); font-weight: 700; }
.activity strong, .activity small { display: block; }
.activity p { margin: 8px 0 0; }
.edit-form { padding: 24px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 22px; }
.field.wide { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 5px; font-weight: 650; }
.field input[type=checkbox] { width: auto; }
.required, .field-error { color: var(--danger); }
.field-error { display: block; margin-top: 4px; }
.form-actions { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.login-card { width: min(440px, 100%); padding: 38px; border: 1px solid var(--line); border-top: 5px solid var(--sand); border-radius: 12px; background: white; box-shadow: 0 20px 60px rgba(6,40,93,.15); }
.login-brand-logo { display: block; width: min(290px, 100%); height: auto; margin: 0 auto 18px; }
.login-product { margin: 0 0 24px; color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: .18em; text-align: center; text-transform: uppercase; }
.stacked-form { display: grid; gap: 9px; margin-top: 24px; }
.stacked-form .button { margin-top: 14px; }
.error, .message { padding: 12px 14px; border-radius: 5px; }
.error { color: #7d2923; background: #f7e7e5; }
.message { margin-bottom: 15px; background: #e4eef8; }
.pagination { display: flex; justify-content: center; gap: 20px; padding: 20px; }
@media (max-width: 900px) {
    .sidebar { width: 160px; }
    .content { margin-left: 160px; padding: 28px 22px; }
    .metrics { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid, .detail-grid { grid-template-columns: 1fr; }
    .full-width { grid-column: auto; }
}
@media (max-width: 650px) {
    .topbar { padding: 0 15px; }
    .brand { min-width: auto; }
    .brand-product, .user-menu span, .global-search { display: none; }
    .brand img { width: 130px; }
    .sidebar { position: static; width: auto; margin-top: 72px; padding: 8px; display: flex; overflow-x: auto; }
    .sidebar a { margin: 0; white-space: nowrap; }
    .content { margin: 0; padding: 24px 14px; }
    .metrics, .form-grid { grid-template-columns: 1fr; }
    .filter-bar { grid-template-columns: 1fr; }
    .page-head { align-items: flex-start; }
}
