:root {
    --ink: #173b31;
    --deep: #153d32;
    --deep-2: #214f40;
    --green: #527d6b;
    --muted: #6c827b;
    --line: #dbe3df;
    --soft: #f4f7f5;
    --paper: #ffffff;
    --yellow: #ffc727;
    --yellow-soft: #fff4c8;
    --red: #a8463c;
    --shadow: 0 16px 40px rgba(25, 54, 44, .07);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--soft);
    font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--soft); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.skip-link { position: absolute; left: -999px; top: 10px; z-index: 50; padding: 10px 14px; background: var(--yellow); color: var(--ink); }
.skip-link:focus { left: 10px; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 260px; flex: 0 0 260px; display: flex; flex-direction: column; min-height: 100vh; padding: 32px 20px 24px; background: #f5f7f6; border-right: 1px solid var(--line); }
.is-admin .sidebar { background: var(--deep); color: #edf4f0; border-right: 0; }
.brand-lockup { padding: 0 18px 38px; }
.brand-logo { display: block; width: 166px; max-width: 100%; height: auto; object-fit: contain; object-position: left center; }
.brand-context { display: block; margin-top: 12px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.is-admin .brand-context { color: #b9d2c6; }
.nav-links { display: grid; gap: 4px; }
.nav-link { display: flex; align-items: center; justify-content: space-between; min-height: 46px; padding: 0 18px; border-radius: 8px; color: #55716a; font-size: 15px; transition: background .18s ease, color .18s ease; }
.nav-link:hover, .nav-link:focus-visible { background: #e7ece9; color: var(--ink); outline: none; }
.nav-link.active { background: #e5eae7; color: var(--ink); font-weight: 700; }
.is-admin .nav-link { color: #d6e6de; }
.is-admin .nav-link:hover, .is-admin .nav-link:focus-visible { background: var(--deep-2); color: #fff; }
.is-admin .nav-link.active { background: #3d6252; color: #fff; }
.nav-meta { min-width: 22px; padding: 3px 6px; border: 1px solid currentColor; border-radius: 5px; font-size: 11px; text-align: center; }
.manager-card { margin-top: auto; padding: 20px 16px 16px; background: #fff; border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 8px 22px rgba(25, 54, 44, .04); }
.manager-card strong { display: block; margin: 12px 0 8px; font-size: 16px; font-weight: 500; }
.manager-card p { margin: 0 0 16px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.sidebar-footer { margin-top: 22px; padding: 18px 8px 0; border-top: 1px solid var(--line); }
.is-admin .sidebar-footer { border-top-color: rgba(221, 238, 230, .2); }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip strong, .user-chip small { display: block; }
.user-chip strong { font-size: 13px; }
.user-chip small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.is-admin .user-chip small { color: #b9d2c6; }
.avatar { display: grid; width: 32px; height: 32px; place-items: center; flex: 0 0 32px; border-radius: 50%; background: #c9d9d0; color: var(--ink); font-size: 13px; font-weight: 700; }
.signout { display: block; margin-top: 16px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 13px; }
.signout:hover { color: var(--ink); text-decoration: underline; }
.is-admin .signout { color: #b9d2c6; }
.mobile-nav-toggle { display: none; }
.main-content { min-width: 0; flex: 1; background: var(--paper); }
.page-wrap { max-width: 1440px; margin: 0 auto; padding: 42px 48px 64px; }
.narrow-wrap { max-width: 1180px; }
.admin-wrap { max-width: 1540px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 30px; }
.page-header h1 { margin: 8px 0 0; color: var(--ink); font-size: clamp(30px, 4vw, 43px); font-weight: 400; letter-spacing: -.04em; line-height: 1.04; }
.page-header .lead { max-width: 650px; margin: 12px 0 0; color: var(--muted); font-size: 16px; line-height: 1.55; }
.client-header { align-items: center; }
.client-header h1 { font-size: 34px; }
.eyebrow, .muted-label { color: #738b83; font-size: 10px; font-weight: 800; letter-spacing: .14em; line-height: 1.4; text-transform: uppercase; }
.muted-label { letter-spacing: .1em; }
.tag-row, .button-row, .header-actions, .alert-row, .filter-tabs { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.tag, .alert-chip { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 10px; border: 1px solid #c8d5cf; border-radius: 5px; color: #55756a; background: #fff; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.tag-soft { background: #eef3f0; }
.tag-outline { background: transparent; }
.tag-warning, .count-badge, .alert-yellow { border-color: #e3b100; background: var(--yellow); color: var(--ink); }
.header-actions { justify-content: flex-end; }
select { min-width: 165px; padding: 11px 35px 11px 13px; border: 1px solid #bccbc4; border-radius: 7px; background: #fff; color: var(--ink); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(330px, .9fr); gap: 18px; }
.card { padding: 24px 26px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: var(--shadow); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.report-card h2 { max-width: 720px; margin: 20px 0 16px; font-size: clamp(23px, 3vw, 29px); font-weight: 400; letter-spacing: -.03em; line-height: 1.27; }
.report-card > p { max-width: 680px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.7; }
.metric-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 24px 0 26px; padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metric-row div { display: grid; gap: 5px; }
.metric-row span, .metric-row small { color: var(--muted); font-size: 11px; }
.metric-row strong { color: var(--ink); font-size: 23px; font-weight: 500; }
.metric-row small { font-size: 12px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 42px; padding: 9px 16px; border: 1px solid transparent; border-radius: 7px; font-size: 14px; font-weight: 650; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); box-shadow: 0 5px 12px rgba(25, 54, 44, .1); }
.button-primary { background: var(--yellow); color: var(--ink); }
.button-secondary { border-color: #b7c7bf; background: #fff; color: var(--ink); }
.button-small { min-height: 34px; padding: 6px 12px; font-size: 12px; }
.button-large { width: 100%; min-height: 50px; }
.button-full { width: 100%; }
.approval-card { display: flex; flex-direction: column; }
.count-badge { min-height: 26px; padding: 5px 8px; border-radius: 5px; font-size: 10px; white-space: nowrap; }
.approval-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 0; border-top: 1px solid var(--line); }
.approval-row strong { font-size: 15px; font-weight: 500; }
.approval-row p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.approval-row small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.card-footnote, .table-caption { margin: 18px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.wide-card, .setup-card { min-width: 0; }
.wide-card { grid-column: 1; }
.setup-card { grid-column: 2; grid-row: 2; }
.text-link { color: var(--green); font-size: 13px; font-weight: 650; }
.text-link:hover { text-decoration: underline; }
.data-table { width: 100%; }
.table-head, .table-row { display: grid; grid-template-columns: 88px 1fr 1.2fr 150px; align-items: center; gap: 16px; }
.table-head { padding: 0 0 10px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.table-row { min-height: 55px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; }
.table-row > * { min-width: 0; }
.table-row strong { font-weight: 500; }
.inline-status { display: inline-flex; align-items: center; gap: 8px; color: #55756a; white-space: nowrap; }
.status-dot { display: inline-block; width: 10px; height: 10px; flex: 0 0 10px; border: 2px solid #bfd0c7; border-radius: 50%; }
.status-running { background: #6c9c86; border-color: #6c9c86; }
.status-waiting { background: var(--yellow); border-color: var(--yellow); }
.status-paused { background: var(--yellow); border-color: var(--yellow); }
.status-complete { color: #4f8a71; border-color: #4f8a71; }
.status-partial { color: #c68e00; border-color: var(--yellow); }
.setup-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 13px; }
.setup-row strong { font-weight: 500; }
.setup-detail { color: var(--muted); font-size: 12px; text-align: right; }
.status-icon { display: grid; width: 17px; height: 17px; place-items: center; border: 1px solid #b7c9bf; border-radius: 50%; font-size: 11px; }
.setup-link { display: inline-block; margin-top: 15px; }
.empty-state { padding: 26px 8px; color: var(--muted); text-align: center; }
.empty-state h2, .empty-state h3 { margin: 8px 0; color: var(--ink); font-weight: 500; }
.empty-state p { margin: 0; font-size: 13px; line-height: 1.6; }
.empty-state.compact { padding: 16px 4px; }
.large-empty { padding: 70px 20px; }
.empty-icon { color: var(--green); font-size: 28px; }
.status-check { display: grid; width: 28px; height: 28px; margin: 0 auto; place-items: center; border: 1px solid #7ca18e; border-radius: 50%; color: #4f8a71; }

.alert-row { margin-bottom: 18px; }
.alert-chip { background: #fff; font-size: 10px; }
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.filter-tabs { padding: 4px; border: 1px solid var(--line); border-radius: 7px; }
.filter-tab { padding: 8px 11px; border-radius: 5px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.filter-tab.active, .filter-tab:hover { background: var(--deep); color: #fff; }
.search-form { display: flex; }
.search-form input { width: 210px; min-height: 40px; padding: 9px 12px; border: 1px solid var(--line); border-right: 0; border-radius: 7px 0 0 7px; outline-color: var(--green); }
.search-form button { min-height: 40px; padding: 8px 14px; border: 1px solid var(--deep); border-radius: 0 7px 7px 0; background: var(--deep); color: #fff; font-size: 13px; }
.admin-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.client-table-card { padding: 18px 20px; overflow: hidden; }
.client-table .table-head, .client-table .table-row { grid-template-columns: 1.55fr 1fr 1fr 1fr 1fr .6fr .9fr; gap: 14px; }
.client-row { min-height: 72px; }
.client-row > div { display: grid; gap: 5px; }
.client-row small { color: var(--muted); font-size: 10px; letter-spacing: .07em; text-transform: uppercase; }
.admin-side-stack { display: grid; gap: 18px; }
.feed-card { padding: 20px; }
.feed-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.feed-row strong { display: block; font-size: 13px; font-weight: 600; }
.feed-row p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.feed-row > span { color: var(--muted); font-size: 10px; white-space: nowrap; }
.collection-card { padding: 0 26px; }
.collection-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 23px 0; border-bottom: 1px solid var(--line); }
.collection-row:last-child { border-bottom: 0; }
.collection-row h2 { margin: 6px 0 6px; font-size: 18px; font-weight: 500; letter-spacing: -.02em; }
.collection-row p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.collection-meta { display: grid; gap: 4px; min-width: 130px; color: var(--muted); text-align: right; }
.collection-meta strong { color: var(--ink); font-size: 19px; font-weight: 500; }
.collection-meta span { font-size: 12px; }
.decision-form { display: flex; gap: 8px; flex-shrink: 0; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.settings-card h2 { margin: 10px 0 14px; font-size: 21px; font-weight: 500; }
.settings-card p { color: var(--muted); font-size: 14px; line-height: 1.7; }
.detail-list { margin: 0; }
.detail-list div { display: flex; justify-content: space-between; gap: 14px; padding: 13px 0; border-top: 1px solid var(--line); }
.detail-list dt, .detail-list dd { font-size: 13px; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; text-align: right; }
.flash { position: relative; z-index: 2; margin: 18px 30px 0; padding: 13px 16px; border-radius: 7px; font-size: 13px; }
.flash-success { border: 1px solid #b8d5c4; background: #eff8f1; color: #2e6b4b; }
.flash-error { border: 1px solid #e4b8b1; background: #fff2f0; color: var(--red); }

.auth-page { display: grid; min-height: 100vh; grid-template-columns: minmax(360px, 1fr) minmax(380px, .9fr); background: var(--soft); }
.auth-panel { display: flex; width: min(510px, calc(100% - 48px)); flex-direction: column; justify-content: center; margin: 0 auto; padding: 44px 0; }
.auth-brand { display: flex; align-items: center; gap: 16px; margin-bottom: 80px; color: var(--muted); font-size: 12px; }
.auth-logo { width: 170px; height: auto; }
.auth-copy h1 { max-width: 480px; margin: 12px 0 16px; color: var(--ink); font-size: clamp(34px, 5vw, 52px); font-weight: 400; letter-spacing: -.06em; line-height: 1.02; }
.auth-copy p { max-width: 430px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.65; }
.auth-form { display: grid; gap: 10px; margin-top: 38px; }
.auth-form label { margin-top: 8px; color: var(--ink); font-size: 13px; font-weight: 650; }
.auth-form input { min-height: 48px; padding: 11px 13px; border: 1px solid #bccbc4; border-radius: 7px; background: #fff; color: var(--ink); outline-color: var(--green); }
.auth-note { margin: 18px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.auth-aside { position: relative; display: flex; flex-direction: column; justify-content: center; overflow: hidden; padding: 70px 12%; background: var(--deep); color: #f6faf7; }
.auth-aside h2 { position: relative; max-width: 450px; margin: 17px 0; font-size: clamp(38px, 5vw, 65px); font-weight: 400; letter-spacing: -.06em; line-height: .98; }
.auth-aside p { position: relative; max-width: 400px; color: #c5d9cf; font-size: 16px; line-height: 1.65; }
.auth-aside .eyebrow { position: relative; color: #bfd9cb; }
.aside-foot { position: absolute; right: 12%; bottom: 50px; display: flex; align-items: center; gap: 8px; color: #bfd9cb; font-size: 12px; }
.aside-orbit { position: absolute; border: 1px solid rgba(226, 244, 235, .2); border-radius: 50%; }
.orbit-one { width: 600px; height: 600px; top: 8%; right: -28%; }
.orbit-two { width: 350px; height: 350px; top: 30%; right: 4%; border-color: rgba(255, 199, 39, .35); }

.splash-page { position: relative; display: grid; min-height: 100vh; place-items: center; overflow: hidden; background: var(--deep); color: #f5faf7; }
.splash-content { position: relative; z-index: 1; width: min(700px, calc(100% - 48px)); text-align: center; }
.splash-logo { width: 220px; max-width: 70%; margin-bottom: 70px; }
.splash-content h1 { margin: 18px 0 22px; font-size: clamp(50px, 8vw, 92px); font-weight: 400; letter-spacing: -.075em; line-height: .94; }
.splash-content h1 em { color: var(--yellow); font-style: normal; }
.splash-content p { max-width: 510px; margin: 0 auto 28px; color: #c5d9cf; font-size: 17px; line-height: 1.7; }
.splash-footer { position: absolute; right: 30px; bottom: 26px; color: #b9d2c6; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.splash-orb { position: absolute; width: 700px; height: 700px; top: -12%; right: -12%; border: 1px solid rgba(233, 247, 239, .16); border-radius: 50%; box-shadow: 0 0 0 90px rgba(233, 247, 239, .025), 0 0 0 180px rgba(233, 247, 239, .025); }

@media (max-width: 1120px) {
    .sidebar { width: 220px; flex-basis: 220px; }
    .page-wrap { padding: 34px 28px 54px; }
    .dashboard-grid, .admin-layout { grid-template-columns: 1fr; }
    .wide-card, .setup-card { grid-column: auto; grid-row: auto; }
    .admin-side-stack { grid-template-columns: 1fr 1fr; }
    .client-table-card { overflow-x: auto; }
    .client-table { min-width: 940px; }
}
@media (max-width: 760px) {
    .app-shell { display: block; }
    .sidebar { position: relative; width: 100%; min-height: auto; padding: 20px 18px 14px; }
    .brand-lockup { padding: 0 6px 16px; }
    .brand-logo { width: 145px; }
    .mobile-nav-toggle { position: absolute; top: 21px; right: 18px; display: block; padding: 7px 10px; border: 1px solid currentColor; border-radius: 6px; background: transparent; color: inherit; font-size: 12px; }
    .nav-links { display: none; }
    .sidebar.is-open .nav-links { display: grid; padding: 8px 0 4px; }
    .nav-link { min-height: 40px; }
    .manager-card { display: none; }
    .sidebar-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding: 12px 6px 0; }
    .signout { margin-top: 0; }
    .main-content { min-height: calc(100vh - 116px); }
    .page-wrap { padding: 28px 18px 46px; }
    .page-header, .admin-toolbar { display: grid; align-items: start; }
    .page-header { gap: 16px; margin-bottom: 22px; }
    .page-header h1, .client-header h1 { font-size: 32px; }
    .header-actions { justify-content: flex-start; }
    .card { padding: 19px 17px; }
    .metric-row { gap: 10px; }
    .metric-row strong { font-size: 19px; }
    .metric-row small { font-size: 10px; }
    .table-head, .table-row { grid-template-columns: 60px 1fr 1fr 110px; gap: 10px; }
    .activity-table { overflow-x: auto; min-width: 650px; }
    .collection-card { padding: 0 17px; }
    .collection-row { align-items: flex-start; flex-direction: column; gap: 14px; }
    .collection-meta { min-width: 0; text-align: left; }
    .decision-form { width: 100%; }
    .decision-form .button { flex: 1; }
    .admin-side-stack, .settings-grid { grid-template-columns: 1fr; }
    .filter-tabs { overflow-x: auto; flex-wrap: nowrap; }
    .search-form input { width: 100%; }
    .search-form { width: 100%; }
    .auth-page { display: block; }
    .auth-panel { width: min(100% - 36px, 510px); padding: 30px 0 45px; }
    .auth-brand { margin-bottom: 52px; }
    .auth-aside { min-height: 360px; padding: 50px 28px; }
    .auth-aside h2 { font-size: 45px; }
    .aside-foot { right: 28px; bottom: 25px; }
    .splash-logo { margin-bottom: 50px; }
    .splash-content h1 { font-size: 54px; }
}
