:root {
    --ink: #17211d;
    --ink-soft: #52605a;
    --green-950: #102e27;
    --green-900: #173f35;
    --green-800: #23584a;
    --green-700: #2f705e;
    --green-100: #dcece6;
    --green-50: #edf6f2;
    --canvas: #f4f1eb;
    --paper: #fffdf9;
    --paper-strong: #ffffff;
    --line: #e1ddd4;
    --line-dark: #d2ccc1;
    --amber: #b97818;
    --amber-bg: #fff3d9;
    --red: #b74335;
    --red-bg: #fce8e4;
    --blue: #3a6695;
    --shadow: 0 12px 34px rgba(37, 45, 40, .07);
    --radius: 18px;
    --sidebar: 258px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, summary { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
    outline: 3px solid rgba(47, 112, 94, .25);
    outline-offset: 2px;
}
.skip-link {
    position: fixed; top: 8px; left: 8px; z-index: 1000; padding: 10px 14px;
    background: #fff; border-radius: 8px; transform: translateY(-150%);
}
.skip-link:focus { transform: none; }
.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 50;
    display: flex; flex-direction: column; padding: 26px 18px 18px;
    background: var(--green-950); color: rgba(255,255,255,.78);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px; color: #fff; }
.brand-mark {
    display: inline-grid; place-items: center; flex: 0 0 auto; width: 38px; height: 38px;
    border-radius: 11px; color: #173f35; background: #d7edc0; font-size: 18px; font-weight: 900;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.45);
}
.brand strong { display: block; font-size: 15px; letter-spacing: -.01em; }
.brand small { display: block; margin-top: 1px; color: rgba(255,255,255,.48); font-size: 11px; }
.main-nav { display: grid; gap: 6px; margin-top: 48px; }
.main-nav a {
    display: flex; align-items: center; gap: 13px; min-height: 46px; padding: 0 14px;
    border-radius: 11px; font-weight: 600; transition: .18s ease;
}
.main-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.main-nav a.active {
    background: rgba(215,237,192,.12); color: #e4f5d2;
    box-shadow: inset 3px 0 0 #b9df95;
}
.nav-icon {
    display: inline-grid; place-items: center; width: 24px; height: 24px;
    color: rgba(255,255,255,.65); font-size: 18px; font-weight: 700;
}
.main-nav a.active .nav-icon { color: #c9eba8; }
.sidebar-footer { margin-top: auto; padding: 16px 10px 4px; border-top: 1px solid rgba(255,255,255,.1); }
.user-chip { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
    display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto;
    border-radius: 50%; background: #d7edc0; color: var(--green-950); font-weight: 800;
}
.user-chip span:last-child { min-width: 0; }
.user-chip strong, .user-chip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip strong { color: #fff; font-size: 12px; }
.user-chip small { color: rgba(255,255,255,.46); font-size: 10px; margin-top: 2px; }
.logout-button {
    width: 100%; margin-top: 13px; padding: 8px 0; border: 0; background: transparent;
    color: rgba(255,255,255,.5); text-align: left; font-size: 12px;
}
.logout-button:hover { color: #fff; }
.page-shell { min-height: 100vh; margin-left: var(--sidebar); }
.main-content { width: min(1460px, 100%); margin: 0 auto; padding: 42px 44px 70px; }
.mobile-header { display: none; }
.sidebar-overlay { display: none; }
.page-header {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px;
}
.page-header h1 { margin: 3px 0 4px; font-size: clamp(30px, 3vw, 43px); line-height: 1.08; letter-spacing: -.045em; }
.page-header p { margin: 0; color: var(--ink-soft); font-size: 15px; }
.eyebrow, .section-kicker {
    color: var(--green-700); font-size: 10px; font-weight: 850; letter-spacing: .14em;
}
.eyebrow.light { color: #badd99; }
.button {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px;
    padding: 9px 16px; border: 1px solid transparent; border-radius: 10px;
    font-weight: 750; font-size: 13px; transition: transform .15s, box-shadow .15s, background .15s;
}
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--green-900); color: #fff; box-shadow: 0 8px 18px rgba(23,63,53,.16); }
.button-primary:hover { background: var(--green-800); box-shadow: 0 10px 22px rgba(23,63,53,.22); }
.button-secondary { border-color: var(--line-dark); background: var(--paper-strong); color: var(--ink); }
.button-secondary:hover { border-color: #aaa399; background: #fff; }
.button-ghost { border-color: transparent; background: transparent; color: var(--ink-soft); }
.button-small { min-height: 34px; padding: 6px 11px; font-size: 12px; }
.button-large { min-height: 50px; padding: 12px 20px; }
.button[disabled] { opacity: .45; pointer-events: none; }
.back-link { display: inline-block; margin-bottom: 11px; color: var(--green-700); font-size: 13px; font-weight: 700; }
.back-link:hover { text-decoration: underline; }
.flash-stack { position: fixed; z-index: 100; top: 20px; right: 24px; width: min(390px, calc(100vw - 32px)); }
.flash {
    display: flex; align-items: center; gap: 11px; margin-bottom: 8px; padding: 13px 14px;
    border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow);
}
.flash > span { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; font-weight: 850; }
.flash p { flex: 1; margin: 0; font-size: 13px; }
.flash button { border: 0; background: transparent; color: var(--ink-soft); font-size: 20px; }
.flash-success > span { background: var(--green-100); color: var(--green-800); }
.flash-danger > span { background: var(--red-bg); color: var(--red); }
.flash-warning > span { background: var(--amber-bg); color: var(--amber); }
.system-alert {
    display: flex; align-items: center; gap: 14px; margin-bottom: 20px; padding: 15px 18px;
    border: 1px solid #efc7bb; border-radius: 13px; background: #fff8f5;
}
.system-alert-icon {
    display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
    background: var(--red-bg); color: var(--red); font-weight: 900;
}
.system-alert div { flex: 1; }
.system-alert strong { font-size: 13px; }
.system-alert p { margin: 2px 0 0; color: var(--ink-soft); font-size: 12px; }
.system-alert a { color: var(--red); font-size: 12px; font-weight: 750; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.metric-card {
    min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 15px;
    background: var(--paper); box-shadow: 0 6px 20px rgba(37,45,40,.035);
}
.metric-top { display: flex; align-items: center; justify-content: space-between; color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.metric-symbol {
    display: grid; place-items: center; width: 27px; height: 27px; border-radius: 8px;
    background: #eeece6; color: var(--ink-soft); font-size: 13px; font-weight: 850;
}
.metric-card > strong { display: block; margin: 13px 0 5px; font-size: clamp(23px, 2.25vw, 31px); line-height: 1; letter-spacing: -.045em; }
.metric-card small { color: #7b837f; font-size: 11px; }
.metric-green { background: #f4faf6; border-color: #cfe1d8; }
.metric-green .metric-symbol { color: var(--green-700); background: var(--green-100); }
.metric-red { background: #fff8f6; border-color: #eed4cd; }
.metric-red .metric-symbol { color: var(--red); background: var(--red-bg); }
.metric-amber { background: #fffbf1; border-color: #efdfb8; }
.metric-amber .metric-symbol { color: var(--amber); background: var(--amber-bg); }
.progress { display: block; width: 100%; height: 4px; margin: 8px 0 6px; overflow: hidden; border: 0; border-radius: 10px; background: #dce8e0; appearance: none; }
.progress::-webkit-progress-bar { border-radius: 10px; background: #dce8e0; }
.progress::-webkit-progress-value { border-radius: 10px; background: var(--green-700); }
.progress::-moz-progress-bar { border-radius: 10px; background: var(--green-700); }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr .75fr; gap: 16px; align-items: start; }
.panel {
    min-width: 0; padding: 22px; border: 1px solid var(--line);
    border-radius: var(--radius); background: var(--paper); box-shadow: 0 8px 24px rgba(37,45,40,.035);
}
.span-2 { grid-column: span 2; }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.panel-header h2 { margin: 2px 0 0; font-size: 19px; letter-spacing: -.025em; }
.panel-header > a { margin-top: 6px; color: var(--green-700); font-size: 12px; font-weight: 750; }
.panel-intro { margin: -8px 0 18px; color: var(--ink-soft); font-size: 12px; }
.payment-list { margin: 0 -8px; }
.payment-row { display: grid; grid-template-columns: 40px minmax(0,1fr) auto 34px; align-items: center; gap: 12px; padding: 12px 8px; border-top: 1px solid #ebe7df; }
.payment-row:first-child { border-top: 0; }
.customer-initial, .table-customer > span {
    display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
    background: #e7edea; color: var(--green-800); font-weight: 850;
}
.payment-name a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 750; }
.payment-name small, .payment-amount small { display: block; color: #818883; font-size: 10px; }
.payment-amount { min-width: 100px; text-align: right; }
.payment-amount strong { font-size: 13px; }
.icon-action {
    display: grid; place-items: center; width: 31px; height: 31px; border: 1px solid var(--line);
    border-radius: 9px; background: #fff; color: var(--ink-soft); font-weight: 850;
}
.icon-action.success:hover { border-color: #acd0bf; background: var(--green-50); color: var(--green-700); }
.timeline { display: grid; gap: 15px; }
.timeline-item { display: flex; align-items: center; gap: 11px; }
.date-badge { display: grid; place-items: center; width: 39px; height: 43px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 9px; background: #f6f4ef; line-height: 1; }
.date-badge strong { font-size: 15px; }
.date-badge small { margin-top: -5px; color: var(--ink-soft); font-size: 9px; }
.timeline-item div { min-width: 0; }
.timeline-item a, .timeline-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline-item a { font-size: 12px; font-weight: 750; }
.timeline-item small { color: var(--ink-soft); font-size: 10px; }
.reminder-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.reminder-card { padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: #f9f7f2; }
.reminder-card.is-due { border-color: #ecc5bd; background: #fff8f6; }
.reminder-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--ink-soft); font-size: 9px; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }
.reminder-card p { margin: 9px 0; font-size: 12px; }
.reminder-card a { color: var(--green-700); font-size: 10px; font-weight: 750; }
.quick-links { display: grid; gap: 9px; }
.quick-links a { display: flex; align-items: center; gap: 11px; padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: #faf8f4; }
.quick-links a:hover { border-color: #bfcfc7; background: var(--green-50); }
.quick-links a > span { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 8px; background: #e6ece8; color: var(--green-800); font-weight: 850; }
.quick-links strong, .quick-links small { display: block; }
.quick-links strong { font-size: 11px; }
.quick-links small { color: var(--ink-soft); font-size: 9px; }
.empty-state { display: flex; align-items: center; justify-content: center; gap: 14px; color: var(--ink-soft); text-align: center; }
.empty-state > span { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 auto; border-radius: 50%; background: var(--green-50); color: var(--green-700); font-weight: 850; }
.empty-state strong, .empty-state h2 { color: var(--ink); }
.empty-state p { margin: 3px 0 0; font-size: 12px; }
.empty-state.compact { justify-content: flex-start; padding: 20px 6px; text-align: left; }
.empty-state.mini { min-height: 88px; }
.empty-state.large { min-height: 300px; flex-direction: column; padding: 50px 20px; }
.empty-state.large > span { width: 58px; height: 58px; font-size: 22px; }
.empty-state.large h2 { margin: 0; font-size: 20px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 18px; }
.search-form { display: flex; align-items: center; gap: 9px; width: min(560px, 100%); padding: 5px 6px 5px 13px; border: 1px solid var(--line-dark); border-radius: 12px; background: #fff; }
.search-form > span { color: var(--ink-soft); font-size: 20px; }
.search-form input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; }
.segmented { display: inline-flex; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: #ebe8e1; }
.segmented a { padding: 7px 13px; border-radius: 8px; color: var(--ink-soft); font-size: 11px; font-weight: 750; white-space: nowrap; }
.segmented a.active { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.page-segmented { margin-bottom: 16px; overflow-x: auto; max-width: 100%; }
.customer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.customer-card { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: 0 7px 20px rgba(37,45,40,.035); }
.customer-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.customer-logo { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--green-100); color: var(--green-900); font-size: 13px; font-weight: 900; }
.customer-logo.large { width: 56px; height: 56px; border-radius: 15px; font-size: 16px; }
.status { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 999px; font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.status:before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-success { color: #227359; background: #e4f3eb; }
.status-warning { color: #9a6414; background: var(--amber-bg); }
.status-danger { color: #a83b30; background: var(--red-bg); }
.status-neutral { color: #66716c; background: #eeece7; }
.status-muted { color: #777c79; background: #e7e5e0; }
.customer-card-title { margin: 16px 0 15px; }
.customer-card-title h2 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; letter-spacing: -.02em; }
.customer-card-title h2 a:hover { color: var(--green-700); }
.customer-card-title p { margin: 3px 0 0; color: var(--ink-soft); font-size: 11px; }
.customer-meta { display: grid; gap: 9px; margin: 0; padding: 13px 0; border-top: 1px solid #ebe7df; border-bottom: 1px solid #ebe7df; }
.customer-meta > div { display: flex; justify-content: space-between; gap: 15px; font-size: 11px; }
.customer-meta dt { color: var(--ink-soft); }
.customer-meta dd { margin: 0; font-weight: 750; text-align: right; }
.customer-contact { display: grid; gap: 5px; min-height: 47px; padding: 13px 0 9px; }
.customer-contact a { overflow: hidden; color: var(--ink-soft); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.customer-contact a:hover { color: var(--green-700); }
.card-action { display: flex; justify-content: space-between; padding-top: 11px; color: var(--green-700); font-size: 11px; font-weight: 800; }
.form-panel { max-width: 900px; }
.form-section-heading { display: flex; align-items: center; gap: 13px; margin-bottom: 20px; }
.form-section-heading > span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--green-100); color: var(--green-800); font-size: 11px; font-weight: 850; }
.form-section-heading h2, .form-section-heading p { margin: 0; }
.form-section-heading h2 { font-size: 17px; }
.form-section-heading p { color: var(--ink-soft); font-size: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { color: #3e4a45; font-size: 11px; font-weight: 750; }
.field small { color: #828985; font-size: 9px; }
.field input, .field select, .field textarea {
    width: 100%; min-height: 43px; padding: 9px 11px; border: 1px solid var(--line-dark);
    border-radius: 9px; outline: 0; background: #fff; color: var(--ink); transition: border .15s, box-shadow .15s;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green-700); box-shadow: 0 0 0 3px rgba(47,112,94,.1); }
.field input::placeholder, .field textarea::placeholder { color: #aaa9a4; }
.form-stack { display: grid; gap: 13px; }
.form-grid .span-2, .settings-form .span-2 { grid-column: span 2; }
.form-panel hr { height: 1px; margin: 28px 0; border: 0; background: var(--line); }
.form-info { display: flex; align-items: center; gap: 12px; align-self: end; min-height: 69px; padding: 12px 14px; border-radius: 10px; background: var(--green-50); }
.form-info > span { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 auto; border-radius: 50%; background: var(--green-100); color: var(--green-800); font-weight: 850; }
.form-info strong, .form-info p { display: block; margin: 0; }
.form-info strong { font-size: 11px; }
.form-info p { margin-top: 2px; color: var(--ink-soft); font-size: 9px; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.customer-detail-header { align-items: center; }
.customer-heading { display: flex; align-items: center; gap: 15px; }
.customer-heading h1 { margin: 0; font-size: 33px; }
.customer-heading p { font-size: 12px; }
.title-line { display: flex; align-items: center; gap: 10px; }
.header-actions, .inline-actions { display: flex; align-items: center; gap: 8px; }
.profile-strip { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 16px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); overflow: hidden; }
.profile-strip > div { position: relative; min-width: 0; padding: 17px 18px 17px 47px; border-left: 1px solid var(--line); }
.profile-strip > div:first-child { border-left: 0; }
.profile-strip > div > span { position: absolute; left: 17px; top: 20px; color: var(--green-700); }
.profile-strip small, .profile-strip strong, .profile-strip a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-strip small { color: var(--ink-soft); font-size: 9px; }
.profile-strip strong, .profile-strip a { margin-top: 3px; font-size: 11px; font-weight: 750; }
.profile-strip a:hover { color: var(--green-700); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, .72fr); gap: 16px; align-items: start; }
.detail-main { display: grid; gap: 16px; }
.detail-side { position: sticky; top: 20px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { padding: 10px 12px; border-bottom: 1px solid var(--line-dark); color: var(--ink-soft); font-size: 9px; text-align: left; text-transform: uppercase; letter-spacing: .07em; }
td { padding: 13px 12px; border-bottom: 1px solid #ebe7df; font-size: 11px; }
tr:last-child td { border-bottom: 0; }
.align-right { text-align: right; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--ink-soft); font-size: 10px; font-weight: 750; }
.text-button:hover { color: var(--ink); text-decoration: underline; }
.text-button.success { color: var(--green-700); }
.text-button.danger { color: var(--red); }
.muted { color: var(--ink-soft); }
.note-composer { margin-bottom: 20px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #f9f7f2; }
.note-composer-footer { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-top: 10px; }
.inline-field { width: min(290px, 100%); }
.notes-timeline { position: relative; display: grid; gap: 0; }
.note-item { position: relative; display: grid; grid-template-columns: 22px 1fr; min-width: 0; }
.note-item:before { content: ""; position: absolute; top: 16px; bottom: -8px; left: 6px; width: 1px; background: var(--line-dark); }
.note-item:last-child:before { display: none; }
.note-dot { position: relative; z-index: 1; width: 13px; height: 13px; margin-top: 4px; border: 3px solid var(--paper); border-radius: 50%; background: var(--green-700); box-shadow: 0 0 0 1px var(--green-700); }
.note-content { min-width: 0; padding: 0 0 20px 5px; }
.note-meta { display: flex; align-items: center; gap: 9px; }
.note-meta time { color: var(--ink-soft); font-size: 9px; }
.remind-chip { padding: 3px 7px; border-radius: 999px; background: var(--amber-bg); color: var(--amber); font-size: 8px; font-weight: 750; }
.note-content p { margin: 7px 0; font-size: 12px; }
.note-item.is-finished { opacity: .58; }
.vault-panel { border-color: #cad9d2; background: #fbfdfb; }
.vault-lock { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; background: var(--green-100); color: var(--green-700); font-size: 8px; }
.credential-list { display: grid; gap: 10px; }
.credential-card { padding: 12px; border: 1px solid #d8e0dc; border-radius: 12px; background: #fff; }
.credential-head { display: flex; align-items: center; gap: 9px; margin-bottom: 11px; }
.credential-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: #e8efeb; color: var(--green-800); font-size: 11px; font-weight: 850; }
.credential-head div { flex: 1; min-width: 0; }
.credential-head strong, .credential-head small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.credential-head strong { font-size: 11px; }
.credential-head small { color: var(--ink-soft); font-size: 9px; }
.mini-link { color: var(--green-700); font-size: 9px; font-weight: 750; }
.credential-field { display: flex; align-items: center; gap: 5px; min-height: 34px; padding: 5px 6px 5px 9px; border-radius: 8px; background: #f5f4f0; }
.credential-field + .credential-field { margin-top: 6px; }
.credential-field span, .credential-field code { flex: 1; min-width: 0; overflow: hidden; font-family: inherit; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.credential-field button { padding: 4px 6px; border: 0; background: transparent; color: var(--green-700); font-size: 9px; font-weight: 750; }
.credential-actions { display: flex; align-items: center; justify-content: flex-end; margin-top: 10px; }
.credential-actions a { color: var(--green-700); font-size: 9px; font-weight: 750; }
.vault-form { margin-top: 14px; border-top: 1px solid #d8e0dc; }
.vault-form summary { padding: 14px 0 0; color: var(--green-700); font-size: 11px; font-weight: 800; list-style: none; }
.vault-form summary::-webkit-details-marker { display: none; }
.vault-form form { margin-top: 14px; }
.payment-toolbar { display: block; }
.filter-form { display: flex; align-items: end; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); }
.compact-field { min-width: 150px; }
.compact-field.grow { flex: 1; }
.compact-field input, .compact-field select { min-height: 38px; padding: 7px 9px; }
.align-end { align-self: end; }
.table-panel { padding: 0; overflow: visible; }
.table-panel table th:first-child, .table-panel table td:first-child { padding-left: 22px; }
.table-panel table th:last-child, .table-panel table td:last-child { padding-right: 22px; }
.table-customer { display: flex; align-items: center; gap: 9px; }
.table-customer > span { width: 31px; height: 31px; border-radius: 8px; font-size: 10px; }
.table-customer strong { font-size: 11px; }
.note-cell { max-width: 210px; overflow: hidden; color: var(--ink-soft); text-overflow: ellipsis; }
.row-menu { position: relative; display: inline-block; text-align: left; }
.row-menu > summary { padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--green-700); font-size: 9px; font-weight: 750; list-style: none; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu-panel { position: absolute; z-index: 20; top: calc(100% + 7px); right: 0; width: 260px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.table-footer { display: flex; justify-content: space-between; padding: 14px 22px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 10px; }
.task-list { margin: -5px 0; }
.task-row { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 16px 4px; border-bottom: 1px solid var(--line); }
.task-row:last-child { border-bottom: 0; }
.task-row.is-overdue { margin: 0 -10px; padding-right: 14px; padding-left: 14px; border-radius: 10px; background: #fff7f4; }
.task-check { display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--line-dark); border-radius: 50%; color: var(--green-700); font-weight: 850; }
.task-main { min-width: 0; }
.task-heading { display: flex; align-items: center; gap: 10px; }
.task-heading a { font-size: 11px; font-weight: 800; }
.task-heading time { color: var(--ink-soft); font-size: 9px; }
.task-main p { margin: 5px 0 0; font-size: 12px; }
.task-actions { display: flex; align-items: center; gap: 9px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.settings-form { margin-top: 8px; }
.settings-form .form-actions { margin-top: 0; }
.test-mail-form { display: flex; align-items: center; gap: 11px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line-dark); }
.test-mail-form small { color: var(--ink-soft); font-size: 9px; }
.health-card { display: flex; align-items: center; gap: 11px; padding: 13px; border-radius: 11px; }
.health-card > span { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; font-weight: 850; }
.health-card strong, .health-card small { display: block; }
.health-card strong { font-size: 11px; }
.health-card small { color: var(--ink-soft); font-size: 9px; }
.health-card.healthy { background: var(--green-50); }
.health-card.healthy > span { background: var(--green-100); color: var(--green-700); }
.health-card.unhealthy { background: var(--red-bg); }
.health-card.unhealthy > span { background: #f4cec6; color: var(--red); }
.error-list { display: grid; gap: 8px; }
.error-list > div { display: flex; gap: 11px; padding: 11px; border-radius: 10px; background: #fff8f6; }
.error-list > div > span { display: grid; place-items: center; width: 24px; height: 24px; flex: 0 0 auto; border-radius: 50%; background: var(--red-bg); color: var(--red); font-size: 10px; font-weight: 850; }
.error-list strong, .error-list p, .error-list small { display: block; margin: 0; }
.error-list strong { font-size: 10px; }
.error-list p { margin: 2px 0; color: var(--ink-soft); font-size: 9px; }
.error-list small { color: #949895; font-size: 8px; }
.empty-page { display: grid; place-items: center; min-height: 70vh; text-align: center; }
.empty-page .empty-icon { display: grid; place-items: center; width: 65px; height: 65px; border-radius: 50%; background: var(--red-bg); color: var(--red); font-size: 25px; font-weight: 900; }
.empty-page h1 { margin: 18px 0 5px; }
.empty-page p { margin: 0 0 20px; color: var(--ink-soft); }

/* Authentication and installer */
.auth-body { min-height: 100vh; background: #f6f3ed; }
.auth-layout { display: grid; grid-template-columns: minmax(420px, .95fr) 1.05fr; min-height: 100vh; }
.auth-story { position: relative; display: flex; flex-direction: column; overflow: hidden; padding: 42px 52px; background: var(--green-950); color: #fff; }
.auth-story:before, .auth-story:after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.auth-story:before { width: 520px; height: 520px; right: -270px; top: 13%; border: 1px solid rgba(215,237,192,.16); box-shadow: 0 0 0 80px rgba(215,237,192,.035), 0 0 0 160px rgba(215,237,192,.02); }
.auth-story:after { width: 200px; height: 200px; left: -120px; bottom: 5%; background: rgba(185,223,149,.055); }
.auth-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 11px; font-size: 15px; }
.auth-copy { position: relative; z-index: 1; width: min(540px, 100%); margin: auto 0; }
.auth-copy h1 { margin: 13px 0 18px; font-size: clamp(38px, 4.8vw, 64px); line-height: 1.02; letter-spacing: -.055em; }
.auth-copy p { width: min(440px, 100%); margin: 0; color: rgba(255,255,255,.62); font-size: 16px; }
.auth-quote { position: relative; z-index: 1; padding: 18px 0 0; border-top: 1px solid rgba(255,255,255,.13); }
.auth-quote span, .auth-quote strong { display: block; }
.auth-quote span { color: #badd99; font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .13em; }
.auth-quote strong { margin-top: 3px; font-size: 12px; }
.auth-panel { display: grid; place-items: center; padding: 40px; }
.auth-form-wrap { width: min(400px, 100%); }
.auth-form-wrap h2 { margin: 7px 0 4px; font-size: 30px; letter-spacing: -.04em; }
.auth-form-wrap > p { margin: 0; font-size: 12px; }
.auth-form { margin-top: 26px; }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 65px; }
.password-field button { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--green-700); font-size: 9px; font-weight: 800; }
.auth-security { margin-top: 18px !important; color: #7d8580; text-align: center; font-size: 9px !important; }
.install-body { min-height: 100vh; padding: 34px 18px 60px; background: var(--canvas); }
.install-shell { width: min(760px, 100%); margin: 0 auto; }
.install-header { display: flex; align-items: center; gap: 11px; margin-bottom: 28px; }
.install-header strong, .install-header small { display: block; }
.install-header small { color: var(--ink-soft); font-size: 10px; }
.install-card { padding: 30px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); box-shadow: var(--shadow); }
.install-card h1 { margin: 5px 0 7px; font-size: 30px; letter-spacing: -.04em; }
.install-card > p, .install-title p { color: var(--ink-soft); }
.install-card code { padding: 2px 5px; border-radius: 5px; background: #eeece7; font-size: 12px; }
.requirement-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 24px 0; }
.requirement-grid > div { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 8px; font-size: 10px; font-weight: 700; }
.requirement-grid > div span { display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; font-size: 9px; }
.requirement-grid .ok { background: var(--green-50); color: var(--green-800); }
.requirement-grid .ok span { background: var(--green-100); }
.requirement-grid .fail { background: var(--red-bg); color: var(--red); }
.requirement-grid .fail span { background: #f4cec6; }
.install-form { padding-top: 23px; border-top: 1px solid var(--line); }
.success-card { text-align: center; }
.install-success { display: grid; place-items: center; width: 60px; height: 60px; margin: 0 auto 15px; border-radius: 50%; background: var(--green-100); color: var(--green-700); font-size: 25px; font-weight: 900; }

@media (max-width: 1180px) {
    .main-content { padding: 34px 28px 60px; }
    .metric-grid { grid-template-columns: 1fr 1fr; }
    .dashboard-grid { grid-template-columns: 1fr 1fr; }
    .dashboard-grid .span-2 { grid-column: span 2; }
    .customer-grid { grid-template-columns: 1fr 1fr; }
    .profile-strip { grid-template-columns: 1fr 1fr; }
    .profile-strip > div:nth-child(3) { border-left: 0; }
    .profile-strip > div:nth-child(n+3) { border-top: 1px solid var(--line); }
}

@media (max-width: 860px) {
    :root { --sidebar: 270px; }
    .sidebar { transform: translateX(-105%); transition: transform .22s ease; box-shadow: 10px 0 35px rgba(0,0,0,.2); }
    .sidebar.open { transform: none; }
    .sidebar-overlay { position: fixed; inset: 0; z-index: 40; background: rgba(10,25,20,.43); }
    .sidebar-overlay.open { display: block; }
    .page-shell { margin-left: 0; }
    .mobile-header { position: sticky; top: 0; z-index: 35; display: flex; align-items: center; justify-content: space-between; height: 60px; padding: 0 18px; border-bottom: 1px solid var(--line); background: rgba(244,241,235,.94); backdrop-filter: blur(12px); }
    .menu-button { width: 36px; height: 36px; border: 1px solid var(--line-dark); border-radius: 9px; background: #fff; }
    .mobile-brand { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 850; }
    .mobile-brand .brand-mark { width: 29px; height: 29px; border-radius: 8px; font-size: 13px; }
    .mobile-spacer { width: 36px; }
    .main-content { padding: 27px 18px 55px; }
    .detail-grid { grid-template-columns: 1fr; }
    .detail-side { position: static; }
    .settings-grid { grid-template-columns: 1fr; }
    .settings-grid .span-2 { grid-column: span 1; }
    .auth-layout { grid-template-columns: 1fr; }
    .auth-story { min-height: 360px; padding: 30px; }
    .auth-copy { margin: 65px 0; }
    .auth-copy h1 { font-size: clamp(35px, 8vw, 52px); }
    .auth-panel { padding: 55px 24px; }
}

@media (max-width: 640px) {
    .page-header { align-items: flex-start; flex-direction: column; }
    .page-header > .button { width: 100%; }
    .dashboard-header { flex-direction: column; }
    .metric-grid, .dashboard-grid, .customer-grid, .form-grid, .reminder-grid { grid-template-columns: 1fr; }
    .dashboard-grid .span-2, .form-grid .span-2 { grid-column: span 1; }
    .metric-card { padding: 17px; }
    .toolbar { align-items: stretch; flex-direction: column; }
    .search-form { width: 100%; }
    .segmented { align-self: flex-start; max-width: 100%; overflow-x: auto; }
    .filter-form { align-items: stretch; flex-direction: column; }
    .compact-field { width: 100%; }
    .payment-row { grid-template-columns: 36px minmax(0,1fr) auto; }
    .payment-row form { display: none; }
    .profile-strip { grid-template-columns: 1fr; }
    .profile-strip > div, .profile-strip > div:nth-child(3) { border-top: 1px solid var(--line); border-left: 0; }
    .profile-strip > div:first-child { border-top: 0; }
    .customer-detail-header { align-items: stretch; }
    .customer-heading { align-items: flex-start; }
    .customer-heading h1 { font-size: 27px; }
    .header-actions { width: 100%; }
    .header-actions > * { flex: 1; }
    .header-actions .button { width: 100%; }
    .note-composer-footer { align-items: stretch; flex-direction: column; }
    .inline-field { width: 100%; }
    .note-composer-footer .button { width: 100%; }
    .task-row { grid-template-columns: 27px 1fr; align-items: start; }
    .task-actions, .task-row > .status { grid-column: 2; }
    .task-heading { align-items: flex-start; flex-direction: column; gap: 2px; }
    .settings-form .span-2 { grid-column: span 1; }
    .settings-form .form-actions { grid-column: span 1; }
    .requirement-grid { grid-template-columns: 1fr; }
    .install-card { padding: 22px; }
    .auth-story { min-height: 320px; padding: 25px; }
    .auth-copy { margin: 50px 0; }
    .auth-copy p { font-size: 14px; }
    .table-panel { margin: 0 -4px; }
}

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