@font-face {
    font-family: "DM Sans";
    src: url("./fonts/dm-sans.woff2") format("woff2");
    font-weight: 400 700;
    font-display: swap;
}
@font-face {
    font-family: "Instrument Serif";
    src: url("./fonts/instrument-serif.woff2") format("woff2");
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: "Material Symbols";
    src: url("./fonts/material-symbols.woff2") format("woff2");
    font-display: block;
}

:root {
    color-scheme: light;
    --ink: #25211d;
    --muted: #675f55;
    --paper: #f6f4f0;
    --white: #fffefa;
    --gold: #e5c486;
    --accent: #795120;
    --gold-wash: #f7efdf;
    --line: #e7e0d6;
    --dark: #191817;
    --sidebar-width: 236px;
    --page-width: 1510px;
    --page-gutter: clamp(16px, 2.8vw, 44px);
    --control-height: 44px;
    --radius: 14px;
    --shadow: 0 2px 3px #29201606, 0 8px 24px #29201606;
    font: 15px/1.5 "DM Sans", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid #956225; outline-offset: 3px; }
.skip { position: fixed; inset: 8px auto auto 8px; z-index: 20; transform: translateY(-150%); background: white; padding: 8px 12px; }
.skip:focus { transform: none; }
.icon {
    display: inline-block;
    flex: 0 0 auto;
    width: 1em;
    overflow: hidden;
    font: 400 21px/1 "Material Symbols", sans-serif;
    font-feature-settings: "liga";
    letter-spacing: normal;
    white-space: nowrap;
    user-select: none;
}
.icon-button {
    display: inline-grid;
    place-items: center;
    flex: 0 0 42px;
    width: 42px;
    min-height: 42px;
    padding: 0;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--white);
    text-decoration: none;
}
.icon-button:hover, .icon-button[aria-current] { background: var(--gold-wash); }

.shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100dvh; }
.shell.menu-collapsed { grid-template-columns: minmax(0, 1fr); }
.sidebar {
    position: sticky;
    top: 0;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--dark);
    color: #f8f2e7;
    border-right: 1px solid #342c24;
    padding: 0 15px;
}
.menu-collapsed .sidebar { display: none; }
.sidebar-brand { display: flex; justify-content: center; align-items: center; flex: 0 0 105px; border-bottom: 1px solid #ffffff18; }
.brand { display: flex; align-items: center; justify-content: center; height: 98px; width: 168px; overflow: hidden; }
.brand img { display: block; flex-shrink: 0; width: 166px; height: auto; max-width: none; }
.sidebar-nav { min-height: 0; overflow-y: auto; padding: 12px 2px; scrollbar-width: thin; scrollbar-color: #615343 transparent; }
.nav-group { padding: 0; margin: 0 0 16px; border: 0; background: none; box-shadow: none; }
.nav-group summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 36px;
    padding: 0 10px;
    color: #c8b7a3;
    font-size: .69rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    list-style: none;
}
.nav-group summary::-webkit-details-marker, .profile summary::-webkit-details-marker { display: none; }
.nav-chevron { width: 7px; height: 7px; border-right: 1.5px solid; border-bottom: 1.5px solid; transform: rotate(-45deg); }
.nav-group[open] .nav-chevron { transform: translateY(-2px) rotate(45deg); }
.nav-group ul { padding: 0; margin: 2px 0 0; list-style: none; }
.nav-group li + li { margin-top: 3px; }
.nav-group a {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #e1d9ce;
    font-weight: 500;
    text-decoration: none;
}
.nav-group a .icon { color: #bfa98d; font-size: 19px; }
.nav-group a:hover { background: #ffffff10; }
.nav-group a[aria-current] { background: #453626; border-color: #6b5337; color: #f7d9a2; font-weight: 700; }
.nav-group a[aria-current] .icon { color: inherit; }
.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 3px 19px;
    margin-top: auto;
    flex-shrink: 0;
    border-top: 1px solid #ffffff18;
    font-size: .86rem;
    font-weight: 700;
}
.sidebar-footer small { display: block; color: #c8b7a3; font-weight: 400; }
.office-avatar, .profile-avatar, .list-avatar {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: var(--accent);
    background: var(--gold-wash);
    font-weight: 700;
}
.office-avatar { border: 1px solid #735a3a; border-radius: 9px; color: var(--gold); background: #342a20; }
.sidebar-close, .menu-backdrop { display: none; }

.workspace { min-width: 0; }
.top {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 69px;
    padding: 9px max(var(--page-gutter), calc((100% - var(--page-width)) / 2 + var(--page-gutter)));
    background: var(--white);
    border-bottom: 1px solid var(--line);
}
.breadcrumb { display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--muted); font-size: .87rem; }
.breadcrumb .icon { font-size: 16px; }
.breadcrumb strong { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.top-search { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 11px; border-radius: 8px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.top-search:hover { background: var(--gold-wash); color: var(--ink); }
.profile { position: relative; padding: 0; margin: 0; border: 0; box-shadow: none; background: none; }
.profile summary {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    padding: 3px 6px;
    border: 1px solid transparent;
    border-radius: 8px;
    list-style: none;
}
.profile summary:hover, .profile[open] summary { background: var(--paper); border-color: var(--line); }
.profile summary > .icon { font-size: 17px; color: var(--muted); }
.profile-name { display: block; max-width: 15ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; line-height: 1.2; }
.profile-name small { display: block; color: var(--muted); font-size: .74rem; margin-top: 3px; font-weight: 500; }
.profile-links {
    position: absolute;
    inset: calc(100% + 7px) 0 auto auto;
    display: grid;
    gap: 3px;
    min-width: 173px;
    padding: 6px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow);
}
.profile-links a, .profile-links button {
    display: flex;
    justify-content: flex-start;
    width: 100%;
    align-items: center;
    min-height: 42px;
    padding: 7px 10px;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--ink);
    text-decoration: none;
}
.profile-links a:hover, .profile-links button:hover { background: var(--gold-wash); }

main { max-width: var(--page-width); margin: auto; padding: 26px var(--page-gutter) 48px; }
h1, h2, h3 { margin: 0 0 14px; line-height: 1.2; font-weight: 700; letter-spacing: -.025em; }
h1 { font-size: clamp(1.85rem, 3.1vw, 2.6rem); letter-spacing: -.045em; }
h2 { font-size: 1.35rem; margin-top: 23px; }
h3 { font-size: 1.06rem; }
.panel > h2:first-child { margin-top: 0; }
p { margin: 0 0 14px; }
.panel, .card, details {
    min-width: 0;
    padding: 18px;
    margin: 0 0 15px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow);
}
.grid, .metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 12px; }
.metrics .card { margin: 0 0 10px; }
.metrics strong { display: block; font-size: 1.43rem; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.card small, .muted { color: var(--muted); }
.actions, .tabs, .pager { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0; }
.tabs { gap: 5px; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.tabs a { padding: 7px 10px; border-radius: 6px; text-decoration: none; }
.tabs a:hover, .tabs a[aria-current] { background: var(--gold-wash); }
.pager { justify-content: center; color: var(--muted); }
.btn, button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--control-height);
    padding: 8px 15px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--gold);
    color: #2b2013;
    text-decoration: none;
    font: 700 .94rem/1.3 "DM Sans", system-ui, sans-serif;
    cursor: pointer;
}
button:hover, .btn:hover { background: #efd7a9; }
button[aria-busy] { opacity: .65; }
form { margin: 0; }
label { display: grid; gap: 5px; margin: 0 0 11px; font-weight: 700; font-size: .9rem; }
.grid > label:not(.check) { display: flex; flex-direction: column; }
.grid > label > :is(input, select):not([type=checkbox]) { margin-top: auto; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
input, select, textarea {
    width: 100%;
    min-width: 0;
    min-height: var(--control-height);
    padding: 8px 11px;
    border: 1px solid #bfb4a5;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-weight: 400;
}
select:not([multiple]) {
    appearance: none;
    padding-inline-end: 32px;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--muted) 50%),
        linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: right 16px center, right 11px center;
    background-size: 5px 5px;
    background-repeat: no-repeat;
}
input[type=checkbox] { width: 18px; min-height: 18px; accent-color: #795120; }
textarea { min-height: 96px; }
summary { cursor: pointer; font-weight: 700; }
details[open] > summary { margin-bottom: 12px; }
.nav-group[open] > summary, .profile[open] > summary { margin-bottom: 0; }
.flash, .error, .empty { padding: 12px 15px; border-radius: 8px; background: #e9f2e7; overflow-wrap: anywhere; }
.error { background: #fbe7e4; color: #742d28; }
.empty { background: var(--gold-wash); color: #5e4e39; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.table-wrap { overflow: auto; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 11px; }
table { width: 100%; border-collapse: collapse; background: var(--white); }
th, td { text-align: left; padding: 12px 13px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
th { background: #f1ebe1; color: #504637; font-size: .88rem; }
tr:last-child td { border-bottom: 0; }

.dashboard-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    align-items: center;
    min-height: 222px;
    padding: clamp(22px, 3vw, 39px);
    border: 1px solid #332820;
    border-radius: 17px;
    background: radial-gradient(ellipse at 90% 30%, #4a3623 0, transparent 66%), #211c17;
    box-shadow: 0 5px 18px #30241c18;
    color: #fff9ee;
}
.dashboard-hero::after, .auth-login .auth-brand::after {
    position: absolute;
    z-index: -1;
    inset: 0;
    content: "";
    pointer-events: none;
    background: repeating-radial-gradient(ellipse 305px 220px at 92% 130%, transparent 0 32px, #d7af742a 33px 34px, transparent 35px 54px);
    mask-image: linear-gradient(95deg, transparent 34%, black);
}
.hero-date { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: #edcca0; font-size: .9rem; font-weight: 600; }
.hero-date .icon { font-size: 18px; }
.dashboard-hero h1 { margin-bottom: 5px; font-size: clamp(2.1rem, 4vw, 3.5rem); line-height: 1.04; }
.hero-greeting { margin-bottom: 18px; color: #eaded0; font-size: 1.08rem; overflow-wrap: anywhere; }
.hero-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.hero-secondary { border-color: #b9a18a; background: #291f19; color: #fff3e0; }
.hero-secondary:hover { background: #473425; }
.dashboard-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 13px;
    margin: 17px 0;
}
.summary-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 100px;
    min-width: 0;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: var(--ink);
    background: var(--white);
    text-decoration: none;
}
.summary-card:hover { border-color: #bd9e72; background: #fffcf6; }
.summary-card > .icon { margin-left: auto; color: var(--accent); font-size: 17px; }
.section-icon { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: var(--gold-wash); color: var(--accent); flex: 0 0 auto; }
.summary-text { display: grid; align-content: center; min-width: 0; gap: 3px; }
.summary-text > span { color: var(--muted); font-size: .82rem; font-weight: 600; line-height: 1.22; }
.summary-text strong { font-size: 1.64rem; line-height: 1.05; font-variant-numeric: tabular-nums; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 15px; margin-bottom: 15px; }
.dashboard-panel { min-width: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.dashboard-panel-heading { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 65px; padding: 12px 17px; border-bottom: 1px solid var(--line); }
.dashboard-panel-heading h2 { margin: 0; font-size: 1.1rem; }
.task-create { margin-bottom: 18px; }
.task-form-body { padding: 18px 17px; }
.task-form-body > label { margin-bottom: 16px; }
.task-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.task-fields label { margin-bottom: 0; }
.task-form-footer {
    display: flex;
    justify-content: flex-end;
    padding: 10px 17px;
    border-top: 1px solid var(--line);
    border-radius: 0 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px);
    background: #faf7f0;
}
.task-list .table-wrap { margin: 0; border: 0; border-radius: 0 0 var(--radius) var(--radius); }
.task-list th, .task-list td { padding-inline: 17px; vertical-align: middle; }
.task-list .pill { display: inline-block; margin: 0; }
.task-list .task-done { background: #e9f2e7; color: #345238; }
.task-list td button {
    padding-inline: 11px;
    border-color: var(--line);
    background: var(--white);
    color: var(--accent);
}
.task-list td button:hover { background: var(--gold-wash); }
.section-link, .period-label { margin-left: auto; font-size: .86rem; }
.section-link { text-decoration: none; font-weight: 700; }
.section-link:hover { text-decoration: underline; }
.dashboard-shortcuts { margin-bottom: 15px; }
.shortcut-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 15px 17px;
    margin: 0;
    list-style: none;
}
.shortcut-list:has(> li:nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.shortcut-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 88px;
    height: 100%;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #faf7f0;
    color: var(--ink);
    text-align: center;
    text-decoration: none;
    font-weight: 700;
    line-height: 1.25;
}
.shortcut-tile .icon { color: var(--accent); font-size: 24px; }
.shortcut-tile:hover, .shortcut-tile:focus-visible {
    border-color: #bd9e72;
    background: var(--gold-wash);
}
#nova-tarefa, #novo-lancamento { scroll-margin-top: 85px; }
.dashboard-list { padding: 0 17px; margin: 0; list-style: none; }
.dashboard-list li { display: flex; align-items: center; gap: 11px; min-height: 61px; padding: 9px 0; }
.dashboard-list li + li { border-top: 1px solid var(--line); }
.event-date {
    display: grid;
    place-content: center;
    text-align: center;
    flex: 0 0 42px;
    min-height: 43px;
    border-radius: 8px;
    color: var(--accent);
    background: var(--gold-wash);
    line-height: 1;
}
.event-date strong { font-size: 1.1rem; }
.event-date span { margin-top: 3px; font-size: .71rem; text-transform: uppercase; }
.list-label { font-weight: 700; overflow-wrap: anywhere; min-width: 0; }
.list-label a { color: var(--ink); text-decoration: none; }
.list-label a:hover { text-decoration: underline; }
.list-label small { display: block; margin-top: 2px; color: var(--muted); font-weight: 500; }
.pill { margin-left: auto; flex: 0 0 auto; padding: 4px 8px; border-radius: 16px; background: var(--gold-wash); color: var(--accent); font-size: .78rem; font-weight: 700; }
.dashboard-empty { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 9px; min-height: 135px; margin: 0; padding: 18px; text-align: center; color: var(--muted); }
.dashboard-empty .icon { color: #9b754b; font-size: 31px; }
.dashboard-report { margin-bottom: 15px; }
.dashboard-panel-body { padding: 16px 17px 0; }
.period-label { color: var(--muted); }
.period-filter { display: flex; align-items: end; flex-wrap: wrap; gap: 9px; margin: 0 0 18px; }
.period-filter label { margin: 0; }
.dashboard-finance { margin-bottom: 15px; }
.receivable-totals {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
    padding: 20px 17px;
}
.receivable-totals dt {
    color: var(--muted);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .055em;
    text-transform: uppercase;
}
.receivable-totals dd {
    margin: 3px 0 0;
    font-size: clamp(1.25rem, 2.5vw, 1.65rem);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}
.dashboard-finance-footer {
    padding: 4px 17px;
    border-top: 1px solid var(--line);
    border-radius: 0 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px);
    background: #faf7f0;
}
.dashboard-finance-footer a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 44px;
    font-weight: 700;
    text-decoration: none;
}
.dashboard-finance-footer a:hover { text-decoration: underline; }
.dashboard-finance-footer .icon { font-size: 17px; }

.auth { display: grid; place-items: center; min-height: 100dvh; background: var(--paper); }
.auth-wrap { width: min(calc(100% - 32px), 480px); margin: 22px auto; }
.auth-brand { display: grid; place-content: center; justify-items: center; height: 111px; overflow: hidden; border-radius: 15px 15px 0 0; background: var(--dark); }
.auth-brand img { width: 174px; height: auto; }
.auth main { padding: 24px; border: 1px solid var(--line); border-radius: 0 0 15px 15px; background: var(--white); box-shadow: var(--shadow); }
.auth h1 { font-size: clamp(1.65rem, 4vw, 2.16rem); overflow-wrap: anywhere; }
.auth-login .auth-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    width: min(calc(100% - 56px), 1030px);
    min-height: 526px;
    border: 1px solid var(--line);
    border-radius: 21px;
    background: var(--white);
    box-shadow: 0 18px 54px #31251c17;
}
.auth-login .auth-brand {
    position: relative;
    isolation: isolate;
    align-content: center;
    height: auto;
    min-height: 100%;
    border-radius: 20px 0 0 20px;
    background: radial-gradient(ellipse at 85% 95%, #3f2f22 0, transparent 68%), #191817;
}
.auth-login .auth-brand::after { mask-image: linear-gradient(0deg, black, transparent 62%); }
.auth-login .auth-brand img { width: min(360px, 100%); margin: -55px 0 -83px; }
.auth-brand-caption { position: relative; color: #eacb9b; font: 400 clamp(1.2rem, 2.3vw, 1.8rem)/1.2 "Instrument Serif", Georgia, serif; text-align: center; padding: 0 18px; }
.auth-login main { width: 100%; max-width: none; align-self: center; padding: clamp(28px, 5vw, 64px); border: 0; border-radius: 20px; box-shadow: none; }
.auth-intro { color: var(--muted); margin-bottom: 25px; }
.auth-field { position: relative; display: flex; align-items: center; margin: 0 0 16px; }
.auth-field > .icon { position: absolute; left: 13px; color: var(--accent); pointer-events: none; font-size: 20px; }
.auth-field input { min-height: 48px; padding-left: 42px; }
.auth-field input[name=password] { padding-right: 45px; }
.auth-field .password-toggle { position: absolute; right: 3px; display: grid; width: 40px; padding: 0; border: 0; color: var(--accent); background: transparent; }
.auth-field .password-toggle:hover { background: var(--gold-wash); }
.login-recovery { text-align: right; font-size: .9rem; }
.login-submit { width: 100%; min-height: 48px; }
.login-submit .icon { font-size: 18px; }

.agenda-heading, .agenda-toolbar, .agenda-period, .agenda-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.agenda-heading, .agenda-toolbar { justify-content: space-between; }
.agenda-heading {
    padding-bottom: 19px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--line);
}
.agenda-heading h1 { margin-bottom: 5px; }
.agenda-heading p { margin: 0; }
.agenda-secondary {
    background: var(--white);
    color: var(--accent);
    border-color: var(--line);
}
.agenda-secondary:hover { background: var(--gold-wash); }
.agenda-toolbar { margin-bottom: 15px; }
.agenda-period h2 { margin: 0; font-size: 1.1rem; }
.agenda-period .icon-button, .agenda-day-heading .icon-button {
    flex-basis: 36px;
    width: 36px;
    min-height: 36px;
}
.agenda-period .btn { min-height: 36px; }
.agenda-modes {
    display: flex;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--white);
}
.agenda-modes a {
    padding: 7px 11px;
    border-radius: 6px;
    color: var(--muted);
    font-weight: 600;
    text-decoration: none;
}
.agenda-modes a:hover { background: var(--paper); }
.agenda-modes a[aria-current] { background: var(--gold-wash); color: var(--accent); }
.agenda-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 15px; align-items: start; }
.agenda-calendar { overflow: hidden; }
.agenda-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1px;
    background: var(--line);
}
.agenda-weekday {
    padding: 10px 3px;
    background: #faf7f0;
    color: var(--muted);
    font-size: .76rem;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
}
.agenda-date {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3px;
    min-height: 57px;
    padding: 7px;
    background: var(--white);
    color: var(--ink);
    text-decoration: none;
    font-variant-numeric: tabular-nums;
}
.agenda-date.outside { color: var(--muted); background: #f9f7f3; }
a.agenda-date:hover { background: #fcf6ea; }
.agenda-date[aria-current] {
    background: var(--gold-wash);
    box-shadow: inset 0 0 0 2px #b98c50;
    color: var(--accent);
    font-weight: 700;
}
.agenda-date:focus-visible { outline-offset: -3px; }
.agenda-date time {
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    flex: 0 0 auto;
    border-radius: 50%;
}
.agenda-date.today time { background: var(--accent); color: #fff; font-weight: 700; }
.agenda-count {
    min-width: 20px;
    padding: 2px 4px;
    border-radius: 5px;
    background: #f0e4d1;
    color: var(--accent);
    font-size: .71rem;
    font-weight: 700;
    text-align: center;
}
.agenda-day { scroll-margin-top: 80px; }
.agenda-day-header { padding: 11px 12px 13px; border-bottom: 1px solid var(--line); }
.agenda-day-heading { display: flex; align-items: center; justify-content: space-between; gap: 5px; margin-bottom: 10px; }
.agenda-day-heading h2 { margin: 0; color: var(--accent); font-size: 1rem; text-align: center; }
.agenda-date-form { display: flex; align-items: center; gap: 8px; }
.agenda-date-form input { flex: 1 1 auto; }
.agenda-date-form button { flex: 0 0 auto; padding-inline: 10px; }
.agenda-date-form label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
.agenda-events { padding-inline: 12px; }
.agenda-event-time { flex-shrink: 0; font-size: .9rem; font-weight: 700; color: var(--accent); }
.agenda-upcoming .table-wrap { margin: 0; border: 0; border-radius: 0 0 var(--radius) var(--radius); }

@media (max-width: 1080px) {
    .agenda-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 540px) {
    .agenda-date { min-height: 46px; padding: 2px 0 11px; justify-content: center; }
    .agenda-date time { width: 23px; height: 23px; }
    .agenda-count { position: absolute; bottom: 1px; padding: 0 3px; min-width: 14px; font-size: .66rem; line-height: 1.1; }
    .agenda-period { gap: 7px; }
    .agenda-heading { padding-bottom: 13px; }
    .agenda-upcoming .table-wrap { margin: 10px 12px 0; }
}

@media (max-width: 1100px) {
    .dashboard-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .summary-card { min-height: 80px; }
}
@media (max-width: 850px) {
    .shell, .shell.menu-collapsed { display: block; }
    .sidebar { position: static; height: auto; }
    .sidebar-nav { overflow: visible; }
    .js-nav .sidebar { display: none; position: fixed; z-index: 7; inset: 0 auto 0 0; width: min(285px, 86vw); height: 100dvh; }
    .js-nav .sidebar-nav { overflow-y: auto; }
    .js-nav .sidebar-brand { justify-content: space-between; }
    .js-nav .sidebar-close { display: inline-grid; background: #30271f; border-color: #614c34; color: #f5dfc2; }
    .js-nav.menu-open .sidebar { display: flex; }
    .js-nav.menu-open .menu-backdrop {
        position: fixed; inset: 0; z-index: 6; display: block;
        width: 100%; height: 100%; border-radius: 0; background: #1c1611a6;
    }
    .js-nav.menu-open { overflow: hidden; }
}
@media (min-width: 851px) and (max-height: 800px) {
    .sidebar-brand { flex-basis: 88px; }
    .sidebar-nav { padding-block: 8px; }
    .nav-group { margin-bottom: 9px; }
    .nav-group summary { min-height: 28px; }
    .nav-group a { min-height: 36px; padding-block: 6px; }
    .nav-group li + li { margin-top: 1px; }
    .sidebar-footer { padding-block: 10px; }
}
@media (max-width: 640px) {
    main { padding-top: 19px; }
    .top { min-height: 60px; gap: 8px; padding-block: 8px; }
    .top-actions { gap: 5px; }
    .top-search { min-width: 38px; padding: 0 6px; justify-content: center; }
    .top-search span:not(.icon), .breadcrumb > span, .profile-name, .profile summary > .icon { display: none; }
    .breadcrumb { font-size: .82rem; }
    .profile summary { padding: 2px; }
    .dashboard-hero { min-height: 201px; padding: 19px; }
    .dashboard-summary { gap: 8px; margin: 12px 0; }
    .summary-card { padding: 9px; gap: 7px; min-height: 82px; }
    .summary-card .section-icon { width: 29px; height: 29px; }
    .summary-card .section-icon .icon { font-size: 17px; }
    .summary-card > .icon { display: none; }
    .summary-text > span { font-size: .77rem; }
    .summary-text strong { font-size: 1.38rem; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-panel-heading { padding: 11px 12px; gap: 7px; }
    .dashboard-panel-heading h2 { font-size: 1rem; }
    .task-form-body { padding: 14px 12px; }
    .task-fields { grid-template-columns: 1fr; }
    .task-form-footer { padding-inline: 12px; }
    .task-form-footer button { width: 100%; }
    .section-link { font-size: .79rem; }
    .period-label { margin: 0; width: 100%; }
    .period-filter label { flex: 1 1 130px; }
    .dashboard-list { padding: 0 12px; }
    .auth-login .auth-wrap { grid-template-columns: 1fr; width: min(calc(100% - 24px), 450px); min-height: 0; border-radius: 16px; }
    .auth-login .auth-brand { min-height: 147px; border-radius: 15px 15px 0 0; }
    .auth-login .auth-brand img { width: 205px; margin: -42px 0 -56px; }
    .auth-brand-caption { font-size: 1.13rem; margin: 0 0 15px; }
    .auth-login main { border-radius: 0 0 15px 15px; padding: 24px 20px; }
    input, select, textarea { font-size: 16px; }
}
@media (max-width: 540px) {
    .shortcut-list { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; }
    .receivable-totals { grid-template-columns: 1fr; gap: 0; padding: 3px 12px; }
    .receivable-totals > div {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 10px;
        padding: 12px 0;
    }
    .receivable-totals > div + div { border-top: 1px solid var(--line); }
    .receivable-totals dd { margin: 0; text-align: right; }
    .dashboard-finance-footer { padding-inline: 12px; }
}
@media (max-width: 760px) {
    .table-wrap { border: 0; border-radius: 0; }
    table, tbody, tr, td { display: block; }
    table { background: transparent; }
    thead { position: absolute; clip-path: inset(50%); }
    tr { margin-bottom: 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--white); }
    td, tr:last-child td { display: grid; grid-template-columns: minmax(85px, 30%) minmax(0, 1fr); gap: 8px; padding: 8px; border-bottom: 1px solid var(--line); }
    td::before { content: attr(data-label); font-weight: 700; }
    td:last-child, tr:last-child td:last-child { border-bottom: 0; }
    .task-list .table-wrap { margin: 10px 12px 0; }
    .task-list td { padding-inline: 8px; }
}
@media print {
    .sidebar, .top, .actions, .hero-actions, form, .skip, .menu-backdrop { display: none !important; }
    .shell { display: block; }
    main { padding: 0; }
}

.clients-heading {
    padding-bottom: 19px;
    margin-bottom: 21px;
    border-bottom: 1px solid var(--line);
}
.clients-heading h1 { margin-bottom: 5px; }
.clients-heading p { margin: 0; }
.clients-toolbar {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    position: relative;
    gap: 10px;
    margin-bottom: 19px;
}
.clients-search {
    display: flex;
    align-items: center;
    flex: 1 1 340px;
    gap: 8px;
    min-height: var(--control-height);
    padding: 0 6px 0 12px;
    border: 1px solid #bfb4a5;
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
}
.clients-search:focus-within { border-color: var(--accent); }
.clients-search input {
    flex: 1 1 auto;
    min-height: 42px;
    padding: 4px 2px;
    border: 0;
    border-radius: 2px;
    background: transparent;
}
.clients-search input::placeholder { text-overflow: ellipsis; }
.clients-search button {
    min-height: 32px;
    padding: 5px 10px;
    border: 0;
    background: var(--gold-wash);
    color: var(--accent);
}
.clients-search button:hover, .client-secondary:hover { background: #f2e4cb; }
.clients-advanced { padding: 0; margin: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.client-secondary {
    border-color: #d6c9b9;
    background: var(--white);
    color: var(--accent);
}
.clients-advanced > summary { list-style: none; }
.clients-advanced > summary::-webkit-details-marker { display: none; }
.clients-advanced > summary .icon { font-size: 17px; transform: rotate(90deg); }
.clients-advanced[open] > summary { margin: 0; background: var(--gold-wash); }
.clients-advanced[open] > summary .icon { transform: rotate(-90deg); }
.clients-filter-icon {
    flex: 0 0 16px;
    width: 16px;
    height: 12px;
    background:
        linear-gradient(currentColor, currentColor) top center / 16px 2px,
        linear-gradient(currentColor, currentColor) center / 10px 2px,
        linear-gradient(currentColor, currentColor) bottom center / 4px 2px;
    background-repeat: no-repeat;
}
.clients-filter-panel {
    position: absolute;
    z-index: 2;
    inset: 53px 0 auto;
    padding: 16px;
    box-shadow: 0 6px 20px #29201626;
}
.clients-filter-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; justify-content: flex-end; }
.clients-filter-actions label { margin: 0 auto 0 0; }
.clients-create { margin-inline-start: auto; white-space: nowrap; }
.clients-plus { font-size: 1.45em; font-weight: 500; line-height: 1; }
.clients-applied { flex: 1 0 100%; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.client-chip, .clients-clear {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 99px;
    padding: 4px 10px;
    font-size: .85rem;
}
.client-chip {
    border: 1px solid #e9d8bc;
    background: var(--gold-wash);
    color: var(--accent);
    overflow-wrap: anywhere;
}
.clients-clear { color: var(--muted); border: 1px solid var(--line); text-decoration: none; }
.clients-clear .icon { font-size: 15px; }
.clients-clear:hover { background: var(--white); color: var(--ink); }
.clients-results .table-wrap { border: 0; border-radius: var(--radius) var(--radius) 0 0; margin: 0; }
.clients-result-name { font-weight: 700; }
.clients-empty {
    display: grid;
    place-content: center;
    justify-items: center;
    min-height: clamp(220px, 36vh, 340px);
    padding: 24px 14px;
    text-align: center;
}
.clients-empty-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    border-radius: 50%;
    background: var(--gold-wash);
    color: var(--accent);
}
.clients-empty-icon .icon { font-size: 36px; }
.clients-empty h2 { margin: 0 0 5px; font-size: 1.16rem; }
.clients-empty p { margin: 0; color: var(--muted); }
.clients-results-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 13px 17px;
    border-top: 1px solid #e9d8bc;
    border-radius: 0 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px);
    background: var(--gold-wash);
    color: var(--accent);
    font-size: .9rem;
}
.clients-results-footer .pager { margin: 0; }

.client-editor {
    display: grid;
    grid-template-columns: minmax(166px, 225px) minmax(0, 1fr);
    align-items: start;
    gap: clamp(14px, 2.6vw, 38px);
    margin-bottom: 19px;
}
.client-editor-rail {
    position: sticky;
    top: 88px;
    max-height: calc(100dvh - 100px);
    overflow: auto;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.client-editor-title {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 12px;
    border-bottom: 1px solid var(--line);
}
.client-editor-title :is(h1, h2) { margin: 0; font-size: 1.12rem; letter-spacing: -.025em; }
.client-editor-nav { display: grid; gap: 3px; padding: 9px; }
.client-editor-nav a {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 39px;
    padding: 7px 8px;
    border-radius: 7px;
    color: var(--muted);
    font-size: .92rem;
    text-decoration: none;
}
.client-editor-nav a::before {
    content: "";
    flex: 0 0 7px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #c7bbac;
}
.client-editor-nav .icon { margin-inline-start: auto; visibility: hidden; font-size: 16px; }
.client-editor-nav a:hover, .client-editor-nav a[aria-current] { background: var(--gold-wash); color: var(--accent); }
.client-editor-nav a[aria-current] { font-weight: 700; }
.client-editor-nav a[aria-current]::before { background: var(--accent); }
.client-editor-nav a[aria-current] .icon { visibility: visible; }
.client-editor-actions {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--line);
}
.client-editor-actions .icon { font-size: 17px; }
.client-editor-blocks { min-width: 0; display: grid; gap: 17px; }
.client-block { scroll-margin-top: 88px; }
.client-block .dashboard-panel-heading { display: block; min-height: 0; padding: 15px clamp(14px, 2.2vw, 26px); }
.client-block .dashboard-panel-heading p { margin: 4px 0 0; color: var(--muted); font-size: .92rem; }
.client-block-body { padding: 18px clamp(14px, 2.2vw, 26px); }
.client-block-body p { margin-bottom: 0; }
.client-block-body label { margin: 0; min-width: 0; font-weight: 600; }
.client-block-body label + p { margin-top: 11px; }
.client-fields, .client-fields-pair {
    display: grid;
    gap: 13px 15px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.client-fields-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.client-field-full { grid-column: 1 / -1; }
.client-field-wide { grid-column: span 2; }
.client-required { color: #a33826; }
.client-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 16px;
    border: 1px solid #e9d8bc;
    border-radius: 9px;
    background: var(--gold-wash);
    color: var(--accent);
}
.client-notice > .icon { margin-top: 1px; }
.client-info-icon {
    display: grid;
    place-items: center;
    flex: 0 0 18px;
    height: 18px;
    margin-top: 2px;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1;
}
.client-notice p { margin: 0; }
.client-document-actions { display: grid; gap: 12px; }
.client-inline-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }

@media (min-width: 1250px) {
    .clients-search { flex-basis: 230px; }
    .clients-applied { flex: 0 1 auto; max-width: 35%; min-height: var(--control-height); }
    .clients-create { order: 1; }
}
@media (max-width: 960px) {
    .clients-search { flex-basis: 100%; }
    .clients-filter-panel { inset-block-start: 108px; }
}
@media (max-width: 760px) {
    .clients-results .table-wrap { margin: 12px; }
    .clients-results .table-wrap tr:last-child { margin-bottom: 0; }
    .client-editor { display: flex; flex-direction: column; align-items: stretch; }
    .client-editor-rail { display: contents; }
    .client-editor-title { padding: 0; border: 0; }
    .client-editor-title :is(h1, h2) { font-size: 1.37rem; }
    .client-editor-nav {
        display: flex;
        flex-wrap: wrap;
        padding: 5px;
        border: 1px solid var(--line);
        border-radius: 9px;
        background: var(--white);
    }
    .client-editor-nav a { gap: 5px; min-height: 36px; }
    .client-editor-nav .icon { display: none; }
    .client-editor-actions {
        order: 1;
        grid-template-columns: 1fr 1fr;
        position: sticky;
        bottom: 0;
        z-index: 1;
        border: 1px solid var(--line);
        border-radius: 10px;
        background: var(--white);
        padding: 8px;
        box-shadow: var(--shadow);
    }
    .client-block { scroll-margin-top: 73px; }
}
@media (max-width: 640px) {
    .client-create-page .breadcrumb > .icon { display: inline-block; }
}
@media (max-width: 520px) {
    .client-fields, .client-fields-pair { grid-template-columns: minmax(0, 1fr); }
    .client-field-wide { grid-column: auto; }
    .client-editor-actions .icon { display: none; }
    .client-create-page .top-search { display: none; }
}
@media (max-width: 370px) {
    .clients-toolbar .btn { padding-inline: 8px; gap: 4px; }
    .clients-toolbar .btn .icon { font-size: 16px; }
}
