:root {
    color-scheme: light;
    --ink: #173a39;
    --ink-soft: #506866;
    --muted: #82928e;
    --paper: #f5f7f3;
    --white: #fff;
    --line: #e3e9e3;
    --teal: #176c65;
    --teal-dark: #10534e;
    --teal-pale: #e4f1ed;
    --lime: #d8e9a5;
    --coral: #d96f54;
    --coral-pale: #f9ebe5;
    --amber: #b7792f;
    --amber-pale: #f7f0df;
    --shadow: 0 18px 48px rgba(25, 57, 48, .08);
}

* { box-sizing: border-box; }
body { min-width: 320px; margin: 0; color: var(--ink); font: 14px/1.5 "DM Sans", "Segoe UI", sans-serif; background: var(--paper); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 3px solid #f0bd58; outline-offset: 2px; }
a { color: var(--teal); }
.app-page { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 3; display: flex; width: 248px; flex-direction: column; padding: 26px 17px 18px; color: #eaf5ee; background: #123e3b; transition: width .2s ease, padding .2s ease; }
.sidebar-toggle { flex: 0 0 auto; padding: 0; border: 0; color: inherit; background: transparent; cursor: pointer; }
.sidebar-toggle:hover { background: transparent; }
.sidebar-toggle:focus-visible { border-radius: 6px; outline-offset: 5px; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 9px; margin: 0 5px 38px; color: inherit; text-align: center; text-decoration: none; }
.brand img { width: 68px; height: 68px; object-fit: contain; }
.brand b { display: block; font: 800 17px/1.15 "Manrope", sans-serif; letter-spacing: 0; }
.brand small { display: block; max-width: 165px; margin-top: 4px; color: #b4cec5; font-size: 8px; font-weight: 700; line-height: 1.35; letter-spacing: .5px; }
.side-caption { padding: 0 11px 12px; color: #8caea5; font-size: 10px; font-weight: 700; letter-spacing: 1.25px; }
.side-nav { display: grid; gap: 5px; }
.nav-item { display: flex; width: 100%; align-items: center; gap: 13px; min-height: 45px; padding: 0 12px; border: 0; border-radius: 5px; color: #c1d5cf; background: transparent; text-align: left; transition: background .18s ease, color .18s ease; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-item.active { color: #123e3b; background: var(--lime); font-weight: 700; }
.nav-mark { display: inline-grid; width: 19px; height: 20px; flex: 0 0 19px; place-items: center; }
.icon-svg { display: block; width: 20px; height: 20px; }
.nav-mark .icon-svg { width: 17px; height: 17px; }
.nav-item i { display: none; min-width: 19px; margin-left: auto; padding: 1px 5px; border-radius: 10px; color: #fff; background: var(--coral); font-size: 10px; font-style: normal; text-align: center; }
.nav-item i:not(:empty) { display: block; }
.sidebar-bottom { margin-top: auto; }
.secure-note { display: flex; align-items: flex-start; gap: 10px; padding: 14px 11px 3px; border-top: 1px solid rgba(216,233,165,.16); color: #dbe8d5; font-size: 11px; }
.secure-note small { display: block; margin-top: 4px; color: #8caea5; font-size: 10px; }
.secure-dot, .live-dot { display: inline-block; width: 7px; height: 7px; flex: 0 0 auto; margin-top: 5px; border-radius: 50%; background: #b2d578; box-shadow: 0 0 0 3px rgba(178,213,120,.14); }
.main-shell { min-height: 100vh; margin-left: 248px; transition: margin-left .2s ease; }
.sidebar-collapsed .sidebar { width: 76px; padding-right: 10px; padding-left: 10px; }
.sidebar-collapsed .sidebar-toggle { align-self: center; margin-right: 0; margin-left: 0; }
.sidebar-collapsed .brand { margin-right: 0; margin-left: 0; }
.sidebar-collapsed .brand img { width: 52px; height: 52px; }
.sidebar-collapsed .brand > span, .sidebar-collapsed .side-caption, .sidebar-collapsed .secure-note > span:last-child { display: none; }
.sidebar-collapsed .side-nav { gap: 8px; }
.sidebar-collapsed .nav-item { position: relative; justify-content: center; gap: 0; padding: 0; overflow: visible; font-size: 0; }
.sidebar-collapsed .nav-mark { width: 22px; height: 22px; flex-basis: 22px; }
.sidebar-collapsed .nav-mark .icon-svg { width: 19px; height: 19px; }
.sidebar-collapsed .nav-item i { position: absolute; top: 2px; right: 2px; min-width: 15px; padding: 0 4px; font-size: 9px; }
.sidebar-collapsed .secure-note { justify-content: center; padding-right: 0; padding-left: 0; }
.sidebar-collapsed .main-shell { margin-left: 76px; }
.topbar { position: sticky; top: 0; z-index: 2; display: flex; height: 70px; align-items: center; justify-content: space-between; padding: 0 42px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); }
.breadcrumb { display: flex; align-items: center; gap: 11px; color: var(--muted); font-size: 12px; }
.breadcrumb b { color: var(--ink); font-weight: 700; }
.crumb-slash { color: #bdc7c0; }
.top-actions, .user-menu { display: flex; align-items: center; }
.top-actions { gap: 12px; }
.today-label { margin-right: 16px; color: var(--muted); font-size: 12px; }
.user-menu { gap: 9px; padding-left: 20px; border-left: 1px solid var(--line); }
.avatar { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; color: #184b46; background: #dcece4; font-weight: 700; }
.user-identity b, .user-identity small { display: block; }
.user-identity b { max-width: 150px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.user-identity small { color: var(--muted); font-size: 10px; }
.user-menu form { margin-left: 6px; }
.account-shortcut { color: var(--teal); font-size: 11px; font-weight: 700; white-space: nowrap; }
.logout-button { width: 34px; height: 34px; border: 1px solid #cbd8d0; border-radius: 5px; color: var(--ink); background: #fff; font-size: 16px; box-shadow: 0 1px 2px rgba(25,57,48,.08); transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.logout-button:hover { border-color: var(--teal); background: var(--teal-pale); box-shadow: 0 2px 5px rgba(25,57,48,.12); transform: translateY(-1px); }
.content-area { max-width: 1500px; margin: 0 auto; padding: 38px 42px 64px; }
.loading-indicator { position: fixed; top: 70px; right: 24px; z-index: 8; display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid #dbe7df; border-radius: 20px; color: var(--ink-soft); background: rgba(255,255,255,.96); box-shadow: 0 4px 14px rgba(25,57,48,.1); font-size: 11px; opacity: 0; pointer-events: none; transform: translateY(-5px); transition: opacity .18s ease, transform .18s ease; }
.loading-indicator.visible { opacity: 1; transform: translateY(0); }
.loading-spinner { display: inline-block; width: 16px; height: 16px; flex: 0 0 auto; border: 2px solid #dce9e2; border-top-color: var(--teal); border-radius: 50%; animation: loading-spin .75s linear infinite; }
.loading-view { min-height: 430px; animation: fade-in .18s ease-out; }
.loading-heading { display: grid; justify-items: start; gap: 11px; margin-bottom: 28px; }
.skeleton-line { display: block; height: 11px; border-radius: 5px; background: linear-gradient(90deg, #edf1ed 25%, #f6f8f5 38%, #edf1ed 62%); background-size: 400% 100%; animation: skeleton-shimmer 1.35s ease infinite; }
.skeleton-eyebrow { width: 175px; height: 9px; }
.skeleton-title { width: min(300px, 72%); height: 29px; }
.skeleton-description { width: min(430px, 88%); height: 13px; }
.loading-toolbar { display: flex; justify-content: flex-end; margin-bottom: 15px; }
.loading-toolbar .skeleton-line { width: min(320px, 60%); height: 38px; }
.loading-table { overflow: hidden; padding: 0 16px; }
.loading-table-head, .loading-table-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: center; gap: 18px; min-height: 48px; border-bottom: 1px solid #edf0ec; }
.loading-table-head .skeleton-line { width: 65%; height: 9px; }
.loading-table-row .skeleton-line { width: 78%; height: 11px; }
.loading-caption { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 22px 0; color: var(--muted); font-size: 11px; }
.loading-state { display: flex; min-height: 190px; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 12px; }
.modal-loading-body .loading-state { min-height: 150px; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 8px; color: var(--teal); font-size: 10px; font-weight: 700; letter-spacing: 1.4px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--ink); font-family: "Manrope", "Segoe UI", sans-serif; letter-spacing: 0; }
h1 { margin-bottom: 6px; font-size: 28px; font-weight: 800; line-height: 1.2; }
h2 { margin-bottom: 4px; font-size: 18px; font-weight: 750; }
h3 { margin-bottom: 8px; font-size: 15px; font-weight: 750; }
.muted, .subheading { color: var(--muted); }
.subheading { margin: 0; font-size: 13px; }
.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 9px; padding: 0 16px; border: 2px solid transparent; border-radius: 5px; font-size: 12px; font-weight: 700; line-height: 1.2; text-decoration: none; box-shadow: 0 2px 4px rgba(25,57,48,.12); transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.button:hover { box-shadow: 0 4px 9px rgba(25,57,48,.16); transform: translateY(-1px); }
.button:active { box-shadow: 0 1px 2px rgba(25,57,48,.12); transform: translateY(0); }
.button-primary { border-color: var(--teal); color: white; background: var(--teal); }
.button-primary:hover { border-color: var(--teal-dark); color: white; background: var(--teal-dark); }
.button-secondary { border-color: #aebfb4; color: var(--ink); background: white; box-shadow: 0 1px 3px rgba(25,57,48,.08); }
.button-secondary:hover { border-color: var(--teal); color: var(--teal-dark); background: #f0f7f3; box-shadow: 0 3px 7px rgba(25,57,48,.12); }
.button-danger { border-color: #b95c43; color: #963d2b; background: #fff5f1; }
.button-danger:hover { border-color: #963d2b; color: #812f20; background: #fce9e2; }
.button:disabled, .button[aria-disabled="true"] { cursor: not-allowed; opacity: .55; box-shadow: none; transform: none; }
.button-small { min-height: 31px; padding: 0 10px; font-size: 11px; }
.button-link { width: 100%; margin-top: 8px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 25px; }
.stat-card { position: relative; min-height: 126px; overflow: hidden; padding: 18px 19px; border: 1px solid var(--line); border-radius: 5px; background: var(--white); }
.stat-card::after { position: absolute; right: -22px; bottom: -42px; width: 110px; height: 110px; border: 1px solid #e5eee2; border-radius: 50%; content: ""; }
.stat-label { display: block; max-width: calc(100% - 40px); color: var(--muted); font-size: 11px; font-weight: 600; line-height: 1.35; }
.stat-value { display: block; margin-top: 8px; font: 800 29px/1 "Manrope", sans-serif; }
.stat-foot { display: block; margin-top: 9px; color: var(--teal); font-size: 10px; }
.stat-accent { position: absolute; top: 18px; right: 19px; display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; color: var(--teal); background: var(--teal-pale); }
.stat-accent .icon-svg { width: 18px; height: 18px; }
.stat-card.warning .stat-value, .stat-card.warning .stat-accent { color: var(--coral); }
.stat-card.warning .stat-accent { background: var(--coral-pale); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(250px, .85fr); gap: 16px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 5px; background: white; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.panel-header p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.panel-body { padding: 18px 20px; }
.quick-list { display: grid; gap: 8px; }
.quick-action { display: flex; align-items: center; gap: 13px; padding: 12px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); background: white; text-align: left; }
.quick-action:hover { border-color: #b7d2c6; background: #f7fbf8; }
.quick-icon { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border-radius: 5px; color: var(--teal); background: var(--teal-pale); }
.quick-icon .icon-svg { width: 19px; height: 19px; }
.quick-action b, .quick-action small { display: block; }
.quick-action b { font-size: 12px; }
.quick-action small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 11px 15px; color: #81918b; background: #f8faf7; font-size: 10px; font-weight: 700; letter-spacing: .35px; white-space: nowrap; }
td { padding: 13px 15px; border-top: 1px solid #edf0ec; color: #405955; font-size: 11px; vertical-align: middle; }
tbody tr:hover { background: #fbfcfa; }
.cell-strong { color: var(--ink); font-weight: 700; }
.cell-sub { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 400; }
.mono { font-family: Consolas, monospace; font-size: 11px; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 20px; color: #667872; background: #eff2ef; font-size: 10px; font-weight: 700; white-space: nowrap; }
.status-pill::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ""; }
.status-pill.approved, .status-pill.issued, .status-pill.active { color: #247462; background: #e4f3ec; }
.status-pill.review, .status-pill.director_review, .status-pill.draft { color: #9c6b28; background: #f8f0df; }
.status-pill.expired, .status-pill.suspended, .status-pill.rejected { color: #ad5a42; background: #fae9e3; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; }
.search-box { position: relative; flex: 1; max-width: 390px; }
.search-box input { width: 100%; padding: 10px 12px 10px 36px; border: 1px solid var(--line); border-radius: 4px; outline: none; background: white; font-size: 12px; }
.search-box input:focus, .field input:focus, .field select:focus, .field textarea:focus, .stack-form input:focus { border-color: #86b6a5; box-shadow: 0 0 0 3px rgba(23,108,101,.08); }
.search-glyph { position: absolute; top: 7px; left: 12px; color: #93a19b; font-size: 17px; }
.table-panel { overflow: hidden; }
.empty-state { padding: 36px 18px; color: var(--muted); text-align: center; }
.empty-state b { display: block; margin-bottom: 4px; color: var(--ink); }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.text-button { display: inline-flex; min-height: 30px; align-items: center; justify-content: center; padding: 4px 9px; border: 1px solid #cbd8d0; border-radius: 5px; color: var(--teal-dark); background: #fff; font-size: 11px; font-weight: 600; line-height: 1.2; text-align: center; text-decoration: none; transition: background .14s ease, border-color .14s ease, color .14s ease; }
.text-button:hover { border-color: #83aa99; color: #104e48; background: #eff6f2; text-decoration: none; }
.text-button:active { background: #e4f1ed; }
.text-button-primary { border-color: #d3e5dc; color: #176c65; background: #eaf4ef; }
.text-button-primary:hover { border-color: #83aa99; color: #104e48; background: #dcece4; }
.medicine-actions { flex-wrap: nowrap; gap: 5px; }
.medicine-actions .text-button { min-height: 28px; padding: 4px 7px; white-space: nowrap; }
.pagination { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 15px; border-top: 1px solid var(--line); background: #fff; }
.pagination-summary { color: var(--muted); font-size: 12px; }
.pagination-controls { display: flex; align-items: center; gap: 6px; }
.pagination-controls button:disabled { cursor: not-allowed; opacity: .45; }
.page-select { min-height: 31px; padding: 0 8px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); background: white; font-size: 11px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; overflow-y: auto; padding: 20px; background: rgba(15,38,35,.55); backdrop-filter: blur(3px); animation: fade-in .16s ease-out; }
.modal { width: min(680px, 100%); max-height: min(90vh, 900px); overflow-y: auto; border-radius: 6px; background: white; box-shadow: var(--shadow); animation: rise-in .2s ease-out; }
.modal-wide { width: min(880px, 100%); }
.modal-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; padding: 20px 24px 16px; border-bottom: 1px solid var(--line); background: white; }
.modal-header h2 { margin: 0; }
.modal-close { width: 34px; height: 34px; border: 1px solid #b8c9bf; border-radius: 5px; color: var(--ink); background: white; font-size: 18px; box-shadow: 0 1px 3px rgba(25,57,48,.08); }
.modal-close:hover { border-color: var(--teal); color: var(--teal-dark); background: var(--teal-pale); }
.modal-body { padding: 20px 24px 24px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding-top: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; }
.field, .stack-form label { display: grid; gap: 6px; color: #526b65; font-size: 11px; font-weight: 700; }
.field[hidden], [hidden] { display: none !important; }
.field.full { grid-column: 1/-1; }
.field input, .field select, .field textarea, .stack-form input { width: 100%; min-height: 39px; padding: 9px 10px; border: 1px solid #dfe7df; border-radius: 4px; outline: none; color: var(--ink); background: #fff; font-size: 12px; font-weight: 400; }
.field textarea { min-height: 78px; resize: vertical; }
.signature-confirm { display: flex; align-items: flex-start; gap: 9px; margin-top: 14px; color: var(--ink-soft); font-size: 12px; }
.signature-confirm input { flex: 0 0 auto; margin-top: 3px; accent-color: var(--teal); }
.section-label { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 9px; color: var(--ink); font-size: 12px; font-weight: 700; }
.medicine-search { position: relative; }
.medicine-search > input { width: 100%; min-height: 39px; padding: 9px 10px; border: 1px solid #dfe7df; border-radius: 4px; outline: none; color: var(--ink); background: #fff; font-size: 12px; }
.medicine-search > input:focus { border-color: #86b6a5; box-shadow: 0 0 0 3px rgba(23,108,101,.08); }
.suggestions { position: absolute; top: calc(100% + 3px); right: 0; left: 0; z-index: 4; max-height: 230px; overflow-y: auto; border: 1px solid var(--line); border-radius: 4px; background: white; box-shadow: var(--shadow); }
.suggestion { display: block; width: 100%; padding: 10px 12px; border: 0; border-bottom: 1px solid #edf0ec; color: var(--ink); background: white; text-align: left; }
.suggestion:hover { background: #f3f8f4; }
.suggestion b, .suggestion small { display: block; }
.suggestion small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.selected-items { display: grid; gap: 9px; }
.selected-medicine { padding: 11px; border: 1px solid var(--line); border-radius: 4px; background: #fbfcfa; }
.selected-medicine-head { display: flex; justify-content: space-between; gap: 12px; }
.selected-medicine-head b { font-size: 11px; }
.selected-medicine-head small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.remove-line { width: 30px; height: 30px; flex: 0 0 auto; border: 1px solid #e4b9ac; border-radius: 4px; color: #963d2b; background: #fff5f1; font-size: 17px; line-height: 1; }
.remove-line:hover { border-color: #b95c43; background: #fce9e2; }
.item-fields { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 9px; }
.item-fields .field input { min-height: 34px; padding: 7px; font-size: 11px; }
.checks { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--line); }
.checks label { display: flex; align-items: center; gap: 5px; color: var(--ink-soft); font-size: 10px; }
.checks input { accent-color: var(--teal); }
.notice { margin: 13px 0; padding: 11px 12px; border: 1px solid #e4ecda; border-radius: 4px; color: #556a48; background: #f5f8ef; font-size: 11px; }
.notice-error { border-color: #f0d7ce; color: #a95039; background: #fff6f2; }
.review-message { margin-top: 8px; padding: 8px 10px; border-left: 3px solid var(--amber); color: var(--ink-soft); background: #fbf8ef; font-size: 10px; white-space: pre-wrap; }
.review-message b { display: block; margin-bottom: 3px; color: var(--ink); }
.workflow { max-width: 950px; padding: 24px 30px; }
.workflow ol { display: grid; gap: 12px; padding-left: 22px; color: var(--ink-soft); }
.workflow li { padding-left: 4px; }
.atc-suggestions { display: grid; gap: 4px; margin-top: 8px; }
.atc-suggestions .muted, .atc-suggestions .notice { margin: 4px 0; }
.signature-canvas { display: block; width: 100%; height: 170px; border: 1px dashed #91aaa0; border-radius: 4px; background: #fff; touch-action: none; }
.decision-products { padding-left: 20px; color: var(--ink-soft); font-size: 11px; }
.toast { position: fixed; right: 28px; bottom: 25px; z-index: 20; max-width: min(420px, calc(100vw - 32px)); padding: 12px 17px; border-radius: 4px; color: white; background: #173f3a; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(10px); transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #a95039; }
.auth-page { display: grid; min-height: 100vh; min-height: 100dvh; place-items: center; padding: 22px; background: radial-gradient(ellipse at 14% 18%, rgba(216,233,165,.56), transparent 33%), radial-gradient(ellipse at 85% 82%, rgba(187,220,208,.64), transparent 34%), #eff4ed; }
.auth-login-page { position: relative; isolation: isolate; overflow: hidden; }
.health-backdrop { position: fixed; inset: 0; z-index: -1; display: grid; place-items: center; overflow: hidden; pointer-events: none; }
.health-backdrop::before, .health-backdrop::after { position: absolute; width: min(38vw, 390px); aspect-ratio: 1; border: 1px solid rgba(23,108,101,.07); border-radius: 50%; content: ""; animation: health-orbit 24s ease-in-out infinite alternate; }
.health-backdrop::after { width: min(55vw, 560px); animation-delay: -12s; }
.health-backdrop svg { width: max(1100px, 120vw); height: min(36vh, 300px); overflow: visible; opacity: .48; }
.health-trace, .health-signal { fill: none; stroke: #71a99c; stroke-linecap: round; stroke-linejoin: round; }
.health-trace { stroke-width: 2; stroke-dasharray: 10 13; animation: health-drift 22s linear infinite; }
.health-signal { stroke: #176c65; stroke-width: 4; stroke-dasharray: 48 1900; animation: health-signal 7s linear infinite; }
.auth-logo-intro { position: fixed; inset: 0; z-index: 2; display: grid; place-items: center; pointer-events: none; animation: auth-logo-intro 2.6s cubic-bezier(.2,.75,.25,1) both; }
.auth-logo-intro img { display: block; width: clamp(210px, 42vmin, 480px); height: auto; filter: drop-shadow(0 20px 34px rgba(23,58,57,.16)); }
.auth-card { width: min(460px, 100%); padding: 34px 38px 26px; border: 1px solid rgba(255,255,255,.72); border-radius: 7px; background: rgba(255,255,255,.92); box-shadow: 0 22px 65px rgba(23,58,57,.13); text-align: center; animation: rise-in .35s ease-out; }
.auth-card-wide { width: min(560px, 100%); }
.auth-login-page .auth-card { position: relative; z-index: 1; animation: login-card-enter .8s 2.2s cubic-bezier(.2,.75,.25,1) both; }
.auth-2fa-page .auth-card { width: min(430px, 100%); padding: 30px 34px 24px; border-radius: 10px; background: rgba(255,255,255,.96); animation: rise-in .35s ease-out; }
.auth-logo { display: block; width: 72px; height: 72px; margin: 0 auto 22px; object-fit: contain; }
.auth-login-page .auth-logo { width: 128px; height: 128px; margin-bottom: 17px; }
.auth-2fa-page .auth-logo { width: 68px; height: 68px; margin-bottom: 13px; }
.auth-card h1 { margin-bottom: 7px; font-size: 22px; line-height: 1.25; overflow-wrap: anywhere; }
.auth-2fa-page .auth-card h1 { margin-bottom: 5px; font-size: 24px; }
.auth-card .muted { margin-bottom: 22px; font-size: 12px; }
.auth-2fa-page .auth-card > .muted { margin-bottom: 17px; }
.auth-2fa-page .eyebrow { margin-bottom: 6px; }
.auth-2fa-page .notice { margin: 10px 0; padding: 9px 12px; border: 1px solid #e7ece6; border-radius: 6px; color: #82908a; background: rgba(246,248,245,.72); line-height: 1.5; }
.auth-2fa-page .notice-error { border-color: #f0d7ce; color: #a95039; background: #fff6f2; }
.stack-form { display: grid; gap: 14px; }
.stack-form label { text-align: left; }
.stack-form .button { width: 100%; margin-top: 5px; }
.auth-2fa-page .stack-form { gap: 12px; }
.auth-2fa-page .stack-form label { display: grid; gap: 6px; color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.auth-2fa-page .stack-form input:not([type="hidden"]) { min-height: 46px; padding: 10px 13px; border: 1px solid #cbd8d0; border-radius: 6px; background: #fff; font-size: 16px; }
.auth-2fa-page .totp-entry-label { gap: 8px; }
.totp-digit-group { display: flex; justify-content: center; gap: 9px; }
.totp-digit-group[hidden], .totp-recovery-field[hidden] { display: none; }
.auth-2fa-page .totp-digit-group .totp-digit { width: 48px; min-height: 54px; padding: 0; border: 1px solid #cbd8d0; border-radius: 7px; color: var(--ink); background: #fff; font: 700 23px/1 "Manrope", "Segoe UI", sans-serif; text-align: center; transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
.auth-2fa-page .totp-digit-group .totp-digit:focus { border-color: var(--teal); outline: none; background: #fbfdfb; box-shadow: 0 0 0 3px rgba(23,108,101,.1); }
.auth-2fa-page .totp-recovery-input { width: 100%; }
.auth-2fa-page .totp-help { margin: 7px 0 12px; padding: 0; color: #899692; background: transparent; line-height: 1.5; }
.auth-2fa-page .stack-form .button { min-height: 44px; margin-top: 1px; border-radius: 6px; }
.auth-foot { margin: 22px 0 0; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; text-align: center; }
.auth-links { margin: 18px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 2; }
.auth-card textarea { width: 100%; min-height: 84px; padding: 9px 10px; border: 1px solid #dfe7df; border-radius: 4px; outline: none; color: var(--ink); background: #fff; font: inherit; font-weight: 400; resize: vertical; }
.auth-card textarea:focus { border-color: #86b6a5; box-shadow: 0 0 0 3px rgba(23,108,101,.08); }
.guide-page { min-height: 100vh; background: var(--paper); }
.guide-header { display: flex; min-height: 74px; align-items: center; justify-content: space-between; gap: 20px; padding: 10px max(24px, calc((100vw - 1080px) / 2)); border-bottom: 1px solid var(--line); background: #fff; }
.guide-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.guide-brand img { width: 46px; height: 46px; object-fit: contain; }
.guide-brand b, .guide-brand small { display: block; }
.guide-brand b { font: 800 16px/1.1 "Manrope", sans-serif; }
.guide-brand small { margin-top: 4px; color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .5px; }
.guide-header nav { display: flex; flex-wrap: wrap; gap: 18px; font-size: 12px; font-weight: 700; }
.guide-content { width: min(900px, calc(100% - 40px)); margin: 0 auto; padding: 46px 0 72px; }
.guide-content h1 { margin-bottom: 9px; font-size: clamp(28px, 4vw, 38px); line-height: 1.2; }
.guide-content > .subheading { max-width: 680px; margin-bottom: 32px; color: var(--ink-soft); font-size: 14px; }
.guide-section { margin-top: 18px; padding: 22px 25px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.guide-section h2 { margin-bottom: 12px; font-size: 17px; }
.guide-section p, .guide-section li { color: var(--ink-soft); font-size: 13px; line-height: 1.75; }
.guide-section ol, .guide-section ul { display: grid; gap: 7px; margin: 0; padding-left: 21px; }
.guide-section .notice { margin-bottom: 0; }
.file-field { display: grid; gap: 7px; color: var(--ink-soft); font-size: 11px; }
.file-field input { width: 100%; font-size: 11px; }
.checklist-summary { color: var(--muted); font-size: 10px; }
.totp-qr-wrap { display: grid; width: 100%; place-items: center; margin: 15px 0 10px; }
.totp-qr { width: 210px; max-width: 70vw; height: auto; padding: 9px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.totp-manual-label { margin: 12px 0 5px; color: var(--ink-soft); font-size: 10px; font-weight: 700; }
.totp-secret { display: block; overflow-wrap: anywhere; padding: 10px; border: 1px solid var(--line); border-radius: 4px; color: var(--teal-dark); background: #f8faf7; font: 700 12px/1.5 Consolas, monospace; letter-spacing: 1px; }
.totp-help { margin: 12px 0; font-size: 11px; }
.cancel-2fa { margin-top: 12px; }
.auth-2fa-page .cancel-2fa { margin-top: 11px; }
.auth-2fa-page .recovery-toggle { justify-self: center; border-color: transparent; color: #778680; background: transparent; box-shadow: none; }
.auth-2fa-page .recovery-toggle:hover { border-color: #d8e4dc; color: var(--teal-dark); background: #f7faf7; }
.auth-2fa-page .auth-foot { margin-top: 19px; }
.recovery-card { width: min(540px, 100%); }
.recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 18px 0; }
.recovery-codes code { padding: 10px 6px; border: 1px solid var(--line); border-radius: 4px; background: #f8faf7; font: 700 13px Consolas, monospace; }
.page-heading { animation: page-enter .28s ease-out both; }
.stat-card { animation: page-enter .34s ease-out both; }
.stat-card:nth-child(2) { animation-delay: 45ms; }
.stat-card:nth-child(3) { animation-delay: 90ms; }
.stat-card:nth-child(4) { animation-delay: 135ms; }
.dashboard-grid > .panel, .table-panel { animation: page-enter .35s ease-out both; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes page-enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes login-card-enter { from { opacity: 0; transform: translateY(30px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes auth-logo-intro {
    0% { opacity: 0; transform: scale(.22); }
    16% { opacity: 1; transform: scale(.72); }
    58% { opacity: 1; transform: scale(1.12); }
    100% { opacity: 0; transform: scale(.72) translateY(-7vh); }
}
@keyframes health-drift { to { stroke-dashoffset: -460; } }
@keyframes health-signal { to { stroke-dashoffset: -1950; } }
@keyframes health-orbit { to { transform: translate(20px, -16px) scale(1.08); } }
@keyframes loading-spin { to { transform: rotate(360deg); } }
@keyframes skeleton-shimmer { to { background-position: -400% 0; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    .auth-logo-intro { display: none; }
    .auth-login-page .auth-card { animation-delay: 0s; }
}

@media (max-width: 1050px) {
    .sidebar { width: 215px; }
    .main-shell { margin-left: 215px; }
    .sidebar-collapsed .sidebar { width: 76px; }
    .sidebar-collapsed .main-shell { margin-left: 76px; }
    .content-area { padding-right: 25px; padding-left: 25px; }
    .topbar { padding-right: 25px; padding-left: 25px; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 760px) {
    .sidebar { position: sticky; top: 0; width: 100%; height: auto; padding: 9px 12px 8px; }
    .sidebar-collapsed .sidebar { width: 100%; padding: 9px 12px 8px; }
    .sidebar-collapsed .brand { margin: 0 auto 8px; }
    .sidebar-collapsed .sidebar-toggle > span, .sidebar-collapsed .side-nav { display: none; }
    .sidebar-collapsed .nav-item { justify-content: flex-start; gap: 7px; padding: 0 10px; font-size: 11px; }
    .sidebar-collapsed .nav-mark { width: 18px; height: 18px; flex-basis: 18px; }
    .sidebar-collapsed .nav-mark .icon-svg { width: 16px; height: 16px; }
    .sidebar-collapsed .main-shell { margin-left: 0; }
    .brand { gap: 4px; margin: 0 auto 8px; }
    .brand img { width: 48px; height: 48px; }
    .brand b { font-size: 13px; }
    .brand small { max-width: 190px; margin-top: 2px; font-size: 7px; }
    .side-caption, .sidebar-bottom { display: none; }
    .side-nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: thin; }
    .nav-item { width: auto; min-width: max-content; min-height: 37px; gap: 7px; padding: 0 10px; font-size: 11px; }
    .nav-mark { width: 17px; height: 17px; flex-basis: 17px; }
    .nav-mark .icon-svg { width: 15px; height: 15px; }
    .main-shell { margin-left: 0; }
    .topbar { position: static; height: 54px; padding: 0 15px; }
    .loading-indicator { top: 62px; right: 12px; }
    .today-label, .user-identity, .live-dot { display: none; }
    .user-menu { padding-left: 0; border: 0; }
    .content-area { padding: 24px 15px 40px; }
    .page-heading { flex-direction: column; align-items: stretch; margin-bottom: 20px; }
    h1 { font-size: 23px; }
    .page-heading .button { min-height: 38px; align-self: flex-start; padding: 0 12px; font-size: 11px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .stats-grid { gap: 9px; }
    .stat-card { min-height: 108px; padding: 14px; }
    .stat-value { font-size: 25px; }
    .stat-accent { top: 12px; right: 12px; width: 28px; height: 28px; }
    .stat-accent .icon-svg { width: 16px; height: 16px; }
    .toolbar { align-items: stretch; }
    .toolbar .search-box { max-width: none; }
    .toolbar > .button { white-space: nowrap; }
    .pagination { align-items: flex-start; flex-direction: column; }
    .pagination-controls { max-width: 100%; flex-wrap: wrap; }
    .form-grid { grid-template-columns: 1fr; }
    .field.full { grid-column: auto; }
    .modal-backdrop { align-items: end; padding: 8px; }
    .modal { max-height: 94vh; border-radius: 7px 7px 4px 4px; }
    .modal-header { padding: 16px 17px 13px; }
    .modal-body { padding: 16px 17px 20px; }
    .item-fields { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .user-menu { gap: 6px; }
    .account-shortcut { font-size: 10px; }
    .auth-card { padding: 28px 23px 23px; }
    .auth-2fa-page { padding: 16px; }
    .auth-2fa-page .auth-card { padding: 25px 21px 20px; }
    .totp-digit-group { gap: 6px; }
    .auth-2fa-page .totp-digit-group .totp-digit { width: min(44px, calc((100vw - 112px) / 6)); min-height: 50px; }
    .auth-login-page .auth-logo { width: 104px; height: 104px; }
    .auth-logo-intro img { width: clamp(190px, 52vmin, 340px); }
    .health-backdrop svg { height: 230px; }
    .recovery-codes { gap: 6px; }
    .recovery-codes code { font-size: 12px; }
}
@media (max-width: 390px) {
    .nav-item { padding: 0 8px; }
    .nav-item { font-size: 10px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat-label { font-size: 10px; }
    .page-heading { gap: 8px; }
    .guide-header { padding-right: 18px; padding-left: 18px; }
    .guide-content { width: min(100% - 28px, 900px); padding-top: 32px; }
    .guide-section { padding: 18px; }
}