:root {
    --navy: #102a43;
    --navy-2: #183b56;
    --navy-3: #243b53;
    --red: #e53935;
    --red-dark: #c62828;
    --ink: #111827;
    --muted: #5d6b7d;
    --faint: #64748b;
    --surface: #ffffff;
    --canvas: #f4f7fa;
    --border: #d9e2ec;
    --border-soft: #e9eef3;
    --green: #16855b;
    --green-soft: #e9f7f1;
    --amber: #ad6800;
    --amber-soft: #fff4d9;
    --blue-soft: #eaf2f8;
    --red-soft: #feeeee;
    --radius-sm: 7px;
    --radius: 12px;
    --radius-lg: 18px;
    --shadow: 0 1px 2px rgba(16, 42, 67, .04), 0 8px 24px rgba(16, 42, 67, .04);
    --shadow-lg: 0 24px 64px rgba(16, 42, 67, .18);
    --sidebar: 238px;
}

* { box-sizing: border-box; }
html { color-scheme: light; background: var(--canvas); }
body { margin: 0; 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; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { color: var(--navy); letter-spacing: -.025em; }
h1 { font-size: 1.65rem; line-height: 1.15; }
h2 { font-size: 1.65rem; line-height: 1.2; }
h3 { font-size: 1rem; line-height: 1.3; }
h4 { font-size: .95rem; }
p { color: var(--muted); }

.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.skip-link { position: fixed; z-index: 9999; left: 16px; top: 12px; transform: translateY(-150%); padding: 10px 14px; background: var(--surface); color: var(--navy); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); font-weight: 700; }
.skip-link:focus { transform: translateY(0); }
.eyebrow { margin: 0 0 5px; color: var(--red-dark); font-size: .68rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.eyebrow.light { color: #ffb6b4; }
.muted { color: var(--muted); }
.danger { color: var(--red-dark) !important; }
.block { display: block; }

/* Authentication and setup */
.auth-body { min-height: 100vh; background: #eef3f7; display: grid; place-items: center; padding: 24px; }
.auth-shell, .setup-shell { width: min(1040px, 100%); min-height: 630px; display: grid; grid-template-columns: 1.05fr .95fr; overflow: hidden; background: var(--surface); border: 1px solid rgba(16,42,67,.12); border-radius: 24px; box-shadow: 0 30px 80px rgba(16,42,67,.16); }
.setup-shell { width: min(1140px, 100%); min-height: 720px; }
.auth-brand-panel { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 48px; overflow: hidden; color: white; background: var(--navy); }
.auth-brand-panel::after { content: ""; position: absolute; right: -130px; bottom: -180px; width: 430px; height: 430px; border: 70px solid rgba(229,57,53,.2); transform: rotate(35deg); border-radius: 30%; }
.auth-logo { width: 210px; height: auto; position: relative; z-index: 1; }
.auth-brand-panel > div { position: relative; z-index: 1; }
.auth-brand-panel h1 { margin: 12px 0 18px; color: white; font-size: clamp(2.35rem, 4vw, 4.4rem); line-height: .98; letter-spacing: -.055em; }
.auth-brand-panel p { max-width: 430px; color: #d9e2ec; font-size: 1.05rem; }
.auth-footnote { position: relative; z-index: 1; margin: 0; color: #9fb3c8 !important; font-size: .78rem !important; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.auth-form-panel { display: flex; flex-direction: column; justify-content: center; padding: clamp(36px, 6vw, 72px); }
.setup-panel { justify-content: flex-start; overflow-y: auto; }
.auth-heading { margin-bottom: 28px; }
.auth-heading h2 { margin-bottom: 8px; font-size: 1.7rem; }
.auth-heading p:last-child { margin: 0; }
.auth-form { gap: 18px !important; }
.security-note { margin: 24px 0 0; text-align: center; font-size: .78rem; }
.preview-note { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 18px; padding: 11px 13px; border: 1px solid #b9d9ed; border-radius: var(--radius-sm); background: #eff8fe; color: var(--navy); font-size: .78rem; }
.setup-success { margin: auto 0; text-align: center; }
.setup-success h2 { margin: 16px 0 8px; font-size: 2rem; }
.setup-success .button { margin-top: 28px; }
.success-mark { display: grid; width: 62px; height: 62px; margin: 0 auto 20px; place-items: center; color: var(--green); background: var(--green-soft); border-radius: 50%; }

/* Forms and buttons */
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.form-grid { display: grid; gap: 15px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-two { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 6px; color: var(--navy); font-size: .82rem; font-weight: 700; }
label small { color: var(--muted); font-weight: 500; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; color: var(--ink); background: white; border: 1px solid #bcccdc; border-radius: var(--radius-sm); outline: 0; transition: border-color .18s ease, box-shadow .18s ease; }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #9aa8b6; }
input:focus, select:focus, textarea:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(16,42,67,.12); }
fieldset { margin: 0 0 10px; padding: 0; border: 0; display: flex; flex-direction: column; gap: 14px; }
legend { width: 100%; margin-bottom: 12px; padding-bottom: 8px; color: var(--navy); border-bottom: 1px solid var(--border-soft); font-weight: 800; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 15px; border: 1px solid transparent; border-radius: var(--radius-sm); font-size: .82rem; font-weight: 800; line-height: 1; transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease; }
.button.primary { color: white; background: var(--red); border-color: var(--red); box-shadow: 0 6px 15px rgba(229,57,53,.16); }
.button.primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.button.secondary { color: var(--navy); background: white; border-color: #aebdca; }
.button.secondary:hover, .button.ghost:hover { background: var(--blue-soft); border-color: #90a4b8; }
.button.ghost { color: var(--navy); background: transparent; border-color: var(--border); }
.button.wide { width: 100%; }
.button.small { padding: 7px 11px; font-size: .76rem; }
.button.tiny { padding: 5px 9px; font-size: .7rem; }
.button:focus-visible, .icon-button:focus-visible, a:focus-visible, .filter-tabs button:focus-visible, .task-check:focus-visible { outline: 3px solid rgba(229,57,53,.32); outline-offset: 2px; }
.icon-button { width: 44px; height: 44px; flex: 0 0 44px; display: inline-grid; place-items: center; color: var(--muted); background: transparent; border: 0; border-radius: 50%; transition: color .18s ease, background .18s ease; }
.icon-button:hover { color: var(--navy); background: var(--blue-soft); }
.alert { margin-bottom: 18px; padding: 11px 13px; border-radius: var(--radius-sm); font-size: .84rem; }
.alert p { margin: 0; color: inherit; }
.alert.error { color: #9b1c1c; background: var(--red-soft); border: 1px solid #f6b8b6; }

/* App shell */
.app-body { min-height: 100vh; background: var(--canvas); }
.sidebar { position: fixed; z-index: 50; inset: 0 auto 0 0; width: var(--sidebar); display: flex; flex-direction: column; padding: 25px 15px 18px; color: white; background: var(--navy); }
.sidebar-brand { padding: 0 10px 24px; border-bottom: 1px solid rgba(255,255,255,.11); }
.sidebar-brand img { width: 166px; height: auto; }
.sidebar-brand span { display: block; margin: 5px 0 0 41px; color: #9fb3c8; font-size: .62rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.nav-list { display: flex; flex-direction: column; gap: 4px; margin-top: 23px; }
.nav-list a, .nav-logout { min-height: 44px; display: flex; align-items: center; gap: 12px; padding: 10px 12px; color: #cbd7e3; background: transparent; border: 0; border-radius: 9px; font-size: .84rem; font-weight: 700; text-align: left; transition: color .18s ease, background .18s ease; }
.nav-list a:hover, .nav-list a[aria-current="page"], .nav-logout:hover { color: white; background: rgba(255,255,255,.1); }
.nav-list a[aria-current="page"] { box-shadow: inset 3px 0 var(--red); }
.nav-list .nav-secondary { margin-top: 14px; padding-top: 13px; border-top: 1px solid rgba(255,255,255,.1); border-radius: 0 0 9px 9px; }
.sidebar-bottom { margin-top: auto; }
.sidebar-user { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding: 13px 10px; border-top: 1px solid rgba(255,255,255,.1); border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar-user > span:last-child { min-width: 0; }
.sidebar-user strong, .sidebar-user small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user strong { font-size: .78rem; }
.sidebar-user small { color: #9fb3c8; font-size: .68rem; }
.nav-logout { width: 100%; }
.app-shell { min-height: 100vh; margin-left: var(--sidebar); display: flex; flex-direction: column; }
.topbar { position: sticky; z-index: 30; top: 0; min-height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 14px clamp(20px, 3vw, 42px); background: rgba(244,247,250,.94); border-bottom: 1px solid var(--border); backdrop-filter: blur(12px); }
.topbar-title { display: flex; align-items: center; gap: 12px; }
.topbar-title h1, .topbar-title p { margin-bottom: 0; }
.topbar-title h1 { font-size: 1.25rem; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.global-search { width: min(320px, 30vw); height: 44px; display: flex; align-items: center; gap: 5px; padding: 0 5px; color: var(--muted); background: white; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.global-search-submit { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; padding: 0; color: var(--muted); background: transparent; border: 0; border-radius: 6px; }
.global-search-submit:hover { color: var(--navy); background: var(--blue-soft); }
.global-search input { min-height: 0; padding: 0; border: 0; box-shadow: none; background: transparent; }
.global-search input:focus { box-shadow: none; }
.global-search kbd { padding: 1px 6px; color: var(--faint); background: var(--canvas); border: 1px solid var(--border); border-radius: 4px; font-size: .65rem; }
.mobile-menu { display: none; }
.mobile-overlay { display: none; }
.main-content { width: 100%; max-width: 1600px; margin: 0 auto; flex: 1; padding: 30px clamp(20px, 3vw, 42px) 48px; }
.app-footer { display: flex; justify-content: space-between; padding: 18px clamp(20px, 3vw, 42px); color: var(--faint); border-top: 1px solid var(--border); font-size: .7rem; }

/* Shared content */
.welcome-row, .page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 24px; }
.welcome-row h2, .page-intro h2 { margin-bottom: 6px; font-size: 1.7rem; }
.welcome-row p:last-child, .page-intro p { margin-bottom: 0; }
.quick-actions, .client-hero-actions { display: flex; gap: 9px; }
.page-summary { display: flex; align-items: stretch; background: white; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.page-summary span { min-width: 135px; padding: 11px 16px; color: var(--muted); border-left: 1px solid var(--border-soft); font-size: .72rem; }
.page-summary span:first-child { border-left: 0; }
.page-summary strong { display: block; margin-bottom: 2px; color: var(--navy); font-size: .92rem; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.panel-heading h3, .panel-heading p { margin-bottom: 0; }
.text-link { display: inline-flex; align-items: center; gap: 4px; color: var(--navy); font-size: .75rem; font-weight: 800; }
.text-link:hover { color: var(--red-dark); }
.status-badge { display: inline-flex; width: max-content; align-items: center; padding: 4px 8px; color: var(--navy); background: var(--blue-soft); border-radius: 999px; font-size: .65rem; font-style: normal; font-weight: 800; line-height: 1; white-space: nowrap; }
.status-badge.active, .status-badge.paid, .status-badge.completed, .status-badge.done { color: #116149; background: var(--green-soft); }
.status-badge.overdue, .status-badge.cancelled, .status-badge.lost { color: #a61b1b; background: var(--red-soft); }
.status-badge.waiting, .status-badge.sent, .status-badge.in_progress, .status-badge.proposal { color: #855000; background: var(--amber-soft); }
.status-badge.paused, .status-badge.draft, .status-badge.planned { color: #536170; background: #edf1f4; }
.avatar { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; color: white; background: linear-gradient(145deg, #274c6b, var(--navy)); border: 1px solid rgba(255,255,255,.15); border-radius: 10px; font-size: .77rem; font-weight: 900; }
.avatar.small { width: 34px; height: 34px; flex-basis: 34px; border-radius: 9px; }
.avatar.large { width: 60px; height: 60px; flex-basis: 60px; border-radius: 15px; font-size: 1.15rem; }
.count-pill { min-width: 24px; padding: 2px 7px; color: var(--muted); background: var(--canvas); border: 1px solid var(--border); border-radius: 999px; font-size: .68rem; font-weight: 800; text-align: center; }
.due-label { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: .7rem; white-space: nowrap; }
.health { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .74rem; font-weight: 700; text-transform: capitalize; }
.health i, .priority-dot, .stage-dot, .project-status { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #8a98a9; }
.health.good i { background: var(--green); }
.health.attention i { background: #e79514; }
.health.risk i { background: var(--red); }
.priority-dot.high { background: var(--red); }
.priority-dot.medium { background: #e79514; }
.priority-dot.low { background: #5f7892; }
.stage-dot.new { background: #7791aa; }
.stage-dot.contacted { background: #3078a8; }
.stage-dot.qualified { background: #8b5fbf; }
.stage-dot.proposal { background: var(--red); }
.empty-state { min-height: 250px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px; color: var(--faint); text-align: center; }
.empty-state.compact { min-height: 120px; padding: 22px; }
.empty-state h3, .empty-state h4 { margin: 10px 0 4px; }
.empty-state p { max-width: 390px; margin-bottom: 16px; }
.export-row { display: flex; justify-content: flex-end; margin-top: 14px; }

/* Lead import and outreach */
.outreach-guide { margin-bottom: 16px; padding: 0; overflow: hidden; }
.outreach-guide ol { counter-reset: outreach-step; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.outreach-guide li { counter-increment: outreach-step; position: relative; min-width: 0; display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: 10px; padding: 14px 16px; border-left: 1px solid var(--border-soft); }
.outreach-guide li:first-child { border-left: 0; }
.outreach-guide li::after { content: ''; position: absolute; z-index: 1; right: -5px; top: 50%; width: 9px; height: 9px; transform: translateY(-50%) rotate(45deg); background: white; border-top: 1px solid var(--border-soft); border-right: 1px solid var(--border-soft); }
.outreach-guide li:last-child::after { display: none; }
.outreach-guide .outreach-step-icon { width: 38px; height: 38px; display: grid; place-items: center; color: var(--red-dark); background: var(--red-soft); border-radius: 9px; }
.outreach-guide li > span:last-child { min-width: 0; }
.outreach-guide b { display: block; color: var(--navy); font-size: .73rem; }
.outreach-guide b::before { content: counter(outreach-step) '. '; color: var(--red-dark); }
.outreach-guide small { display: block; overflow: hidden; color: var(--muted); font-size: .62rem; text-overflow: ellipsis; white-space: nowrap; }
.outreach-card { gap: 0; }
.lead-gap { margin: 10px 0; padding: 10px; background: #eef8fe; border: 1px solid #c9e3f2; border-radius: 8px; }
.lead-gap.missing { background: #fff8eb; border-color: #fed7aa; }
.lead-gap small { display: block; margin-bottom: 4px; color: var(--faint); font-size: .59rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.lead-gap p { margin: 0; color: var(--navy); font-size: .7rem; line-height: 1.45; }
.lead-meta-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.channel-pill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 7px; color: #075985; background: #e0f2fe; border-radius: 999px; font-size: .62rem; font-weight: 800; }
.channel-pill.whatsapp { color: #116149; background: var(--green-soft); }
.channel-pill.call { color: #6b3e00; background: var(--amber-soft); }
.outreach-actions { display: grid; grid-template-columns: 1fr; gap: 7px; margin-top: 10px; }
.outreach-actions form { margin: 0; }
.outreach-count { display: block; margin-top: 8px; color: var(--faint); font-size: .62rem; text-align: center; }
.outreach-modal { width: min(820px, calc(100vw - 32px)); }
.outreach-history { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.outreach-history h3 { margin: 0 0 8px; font-size: .86rem; }
.outreach-history > div { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 8px 0; border-top: 1px solid var(--border-soft); }
.outreach-history strong { overflow: hidden; color: var(--navy); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.outreach-history time { color: var(--muted); font-size: .63rem; }
.export-row { gap: 8px; flex-wrap: wrap; }
.integration-status { display: flex; align-items: center; gap: 10px; margin: 14px 0; padding: 12px; background: var(--canvas); border: 1px solid var(--border); border-radius: 9px; }
.integration-status strong, .integration-status small { display: block; }
.integration-status strong { color: var(--navy); font-size: .78rem; }
.integration-status small { margin-top: 2px; color: var(--muted); font-size: .67rem; }

/* Client delivery list */
.client-progress { min-width: 135px; display: flex; align-items: center; gap: 8px; }
.client-progress > span { height: 7px; min-width: 80px; flex: 1; overflow: hidden; background: #e7edf2; border-radius: 999px; }
.client-progress i { display: block; height: 100%; background: var(--red); border-radius: inherit; }
.client-progress b { color: var(--navy); font-size: .68rem; }
.waiting-copy { display: block; margin-top: 5px; color: #9a3412; font-size: .63rem; font-weight: 700; }

/* Dashboard */
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.metric-card { min-height: 118px; display: flex; align-items: center; gap: 15px; padding: 18px; background: white; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.metric-card > div { min-width: 0; }
.metric-card p { margin: 0 0 3px; color: var(--muted); font-size: .72rem; font-weight: 700; }
.metric-card strong { display: block; color: var(--navy); font-size: 1.25rem; letter-spacing: -.025em; }
.metric-card small { display: block; margin-top: 3px; color: var(--faint); font-size: .66rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric-icon { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 10px; }
.metric-icon.navy, .metric-icon.draft { color: var(--navy); background: var(--blue-soft); }
.metric-icon.red, .metric-icon.overdue { color: var(--red-dark); background: var(--red-soft); }
.metric-icon.amber, .metric-icon.sent { color: var(--amber); background: var(--amber-soft); }
.metric-icon.green, .metric-icon.paid { color: var(--green); background: var(--green-soft); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, .85fr); gap: 16px; }
.dashboard-grid > .panel { padding: 20px; }
.task-list, .project-list { display: flex; flex-direction: column; }
.task-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 11px 0; border-top: 1px solid var(--border-soft); }
.task-row:first-child { border-top: 0; }
.task-row.overdue { box-shadow: inset 3px 0 var(--red); padding-left: 12px; }
.task-check { position: relative; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; color: white; background: transparent; border: 0; border-radius: 50%; }
.task-check::before { content: ""; position: absolute; width: 24px; height: 24px; background: white; border: 1.5px solid #90a4b8; border-radius: 50%; transition: border-color .18s ease, background .18s ease; }
.task-check:hover::before { border-color: var(--green); background: var(--green-soft); }
.task-check svg { position: relative; z-index: 1; }
.task-copy { min-width: 0; }
.task-copy strong, .task-copy span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-copy strong { color: var(--navy); font-size: .8rem; }
.task-copy span { color: var(--muted); font-size: .68rem; }
.followup-list a { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border-soft); }
.followup-list a:first-child { border-top: 0; }
.followup-list a:hover strong { color: var(--red-dark); }
.followup-list strong, .followup-list small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.followup-list strong { color: var(--navy); font-size: .76rem; }
.followup-list small, .followup-list time { color: var(--muted); font-size: .66rem; }
.project-row { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(105px, 28%); align-items: center; gap: 10px; min-height: 56px; padding: 10px 0; border-top: 1px solid var(--border-soft); }
.project-row:first-child { border-top: 0; }
.project-row:hover strong { color: var(--red-dark); }
.project-status.active { background: var(--green); }
.project-status.waiting { background: #e79514; }
.project-status.planned { background: #5f7892; }
.project-status.completed { background: #3078a8; }
.project-copy { min-width: 0; }
.project-copy strong, .project-copy small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-copy strong { color: var(--navy); font-size: .77rem; }
.project-copy small { color: var(--muted); font-size: .66rem; }
.progress-compact { display: flex; align-items: center; gap: 7px; }
.progress-compact > span { height: 5px; flex: 1; overflow: hidden; background: #e7edf2; border-radius: 999px; }
.progress-compact i, .progress-bar i { display: block; height: 100%; background: var(--red); border-radius: inherit; }
.progress-compact b { color: var(--muted); font-size: .65rem; }
.invoice-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-top: 1px solid var(--border-soft); }
.invoice-row:first-child { border-top: 0; }
.invoice-row > span:last-child { text-align: right; }
.invoice-row strong, .invoice-row small, .invoice-row b { display: block; }
.invoice-row strong { color: var(--navy); font-size: .76rem; }
.invoice-row small { color: var(--muted); font-size: .66rem; }
.invoice-row b { margin-bottom: 4px; color: var(--navy); font-size: .78rem; }

/* Tables */
.table-panel { overflow: hidden; }
.panel-toolbar { min-height: 67px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.panel-toolbar h3, .panel-toolbar p { margin-bottom: 0; }
.filter-tabs { display: flex; gap: 4px; }
.filter-tabs button, .filter-tabs a { min-height: 44px; display: inline-flex; align-items: center; padding: 7px 11px; color: var(--muted); background: transparent; border: 0; border-radius: 7px; font-size: .73rem; font-weight: 800; }
.filter-tabs button:hover, .filter-tabs button.active, .filter-tabs a:hover, .filter-tabs a.active { color: var(--navy); background: var(--blue-soft); }
.responsive-table { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 10px 14px; color: var(--muted); background: #f8fafc; border-bottom: 1px solid var(--border); font-size: .64rem; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
td { padding: 13px 14px; color: var(--muted); border-bottom: 1px solid var(--border-soft); font-size: .74rem; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfdff; }
.entity-cell { min-width: 190px; display: flex; align-items: center; gap: 10px; }
.entity-cell strong, .entity-cell small { display: block; }
.entity-cell strong, .subtle-strong { color: var(--navy); font-weight: 800; }
.entity-cell small { color: var(--muted); font-size: .65rem; }
.work-count { white-space: nowrap; }

/* Client */
.back-row { margin-bottom: 12px; }
.back-row a { color: var(--muted); font-size: .75rem; font-weight: 700; }
.back-row a:hover { color: var(--navy); }
.client-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 16px; padding: 22px; }
.client-identity { display: flex; align-items: center; gap: 15px; }
.client-identity h2 { margin: 5px 0 2px; }
.client-identity p { margin-bottom: 0; font-size: .78rem; }
.client-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(270px, .6fr); gap: 16px; }
.client-main, .client-aside { display: flex; flex-direction: column; gap: 16px; }
.client-main > .panel, .client-aside > .panel { padding: 20px; }
.timeline article { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 0 0 20px; }
.timeline article:not(:last-child)::after { content: ""; position: absolute; top: 31px; bottom: 0; left: 15px; width: 1px; background: var(--border); }
.timeline-icon { position: relative; z-index: 1; width: 31px; height: 31px; display: grid; place-items: center; color: var(--navy); background: var(--blue-soft); border-radius: 50%; }
.timeline-meta { display: flex; justify-content: space-between; gap: 12px; }
.timeline-meta strong { color: var(--navy); font-size: .8rem; }
.timeline-meta time, .timeline article small { color: var(--faint); font-size: .64rem; }
.timeline article p { margin: 5px 0; color: var(--muted); font-size: .76rem; }
.client-details dl { margin: 0; }
.client-details dl div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border-soft); }
.client-details dl div:first-child { border-top: 0; }
.client-details dt { color: var(--muted); font-size: .7rem; }
.client-details dd { margin: 0; color: var(--navy); font-size: .72rem; font-weight: 700; text-align: right; }
.client-details dd a { color: #1b6b9b; }
.next-action-card { background: var(--navy); border-color: var(--navy); }
.next-action-card h3 { margin: 6px 0 12px; color: white; font-size: 1.12rem; }
.next-action-card .eyebrow { color: #ffaaa7; }
.next-action-card .due-label { color: #cbd7e3; }
.mini-task-list > div { display: flex; align-items: flex-start; gap: 9px; padding: 9px 0; border-top: 1px solid var(--border-soft); }
.mini-task-list .priority-dot { margin-top: 5px; }
.mini-task-list strong, .mini-task-list small { display: block; }
.mini-task-list strong { color: var(--navy); font-size: .74rem; }
.mini-task-list small { color: var(--muted); font-size: .65rem; }

/* Pipeline */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 12px; align-items: start; }
.kanban-column { min-width: 0; padding: 12px; background: #eaf0f5; border: 1px solid var(--border); border-radius: var(--radius); }
.kanban-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; padding: 0 2px; }
.kanban-heading > div { display: flex; align-items: center; gap: 7px; }
.kanban-heading h3 { margin: 0; font-size: .78rem; }
.kanban-heading > strong { color: var(--muted); font-size: .67rem; }
.kanban-stack { display: flex; flex-direction: column; gap: 9px; }
.lead-card { padding: 14px; background: white; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 2px 8px rgba(16,42,67,.035); }
.lead-card-top { display: flex; align-items: center; justify-content: space-between; }
.lead-card h4 { margin: 10px 0 1px; }
.lead-card > p { margin-bottom: 11px; font-size: .68rem; }
.lead-value { display: block; margin-bottom: 12px; color: var(--navy); font-size: .85rem; }
.lead-next { padding-top: 10px; border-top: 1px solid var(--border-soft); }
.lead-next small { color: var(--faint); font-size: .6rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.lead-next p { margin: 2px 0 7px; color: var(--navy); font-size: .72rem; font-weight: 700; }
.lead-convert-form { margin-top: 12px; }
.kanban-empty { min-height: 96px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; color: var(--muted); background: rgba(255,255,255,.45); border: 1px dashed #b4c2cf; border-radius: 10px; font-size: .7rem; font-weight: 700; }
.kanban-empty:hover { color: var(--navy); background: white; }

/* Projects */
.project-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.project-card { padding: 18px; }
.project-card-header { display: flex; align-items: center; justify-content: space-between; }
.client-label { margin: 12px 0 3px; color: var(--red-dark); font-size: .66rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.project-card h3 { margin-bottom: 7px; font-size: 1.04rem; }
.project-summary { min-height: 42px; margin-bottom: 17px; font-size: .74rem; }
.progress-block > div:first-child { display: flex; justify-content: space-between; margin-bottom: 6px; color: var(--muted); font-size: .67rem; }
.progress-block strong { color: var(--navy); }
.progress-bar { height: 7px; overflow: hidden; background: #e7edf2; border-radius: 999px; }
.project-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 17px; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.project-meta > span { display: flex; gap: 6px; min-width: 0; color: var(--muted); }
.project-meta small, .project-meta strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-meta small { font-size: .58rem; }
.project-meta strong { color: var(--navy); font-size: .66rem; }

/* Tasks */
.task-table { display: flex; flex-direction: column; }
.task-table-row { min-height: 64px; display: grid; grid-template-columns: auto auto minmax(220px, 1fr) auto 120px auto; align-items: center; gap: 12px; padding: 10px 15px; border-bottom: 1px solid var(--border-soft); }
.task-table-row:last-child { border-bottom: 0; }
.task-table-row:hover { background: #fbfdff; }
.task-table-row.completed { opacity: .63; }
.task-table-row.completed .task-table-copy strong { text-decoration: line-through; }
.task-table-row.completed .task-check { color: white; }
.task-table-row.completed .task-check::before { background: var(--green); border-color: var(--green); }
.task-table-copy { min-width: 0; }
.task-table-copy strong, .task-table-copy small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-table-copy strong { color: var(--navy); font-size: .78rem; }
.task-table-copy small { color: var(--muted); font-size: .66rem; }

/* Invoice / Money */
.money-metrics .metric-card { min-height: 104px; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }

/* Search */
.search-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.search-results > .panel { padding: 18px; }
.result-list a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 10px 0; border-top: 1px solid var(--border-soft); }
.result-list a:first-child { border-top: 0; }
.result-list a:hover strong { color: var(--red-dark); }
.result-icon { width: 34px; height: 34px; display: grid; place-items: center; color: var(--navy); background: var(--blue-soft); border-radius: 9px; }
.result-list strong, .result-list small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-list strong { color: var(--navy); font-size: .76rem; }
.result-list small { color: var(--muted); font-size: .66rem; }

/* Dialogs and feedback */
.modal { width: min(560px, calc(100vw - 32px)); max-height: min(88vh, 850px); padding: 0; overflow: auto; background: white; border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); }
.modal.wide-modal { width: min(720px, calc(100vw - 32px)); }
.modal::backdrop { background: rgba(8,24,38,.58); backdrop-filter: blur(4px); }
.modal form { display: flex; flex-direction: column; gap: 15px; padding: 22px; }
.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 13px; border-bottom: 1px solid var(--border-soft); }
.modal-heading h2, .modal-heading p { margin-bottom: 0; }
.modal-heading h2 { font-size: 1.35rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 7px; }
.toast { position: fixed; z-index: 100; top: 95px; right: 28px; width: min(360px, calc(100vw - 40px)); display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 11px 12px; color: #0f5132; background: #f0fbf6; border: 1px solid #a5dac4; border-radius: 10px; box-shadow: var(--shadow-lg); }
.toast.error { color: #9b1c1c; background: var(--red-soft); border-color: #f0b8b6; }
.toast p { margin: 0; color: inherit; font-size: .78rem; font-weight: 700; }
.toast button { width: 32px; height: 32px; display: grid; place-items: center; color: inherit; background: transparent; border: 0; border-radius: 50%; }
.toast button:hover { background: rgba(0,0,0,.05); }

.metric-card strong, .lead-value, .page-summary strong, td, .invoice-row b { font-variant-numeric: tabular-nums; }
.client-details dd, td, .task-copy, .project-copy, .result-list span { overflow-wrap: anywhere; }
.button[disabled] { cursor: wait; opacity: .62; }

/* Reporting */
.reminder-strip { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 14px; margin-bottom: 16px; padding: 14px 17px; background: #fff9e9; border: 1px solid #efd99a; border-radius: var(--radius); }
.reminder-strip h3, .reminder-strip p { margin: 0; }
.reminder-icon { width: 42px; height: 42px; display: grid; place-items: center; color: var(--amber); background: var(--amber-soft); border-radius: 11px; }
.reminder-links { min-width: 0; display: flex; justify-content: flex-end; gap: 8px; overflow-x: auto; }
.reminder-links a { min-width: 170px; padding: 8px 10px; background: white; border: 1px solid #ebd99f; border-radius: 8px; }
.reminder-links strong, .reminder-links small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reminder-links strong { color: var(--navy); font-size: .72rem; }
.reminder-links small { color: var(--muted); font-size: .64rem; }
.reporting-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr); gap: 16px; margin-bottom: 16px; }
.report-card { min-height: 270px; padding: 20px; }
.report-total { color: var(--navy); font-size: 1rem; font-variant-numeric: tabular-nums; }
.bar-chart { height: 178px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: end; gap: 10px; padding-top: 20px; border-bottom: 1px solid var(--border); }
.bar-chart-item { height: 100%; min-width: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 5px; text-align: center; }
.bar-value { color: var(--muted); font-size: .58rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { position: relative; width: min(34px, 65%); height: 100%; margin: 0 auto; overflow: hidden; background: var(--blue-soft); border-radius: 6px 6px 0 0; }
.bar-track i { position: absolute; inset: auto 0 0; min-height: 3px; background: linear-gradient(180deg, #ef5a56, var(--red)); border-radius: 5px 5px 0 0; }
.bar-label { padding-bottom: 7px; color: var(--navy); font-size: .66rem; font-weight: 800; }
.funnel-chart { display: flex; flex-direction: column; gap: 15px; margin: 4px 0 0; padding: 0; list-style: none; }
.funnel-chart li { display: grid; grid-template-columns: 72px minmax(80px, 1fr) 82px; align-items: center; gap: 10px; }
.funnel-label { color: var(--navy); font-size: .7rem; font-weight: 800; }
.funnel-track { height: 9px; overflow: hidden; background: var(--blue-soft); border-radius: 999px; }
.funnel-track i { display: block; height: 100%; background: var(--navy-2); border-radius: inherit; }
.funnel-value { text-align: right; }
.funnel-value strong, .funnel-value small { display: block; }
.funnel-value strong { color: var(--navy); font-size: .72rem; }
.funnel-value small { color: var(--muted); font-size: .58rem; }

/* Settings and data */
.settings-health { min-width: 210px; display: flex; align-items: center; gap: 11px; padding: 11px 14px; background: white; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.settings-health strong, .settings-health small { display: block; }
.settings-health strong { color: var(--navy); font-size: .76rem; }
.settings-health small { color: var(--muted); font-size: .65rem; }
.status-dot { width: 10px; height: 10px; flex: 0 0 10px; border-radius: 50%; }
.status-dot.healthy { background: var(--green); box-shadow: 0 0 0 5px var(--green-soft); }
.status-dot.warning { background: #e79514; box-shadow: 0 0 0 5px var(--amber-soft); }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.settings-card { padding: 21px; }
.settings-card-heading { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 21px; padding-bottom: 16px; border-bottom: 1px solid var(--border-soft); }
.settings-card-heading h3, .settings-card-heading p { margin: 0; }
.settings-card-heading p { margin-top: 3px; font-size: .72rem; }
.settings-icon { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; color: var(--navy); background: var(--blue-soft); border-radius: 10px; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 3px; }
.split-actions { justify-content: flex-start; flex-wrap: wrap; }
.backup-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.backup-summary div { padding: 13px; background: var(--canvas); border: 1px solid var(--border-soft); border-radius: 9px; }
.backup-summary span, .backup-summary strong { display: block; }
.backup-summary span { color: var(--muted); font-size: .65rem; }
.backup-summary strong { margin-top: 3px; color: var(--navy); font-size: .78rem; }
.cron-details { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--border-soft); }
.cron-details summary { color: var(--navy); cursor: pointer; font-size: .75rem; font-weight: 800; }
.cron-details p { margin: 10px 0; font-size: .7rem; }
.cron-details code { display: block; padding: 10px; overflow-x: auto; color: #dbeafe; background: #102a43; border-radius: 7px; font-size: .65rem; white-space: nowrap; }
.file-field input { padding: 7px; }
.file-field input::file-selector-button { min-height: 30px; margin-right: 10px; padding: 5px 10px; color: var(--navy); background: var(--blue-soft); border: 0; border-radius: 5px; font-weight: 700; }
.template-links { display: flex; flex-wrap: wrap; gap: 7px 12px; color: var(--muted); font-size: .7rem; }
.template-links a { color: var(--red-dark); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.feature-checklist { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.feature-checklist li { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 10px; color: var(--green); }
.feature-checklist strong, .feature-checklist small { display: block; }
.feature-checklist strong { color: var(--navy); font-size: .75rem; }
.feature-checklist small { margin-top: 2px; color: var(--muted); font-size: .67rem; }
.field-error { color: var(--red-dark); font-size: .68rem; font-weight: 600; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 3px rgba(229,57,53,.1); }

/* Team access and account security */
.team-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.team-panel { margin-bottom: 16px; }
.security-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; color: #116149; background: var(--green-soft); border-radius: 999px; font-size: .68rem; font-weight: 800; }
.you-label { margin-left: 5px; color: var(--red-dark); font-size: .62rem; font-style: normal; text-transform: uppercase; }
.role-badge { display: inline-flex; width: max-content; align-items: center; padding: 5px 9px; color: var(--navy); background: var(--blue-soft); border: 1px solid #c9dcea; border-radius: 999px; font-size: .68rem; font-weight: 800; white-space: nowrap; }
.role-badge.admin { color: #812020; background: var(--red-soft); border-color: #f2c0be; }
.role-badge.manager { color: #244f71; background: #eaf2f8; border-color: #c5dbea; }
.role-badge.finance { color: #116149; background: var(--green-soft); border-color: #b9dfcf; }
.role-badge.viewer { color: #536170; background: #edf1f4; border-color: #d5dde4; }
.access-list { display: flex; flex-wrap: wrap; gap: 4px; }
.access-list span { padding: 3px 6px; color: var(--navy); background: var(--canvas); border: 1px solid var(--border-soft); border-radius: 5px; font-size: .62rem; font-weight: 700; }
.scope-note { display: block; margin-top: 5px; color: var(--muted); font-size: .62rem; }
.row-actions form { margin: 0; }
.danger-button { color: var(--red-dark) !important; border-color: #efb4b2 !important; }
.danger-button:hover { background: var(--red-soft) !important; }
.audit-panel { padding: 20px; }
.audit-list { display: flex; flex-direction: column; }
.audit-list article { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border-soft); }
.audit-list article:first-child { border-top: 0; }
.audit-icon { width: 34px; height: 34px; display: grid; place-items: center; color: var(--navy); background: var(--blue-soft); border-radius: 9px; }
.audit-list strong, .audit-list p { margin: 0; }
.audit-list strong { color: var(--navy); font-size: .76rem; }
.audit-list p, .audit-list time { color: var(--muted); font-size: .66rem; }
.team-user-modal { width: min(820px, calc(100vw - 32px)); }
.permission-fieldset { margin-top: 2px; }
.permission-help { margin: -4px 0 12px; font-size: .72rem; }
.permission-matrix { overflow: hidden; border: 1px solid var(--border); border-radius: 10px; }
.permission-row { min-height: 64px; display: grid; grid-template-columns: minmax(0, 1fr) 82px 82px; align-items: center; gap: 10px; padding: 10px 13px; border-top: 1px solid var(--border-soft); }
.permission-row:first-child { border-top: 0; }
.permission-row > div strong, .permission-row > div small { display: block; }
.permission-row > div strong { color: var(--navy); font-size: .76rem; }
.permission-row > div small { margin-top: 2px; color: var(--muted); font-size: .64rem; }
.check-option { min-height: 44px; flex-direction: row; align-items: center; justify-content: center; gap: 7px; padding: 7px; background: var(--canvas); border: 1px solid var(--border-soft); border-radius: 7px; cursor: pointer; }
.check-option input { width: 18px; min-height: 18px; height: 18px; margin: 0; accent-color: var(--red); }
.check-option span { font-size: .7rem; }
.check-option:has(input:disabled) { cursor: not-allowed; opacity: .66; }
.secure-note, .security-banner { display: flex; align-items: flex-start; gap: 11px; padding: 13px 14px; color: var(--navy); background: #eff8fe; border: 1px solid #b9d9ed; border-radius: 10px; }
.secure-note p, .secure-note strong, .secure-note span, .security-banner p, .security-banner strong { display: block; margin: 0; }
.secure-note strong, .security-banner strong { font-size: .76rem; }
.secure-note span, .security-banner p { margin-top: 2px; color: var(--muted); font-size: .68rem; }
.account-intro { align-items: center; }
.security-banner { max-width: 900px; margin: 0 auto 16px; }
.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.account-grid.password-required { max-width: 720px; margin: 0 auto; grid-template-columns: 1fr; }
.account-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 3px 0; }
.account-meta span { padding: 10px; color: var(--muted); background: var(--canvas); border: 1px solid var(--border-soft); border-radius: 8px; font-size: .67rem; }
.account-meta strong { display: block; margin-top: 2px; color: var(--navy); font-size: .72rem; }
.password-input { position: relative; display: block; }
.password-input input { padding-right: 48px; }
.password-input button { position: absolute; top: 0; right: 0; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; color: var(--muted); background: transparent; border: 0; border-radius: 7px; }
.password-input button:hover { color: var(--navy); background: var(--blue-soft); }
.task-check-readonly { pointer-events: none; }

/* Web Design Agency Specific Styles */
.badge-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.phase-badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px; font-size: .63rem; font-weight: 800; line-height: 1; letter-spacing: .02em; text-transform: uppercase; }
.phase-badge.phase-discovery { color: #2d4379; background: #e8eefa; }
.phase-badge.phase-wireframing { color: #57408f; background: #f0ebf8; }
.phase-badge.phase-design { color: #872e73; background: #fbebf7; }
.phase-badge.phase-client_review { color: #9c4c00; background: #fef1e4; }
.phase-badge.phase-development { color: #0d606e; background: #e5f6f8; }
.phase-badge.phase-content_qa { color: #855000; background: var(--amber-soft); }
.phase-badge.phase-launch_ready { color: #0f6c49; background: var(--green-soft); border: 1px solid #a4dfc7; }
.phase-badge.phase-completed { color: #435467; background: #edf2f7; }

.waiting-client-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; color: #a61b1b; background: #feeeee; border: 1px solid #f6b8b6; border-radius: 999px; font-size: .62rem; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; animation: pulseSoft 2.5s infinite; }
@keyframes pulseSoft { 0%, 100% { opacity: 1; } 50% { opacity: .75; } }

.warning-pill { display: inline-flex; align-items: center; padding: 3px 8px; color: #92400e; background: #fef3c7; border: 1px solid #fde68a; border-radius: 999px; font-size: .68rem; font-weight: 800; }
.badge-mini { display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: .62rem; font-weight: 800; text-transform: uppercase; }
.badge-mini.danger { color: #991b1b; background: #fee2e2; }

.project-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.project-title-row h3 { margin-bottom: 0; }
.tech-badge { display: inline-flex; align-items: center; padding: 2px 7px; color: var(--navy-2); background: #e2e8f0; border-radius: 6px; font-size: .65rem; font-weight: 800; letter-spacing: .02em; white-space: nowrap; }

.asset-links-bar { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 14px; padding: 8px; background: #f8fafc; border: 1px solid var(--border-soft); border-radius: 8px; }
.asset-link { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 6px; font-size: .68rem; font-weight: 700; transition: all .15s ease; }
.asset-link.figma { color: #a21caf; background: #fae8ff; border: 1px solid #f0abfc; }
.asset-link.figma:hover { background: #f5d0fe; }
.asset-link.staging { color: #1e40af; background: #dbeafe; border: 1px solid #bfdbfe; }
.asset-link.staging:hover { background: #bfdbfe; }
.asset-link.live { color: #065f46; background: #d1fae5; border: 1px solid #a7f3d0; }
.asset-link.live:hover { background: #a7f3d0; }
.asset-link.repo { color: #334155; background: #f1f5f9; border: 1px solid #cbd5e1; }
.asset-link.repo:hover { background: #e2e8f0; }

.web-assets-group { padding: 14px; background: #fbfcfe; border: 1px solid var(--border); border-radius: 10px; margin-top: 4px; }
.web-assets-group legend { padding: 0 6px; font-size: .8rem; font-weight: 800; color: var(--navy); border: 0; width: auto; margin-bottom: 6px; }
.checkbox-toggle { display: flex; flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; background: #fff8eb; border: 1px solid #fed7aa; border-radius: 8px; cursor: pointer; }
.checkbox-toggle input[type="checkbox"] { width: 18px; height: 18px; min-height: 18px; margin: 0; cursor: pointer; accent-color: var(--red); }
.checkbox-toggle span { font-size: .78rem; color: #9a3412; }

.client-care-plan { border-top: 3px solid #0284c7; }
.care-plan-body { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.care-plan-badge { display: inline-flex; width: max-content; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: .7rem; font-weight: 800; text-transform: uppercase; }
.care-plan-badge.tier-growth { color: #0369a1; background: #e0f2fe; border: 1px solid #bae6fd; }
.care-plan-badge.tier-basic { color: #0f766e; background: #ccfbf1; border: 1px solid #99f6e4; }
.care-plan-badge.tier-ecommerce { color: #6b21a8; background: #f3e8ff; border: 1px solid #e9d5ff; }
.care-plan-badge.tier-custom { color: #854d0e; background: #fef9c3; border: 1px solid #fef08a; }
.care-plan-badge.tier-none { color: #64748b; background: #f1f5f9; }
.care-plan-pill { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px; font-size: .65rem; font-weight: 800; background: #f1f5f9; color: var(--navy); }
.care-plan-pill.tier-growth { color: #0369a1; background: #e0f2fe; }
.care-plan-pill.tier-basic { color: #0f766e; background: #ccfbf1; }
.care-plan-pill.tier-ecommerce { color: #6b21a8; background: #f3e8ff; }
.care-retainer strong { font-size: 1.1rem; color: var(--navy); }
.support-hours-block { margin-top: 4px; }
.support-hours-block .hours-label { display: flex; justify-content: space-between; font-size: .68rem; margin-bottom: 5px; color: var(--muted); }
.support-hours-block .progress-bar { height: 8px; }
.support-hours-block .progress-bar i.danger { background: var(--red); }

.client-infrastructure { border-top: 3px solid #0f766e; }
.infra-dl div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border-soft); }
.infra-dl div:first-child { border-top: 0; }
.infra-dl dt { color: var(--muted); font-size: .7rem; }
.infra-dl dd { margin: 0; color: var(--navy); font-size: .72rem; font-weight: 700; text-align: right; }
.domain-link, .domain-text-link { display: inline-flex; align-items: center; gap: 4px; color: #0284c7; font-weight: 700; }
.domain-link:hover, .domain-text-link:hover { text-decoration: underline; }

.web-agency-radar-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; margin-bottom: 18px; }
.radar-card { padding: 18px; }
.radar-card.client-lag-card { border-left: 4px solid var(--red); }
.radar-card.domain-renewal-card { border-left: 4px solid #0284c7; }
.radar-list { display: flex; flex-direction: column; gap: 8px; }
.radar-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; background: #fbfcfe; border: 1px solid var(--border-soft); border-radius: 8px; transition: background .15s ease; }
.radar-item:hover { background: #f0f6fa; }
.radar-item > div { flex: 1; min-width: 0; }
.radar-item strong { display: block; color: var(--navy); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.radar-item small { display: block; color: var(--muted); font-size: .67rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.warning-icon { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; border-radius: 50%; color: var(--red-dark); background: var(--red-soft); }
.radar-icon-wrap { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; border-radius: 50%; color: #0369a1; background: #e0f2fe; }
.font-bold { font-weight: 800 !important; }

@media (max-width: 1180px) {
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .project-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kanban { grid-template-columns: repeat(2, minmax(250px, 1fr)); }
    .reporting-grid { grid-template-columns: 1fr; }
    .team-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    :root { --sidebar: 260px; }
    .sidebar { transform: translateX(-102%); transition: transform .22s ease; box-shadow: 15px 0 40px rgba(8,24,38,.25); }
    .app-body.sidebar-open .sidebar { transform: translateX(0); }
    .mobile-overlay { position: fixed; z-index: 40; inset: 0; background: rgba(8,24,38,.45); }
    .app-body.sidebar-open .mobile-overlay { display: block; }
    .app-shell { margin-left: 0; }
    .mobile-menu { display: inline-grid; }
    .dashboard-grid, .client-layout { grid-template-columns: 1fr; }
    .auth-shell, .setup-shell { grid-template-columns: 1fr; max-width: 630px; }
    .auth-brand-panel { min-height: 285px; padding: 32px; }
    .auth-brand-panel h1 { max-width: 520px; font-size: 2.6rem; }
    .auth-footnote { display: none; }
    .auth-form-panel { padding: 40px 32px; }
    .settings-grid { grid-template-columns: 1fr; }
    .account-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
    body { font-size: 14px; }
    .topbar { min-height: 70px; padding: 10px 15px; }
    .topbar-title .eyebrow { display: none; }
    .topbar-title h1 { font-size: 1.05rem; }
    .global-search { width: 44px; padding: 0; justify-content: center; border: 0; background: transparent; }
    .global-search-submit { width: 44px; height: 44px; flex-basis: 44px; }
    .global-search input, .global-search kbd { display: none; }
    .topbar-add { width: 42px; padding: 0; font-size: 0; }
    .topbar-add svg { width: 20px; height: 20px; }
    .main-content { padding: 20px 14px 36px; }
    .welcome-row, .page-intro { align-items: flex-start; flex-direction: column; gap: 15px; }
    .welcome-row h2, .page-intro h2 { font-size: 1.4rem; }
    .quick-actions { width: 100%; }
    .quick-actions .button { flex: 1; }
    .page-summary { width: 100%; overflow-x: auto; }
    .page-summary span { min-width: 122px; }
    .outreach-guide ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .outreach-guide li:nth-child(odd) { border-left: 0; }
    .outreach-guide li:nth-child(n+3) { border-top: 1px solid var(--border-soft); }
    .outreach-guide li:nth-child(2)::after { display: none; }
    .outreach-history > div { grid-template-columns: 88px minmax(0, 1fr); }
    .outreach-history time { grid-column: 2; }
    .metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
    .metric-card { min-height: 110px; align-items: flex-start; flex-direction: column; gap: 9px; padding: 14px; }
    .metric-icon { width: 36px; height: 36px; flex-basis: 36px; }
    .metric-card strong { font-size: 1.05rem; }
    .dashboard-grid > .panel { padding: 15px; }
    .task-row { grid-template-columns: auto minmax(0,1fr); }
    .task-row > .due-label { grid-column: 2; }
    .project-row { grid-template-columns: auto minmax(0,1fr); }
    .project-row .progress-compact { grid-column: 2; }
    .project-board, .kanban, .search-results { grid-template-columns: 1fr; }
    .client-hero { align-items: flex-start; flex-direction: column; padding: 17px; }
    .client-hero-actions { width: 100%; }
    .client-hero-actions .button { flex: 1; }
    .client-main > .panel, .client-aside > .panel { padding: 15px; }
    .panel-toolbar { align-items: flex-start; flex-direction: column; }
    .filter-tabs { max-width: 100%; overflow-x: auto; }
    .responsive-table { overflow: visible; }
    .data-table, .data-table tbody { display: block; }
    .data-table thead { display: none; }
    .data-table tbody { padding: 0 14px 14px; }
    .data-table tr { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 13px 18px; margin-top: 12px; padding: 15px; background: white; border: 1px solid var(--border); border-radius: 10px; }
    .data-table tr:hover { background: white; }
    .data-table td { min-width: 0; display: block; padding: 0; border: 0; }
    .data-table td::before { content: attr(data-label); display: block; margin-bottom: 4px; color: var(--faint); font-size: .6rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
    .data-table td:first-child { grid-column: 1 / -1; padding-bottom: 11px; border-bottom: 1px solid var(--border-soft); }
    .data-table .entity-cell { min-width: 0; }
    .clients-table td:nth-child(6) { grid-column: 1 / -1; }
    .clients-table .record-open { display: none; }
    .invoices-table .record-actions { grid-column: 1 / -1; padding-top: 8px; border-top: 1px solid var(--border-soft); }
    .invoices-table .record-actions::before { display: none; }
    .invoices-table .row-actions { justify-content: flex-start; }
    .team-table .record-actions { grid-column: 1 / -1; padding-top: 8px; border-top: 1px solid var(--border-soft); }
    .team-table .record-actions::before { display: none; }
    .team-table .row-actions { justify-content: flex-start; flex-wrap: wrap; }
    .task-table-row { grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 9px; }
    .task-table-row .status-badge, .task-table-row .due-label { grid-column: 3; }
    .task-table-row > .icon-button { grid-column: 4; grid-row: 1; }
    .form-grid.two { grid-template-columns: 1fr; }
    input, select, textarea { font-size: 16px; }
    .span-two { grid-column: auto; }
    .modal form { padding: 17px; }
    .app-footer { flex-direction: column; gap: 4px; }
    .reminder-strip { grid-template-columns: auto minmax(0, 1fr); }
    .reminder-links { grid-column: 1 / -1; justify-content: flex-start; }
    .report-card { min-height: auto; padding: 15px; }
    .bar-chart { gap: 4px; }
    .bar-value { writing-mode: vertical-rl; transform: rotate(180deg); justify-self: center; }
    .settings-health { width: 100%; }
    .settings-card { padding: 16px; }
    .backup-summary { grid-template-columns: 1fr; }
    .team-metrics { grid-template-columns: 1fr; }
    .permission-row { grid-template-columns: 1fr 1fr; }
    .permission-row > div { grid-column: 1 / -1; }
    .audit-list article { grid-template-columns: auto minmax(0, 1fr); }
    .audit-list time { grid-column: 2; }
    .account-meta { grid-template-columns: 1fr; }
    .auth-body { padding: 0; }
    .auth-shell, .setup-shell { min-height: 100vh; border: 0; border-radius: 0; }
    .auth-brand-panel { min-height: 235px; padding: 25px; }
    .auth-logo { width: 175px; }
    .auth-brand-panel h1 { margin: 8px 0; font-size: 2.05rem; }
    .auth-brand-panel p { margin: 0; font-size: .9rem; }
    .auth-form-panel { padding: 32px 22px; }
}

@media (max-width: 420px) {
    .outreach-guide ol { grid-template-columns: 1fr; }
    .outreach-guide li { border-left: 0; border-top: 1px solid var(--border-soft); }
    .outreach-guide li:first-child { border-top: 0; }
    .outreach-guide li::after { display: none; }
    .metric-grid { grid-template-columns: 1fr; }
    .metric-card { min-height: auto; flex-direction: row; align-items: center; }
    .page-summary span { min-width: 112px; padding: 10px 12px; }
    .timeline-meta { flex-direction: column; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Team member editor */
.team-user-modal { width: min(760px, calc(100vw - 32px)); height: min(90vh, 860px); height: min(90dvh, 860px); max-height: min(90vh, 860px); max-height: min(90dvh, 860px); overflow: hidden; }
.team-user-modal form { min-height: 0; height: 100%; display: flex; flex-direction: column; gap: 0; padding: 0; overflow: hidden; }
.team-modal-header { flex: 0 0 auto; align-items: flex-start; padding: 22px 28px 16px; background: linear-gradient(135deg, #f9fbfd, #eef7fb); }
.team-modal-header h2 { margin: 0; font-size: 1.42rem; letter-spacing: -.02em; }
.team-modal-subtitle { max-width: 480px; margin: 5px 0 0; color: var(--muted); font-size: .73rem; line-height: 1.45; }
.team-modal-scroll { min-height: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 15px; overflow-y: auto; padding: 20px 28px 24px; scrollbar-gutter: stable; }
.team-form-section { padding: 18px; background: #fff; border: 1px solid var(--border); border-radius: 12px; }
.team-form-section-heading { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border-soft); }
.team-section-icon { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; color: var(--navy); background: var(--blue-soft); border-radius: 9px; }
.team-form-section-heading h3, .team-form-section-heading p { margin: 0; }
.team-form-section-heading h3 { color: var(--navy); font-size: .86rem; letter-spacing: -.01em; }
.team-form-section-heading p { margin-top: 3px; color: var(--muted); font-size: .69rem; line-height: 1.4; }
.team-form-section .form-grid { gap: 14px; }
.team-form-section label { min-width: 0; }
.field-hint { margin-left: 4px; color: var(--faint); font-size: .62rem; font-weight: 500; }
.team-role-field { margin-bottom: 12px; }
.team-role-field select { font-size: .84rem; }
.role-summary { padding: 10px 12px; color: var(--navy); background: var(--canvas); border: 1px solid var(--border-soft); border-radius: 8px; font-size: .72rem; line-height: 1.45; }
.permission-fieldset { margin: 16px 0 0; padding: 0; border: 0; }
.permission-help { margin: 0 0 10px; font-size: .7rem; }
.permission-matrix-header { display: grid; grid-template-columns: minmax(0, 1fr) 76px 76px; gap: 10px; padding: 9px 13px; color: var(--faint); background: var(--canvas); border-bottom: 1px solid var(--border); font-size: .62rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.permission-matrix-header span:not(:first-child) { text-align: center; }
.permission-row { min-height: 60px; grid-template-columns: minmax(0, 1fr) 76px 76px; padding: 9px 13px; }
.permission-row > div strong { font-size: .75rem; }
.permission-row > div small { font-size: .63rem; line-height: 1.35; }
.admin-access-state { display: flex; align-items: flex-start; gap: 12px; margin-top: 16px; padding: 16px; color: var(--navy); background: linear-gradient(135deg, #eef8fe, #f8fbfd); border: 1px solid #b9d9ed; border-radius: 11px; }
.admin-access-state > span { flex: 0 0 22px; margin-top: 1px; color: #14739f; }
.admin-access-state strong, .admin-access-state p { display: block; margin: 0; }
.admin-access-state strong { font-size: .8rem; }
.admin-access-state p { margin-top: 3px; color: var(--muted); font-size: .69rem; line-height: 1.45; }
.password-reset-details { margin-top: 2px; background: var(--canvas); border: 1px solid var(--border); border-radius: 10px; }
.password-reset-details summary { padding: 12px 14px; color: var(--navy); cursor: pointer; font-size: .77rem; font-weight: 800; list-style-position: inside; }
.password-reset-details[open] summary { border-bottom: 1px solid var(--border-soft); }
.password-reset-panel { padding: 14px; }
.password-reset-panel label { font-size: .8rem; }
.team-modal-actions { flex: 0 0 auto; padding: 14px 28px 18px; background: rgba(248, 250, 252, .98); border-top: 1px solid var(--border); box-shadow: 0 -8px 22px rgba(16, 42, 67, .08); }
.team-modal-actions .button { min-width: 112px; }

@media (max-width: 680px) {
    .team-user-modal { width: calc(100vw - 20px); height: calc(100dvh - 20px); max-height: calc(100dvh - 20px); }
    .team-modal-header { padding: 18px 18px 14px; }
    .team-modal-header h2 { font-size: 1.25rem; }
    .team-modal-scroll { gap: 12px; padding: 14px 14px 18px; }
    .team-form-section { padding: 14px; }
    .team-form-section-heading { margin-bottom: 13px; }
    .team-form-section-heading p { font-size: .67rem; }
    .permission-matrix-header, .permission-row { grid-template-columns: minmax(0, 1fr) 64px 64px; }
    .permission-row { gap: 7px; padding: 9px 10px; }
    .permission-matrix-header { gap: 7px; padding: 8px 10px; }
    .team-modal-actions { padding: 12px 14px 14px; }
    .team-modal-actions .button { flex: 1; }
}

/* Sales and billing */
.billing-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: -6px 0 20px; }
.billing-tabs a { min-height: 68px; display: flex; align-items: center; gap: 11px; padding: 12px 14px; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); transition: color .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease; }
.billing-tabs a:hover { color: var(--navy); border-color: #aebdca; box-shadow: 0 8px 24px rgba(16, 42, 67, .08); }
.billing-tabs a[aria-current="page"] { color: var(--navy); background: #f3f8fc; border-color: #90a4b8; box-shadow: inset 3px 0 var(--red), var(--shadow); }
.billing-tab-icon { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; color: var(--navy); background: var(--blue-soft); border-radius: 9px; }
.billing-tabs strong, .billing-tabs small { display: block; }
.billing-tabs strong { font-size: .78rem; }
.billing-tabs small { margin-top: 2px; color: var(--muted); font-size: .64rem; font-weight: 500; }
.billing-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
body[data-page="subscriptions"] .billing-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.table-subtitle { display: block; margin-top: 3px; color: var(--muted); font-size: .64rem; font-weight: 500; }
.billing-record-modal textarea { min-height: 104px; }
.status-badge.accepted, .status-badge.viewed { color: #116149; background: var(--green-soft); }
.status-badge.declined, .status-badge.expired { color: #a61b1b; background: var(--red-soft); }
.nav-list { min-height: 0; flex: 1 1 auto; overflow-y: auto; }
.sidebar-bottom { flex: 0 0 auto; }

.modal.invoice-modal { width: min(1040px, calc(100vw - 32px)); max-height: min(92vh, 920px); max-height: min(92dvh, 920px); overflow: hidden; }
.invoice-modal > form { min-height: 0; max-height: inherit; display: flex; flex-direction: column; gap: 0; padding: 0; overflow: hidden; }
.invoice-modal .modal-heading { flex: 0 0 auto; padding: 22px 26px 17px; background: linear-gradient(135deg, #f9fbfd, #eef7fb); border-bottom: 1px solid var(--border-soft); }
.invoice-modal-scroll { min-height: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 20px; overflow-y: auto; padding: 22px 26px 28px; scrollbar-gutter: stable; }
.invoice-modal-scroll > * { flex: 0 0 auto; }
.invoice-item-builder { overflow: hidden; background: #fbfcfe; border: 1px solid var(--border); border-radius: 12px; }
.invoice-item-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 17px 18px 15px; background: white; border-bottom: 1px solid var(--border); }
.invoice-item-heading h3, .invoice-item-heading p { margin: 0; }
.invoice-item-heading h3 { color: var(--navy); font-size: .92rem; }
.invoice-item-heading > div > p:last-child { margin-top: 4px; color: var(--muted); font-size: .69rem; }
.invoice-item-list { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.invoice-item-row { position: relative; display: grid; grid-template-columns: minmax(180px, .9fr) minmax(180px, 1fr) 82px 130px 38px; gap: 10px; align-items: end; padding: 13px; background: white; border: 1px solid var(--border-soft); border-radius: 10px; }
.invoice-item-row label { min-width: 0; }
.invoice-item-row label > span { min-height: 18px; display: block; }
.invoice-item-row label > span small { color: var(--faint); font-size: .59rem; font-weight: 500; }
.invoice-service-preset { grid-column: 1 / 3; }
.invoice-service-name { grid-column: 3 / 6; }
.invoice-service-description { grid-column: 1 / 3; }
.invoice-item-row input, .invoice-item-row select { min-width: 0; }
.invoice-item-remove { align-self: end; margin-bottom: 3px; color: var(--muted); }
.invoice-item-remove:hover { color: var(--red-dark); background: var(--red-soft); }
.invoice-total { display: flex; align-items: center; justify-content: flex-end; gap: 24px; padding: 15px 18px; background: #eef5fa; border-top: 1px solid var(--border); }
.invoice-total span { color: var(--muted); font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.invoice-total strong { min-width: 160px; color: var(--navy); font-size: 1.35rem; text-align: right; }
.invoice-notes textarea { min-height: 86px; }
.invoice-modal-actions { flex: 0 0 auto; padding: 14px 26px 17px; background: rgba(248, 250, 252, .98); border-top: 1px solid var(--border); box-shadow: 0 -8px 22px rgba(16, 42, 67, .08); }
.modal-action-spacer { flex: 1 1 auto; }

@media (max-width: 900px) {
    .billing-metrics, body[data-page="subscriptions"] .billing-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .invoice-item-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 80px 120px 38px; }
}

@media (max-width: 680px) {
    .billing-tabs { grid-template-columns: 1fr; gap: 7px; margin-bottom: 16px; }
    .billing-tabs a { min-height: 58px; padding: 9px 11px; }
    .billing-tabs small { font-size: .67rem; }
    .billing-metrics, body[data-page="subscriptions"] .billing-metrics { grid-template-columns: 1fr; }
    .proposals-table .record-actions, .subscriptions-table .record-actions { grid-column: 1 / -1; padding-top: 8px; border-top: 1px solid var(--border-soft); }
    .proposals-table .record-actions::before, .subscriptions-table .record-actions::before { display: none; }
    .proposals-table .row-actions, .subscriptions-table .row-actions { justify-content: flex-start; flex-wrap: wrap; }
    .modal.invoice-modal { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); }
    .invoice-modal .modal-heading { padding: 18px 18px 14px; }
    .invoice-modal-scroll { gap: 15px; padding: 16px 14px 20px; }
    .invoice-item-heading { align-items: stretch; flex-direction: column; padding: 14px; }
    .invoice-item-heading .button { align-self: flex-start; }
    .invoice-item-list { padding: 10px; }
    .invoice-item-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 38px; gap: 9px; padding: 11px; }
    .invoice-service-preset, .invoice-service-name, .invoice-service-description { grid-column: 1 / -1; }
    .invoice-service-quantity { grid-column: 1; }
    .invoice-service-price { grid-column: 2; }
    .invoice-item-remove { grid-column: 3; }
    .invoice-total { justify-content: space-between; gap: 12px; padding: 13px 14px; }
    .invoice-total strong { min-width: 0; font-size: 1.15rem; }
    .invoice-modal-actions { flex-wrap: wrap; padding: 12px 14px 14px; }
    .invoice-modal-actions .modal-action-spacer { display: none; }
    .invoice-modal-actions .button { flex: 1 1 calc(50% - 5px); justify-content: center; }
}
