:root { --ink:#17201d; --muted:#68736f; --line:#e2e7e4; --paper:#fff; --canvas:#f3f6f4; --nav:#18211e; --green:#17875f; --blue:#2878d0; --red:#d34c4c; --amber:#c98214; }
* { box-sizing:border-box; }
html { background:var(--canvas); }
body { margin:0; color:var(--ink); font-family:Inter, "Segoe UI", Arial, sans-serif; font-size:14px; letter-spacing:0; }
button,input,select,textarea { font:inherit; letter-spacing:0; }
button,a { -webkit-tap-highlight-color:transparent; }
a { color:inherit; text-decoration:none; }
.app { min-height:100vh; display:grid; grid-template-columns:238px minmax(0,1fr); }
.sidebar { position:sticky; top:0; height:100vh; background:var(--nav); color:#eef5f1; padding:20px 14px; display:flex; flex-direction:column; z-index:20; }
.brand { display:flex; align-items:center; gap:11px; padding:2px 9px 24px; font-size:17px; font-weight:750; }
.brand-mark { width:32px; height:32px; display:grid; place-items:center; border-radius:7px; color:#10221b; background:#80d5ad; font-weight:900; }
.workspace { padding:0 10px 18px; color:#91a19a; font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.nav { display:grid; gap:4px; }
.nav a { min-height:42px; padding:0 11px; border-radius:6px; display:flex; align-items:center; gap:11px; color:#aab8b2; font-weight:600; }
.nav a:hover,.nav a.active { color:#fff; background:#26322e; }
.nav a.active { box-shadow:inset 3px 0 #70d4a7; }
.nav svg { width:18px; height:18px; }
.sidebar-bottom { margin-top:auto; border-top:1px solid #33403b; padding-top:14px; }
.profile { display:flex; align-items:center; gap:10px; padding:8px; }
.avatar { width:34px; height:34px; border-radius:50%; display:grid; place-items:center; color:#153127; background:#b9e8d3; font-weight:800; flex:none; }
.profile-meta { min-width:0; flex:1; }
.profile-name,.profile-role { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.profile-name { font-weight:700; color:#fff; }
.profile-role { color:#91a19a; font-size:12px; margin-top:2px; }
.icon-button { border:0; background:transparent; color:inherit; padding:8px; border-radius:6px; cursor:pointer; display:grid; place-items:center; }
.icon-button:hover { background:#ffffff10; }
.danger-action { color:var(--red); }
.danger-action:hover { background:#fff0f0; }
.main { min-width:0; }
.topbar { height:65px; padding:0 28px; display:flex; align-items:center; gap:16px; justify-content:space-between; background:rgba(255,255,255,.94); border-bottom:1px solid var(--line); position:sticky; top:0; z-index:15; backdrop-filter:blur(10px); }
.page-title { font-size:20px; line-height:1.2; margin:0; font-weight:760; }
.top-actions { display:flex; gap:8px; align-items:center; }
.content { padding:26px 28px 44px; max-width:1540px; margin:0 auto; }
.section-head { display:flex; align-items:flex-end; justify-content:space-between; gap:16px; margin-bottom:18px; }
.section-head h2 { margin:0; font-size:18px; }
.section-head p { margin:5px 0 0; color:var(--muted); }
.btn { border:1px solid var(--line); background:#fff; color:var(--ink); min-height:38px; padding:0 14px; border-radius:6px; display:inline-flex; align-items:center; justify-content:center; gap:8px; font-weight:700; cursor:pointer; white-space:nowrap; }
.btn:hover { border-color:#bac5c0; background:#fafcfb; }
.btn-primary { color:#fff; border-color:var(--green); background:var(--green); }
.btn-primary:hover { background:#116f4d; border-color:#116f4d; }
.btn-danger { color:#b02f2f; }
.btn-compact { min-height:34px; padding:0 11px; }
.btn svg { width:17px; height:17px; }
.stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); border:1px solid var(--line); background:var(--paper); margin-bottom:22px; }
.stat { padding:19px 21px; border-right:1px solid var(--line); min-width:0; }
.stat:last-child { border:0; }
.stat-label { color:var(--muted); font-size:12px; font-weight:700; text-transform:uppercase; }
.stat-value { font-size:29px; line-height:1; margin-top:12px; font-weight:780; }
.stat-note { color:var(--muted); font-size:12px; margin-top:7px; }
.panel { background:var(--paper); border:1px solid var(--line); }
.panel-head { padding:16px 18px; border-bottom:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; gap:12px; }
.panel-head h3 { margin:0; font-size:15px; }
.dashboard-grid { display:grid; grid-template-columns:minmax(0,1.65fr) minmax(290px,.75fr); gap:20px; }
.chart { height:230px; padding:34px 22px 16px; display:flex; align-items:flex-end; gap:8px; }
.bar-wrap { flex:1; height:100%; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; gap:8px; min-width:0; position:relative; }
.bar { width:100%; max-width:34px; min-height:3px; background:#50aa82; border-radius:3px 3px 0 0; transition:height .25s; }
.bar-tip { position:absolute; bottom:calc(100% + 8px); left:50%; transform:translate(-50%, 4px); opacity:0; pointer-events:none; background:#17201d; color:#fff; border-radius:5px; padding:5px 7px; font-size:12px; font-weight:750; white-space:nowrap; box-shadow:0 10px 24px #10181422; transition:opacity .16s, transform .16s; }
.bar-tip:after { content:""; position:absolute; left:50%; top:100%; transform:translateX(-50%); border:5px solid transparent; border-top-color:#17201d; }
.bar-wrap:hover .bar-tip { opacity:1; transform:translate(-50%, 0); }
.bar-label { color:var(--muted); font-size:10px; }
.feed { padding:8px 18px 18px; }
.feed-row { display:grid; grid-template-columns:9px minmax(0,1fr) auto; gap:12px; align-items:start; padding:12px 0; border-bottom:1px solid #edf0ee; }
.feed-row:last-child { border:0; }
.dot { width:8px; height:8px; margin-top:5px; border-radius:50%; background:var(--blue); }
.feed-title { font-weight:700; }
.feed-sub,.small { font-size:12px; color:var(--muted); margin-top:4px; }
.filters { padding:14px; display:flex; gap:9px; flex-wrap:wrap; border-bottom:1px solid var(--line); }
.field { display:grid; gap:6px; }
.field label { font-size:12px; color:var(--muted); font-weight:700; }
.input,.select,.textarea { width:100%; border:1px solid #d9e0dc; background:#fff; color:var(--ink); border-radius:6px; padding:0 11px; min-height:39px; outline:none; }
.input-compact { min-height:34px; }
.textarea { padding:10px 11px; min-height:94px; resize:vertical; }
.input:focus,.select:focus,.textarea:focus { border-color:#479979; box-shadow:0 0 0 3px #16835d14; }
.search { min-width:240px; flex:1; max-width:380px; }
.table-wrap { overflow:auto; }
table { width:100%; border-collapse:collapse; }
th { padding:11px 14px; color:var(--muted); background:#fafbfa; font-size:11px; text-align:left; text-transform:uppercase; white-space:nowrap; }
td { padding:13px 14px; border-top:1px solid #edf0ee; vertical-align:middle; }
tbody tr:hover { background:#fbfdfc; }
.team-row-form { display:flex; align-items:flex-end; gap:9px; flex-wrap:wrap; }
.team-field { min-width:180px; }
.switch-field { min-height:34px; display:inline-flex; align-items:center; gap:8px; color:var(--muted); font-weight:700; }
.switch-field input { width:16px; height:16px; accent-color:var(--green); }
.client { font-weight:720; }
.phone { margin-top:3px; color:var(--muted); font-size:12px; }
.badge { display:inline-flex; align-items:center; gap:6px; padding:5px 8px; border-radius:5px; font-size:12px; font-weight:700; white-space:nowrap; background:#eef1ef; color:#59635f; }
.badge:before { content:""; width:6px; height:6px; border-radius:50%; background:currentColor; }
.badge-blue { background:#e9f3ff; color:#2878d0; }.badge-amber { background:#fff4dc; color:#b56e05; }.badge-green,.badge-emerald { background:#e6f7ef; color:#16805b; }
.badge-red { background:#ffeded; color:#c63e3e; }.badge-orange { background:#fff0e5; color:#c46622; }.badge-violet,.badge-purple { background:#f1ecff; color:#7552bf; }.badge-cyan { background:#e4f7f8; color:#23858c; }
.overdue { color:var(--red); font-weight:700; }
.pagination { display:flex; justify-content:space-between; align-items:center; padding:14px; border-top:1px solid var(--line); }
.empty { padding:60px 24px; text-align:center; color:var(--muted); }
.lead-layout { display:grid; grid-template-columns:minmax(0,1fr) 350px; gap:20px; }
.lead-hero { padding:20px; display:flex; align-items:flex-start; justify-content:space-between; gap:18px; border-bottom:1px solid var(--line); }
.lead-name { margin:0; font-size:23px; }
.lead-contact { display:flex; gap:15px; flex-wrap:wrap; margin-top:10px; color:var(--muted); }
.lead-contact a { color:#176f9f; font-weight:650; }
.details-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); padding:4px 20px 20px; }
.detail { padding:14px 0; border-bottom:1px solid #edf0ee; }
.detail:nth-child(odd) { padding-right:20px; }
.detail-label { color:var(--muted); font-size:12px; }
.detail-value { margin-top:6px; word-break:break-word; }
.side-form { padding:17px; display:grid; gap:13px; }
.timeline { padding:8px 20px 20px; }
.timeline-item { position:relative; padding:13px 0 13px 25px; border-bottom:1px solid #edf0ee; }
.timeline-item:before { content:""; position:absolute; left:2px; top:18px; width:8px; height:8px; border-radius:50%; background:#56a987; box-shadow:0 0 0 4px #e5f4ed; }
.timeline-title { font-weight:700; }
.modal { position:fixed; inset:0; background:#10181499; z-index:50; display:none; place-items:center; padding:20px; }
.modal.open { display:grid; }
.modal-box { width:min(520px,100%); max-height:calc(100vh - 40px); overflow:auto; background:#fff; border-radius:8px; box-shadow:0 28px 90px #0005; }
.modal-head { padding:17px 19px; border-bottom:1px solid var(--line); display:flex; justify-content:space-between; align-items:center; }
.modal-head h3 { margin:0; font-size:17px; }
.modal-body { padding:19px; display:grid; gap:14px; }
.modal-box-wide { width:min(720px,100%); }
.modal-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.modal-grid .field-wide { grid-column:1/-1; }
.modal-actions { padding:15px 19px; border-top:1px solid var(--line); display:flex; justify-content:flex-end; gap:8px; }
.toast-stack { position:fixed; right:20px; top:82px; z-index:80; display:grid; gap:10px; width:min(360px,calc(100vw - 40px)); }
.toast { background:#16211d; color:#fff; padding:13px 15px; border-radius:7px; box-shadow:0 12px 40px #10181435; display:flex; gap:10px; align-items:flex-start; animation:toast-in .2s ease; }
.toast.error { background:#9e3030; }.toast svg { width:18px; flex:none; margin-top:1px; }
@keyframes toast-in { from { opacity:0; transform:translateY(-8px); } }
.auth-shell { min-height:100vh; display:grid; grid-template-columns:minmax(320px,440px) 1fr; background:#fff; }
.auth-panel { padding:48px clamp(28px,5vw,64px); display:flex; flex-direction:column; justify-content:center; border-right:1px solid var(--line); }
.auth-panel .brand { color:var(--ink); padding:0 0 42px; }.auth-panel .brand-mark { background:#83d6ae; }
.auth-panel h1 { margin:0; font-size:30px; }.auth-panel > p { color:var(--muted); line-height:1.6; margin:10px 0 28px; }
.auth-form { display:grid; gap:15px; }
.auth-link { margin-top:24px; color:var(--muted); }.auth-link a { color:var(--green); font-weight:700; }
.auth-scene { background:#1b2823; color:#fff; padding:8vw; display:flex; flex-direction:column; justify-content:flex-end; position:relative; overflow:hidden; }
.auth-scene:before { content:""; position:absolute; inset:0; background-image:linear-gradient(#ffffff0b 1px,transparent 1px),linear-gradient(90deg,#ffffff0b 1px,transparent 1px); background-size:44px 44px; }
.auth-scene > * { position:relative; }.auth-scene h2 { max-width:620px; font-size:42px; line-height:1.15; margin:0; }.auth-scene p { max-width:570px; color:#b8c8c1; font-size:17px; line-height:1.6; }
.error-text { color:var(--red); font-size:12px; }
.mobile-toggle { display:none; }
.code-box { background:#17201d; color:#bfe9d5; padding:15px; border-radius:6px; font:12px/1.6 Consolas,monospace; overflow:auto; white-space:pre-wrap; word-break:break-all; }
@media(max-width:1000px){.dashboard-grid,.lead-layout{grid-template-columns:1fr}.stats{grid-template-columns:repeat(2,1fr)}.stat:nth-child(2){border-right:0}.stat:nth-child(-n+2){border-bottom:1px solid var(--line)}}
@media(max-width:760px){.app{grid-template-columns:1fr}.sidebar{position:fixed;left:-250px;width:238px;transition:left .2s}.sidebar.open{left:0;box-shadow:20px 0 50px #0004}.mobile-toggle{display:grid}.topbar{padding:0 15px;height:58px}.content{padding:18px 14px 36px}.stats{grid-template-columns:1fr}.stat{border-right:0;border-bottom:1px solid var(--line)!important}.stat:last-child{border-bottom:0!important}.section-head{align-items:flex-start}.hide-mobile{display:none}.lead-hero{display:block}.lead-hero .btn{margin-top:14px}.details-grid{grid-template-columns:1fr}.detail:nth-child(odd){padding-right:0}.auth-shell{grid-template-columns:1fr}.auth-panel{min-height:100vh}.auth-scene{display:none}.filters{display:grid;grid-template-columns:1fr 1fr}.filters .search{grid-column:1/-1;max-width:none;min-width:0}.modal-grid{grid-template-columns:1fr}.modal-grid .field-wide{grid-column:auto}}
