:root { --bg:var(--bg-primary); --surface:var(--bg-card); --surface-2:var(--bg-hover); --line:var(--border-color); --text:var(--text-primary); --muted:var(--text-muted); --accent:var(--accent-primary); --accent-strong:var(--accent-primary); --radius:12px; font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
* { box-sizing: border-box; } body { margin: 0; color: var(--text); background: var(--bg); } a { color: var(--accent); text-decoration: none; } a:hover { color: var(--accent-hover); } .app-shell { min-height: 100vh; display: grid; grid-template-columns: 245px minmax(0,1fr); } .sidebar { border-right: 1px solid var(--line); background: var(--bg-secondary); padding: 26px 16px; display: flex; flex-direction: column; } .brand { color: var(--text); display: flex; gap: 10px; align-items: center; font-size: 16px; letter-spacing: .01em; padding: 4px 10px 28px; } .brand-mark { width: 29px; height: 29px; display:grid; place-items:center; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-weight: 800; } .sidebar nav { display: grid; gap: 5px; } .nav-item { display: flex; align-items:center; gap: 12px; padding: 11px 12px; border-radius: 9px; color: var(--muted); font-size: 14px; } .nav-item span { color: var(--text-muted); width: 15px; text-align:center; } .nav-item.is-active { background: var(--bg-hover); color: var(--text); } .nav-item.is-active span { color: var(--accent); } .nav-item.is-disabled { cursor: default; opacity: .6; } .sidebar-note { margin: auto 10px 0; color: var(--text-muted); font-size: 12px; line-height: 1.6; }.sidebar-note span { font-size:11px; } .main-content { padding: 42px clamp(20px, 3vw, 48px); max-width: 1600px; width: 100%; margin: 0 auto; } .page-header { display:flex; justify-content:space-between; gap:20px; align-items:flex-end; margin-bottom:28px; } h1 { margin: 2px 0 7px; font-size: clamp(28px, 3vw, 38px); letter-spacing:-.035em; } h2 { font-size: 15px; margin: 0 0 18px; } .eyebrow { margin:0; color:var(--accent); text-transform:uppercase; letter-spacing:.11em; font-size:11px; font-weight:700; } .muted { color: var(--muted); margin: 0; font-size:14px; } .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); } .toolbar { padding: 14px; display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:18px; }.search-form { display:flex; gap:8px; flex: 1; max-width: 690px; }.search-form input { flex:1; }.result-count { color:var(--muted); font-size:13px; white-space:nowrap; } input, select, textarea { color:var(--text); background:var(--input-bg); border:1px solid var(--border-color); border-radius:8px; padding:10px 11px; font:inherit; font-size:14px; width:100%; outline:none; } input:focus, select:focus, textarea:focus { border-color:var(--accent); box-shadow:0 0 0 3px var(--focus-ring); } select { width:auto; } textarea { resize:vertical; } .button { display:inline-flex; align-items:center; justify-content:center; border:0; border-radius:8px; padding:10px 14px; font:inherit; font-size:14px; font-weight:650; cursor:pointer; white-space:nowrap; }.button-primary { background:var(--accent-strong); color:var(--on-accent); }.button-primary:hover { background:var(--accent-hover); color:var(--on-accent); }.button-secondary { background:var(--bg-hover); color:var(--text); }.button-danger { background:var(--danger-solid); color:white; }.table-panel { overflow:hidden; }.table-scroll { overflow-x:auto; } table { width:100%; border-collapse:collapse; min-width:680px; } th { text-align:left; background:var(--table-header-bg); color:var(--text-secondary); font-size:11px; text-transform:uppercase; letter-spacing:.06em; white-space:normal; } th a { color:var(--text-secondary); } th, td { padding:12px 14px; border-bottom:1px solid var(--border-color); } td { font-size:13px; color:var(--text); vertical-align:top; } tr:last-child td { border-bottom:0; } tbody tr:hover { background:var(--bg-hover); }.company-link { color:var(--text); font-weight:650; display:block; }.company-link:hover { color:var(--accent-hover); } td small { color:var(--muted); display:block; margin-top:4px; }.badge { display:inline-block; border-radius:20px; padding:4px 8px; font-size:11px; line-height:1; background:var(--neutral-bg); color:var(--neutral); white-space:nowrap; }.empty-state { text-align:center; padding:52px; color:var(--muted); }.back-link { margin-bottom:22px; font-size:14px; }.detail-header { align-items:center; }.actions, .form-actions { display:flex; gap:10px; }.detail-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }.detail-card { padding:21px; }.detail-card dl { margin:0; }.detail-card dl > div { display:grid; grid-template-columns:145px 1fr; padding:10px 0; gap:12px; border-bottom:1px solid var(--border-color); }.detail-card dl > div:last-child { border-bottom:0; }.detail-card dt { color:var(--muted); font-size:12px; }.detail-card dd { margin:0; font-size:13px; overflow-wrap:anywhere; }.customer-form { display:grid; gap:18px; }.form-section { padding:22px; }.form-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:17px; }.field { display:grid; gap:7px; }.field span { color:var(--text-secondary); font-size:12px; font-weight:600; }.field em { color:var(--danger); font-style:normal; margin-left:3px; }.field-wide { grid-column:span 3; }.field select { width:100%; }.form-actions { justify-content:flex-end; margin-top:8px; }.form-error, .flash { padding:12px 14px; border-radius:10px; margin:0 0 20px; font-size:14px; }.form-error { background:var(--danger-bg); border:1px solid var(--danger); color:var(--danger); }.flash-success { background:var(--success-bg); border:1px solid var(--success); color:var(--success); }.confirm-card { max-width:650px; padding:32px; margin:9vh auto; }.confirm-card h1 { margin-top:7px; }.confirm-card p { color:var(--text-secondary); line-height:1.6; }.confirm-card .form-actions { margin-top:28px; justify-content:flex-start; }
@media (max-width: 850px) { .app-shell { grid-template-columns:1fr; }.sidebar { padding:12px 16px; border-right:0; border-bottom:1px solid var(--line); }.brand { padding:4px 4px 12px; }.sidebar nav { display:flex; overflow-x:auto; }.nav-item { flex:0 0 auto; }.sidebar-note { display:none; }.main-content { padding:28px 18px; }.detail-grid { grid-template-columns:1fr; }.form-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }.field-wide { grid-column:span 2; } }
@media (max-width: 560px) { .page-header { align-items:flex-start; flex-direction:column; }.toolbar, .search-form { align-items:stretch; flex-direction:column; }.search-form select { width:100%; }.result-count { display:none; }.form-grid { grid-template-columns:1fr; }.field-wide { grid-column:span 1; }.detail-card dl > div { grid-template-columns:1fr; gap:4px; }.actions { width:100%; }.actions .button { flex:1; }.form-actions { flex-direction:column-reverse; }.form-actions .button { width:100%; } }

