:root {
    --ink: #102c26;
    --muted: #60736d;
    --forest: #123f35;
    --forest-deep: #082b24;
    --lime: #78bd43;
    --lime-soft: #eaf5e2;
    --sand: #f5f2e9;
    --paper: #fff;
    --line: #dce5e1;
    --danger: #a33434;
    --danger-soft: #faeaea;
    --warning: #8a5b11;
    --warning-soft: #fff2cf;
    --shadow: 0 18px 45px rgba(8, 43, 36, .08);
    --radius: 18px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: linear-gradient(180deg, #f7f8f4 0, #eef3ef 100%); font: 16px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: var(--forest); text-underline-offset: .2em; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.site-header { position: sticky; top: 0; z-index: 10; color: #fff; background: rgba(8, 43, 36, .97); border-bottom: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(16px); }
.header-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand-logo { display: block; width: 188px; height: auto; }
.brand-portal { padding-left: 12px; border-left: 1px solid rgba(255,255,255,.28); color: #c6d8d1; font-size: 12px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
nav { display: flex; align-items: center; gap: 19px; }
nav a, .link-button { color: #eef8f3; background: none; border: 0; text-decoration: none; cursor: pointer; padding: 8px 0; }
nav a:hover, .link-button:hover { color: var(--lime); }
.nav-form { margin: 0; }
.nav-identity { max-width: 180px; overflow: hidden; color: #b8cec6; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.nav-cta { padding: 9px 14px !important; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; }
.page { min-height: calc(100vh - 164px); padding-block: 56px 76px; }
.site-footer { color: #d4e0dc; background: var(--forest-deep); font-size: 14px; }
.footer-inner { min-height: 86px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.site-footer a { color: #fff; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 900px; font-size: clamp(2rem, 5vw, 4.25rem); line-height: 1.02; letter-spacing: -.045em; }
h2 { font-size: clamp(1.35rem, 2vw, 1.8rem); line-height: 1.2; letter-spacing: -.025em; }
h3 { font-size: 1.05rem; line-height: 1.3; }
.eyebrow { margin-bottom: 10px; color: #508b3d; font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.page-heading { margin-bottom: 38px; }
.page-heading > p:last-child { max-width: 760px; color: var(--muted); font-size: 18px; }
.narrow { max-width: 820px; margin-inline: auto; }
.heading-row, .dashboard-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; }
.heading-row h1, .dashboard-heading h1 { margin-bottom: 12px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.form-card { padding: clamp(24px, 4vw, 42px); }
.form-card h1, .form-card h2 { margin-bottom: 14px; }
.form-card > p { color: var(--muted); }
form { display: grid; gap: 18px; }
label { display: grid; gap: 7px; color: var(--forest); font-weight: 700; }
.optional, .field-help { color: var(--muted); font-size: 13px; font-weight: 500; }
input, textarea { width: 100%; color: var(--ink); background: #fbfcfa; border: 1px solid #bdcbc5; border-radius: 10px; padding: 12px 13px; outline: none; }
input:focus, textarea:focus { border-color: #4d8b3e; box-shadow: 0 0 0 4px rgba(120, 189, 67, .16); }
textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.check-label { grid-template-columns: auto 1fr; align-items: start; color: var(--muted); font-weight: 500; }
.check-label input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--forest); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 17px; border: 1px solid transparent; border-radius: 10px; font-weight: 800; text-decoration: none; cursor: pointer; }
.button-primary { color: #071f1a; background: var(--lime); border-color: var(--lime); }
.button-primary:hover { background: #8bcd58; }
.button-secondary { color: var(--forest); background: #fff; border-color: #9fb3ab; }
.button-danger { color: var(--danger); background: #fff; border-color: #ddb2b2; }
.button-small { min-height: 34px; padding: 6px 10px; font-size: 13px; }
.button-block { width: 100%; }
.auth-grid { display: grid; grid-template-columns: 1.3fr minmax(340px, .7fr); align-items: center; gap: clamp(40px, 8vw, 110px); min-height: 550px; }
.auth-intro h1 { margin-bottom: 24px; }
.auth-intro > p:last-child { max-width: 650px; color: var(--muted); font-size: 19px; }
.form-links { display: flex; justify-content: space-between; gap: 16px; margin-top: 20px; font-size: 14px; }
.auth-card { max-width: 540px; margin: 40px auto; }
.back-link { display: inline-block; margin-top: 22px; }
.alert { margin-bottom: 24px; padding: 14px 17px; border: 1px solid; border-radius: 10px; }
.alert-success { color: #245d25; background: var(--lime-soft); border-color: #b8dba3; }
.alert-error { color: var(--danger); background: var(--danger-soft); border-color: #e2b8b8; }
.alert-warning { color: var(--warning); background: var(--warning-soft); border-color: #ead38d; }
.message-card { max-width: 650px; margin: 70px auto; padding: 48px; text-align: center; }
.message-card h1 { font-size: clamp(2rem, 4vw, 3rem); }
.message-card p { color: var(--muted); font-size: 18px; }
.status-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 22px; color: var(--forest); background: var(--lime-soft); border-radius: 50%; font-size: 28px; font-weight: 900; }
.error-card .status-icon { color: var(--danger); background: var(--danger-soft); }
.details-list { margin: 25px 0; }
.details-list div { display: grid; grid-template-columns: 135px 1fr; gap: 20px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.details-list dt { color: var(--muted); }
.details-list dd { margin: 0; font-weight: 800; overflow-wrap: anywhere; }
.notice { padding: 14px; color: var(--warning) !important; background: var(--warning-soft); border-radius: 10px; }
.secure-badge { flex: 0 0 auto; padding: 9px 14px; color: #245d25; background: var(--lime-soft); border: 1px solid #c4dfb4; border-radius: 999px; font-weight: 800; }
.section-block { margin-top: 50px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-title h2 { margin: 0; }
.section-title span { color: var(--muted); font-size: 14px; }
.empty-state { padding: 35px; color: var(--muted); background: rgba(255,255,255,.65); border: 1px dashed #b7c8c1; border-radius: var(--radius); text-align: center; }
.file-list { display: grid; gap: 12px; }
.file-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.file-icon { display: grid; place-items: center; width: 54px; height: 54px; color: #fff; background: var(--forest); border-radius: 12px; font-size: 11px; font-weight: 900; }
.file-main h3 { margin-bottom: 5px; }
.file-main p { margin-bottom: 5px; color: var(--muted); }
.file-main small { color: var(--muted); overflow-wrap: anywhere; }
.notes-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.note-card { padding: 24px; }
.note-card time, .note-card small { color: var(--muted); font-size: 13px; }
.note-card h3 { margin: 8px 0; }
.note-card p { margin-bottom: 8px; color: #384d47; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat-card { padding: 24px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; }
.stat-card strong, .stat-card span { display: block; }
.stat-card strong { font-size: 38px; line-height: 1; }
.stat-card span { margin-top: 9px; color: var(--muted); }
.admin-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 32px; }
.action-card { padding: 30px; color: var(--ink); text-decoration: none; }
.action-card p { color: var(--muted); margin-bottom: 0; }
.clients-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.client-card { position: relative; padding: 25px; color: var(--ink); text-decoration: none; }
.client-card h2 { margin-top: 20px; margin-bottom: 6px; }
.client-card p { color: var(--muted); overflow-wrap: anywhere; }
.client-metrics { display: flex; gap: 15px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.admin-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.table-card { padding: 0; overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 14px 15px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { color: var(--muted); background: #f5f8f6; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
td strong, td small { display: block; }
td small { max-width: 340px; margin-top: 4px; color: var(--muted); overflow-wrap: anywhere; }
.empty-cell { padding: 35px; color: var(--muted); text-align: center; }
.status { display: inline-flex; padding: 3px 8px; border-radius: 999px; color: var(--muted); background: #edf1ef; font-size: 11px; font-weight: 900; text-transform: uppercase; }
.status-active, .status-approved { color: #286525; background: var(--lime-soft); }
.status-pending { color: var(--warning); background: var(--warning-soft); }
.status-inactive, .status-disabled, .status-rejected { color: var(--danger); background: var(--danger-soft); }
.inline-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.inline-actions form { display: inline-flex; }
.compact-field { min-width: 15rem; font-size: .78rem; }
.compact-field select { width: 100%; margin-top: .3rem; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: 1.25rem 0; }
.audit-panel { margin-top: 50px; }
.audit-panel summary { cursor: pointer; font-weight: 800; }
.audit-panel[open] summary { margin-bottom: 15px; }

@media (max-width: 900px) {
    .auth-grid { grid-template-columns: 1fr; min-height: auto; }
    .auth-intro { display: none; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .clients-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-columns { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
    .shell { width: min(100% - 28px, 1180px); }
    .header-inner { min-height: 68px; }
    .brand-logo { width: 154px; }
    .brand-portal { display: none; }
    nav { gap: 12px; font-size: 14px; }
    .nav-identity { display: none; }
    nav a:not(.nav-cta):not(:first-child) { display: none; }
    .page { padding-block: 38px 55px; }
    h1 { font-size: 2.35rem; }
    .form-grid, .notes-grid, .admin-actions, .clients-grid { grid-template-columns: 1fr; }
    .heading-row, .dashboard-heading { align-items: flex-start; flex-direction: column; }
    .file-card { grid-template-columns: auto 1fr; }
    .file-card .button { grid-column: 1 / -1; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat-card { padding: 18px; }
    .stat-card strong { font-size: 30px; }
    .footer-inner { align-items: flex-start; flex-direction: column; justify-content: center; }
    .details-list div { grid-template-columns: 1fr; gap: 3px; }
    .message-card { padding: 32px 22px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
