:root {
    --ink: #183b34;
    --ink-soft: #47635b;
    --moss: #1f5c4d;
    --moss-deep: #153d35;
    --lime: #d7e83c;
    --lime-soft: #eef4bb;
    --paper: #f3f6ef;
    --surface: #ffffff;
    --surface-soft: #f8faf6;
    --line: #dbe5dc;
    --line-strong: #c5d4c9;
    --muted: #77877f;
    --coral: #db7966;
    --amber: #d19b48;
    --sky: #dbeee9;
    --shadow: 0 10px 30px rgba(27, 65, 55, .07);
    --radius: 7px;
}

* { box-sizing: border-box; }
html { min-width: 0; overflow-x: hidden; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "DM Sans", "Segoe UI", sans-serif; font-size: 14px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.icon { width: 18px; height: 18px; stroke-width: 1.8; }
.icon-small { width: 15px; height: 15px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 16px 18px; color: #e9f1e9; background: var(--moss-deep); overflow: hidden; }
.sidebar::after { content: ""; position: absolute; inset: auto -50px -80px -50px; height: 220px; opacity: .15; background: repeating-linear-gradient(115deg, transparent 0 18px, var(--lime) 19px 20px); transform: rotate(-5deg); pointer-events: none; }
.brand { display: inline-flex; align-items: center; gap: 9px; width: fit-content; padding: 0 11px; color: #fff; }
.brand-mark { display: inline-grid; width: 30px; height: 30px; place-items: center; color: var(--moss-deep); background: var(--lime); border-radius: 7px; font-family: Newsreader, Georgia, serif; font-size: 25px; line-height: 1; font-weight: 600; }
.brand-word { font-family: Newsreader, Georgia, serif; font-size: 27px; letter-spacing: -.5px; }
.brand-word span { color: var(--lime); }
.workspace-switcher { display: flex; align-items: center; gap: 10px; margin: 33px 0 28px; padding: 11px 10px; border: 1px solid rgba(229, 241, 231, .14); border-radius: var(--radius); background: rgba(255, 255, 255, .055); }
.workspace-avatar, .avatar { display: inline-grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: var(--moss-deep); background: var(--lime); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.workspace-avatar { width: 29px; height: 29px; }
.workspace-copy { min-width: 0; display: grid; flex: 1; gap: 1px; }
.workspace-copy strong, .profile-link strong { overflow: hidden; color: #f6fbf5; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.workspace-copy small, .profile-link small { color: #a8beb1; font-size: 10px; }
.primary-nav { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 3px; }
.nav-label { padding: 0 12px 8px; color: #8aa69a; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.nav-label-spaced { margin-top: 28px; }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border: 1px solid transparent; border-radius: 6px; color: #b7c9be; font-size: 13px; transition: background .2s ease, color .2s ease, border-color .2s ease; }
.nav-item svg { width: 17px; height: 17px; stroke-width: 1.7; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-item.is-active { color: var(--lime); border-color: rgba(215,232,60,.14); background: rgba(215,232,60,.1); }
.nav-item.is-active svg { stroke-width: 2.2; }
.nav-count { margin-left: auto; color: #a8beb1; font-size: 11px; }
.sidebar-bottom { position: relative; z-index: 1; display: grid; gap: 7px; margin-top: auto; }
.sidebar-tip { display: flex; gap: 9px; margin: 0 5px 14px; padding: 11px 10px; border: 1px solid rgba(215,232,60,.2); background: rgba(215,232,60,.08); }
.sidebar-tip svg { flex: 0 0 auto; width: 17px; height: 17px; color: var(--lime); }
.sidebar-tip div { display: grid; gap: 2px; }
.sidebar-tip strong { font-size: 11px; font-weight: 600; color: #f2f6d1; }
.sidebar-tip span { color: #9fb6a9; font-size: 10px; line-height: 1.35; }
.profile-form { margin-top: 12px; border-top: 1px solid rgba(229,241,231,.13); }
.profile-link { display: flex; align-items: center; gap: 9px; width: 100%; min-width: 0; padding: 12px 7px 4px; border: 0; color: inherit; text-align: left; background: transparent; }
.profile-link > span:nth-child(2) { min-width: 0; display: grid; flex: 1; }
.profile-link > svg { color: #8aa69a; }
.avatar { width: 29px; height: 29px; }

.main-area { min-width: 0; background: var(--paper); }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 76px; padding: 0 5.4vw; border-bottom: 1px solid rgba(198, 211, 201, .72); background: rgba(243,246,239,.82); }
.breadcrumbs { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.breadcrumbs > span { color: var(--moss); font-family: Newsreader, Georgia, serif; font-size: 16px; font-weight: 600; }
.breadcrumbs strong { color: var(--ink-soft); font-weight: 500; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.icon-button { position: relative; display: inline-grid; width: 38px; height: 38px; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 6px; color: var(--ink-soft); background: transparent; }
.icon-button:hover { border-color: var(--line); background: var(--surface); }
.icon-button svg { width: 18px; height: 18px; }
.notification-dot { position: absolute; top: 8px; right: 8px; width: 5px; height: 5px; border: 1px solid var(--paper); border-radius: 50%; background: var(--coral); }
.content-wrap { max-width: 1440px; margin: 0 auto; padding: 45px 5.4vw 70px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.eyebrow { margin: 0 0 7px; color: var(--moss); font-size: 11px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: Newsreader, Georgia, serif; letter-spacing: -.3px; font-weight: 600; }
h1 { margin-bottom: 8px; color: var(--ink); font-size: clamp(32px, 4vw, 46px); line-height: 1.03; }
h2 { margin-bottom: 7px; font-size: 27px; line-height: 1.1; }
h3 { margin-bottom: 4px; color: var(--ink); font-size: 14px; font-weight: 700; }
.lead { max-width: 570px; margin-bottom: 0; color: var(--muted); font-size: 14px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 15px; border: 1px solid transparent; border-radius: 6px; font-size: 12px; font-weight: 700; letter-spacing: .01em; transition: transform .18s ease, background .18s ease, border-color .18s ease; }
.button:hover { transform: translateY(-1px); }
.button svg { width: 16px; height: 16px; }
.button-primary { color: var(--moss-deep); background: var(--lime); }
.button-primary:hover { background: #e0ef56; }
.button-dark { color: #fff; background: var(--moss); }
.button-dark:hover { background: var(--moss-deep); }
.button-secondary { color: var(--ink-soft); border-color: var(--line-strong); background: var(--surface); }
.button-secondary:hover { border-color: var(--moss); color: var(--moss); }
.button-ghost { color: var(--moss); background: transparent; }
.button-danger { color: #a34f40; border-color: #efcfc9; background: #fff8f6; }
.button-compact { min-height: 36px; padding: 0 12px; }
.button-small { min-height: 32px; padding: 0 10px; font-size: 11px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 18px; }
.metric-card { position: relative; min-height: 150px; padding: 19px 19px 16px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 3px 10px rgba(28, 68, 56, .025); }
.metric-card::after { content: ""; position: absolute; right: -20px; bottom: -42px; width: 110px; height: 90px; border-top: 1px solid rgba(31,92,77,.14); border-radius: 50%; transform: rotate(-25deg); }
.metric-card.metric-highlight { color: #f4f8ef; border-color: var(--moss); background: var(--moss); }
.metric-card.metric-highlight::after { border-color: rgba(215,232,60,.45); }
.metric-label { display: flex; align-items: center; gap: 7px; margin-bottom: 15px; color: var(--muted); font-size: 11px; font-weight: 600; }
.metric-highlight .metric-label { color: #b9d2c4; }
.metric-label svg { width: 15px; height: 15px; color: var(--moss); }
.metric-highlight .metric-label svg { color: var(--lime); }
.metric-value { display: block; margin-bottom: 12px; color: var(--ink); font-family: Newsreader, Georgia, serif; font-size: 29px; font-weight: 600; line-height: 1; }
.metric-highlight .metric-value { color: #fff; }
.metric-meta { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; }
.metric-highlight .metric-meta { color: #b9d2c4; }
.meta-up { color: var(--moss); font-weight: 700; }
.metric-highlight .meta-up { color: var(--lime); }
.quick-actions .metric-card { min-height: 125px; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.quick-actions .metric-card:hover { border-color: var(--moss); box-shadow: var(--shadow); transform: translateY(-2px); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .9fr); gap: 18px; margin-bottom: 20px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 20px 21px 0; }
.panel-heading h2, .panel-heading h3 { margin-bottom: 4px; }
.panel-kicker { color: var(--muted); font-size: 11px; }
.panel-link { display: inline-flex; align-items: center; gap: 4px; color: var(--moss); font-size: 11px; font-weight: 700; }
.panel-link svg { width: 13px; height: 13px; }
.chart-panel { min-height: 305px; }
.chart-area { display: flex; align-items: flex-end; gap: 13px; height: 192px; margin: 24px 21px 15px; padding: 0 4px; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0 47px, rgba(219,229,220,.62) 48px, transparent 49px); }
.chart-column { display: flex; align-items: center; flex: 1; flex-direction: column; gap: 8px; height: 100%; justify-content: flex-end; }
.chart-bar { width: min(30px, 70%); min-height: 8px; border-radius: 4px 4px 0 0; background: var(--sky); transition: height .5s ease, background .2s ease; }
.chart-column:first-child .chart-bar, .chart-column:last-child .chart-bar { background: var(--lime); }
.chart-column:hover .chart-bar { background: var(--moss); }
.chart-label { margin-bottom: -23px; color: var(--muted); font-size: 10px; }
.chart-caption { display: flex; justify-content: space-between; padding: 0 22px 17px; color: var(--muted); font-size: 10px; }
.chart-caption strong { color: var(--ink-soft); font-weight: 600; }
.activity-panel { min-height: 305px; }
.activity-list { display: grid; gap: 0; padding: 15px 21px 20px; }
.activity-item { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid #edf1ec; }
.activity-item:last-child { border-bottom: 0; }
.activity-icon { display: inline-grid; width: 31px; height: 31px; place-items: center; border-radius: 50%; color: var(--moss); background: var(--sky); }
.activity-icon svg { width: 15px; height: 15px; }
.activity-copy { min-width: 0; display: grid; flex: 1; gap: 1px; }
.activity-copy strong { overflow: hidden; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.activity-copy span { color: var(--muted); font-size: 10px; }
.activity-amount { color: var(--ink); font-size: 11px; font-weight: 700; }
.empty-activity { padding: 28px 0; color: var(--muted); font-size: 12px; text-align: center; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 28px 0 13px; }
.section-heading h2 { margin: 0; font-size: 23px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 8px; }
.search-box { position: relative; display: flex; align-items: center; }
.search-box svg { position: absolute; left: 11px; width: 16px; height: 16px; color: var(--muted); }
.search-box input { width: 235px; padding-left: 34px; }
.select-control, input, select, textarea { width: 100%; min-height: 40px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 5px; outline: 0; color: var(--ink); background: var(--surface); font-size: 12px; }
textarea { min-height: 90px; padding-top: 10px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #a2aea7; }
input:focus, select:focus, textarea:focus { border-color: var(--moss); box-shadow: 0 0 0 3px rgba(31,92,77,.1); }
.table-panel { overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 12px 20px; color: var(--muted); border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
.data-table td { padding: 15px 20px; border-bottom: 1px solid #edf1ec; color: var(--ink-soft); font-size: 12px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tr:hover td { background: #fbfcf9; }
.document-cell { display: flex; align-items: center; gap: 10px; }
.document-icon { display: inline-grid; width: 31px; height: 35px; place-items: center; border: 1px solid var(--line); border-radius: 4px; color: var(--moss); background: var(--surface-soft); }
.document-icon svg { width: 15px; height: 15px; }
.document-copy { display: grid; gap: 1px; }
.document-copy strong { color: var(--ink); font-size: 12px; font-weight: 700; }
.document-copy small { color: var(--muted); font-size: 10px; }
.cell-strong { color: var(--ink); font-weight: 700; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 20px; font-size: 10px; font-weight: 700; }
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-draft { color: #77877f; background: #eef2ed; }
.status-sent { color: #477c70; background: #e3f1ec; }
.status-paid, .status-accepted { color: #597b2c; background: #edf4c6; }
.status-overdue, .status-rejected, .status-cancelled { color: #b25c4c; background: #fce9e4; }
.row-actions { display: flex; justify-content: flex-end; gap: 3px; }
.table-action { display: inline-grid; width: 29px; height: 29px; place-items: center; border: 1px solid transparent; border-radius: 4px; color: var(--muted); background: transparent; }
.table-action:hover { border-color: var(--line); color: var(--moss); background: var(--surface-soft); }
.table-action svg { width: 15px; height: 15px; }
.table-empty { padding: 58px 20px !important; color: var(--muted) !important; text-align: center; }
.table-empty svg { display: block; width: 30px; height: 30px; margin: 0 auto 10px; color: var(--line-strong); }
.pagination { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; color: var(--muted); font-size: 11px; }
.pagination-links { display: flex; gap: 4px; }
.pagination-link { display: inline-grid; width: 30px; height: 30px; place-items: center; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.pagination-link.is-current { color: var(--moss-deep); border-color: var(--lime); background: var(--lime); }

.form-panel { max-width: 970px; padding: 27px; }
.form-section { padding: 0 0 25px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.form-section:last-of-type { margin-bottom: 0; border-bottom: 0; }
.form-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.form-section-heading p { margin-bottom: 0; color: var(--muted); font-size: 11px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-field { display: grid; gap: 6px; }
.form-field-full { grid-column: 1 / -1; }
.form-field label { color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.form-field .helptext { color: var(--muted); font-size: 10px; }
.form-field input[type="checkbox"] { width: 17px; min-height: 17px; padding: 0; accent-color: var(--moss); }
.check-field { display: flex; min-height: 68px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-soft); cursor: pointer; }
.check-field > span { display: grid; grid-template-columns: 19px minmax(0, 1fr); align-items: start; column-gap: 9px; row-gap: 2px; }
.check-field input { width: 17px; min-height: 17px; padding: 0; margin: 2px 0 0; border: 0; accent-color: var(--moss); }
.check-field strong { color: var(--ink-soft); font-size: 11px; }
.check-field small { grid-column: 2; color: var(--muted); font-size: 10px; line-height: 1.35; }
.form-errors { padding: 10px 12px; margin-bottom: 15px; border: 1px solid #efcfc9; border-radius: 5px; color: #a34f40; background: #fff8f6; font-size: 11px; }
.field-error { color: #b25c4c; font-size: 10px; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding-top: 3px; }
.lines-table { width: 100%; border-collapse: collapse; }
.lines-table th { padding: 8px 6px; color: var(--muted); font-size: 10px; text-align: left; }
.lines-table td { padding: 5px 5px; vertical-align: top; }
.lines-table td:first-child { padding-left: 0; }
.lines-table td:last-child { padding-right: 0; }
.lines-table .line-description { min-width: 240px; }
.remove-line { display: inline-grid; width: 37px; height: 39px; place-items: center; border: 0; color: var(--coral); background: transparent; }
.remove-line svg { width: 16px; height: 16px; }
.add-line { margin-top: 11px; }

.detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; margin-bottom: 24px; }
.detail-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.document-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(270px, .7fr); align-items: start; gap: 18px; }
.invoice-preview { padding: 33px; }
.invoice-preview-head { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 23px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.invoice-word { color: var(--moss); font-family: Newsreader, Georgia, serif; font-size: 31px; line-height: 1; }
.invoice-number { margin-top: 5px; color: var(--muted); font-size: 11px; }
.invoice-company { text-align: right; }
.invoice-company strong { display: block; margin-bottom: 3px; font-family: Newsreader, Georgia, serif; font-size: 18px; }
.invoice-company span { display: block; color: var(--muted); font-size: 10px; }
.invoice-parties { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.party-box { padding: 13px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-soft); }
.party-box > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.party-box strong { display: block; margin-bottom: 3px; color: var(--ink); font-size: 12px; }
.party-box p { margin-bottom: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.invoice-lines { width: 100%; border-collapse: collapse; }
.invoice-lines th { padding: 8px 4px; border-bottom: 1px solid var(--ink); color: var(--ink-soft); font-size: 9px; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
.invoice-lines td { padding: 12px 4px; border-bottom: 1px solid #edf1ec; color: var(--ink-soft); font-size: 11px; }
.invoice-lines th:not(:first-child), .invoice-lines td:not(:first-child) { text-align: right; }
.invoice-totals { display: grid; grid-template-columns: 1fr 210px; gap: 15px; padding-top: 17px; }
.payment-note { align-self: end; color: var(--muted); font-size: 10px; line-height: 1.55; }
.total-list { display: grid; gap: 7px; }
.total-row { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.total-row strong { color: var(--ink); }
.total-row.total-final { padding-top: 10px; margin-top: 3px; border-top: 1px solid var(--ink); color: var(--ink); font-size: 15px; }
.total-final strong { font-family: Newsreader, Georgia, serif; font-size: 23px; }
.side-stack { display: grid; gap: 15px; }
.side-card { padding: 19px; }
.side-card h3 { margin-bottom: 14px; }
.side-card p { margin-bottom: 0; color: var(--muted); font-size: 11px; }
.side-list { display: grid; gap: 11px; }
.side-list-row { display: flex; justify-content: space-between; gap: 15px; color: var(--muted); font-size: 11px; }
.side-list-row strong { color: var(--ink); font-weight: 600; text-align: right; }
.side-card-highlight { border-color: var(--moss); background: var(--moss); }
.side-card-highlight h3, .side-card-highlight p { color: #e7f0e8; }
.side-card-highlight .button { margin-top: 15px; }

.security-hero { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 20px; padding: 25px; border: 1px solid var(--line); background: var(--surface); }
.security-status { display: flex; align-items: flex-start; gap: 14px; }
.security-icon { display: inline-grid; width: 48px; height: 48px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: var(--moss); background: var(--lime-soft); }
.security-icon svg { width: 24px; height: 24px; }
.security-status h2 { margin-bottom: 6px; font-size: 24px; }
.security-status p { margin-bottom: 0; color: var(--muted); font-size: 12px; }
.security-badge { justify-self: end; align-self: start; padding: 7px 10px; color: #597b2c; border-radius: 20px; background: var(--lime-soft); font-size: 10px; font-weight: 700; }
.security-setup { display: grid; grid-template-columns: 185px minmax(0, 1fr); gap: 27px; padding: 25px; margin-top: 15px; border: 1px solid var(--line); background: var(--surface); }
.qr-frame { display: grid; width: 165px; height: 165px; place-items: center; padding: 10px; border: 1px solid var(--line); background: #fff; }
.qr-frame img { width: 143px; height: 143px; image-rendering: pixelated; }
.step-list { display: grid; gap: 15px; margin: 2px 0 20px; padding: 0; list-style: none; }
.step-list li { display: flex; gap: 11px; color: var(--ink-soft); font-size: 12px; }
.step-number { display: inline-grid; width: 22px; height: 22px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: var(--moss-deep); background: var(--lime); font-size: 10px; font-weight: 700; }
.code-form { display: flex; align-items: flex-end; gap: 9px; max-width: 360px; }
.code-form .form-field { flex: 1; }
.code-form input { letter-spacing: .27em; text-align: center; }
.security-url { overflow: hidden; padding: 10px; margin-top: 15px; border: 1px dashed var(--line-strong); color: var(--muted); font-family: monospace; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.security-disabled { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 18px 20px; margin-top: 15px; border: 1px solid var(--line); background: var(--surface); }
.security-disabled p { margin: 0; color: var(--muted); font-size: 11px; }

.flash-stack { display: grid; gap: 7px; max-width: 620px; margin: 18px auto 0; padding: 0 5.4vw; }
.flash { display: flex; align-items: center; gap: 9px; padding: 11px 13px; border: 1px solid #c9dfd4; border-radius: 5px; color: var(--moss); background: #f1faf3; font-size: 12px; }
.flash svg { width: 16px; height: 16px; flex: 0 0 auto; }
.flash-error { color: #a34f40; border-color: #efcfc9; background: #fff8f6; }
.flash-close { display: inline-grid; width: 22px; height: 22px; place-items: center; margin-left: auto; padding: 0; border: 0; color: currentColor; background: transparent; }
.flash-close svg { width: 14px; height: 14px; }

.auth-shell { position: relative; display: grid; min-height: 100vh; place-items: center; padding: 35px 20px 55px; overflow: hidden; background: var(--moss-deep); }
.auth-shell::before { content: ""; position: absolute; inset: 0; opacity: .17; background: repeating-linear-gradient(115deg, transparent 0 30px, var(--lime) 31px 32px, transparent 33px 73px); transform: rotate(-8deg) scale(1.4); pointer-events: none; }
.auth-brand { position: absolute; top: 32px; left: 39px; display: flex; align-items: center; gap: 9px; color: #fff; }
.auth-brand .brand-mark { color: var(--moss-deep); }
.auth-ambient { position: absolute; border-radius: 50%; opacity: .12; pointer-events: none; }
.auth-ambient-one { width: 330px; height: 330px; right: -120px; bottom: -90px; border: 1px solid var(--lime); }
.auth-ambient-two { width: 180px; height: 180px; top: 21%; left: -100px; border: 1px solid #dbeee9; }
.auth-card { position: relative; z-index: 1; width: min(100%, 425px); padding: 37px; border: 1px solid rgba(255,255,255,.2); background: #fbfcf8; box-shadow: 0 30px 80px rgba(0,0,0,.2); }
.auth-card h1 { margin-bottom: 9px; color: var(--ink); font-size: 34px; }
.auth-card .lead { margin-bottom: 28px; }
.auth-form { display: grid; gap: 16px; }
.auth-form .button { width: 100%; margin-top: 5px; }
.auth-form-footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 7px; color: var(--muted); font-size: 11px; }
.auth-form-footer a, .text-link { color: var(--moss); font-weight: 700; }
.auth-footnote { position: absolute; z-index: 1; right: 20px; bottom: 20px; left: 20px; margin: 0; color: rgba(237,246,235,.62); font-size: 10px; text-align: center; }
.otp-mark { display: inline-grid; width: 47px; height: 47px; place-items: center; margin-bottom: 20px; border-radius: 50%; color: var(--moss); background: var(--lime-soft); }
.otp-mark svg { width: 23px; height: 23px; }

@media (max-width: 1050px) {
    .app-shell { grid-template-columns: 215px minmax(0, 1fr); }
    .content-wrap, .topbar { padding-right: 4vw; padding-left: 4vw; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-grid, .detail-grid { grid-template-columns: 1fr; }
    .side-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .app-shell { display: block; }
    .sidebar { position: static; height: auto; min-height: auto; padding: 15px 16px; }
    .workspace-switcher, .sidebar-bottom, .nav-label, .nav-label-spaced { display: none; }
    .primary-nav { flex-direction: row; overflow-x: auto; margin-top: 14px; padding-bottom: 1px; }
    .nav-item { min-width: max-content; min-height: 36px; padding: 0 10px; font-size: 11px; }
    .nav-item svg { width: 15px; height: 15px; }
    .nav-count { display: none; }
    .main-area { min-height: calc(100vh - 96px); }
    .topbar { min-height: 62px; padding: 0 18px; }
    .content-wrap { padding: 30px 18px 45px; }
    .page-heading, .detail-header, .toolbar { align-items: stretch; flex-direction: column; gap: 15px; }
    .page-heading .button, .detail-actions .button { width: 100%; }
    .topbar-actions .button span { display: none; }
    .topbar-actions .button { width: 36px; padding: 0; }
    .hide-mobile { display: none; }
    h1 { font-size: 35px; }
    .metric-grid { grid-template-columns: 1fr; gap: 9px; }
    .metric-card { min-height: 133px; padding: 15px; }
    .metric-value { font-size: 24px; }
    .dashboard-grid { gap: 12px; }
    .chart-area { gap: 6px; margin-right: 13px; margin-left: 13px; }
    .panel-heading { padding-right: 15px; padding-left: 15px; }
    .activity-list { padding-right: 15px; padding-left: 15px; }
    .table-panel { overflow-x: auto; }
    .data-table { min-width: 650px; }
    .toolbar-left, .toolbar-right { width: 100%; }
    .search-box, .search-box input { width: 100%; }
    .toolbar-right .button { flex: 1; }
    .form-panel { padding: 20px 16px; }
    .form-grid, .form-grid-three, .invoice-parties, .security-hero, .security-setup { grid-template-columns: 1fr; }
    .form-field-full { grid-column: auto; }
    .lines-table { min-width: 650px; }
    .lines-scroll { overflow-x: auto; }
    .invoice-preview { padding: 20px 16px; }
    .invoice-preview-head { flex-direction: column; }
    .invoice-company { text-align: left; }
    .invoice-totals { grid-template-columns: 1fr; }
    .side-stack { grid-template-columns: 1fr; }
    .detail-actions { justify-content: stretch; }
    .detail-actions .button { flex: 1; }
    .security-setup { gap: 20px; padding: 20px; }
    .security-status { flex-direction: column; }
    .security-badge { justify-self: start; }
    .code-form { align-items: stretch; flex-direction: column; }
    .qr-frame { width: 185px; height: 185px; }
    .qr-frame img { width: 163px; height: 163px; }
    .auth-brand { top: 22px; left: 22px; }
    .auth-card { padding: 28px 22px; }
}