.customer-tabs { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:24px; }
.former-contacts { margin-top:24px; } .former-contacts summary { cursor:pointer; color:var(--muted); padding:16px 0; }
.contact-actions { display:grid; gap:10px; } .contact-actions form { display:grid; gap:8px; }
.preserve-lines { white-space:pre-wrap; } .employment-record { padding:12px 0; border-bottom:1px solid var(--line); }

.login-panel { width: min(420px, calc(100% - 32px)); margin: 12vh auto; padding: 28px; }
.login-panel h1 { font-size: 28px; margin-bottom: 24px; }

/* Dashboard: reuse the existing workspace palette and panels. */
.dashboard-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.dashboard-stat { padding:20px; color:var(--text); display:grid; gap:12px; }
.dashboard-stat span { color:var(--muted); font-size:13px; }
.dashboard-stat strong { font-size:30px; }
.dashboard section { margin-top:28px; }
.dashboard-section-header { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:12px; }
.dashboard-section-header h2 { margin:0; font-size:17px; }
.dashboard-section-header a { font-size:13px; }
.dashboard table { min-width:760px; }
.dashboard th, .dashboard td { padding:12px; }
.dashboard .empty-state { padding:30px; }
.dashboard-pipeline { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.dashboard-stage { padding:18px; }
.dashboard-stage h3 { color:var(--muted); font-size:13px; margin:0 0 12px; }
.dashboard-stage p { font-size:13px; margin:10px 0 0; }
.dashboard-note { margin-bottom:12px; }
.dashboard .dashboard-warning { color:var(--danger); }
@media (max-width:560px) { .dashboard-summary, .dashboard-pipeline { grid-template-columns:repeat(2,minmax(0,1fr)); } }

/* Compact activity lists reuse shared panels and semantic badges. */
.activity-timeline { list-style: none; margin: 0; padding: 0 0 0 1rem; border-left: 2px solid var(--border-color); }
.activity-timeline li { padding: .75rem 1rem; border-bottom: 1px solid var(--border-color); }
.activity-timeline time { display: inline-block; margin-right: .75rem; font-size: .85rem; }
.activity-timeline h3 { margin: .5rem 0; }
.activity-timeline p { margin: .25rem 0; }

/* Shared components: palette values live exclusively in themes.css. */
body { line-height:1.5; }
h1, h2, h3 { overflow-wrap:anywhere; }
h2 { font-size:17px; }
a:hover { text-decoration:underline; }
.button:hover, .nav-item:hover, .brand:hover, .dashboard-stat:hover { text-decoration:none; }
:focus-visible { outline:3px solid var(--accent-primary); outline-offset:3px; }
input::placeholder, textarea::placeholder { color:var(--text-muted); opacity:1; }
input[type=checkbox], input[type=radio] { width:auto; accent-color:var(--accent-primary); }
option { background:var(--input-bg); color:var(--text-primary); }
.field:has([required]) > span::after { content:" *"; color:var(--danger); }
.field:has(em) > span::after { content:none; }
.field, .search-form, .main-content, .sidebar, .detail-grid > *, .form-grid > * { min-width:0; }
.field small, .helper-text { color:var(--text-muted); font-size:12px; }
.toolbar, .search-form, .actions, .form-actions { flex-wrap:wrap; }
.search-form input { min-width:150px; }
.search-form select { max-width:100%; }
.button-secondary { border:1px solid var(--border-color); }
.button-secondary:hover, .nav-item:not(.is-disabled):hover { background:var(--bg-hover); color:var(--accent-primary); }
.button:disabled { cursor:not-allowed; opacity:.65; }
.nav-item.is-active { box-shadow:inset 3px 0 var(--accent-primary); font-weight:650; }
.nav-settings { margin-top:14px; border-top:1px solid var(--border-color); }
.sidebar > form { margin:22px 10px; }
.sidebar-note { padding-top:16px; }
.table-scroll { max-width:100%; }
td { min-width:85px; max-width:300px; overflow-wrap:anywhere; }
th { line-height:1.4; }
td:has(.contact-actions) { width:180px; }
td:has(> a:only-child) { max-width:240px; }
.badge { line-height:1.4; white-space:normal; font-weight:650; }
.badge-success { background:var(--success-bg); color:var(--success); }
.badge-warning { background:var(--warning-bg); color:var(--warning); }
.badge-danger { background:var(--danger-bg); color:var(--danger); }
.badge-info { background:var(--info-bg); color:var(--info); }
.badge-neutral { background:var(--neutral-bg); color:var(--neutral); }
.flash-error, .flash-danger { background:var(--danger-bg); color:var(--danger); border:1px solid var(--danger); }
.flash-warning { background:var(--warning-bg); color:var(--warning); }
.flash-info { background:var(--info-bg); color:var(--info); }
.pagination { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:10px; padding:18px 0; }
.main-content > section.panel { margin-top:20px; }
section.panel > h2, section.panel > .page-header, section.panel > .activity-timeline, section.panel > p.muted { margin:18px 20px; }
.detail-card > h2, .form-section > h2 { margin:0 0 18px !important; }
.dashboard-stat { border-top:3px solid var(--accent-primary); }
.dashboard-stat:hover { background:var(--bg-hover); color:var(--text-primary); }
.dashboard-stat[href="#overdue_follow_ups"] { border-top-color:var(--danger); }
.dashboard-stat[href="#waiting"] { border-top-color:var(--warning); }
.dashboard-stat strong { font-variant-numeric:tabular-nums; }
.theme-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; }
.theme-option { text-align:left; padding:16px; border:2px solid var(--border-color); border-radius:var(--radius); background:var(--bg-card); color:var(--text-primary); font:inherit; cursor:pointer; box-shadow:var(--shadow); }
.theme-option:hover { border-color:var(--accent-primary); }
.theme-option[aria-pressed=true] { border-color:var(--accent-primary); outline:2px solid var(--focus-ring); }
.theme-name { display:flex; flex-wrap:wrap; gap:8px; justify-content:space-between; font-weight:700; margin:14px 0 8px; }
.theme-description { display:block; color:var(--text-secondary); font-size:13px; }
.theme-selected { visibility:hidden; color:var(--accent-primary); font-size:12px; }
[aria-pressed=true] .theme-selected { visibility:visible; }
.theme-preview { display:flex; height:105px; gap:12px; padding:12px; background:var(--bg-primary); border:1px solid var(--border-color); border-radius:8px; }
.preview-sidebar { width:22%; border-radius:4px; background:var(--bg-secondary); border:1px solid var(--border-color); }
.preview-card { flex:1; display:grid; align-content:center; gap:10px; padding:12px; background:var(--bg-card); border:1px solid var(--border-color); border-radius:4px; }
.preview-card span { height:5px; background:var(--text-muted); border-radius:2px; }
.preview-card span:last-child { width:60%; }
.preview-accent { width:12%; border-radius:4px; background:var(--accent-primary); }
.appearance-note { margin-top:20px; }
.source-preview { display:block; max-width:100%; max-height:600px; object-fit:contain; margin:20px 0; border:1px solid var(--border-color); border-radius:var(--radius); }
@media (max-width:1100px) { .theme-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .detail-header { align-items:flex-start; flex-wrap:wrap; } }
@media (max-width:850px) { .nav-settings { margin-top:0; border-top:0; border-left:1px solid var(--border-color); } .sidebar > form { margin:12px 0 0; } }
@media (max-width:560px) { .theme-grid, .dashboard-pipeline { grid-template-columns:1fr; } .theme-preview { height:90px; } .page-header .actions { flex-wrap:wrap; } }
