:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --line: #e6eaf2;
  --text: #0f172a;
  --muted: #64748b;
  --brand: #2563eb;
  --brand-2: #6d28d9;
  --brand-soft: #eaf1ff;
  --grad: linear-gradient(135deg, #2563eb 0%, #6d28d9 100%);
  --side: #0b1224;
  --side-2: #121b33;
  --side-text: #c7d2fe;
  --green: #10b981; --green-soft: #e7f8f1;
  --amber: #f59e0b; --amber-soft: #fff5e0;
  --red: #ef4444; --red-soft: #fdecec;
  --violet: #8b5cf6; --violet-soft: #f1ebff;
  --cyan: #06b6d4; --cyan-soft: #e3f8fc;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px -12px rgba(15,23,42,.12);
  --shadow-lg: 0 24px 60px -20px rgba(15,23,42,.35);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body { font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
.muted { color: var(--muted); }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }

/* ---------- buttons & inputs ---------- */
.btn { border: 0; border-radius: 11px; padding: 10px 16px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: transform .12s, box-shadow .2s, background .2s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 20px -8px rgba(37,99,235,.65); }
.btn-primary:hover { box-shadow: 0 10px 26px -8px rgba(109,40,217,.7); }
.btn-ghost { background: var(--surface); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; justify-content: center; padding: 12px; }
.icon-btn { border: 0; background: transparent; width: 34px; height: 34px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; font-size: 16px; color: inherit; }
.icon-btn:hover { background: rgba(100,116,139,.12); }
label { display: grid; gap: 6px; font-size: 12.5px; font-weight: 600; color: #334155; }
input, select, textarea { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 11px; padding: 10px 12px; outline: none; transition: border .15s, box-shadow .15s; font-weight: 500; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(37,99,235,.12); }
textarea { resize: vertical; min-height: 90px; }
.form-error { color: var(--red); font-size: 13px; min-height: 1em; margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------- auth ---------- */
.auth { display: grid; grid-template-columns: 1.15fr 1fr; min-height: 100vh; }
.auth-art { position: relative; overflow: hidden; background: var(--side); color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: center; gap: 22px; }
.auth-glow { position: absolute; inset: -30%; background: radial-gradient(circle at 20% 20%, rgba(59,130,246,.45), transparent 40%), radial-gradient(circle at 80% 70%, rgba(139,92,246,.45), transparent 40%); filter: blur(30px); animation: drift 14s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate(4%, -3%) rotate(6deg); } }
.auth-art > * { position: relative; }
.auth-art h1 { font-size: 44px; line-height: 1.08; font-weight: 800; }
.auth-art h1 span { background: linear-gradient(90deg, #93c5fd, #c4b5fd); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-art p { color: #c7d2fe; max-width: 460px; font-size: 15.5px; }
.auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; color: #e0e7ff; }
.auth-points i { color: #93c5fd; font-style: normal; margin-right: 8px; }
.auth-foot { position: absolute !important; bottom: 28px; left: 56px; color: #64748b; font-size: 12.5px; }
.auth-panel { display: grid; place-items: center; padding: 32px; }
.auth-card { width: min(400px, 100%); display: grid; gap: 14px; background: var(--surface); padding: 34px; border-radius: 22px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.auth-card h2 { font-size: 26px; }
.auth-card .muted { margin: -8px 0 6px; }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 11px; }
.brand img { width: 42px; height: 42px; object-fit: contain; }
.brand b { display: block; font-size: 16px; letter-spacing: .08em; font-weight: 800; }
.brand small { display: block; font-size: 11.5px; color: #94a3b8; max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-lg img { width: 64px; height: 64px; }
.brand-lg b { font-size: 20px; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--side); color: var(--side-text); padding: 22px 16px; display: flex; flex-direction: column; gap: 22px; overflow-y: auto; }
.sidebar .brand b { color: #fff; }
.module-switch { position: relative; display: grid; grid-template-columns: 1fr 1fr; background: var(--side-2); border-radius: 12px; padding: 4px; }
.module-switch button { position: relative; z-index: 1; border: 0; background: none; color: #94a3b8; font-weight: 700; padding: 8px 4px; font-size: 13px; cursor: pointer; border-radius: 9px; transition: color .2s; }
.module-switch button.selected { color: #fff; }
.switch-pill { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); background: var(--grad); border-radius: 9px; transition: transform .28s cubic-bezier(.4,1.4,.6,1); box-shadow: 0 6px 16px -6px rgba(37,99,235,.8); }
#nav { display: grid; gap: 3px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: #475569; margin: 6px 10px; font-weight: 700; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 11px; color: #a5b4cf; cursor: pointer; font-weight: 600; border: 0; background: none; text-align: left; width: 100%; transition: background .15s, color .15s; }
.nav-item:hover { background: rgba(148,163,184,.08); color: #fff; }
.nav-item.active { background: rgba(59,130,246,.16); color: #fff; box-shadow: inset 3px 0 0 #60a5fa; }
.nav-item .ico { width: 20px; text-align: center; opacity: .9; }
.nav-item .count { margin-left: auto; font-size: 11.5px; background: rgba(148,163,184,.15); padding: 1px 8px; border-radius: 99px; }
.nav-item .count.hot { background: var(--red); color: #fff; }
.sidebar-card { background: linear-gradient(160deg, rgba(59,130,246,.18), rgba(139,92,246,.12)); border: 1px solid rgba(148,163,184,.12); border-radius: 14px; padding: 14px; font-size: 13px; margin-top: auto; }
.sidebar-card b { color: #fff; display: block; margin-bottom: 4px; }
.sidebar-card .muted { color: #a5b4cf; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--side-2); }
.user-chip b { color: #fff; display: block; font-size: 13px; }
.user-chip small { color: #64748b; font-size: 11.5px; display: block; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.user-chip .icon-btn { margin-left: auto; color: #94a3b8; }
.avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; color: #fff; background: var(--grad); flex: none; }

.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 18px; padding: 18px 32px; background: rgba(244,246,251,.82); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.crumb { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .1em; }
.topbar h1 { font-size: 22px; font-weight: 800; }
.search-trigger { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 300px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 9px 12px; color: var(--muted); cursor: pointer; }
.search-trigger kbd { margin-left: auto; font-family: inherit; font-size: 11px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.top-actions { display: flex; gap: 10px; }
.menu-btn { display: none; }
.view { padding: 28px 32px 60px; display: grid; gap: 22px; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 0; }
.card-head h3 { font-size: 15.5px; }
.card-head .muted { font-size: 12.5px; }
.card-head .spacer { flex: 1; }
.card-body { padding: 16px 20px 20px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { padding: 18px 20px; position: relative; overflow: hidden; }
.stat .label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stat .value { font-size: 28px; font-weight: 800; letter-spacing: -.03em; margin-top: 4px; }
.stat .sub { font-size: 12px; color: var(--muted); }
.stat .glyph { position: absolute; right: 16px; top: 16px; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 17px; }
.g-blue { background: var(--brand-soft); color: var(--brand); }
.g-green { background: var(--green-soft); color: var(--green); }
.g-amber { background: var(--amber-soft); color: var(--amber); }
.g-violet { background: var(--violet-soft); color: var(--violet); }
.g-red { background: var(--red-soft); color: var(--red); }
.cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 22px; align-items: start; }

/* funnel */
.funnel { display: grid; gap: 10px; }
.funnel-row { display: grid; grid-template-columns: 92px 1fr 70px; align-items: center; gap: 12px; font-size: 13px; font-weight: 600; }
.funnel-bar { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.funnel-bar span { display: block; height: 100%; border-radius: 99px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.funnel-row .num { text-align: right; color: var(--muted); }

/* lists */
.row-list { display: grid; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); cursor: pointer; transition: background .12s; }
.row:hover { background: var(--surface-2); }
.row:first-child { border-top: 0; }
.row .main-col { min-width: 0; flex: 1; }
.row .title { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.row .meta { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.done .title { text-decoration: line-through; color: var(--muted); }
.check { width: 24px; height: 24px; border-radius: 8px; border: 2px solid #cbd5e1; background: #fff; cursor: pointer; display: grid; place-items: center; color: transparent; font-size: 13px; flex: none; transition: all .15s; }
.check:hover { border-color: var(--green); }
.check.on { background: var(--green); border-color: var(--green); color: #fff; }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.empty .em { font-size: 30px; margin-bottom: 6px; }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--surface-2); color: #475569; border: 1px solid var(--line); white-space: nowrap; }
.chip.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-New { color: #2563eb; background: var(--brand-soft); border-color: transparent; }
.st-Contacted { color: #0891b2; background: var(--cyan-soft); border-color: transparent; }
.st-Interested { color: #7c3aed; background: var(--violet-soft); border-color: transparent; }
.st-Proposal { color: #b45309; background: var(--amber-soft); border-color: transparent; }
.st-Won { color: #047857; background: var(--green-soft); border-color: transparent; }
.st-Lost { color: #b91c1c; background: var(--red-soft); border-color: transparent; }
.due-over { color: var(--red); font-weight: 700; }
.due-today { color: #b45309; font-weight: 700; }

/* table */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { width: auto; min-width: 170px; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--brand-soft); color: var(--brand); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
th:first-child { border-top-left-radius: var(--radius); } th:last-child { border-top-right-radius: var(--radius); }
td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr { cursor: pointer; transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
.person { display: flex; align-items: center; gap: 10px; }
.person b { display: block; }
.person small { color: var(--muted); }
.ava { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 12px; flex: none; }
.money { font-weight: 700; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }

/* kanban */
.kanban { display: grid; grid-template-columns: repeat(6, minmax(230px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.lane { background: #eef1f8; border-radius: 16px; padding: 12px; min-height: 420px; display: flex; flex-direction: column; gap: 10px; transition: background .15s, box-shadow .15s; }
.lane.over { background: var(--brand-soft); box-shadow: inset 0 0 0 2px var(--brand); }
.lane-head { display: flex; align-items: center; gap: 8px; font-weight: 700; padding: 2px 4px 6px; }
.lane-head .sum { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 600; }
.deal { background: #fff; border-radius: 13px; padding: 12px; box-shadow: var(--shadow); border: 1px solid var(--line); cursor: grab; display: grid; gap: 6px; transition: transform .12s, box-shadow .15s; }
.deal:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -14px rgba(15,23,42,.3); }
.deal.dragging { opacity: .45; }
.deal b { font-size: 13.5px; }
.deal .meta { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }

/* social */
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.client-card { padding: 20px; display: grid; gap: 14px; cursor: pointer; transition: transform .15s, box-shadow .2s; position: relative; overflow: hidden; }
.client-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--accent, var(--grad)); }
.client-card:hover { transform: translateY(-3px); box-shadow: 0 20px 40px -24px rgba(15,23,42,.4); }
.client-top { display: flex; align-items: center; gap: 12px; }
.client-top .ava { width: 46px; height: 46px; border-radius: 14px; font-size: 15px; color: #fff; }
.client-top b { font-size: 16px; display: block; }
.net-row { display: flex; gap: 6px; flex-wrap: wrap; }
.net { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; position: relative; }
.net.off { filter: grayscale(.2); opacity: .55; }
.net-Instagram { background: linear-gradient(45deg, #f59e0b, #ec4899, #8b5cf6); }
.net-Facebook { background: #1877f2; }
.net-LinkedIn { background: #0a66c2; }
.net-YouTube { background: #ff0000; }
.net-X { background: #0f172a; }
.net-Google { background: #34a853; }
.client-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.client-stats div { background: var(--surface-2); border-radius: 11px; padding: 9px 10px; }
.client-stats b { display: block; font-size: 17px; }
.client-stats small { color: var(--muted); font-size: 11.5px; }
.add-card { border: 2px dashed #cbd5e1; background: transparent; box-shadow: none; display: grid; place-items: center; min-height: 220px; color: var(--muted); font-weight: 700; cursor: pointer; border-radius: var(--radius); }
.add-card:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

.composer { display: grid; grid-template-columns: 1.25fr 1fr; gap: 22px; align-items: start; }
.channel-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.channel-opt { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--line); border-radius: 12px; padding: 9px 10px; cursor: pointer; font-weight: 600; font-size: 13px; transition: all .15s; }
.channel-opt input { display: none; }
.channel-opt .net { width: 26px; height: 26px; border-radius: 8px; font-size: 11px; }
.channel-opt.on { border-color: var(--brand); background: var(--brand-soft); }
.channel-opt small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; }
.counter { font-size: 12px; color: var(--muted); text-align: right; margin-top: -6px; }
.counter.warn { color: var(--red); font-weight: 700; }
.compose-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.preview { position: sticky; top: 100px; }
.phone { margin: 0 auto; width: 300px; border-radius: 34px; background: #0b1224; padding: 12px; box-shadow: var(--shadow-lg); }
.phone-inner { background: #fff; border-radius: 24px; overflow: hidden; }
.ig-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-weight: 700; font-size: 13px; }
.ig-head .ava { width: 28px; height: 28px; border-radius: 50%; font-size: 10px; color: #fff; }
.ig-media { aspect-ratio: 4/5; background: linear-gradient(135deg, #dbeafe, #ede9fe); display: grid; place-items: center; color: #6366f1; font-weight: 700; text-align: center; padding: 20px; font-size: 13px; }
.ig-cap { padding: 10px 12px 16px; font-size: 12.5px; white-space: pre-wrap; word-break: break-word; max-height: 160px; overflow: auto; }
.ig-icons { padding: 8px 12px 0; letter-spacing: 6px; font-size: 16px; }

.cal-head { display: flex; align-items: center; gap: 10px; }
.cal-head h3 { min-width: 170px; }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--line); }
.cal-dow { padding: 10px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; border-bottom: 1px solid var(--line); }
.cal-day { min-height: 116px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 8px; display: grid; align-content: start; gap: 4px; cursor: pointer; transition: background .12s; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day:hover { background: var(--surface-2); }
.cal-day.other { background: #fafbfd; color: #cbd5e1; }
.cal-day .d { font-size: 12.5px; font-weight: 700; }
.cal-day.today .d { background: var(--grad); color: #fff; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; }
.cal-post { font-size: 11.5px; font-weight: 600; padding: 3px 7px; border-radius: 7px; background: var(--brand-soft); color: var(--brand); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--brand); }
.cal-post.Draft { background: #f1f5f9; color: #475569; border-color: #94a3b8; }
.cal-post.Published { background: var(--green-soft); color: #047857; border-color: var(--green); }
.cal-post.Needs { background: var(--amber-soft); color: #b45309; border-color: var(--amber); }

.post-row .text { font-size: 13px; color: #334155; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ps-Draft { color: #475569; } .ps-Scheduled { color: var(--brand); background: var(--brand-soft); border-color: transparent; }
.ps-Needs { color: #b45309; background: var(--amber-soft); border-color: transparent; }
.ps-Published { color: #047857; background: var(--green-soft); border-color: transparent; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: linear-gradient(135deg, #eff6ff, #f5f3ff); border: 1px solid #dbe4ff; font-size: 13px; color: #334155; }
.notice b { color: var(--text); }

/* ---------- drawer ---------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.35); backdrop-filter: blur(2px); z-index: 20; animation: fadeIn .2s; }
@keyframes fadeIn { from { opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: var(--surface); z-index: 21; transform: translateX(105%); transition: transform .3s cubic-bezier(.2,.8,.2,1); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer-head { padding: 22px 24px; border-bottom: 1px solid var(--line); display: flex; gap: 14px; align-items: flex-start; }
.drawer-head .ava { width: 52px; height: 52px; border-radius: 15px; font-size: 17px; }
.drawer-head h2 { font-size: 20px; }
.drawer-body { padding: 20px 24px; overflow-y: auto; display: grid; gap: 18px; align-content: start; flex: 1; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; }
.stage-steps { display: flex; gap: 4px; }
.stage-steps button { flex: 1; border: 0; padding: 8px 4px; font-size: 11.5px; font-weight: 700; background: var(--surface-2); color: var(--muted); cursor: pointer; border-radius: 6px; transition: all .15s; }
.stage-steps button:first-child { border-radius: 10px 6px 6px 10px; } .stage-steps button:last-child { border-radius: 6px 10px 10px 6px; }
.stage-steps button.past { background: #dbeafe; color: var(--brand); }
.stage-steps button.cur { background: var(--grad); color: #fff; }
.stage-steps button.lost.cur { background: var(--red); }
.timeline { display: grid; gap: 0; position: relative; }
.tl { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding-bottom: 14px; position: relative; }
.tl::before { content: ""; position: absolute; left: 13px; top: 26px; bottom: 0; width: 2px; background: var(--line); }
.tl:last-child::before { display: none; }
.tl .dotx { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-size: 13px; background: var(--surface-2); }
.tl p { margin: 3px 0 0; font-size: 13.5px; white-space: pre-wrap; }
.tl small { color: var(--muted); font-size: 11.5px; }
.section-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kv div { background: var(--surface-2); padding: 10px 12px; border-radius: 12px; }
.kv small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.kv b { font-size: 13.5px; word-break: break-word; }
.drawer-foot { padding: 14px 24px; border-top: 1px solid var(--line); display: flex; gap: 10px; }

/* ---------- modal / palette ---------- */
dialog { border: 0; padding: 0; background: transparent; }
dialog::backdrop { background: rgba(15,23,42,.45); backdrop-filter: blur(3px); }
.modal[open] { animation: pop .22s cubic-bezier(.2,.9,.3,1.2); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } }
.modal-card { width: min(560px, 94vw); background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); }
.modal-card header { display: flex; align-items: center; padding: 20px 24px 0; }
.modal-card header h2 { font-size: 19px; }
.modal-card header .icon-btn { margin-left: auto; }
.modal-card form { padding: 18px 24px 24px; display: grid; gap: 14px; }
.modal-card .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.profile-edit { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; }
.palette { width: min(620px, 94vw); margin-top: 12vh; }
.palette[open] { animation: pop .18s ease; }
.palette input { border: 0; border-radius: 18px 18px 0 0; padding: 18px 20px; font-size: 16px; box-shadow: none !important; border-bottom: 1px solid var(--line); }
#palette-results { background: var(--surface); border-radius: 0 0 18px 18px; max-height: 420px; overflow: auto; padding: 6px; box-shadow: var(--shadow-lg); }
.pal-item { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 11px; cursor: pointer; }
.pal-item.sel, .pal-item:hover { background: var(--brand-soft); }
.pal-item small { color: var(--muted); display: block; }
.pal-group { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; padding: 10px 12px 4px; }

/* ---------- toast ---------- */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); background: #0f172a; color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 13.5px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 50; box-shadow: var(--shadow-lg); }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 1200px) { .stats { grid-template-columns: repeat(2, 1fr); } .cols, .composer { grid-template-columns: 1fr; } .preview { position: static; } }
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; } .auth-art { display: none; }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 30; width: 270px; transform: translateX(-100%); transition: transform .25s; }
  .app.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .menu-btn { display: grid; }
  .search-trigger { min-width: 0; flex: 1; } .search-trigger kbd, .search-trigger span + * { display: none; }
  .topbar { padding: 14px 16px; gap: 10px; flex-wrap: wrap; } .view { padding: 18px 16px 50px; }
  .top-actions { width: 100%; } .top-actions .btn { flex: 1; justify-content: center; }
  .grid-2, .kv { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; } .stat .value { font-size: 22px; }
  .cal-day { min-height: 70px; padding: 4px; } .cal-post { font-size: 0; height: 6px; padding: 0; }
}

/* ---------- packages ---------- */
.pk-bars { display: grid; gap: 8px; }
.pk-row { display: grid; grid-template-columns: 104px 1fr auto; gap: 10px; align-items: center; font-size: 12.5px; font-weight: 600; }
.pk-l { color: #334155; }
.pk-bar { position: relative; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.pk-bar span { position: absolute; inset: 0 auto 0 0; border-radius: 99px; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.pk-plan { background: #c7d7fe; }
.pk-done { background: var(--grad); }
.pk-row.ok .pk-done { background: var(--green); }
.pk-row.ok .pk-n b { color: var(--green); }
.pk-n { white-space: nowrap; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.pk-n b { color: var(--text); }
.mini { width: 22px; height: 22px; border-radius: 7px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 700; line-height: 1; padding: 0; }
.mini:hover { border-color: var(--brand); color: var(--brand); }
.pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; align-items: start; }
.pk-card { align-content: start; }
.pk-card { padding: 18px 20px; display: grid; gap: 14px; cursor: pointer; position: relative; overflow: hidden; }
.pk-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--accent); }
.svc-list { display: flex; flex-wrap: wrap; gap: 6px; }
.count-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.svc-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.svc { display: inline-flex; cursor: pointer; }
.svc input { display: none; }
.svc span { padding: 7px 12px; border-radius: 99px; border: 1.5px solid var(--line); font-size: 12.5px; font-weight: 600; color: #475569; transition: all .15s; }
.svc input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.svc input:checked + span::before { content: "✓ "; }

/* ---------- upload ---------- */
.drop { display: grid; place-items: center; gap: 4px; text-align: center; padding: 34px 20px; border: 2px dashed #cbd5e1; border-radius: 16px; cursor: pointer; background: var(--surface-2); transition: all .15s; font-weight: 500; }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop input { display: none; }
.drop .em { font-size: 28px; color: var(--brand); }
.drop b { font-size: 15px; color: var(--text); }
code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; font-size: 12px; }
.perm { display: grid; gap: 10px; font-size: 13.5px; font-weight: 500; }
.perm .ok { color: #065f46; } .perm .no { color: #991b1b; }

/* ---------- quotations ---------- */
.q-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 22px; align-items: start; }
.q-preview { position: sticky; top: 100px; max-height: calc(100vh - 120px); overflow: auto; border-radius: 16px; box-shadow: var(--shadow-lg); }
.ot-row { display: grid; grid-template-columns: 1fr 140px 34px; gap: 8px; align-items: center; }
.quote-doc { background: #fff; padding: 36px 40px; font-size: 13px; color: #1e293b; }
.qd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 18px; border-bottom: 3px solid; border-image: var(--grad) 1; }
.qd-title { text-align: right; font-size: 12.5px; color: var(--muted); }
.qd-title h2 { font-size: 24px; letter-spacing: .14em; color: var(--text); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.qd-title b { color: var(--text); }
.qd-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 20px 0 6px; }
.qd-parties > div { display: grid; gap: 2px; background: var(--surface-2); padding: 12px 14px; border-radius: 12px; }
.qd-parties small { font-size: 10.5px; letter-spacing: .12em; color: var(--muted); font-weight: 700; }
.qd-parties b { font-size: 14px; }
.qd-parties span { color: #475569; font-size: 12px; }
.quote-doc h4 { margin: 22px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--brand); }
.qd-table { width: 100%; border-collapse: collapse; }
.qd-table th { background: #f1f5ff; color: #334155; border: 0; font-size: 11px; padding: 9px 12px; }
.qd-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); }
.qd-table td:last-child { white-space: nowrap; }
.qd-table tr { cursor: default; } .qd-table tbody tr:hover { background: none; }
.qd-svc { display: flex; flex-wrap: wrap; gap: 6px 14px; color: #065f46; font-weight: 600; font-size: 12px; }
.qd-sum { margin: 20px 0 0 auto; width: min(380px, 100%); display: grid; gap: 2px; }
.qd-sum div { display: flex; justify-content: space-between; gap: 10px; padding: 6px 12px; }
.qd-sum .disc b { color: var(--green); }
.qd-sum .big { background: var(--grad); color: #fff; border-radius: 10px; padding: 10px 12px; font-size: 14.5px; margin: 4px 0; }
.qd-sum .big.alt { background: #0f172a; }
.qd-p { white-space: pre-wrap; margin: 0; color: #475569; font-size: 12px; line-height: 1.65; }
.qd-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 44px; font-size: 12.5px; font-weight: 600; }
.qd-sign span { display: block; border-top: 1px solid #94a3b8; margin-bottom: 6px; }
.qd-sign small { color: var(--muted); font-weight: 500; }
.qd-foot { margin-top: 30px; padding-top: 12px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: 11px; }
@media (max-width: 1200px) { .q-wrap { grid-template-columns: 1fr; } .q-preview { position: static; max-height: none; } }
@media (max-width: 900px) { .count-grid { grid-template-columns: 1fr 1fr; } .pk-grid { grid-template-columns: 1fr; } .quote-doc { padding: 22px 18px; } .qd-parties { grid-template-columns: 1fr; } }
@media print {
  body * { visibility: hidden !important; }
  .quote-doc, .quote-doc * { visibility: visible !important; }
  .quote-doc { position: absolute; left: 0; top: 0; width: 100%; padding: 0; }
  .q-preview { box-shadow: none; overflow: visible; max-height: none; }
  .qd-sum .big, .qd-head { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { margin: 14mm; }
}

/* ---------- login code & access picker ---------- */
.code-input { font-size: 26px; letter-spacing: .5em; text-align: center; font-weight: 800; padding: 12px; }
.auth-links { display: flex; align-items: center; margin-top: -4px; }
.link-btn { border: 0; background: none; color: var(--brand); font-weight: 600; cursor: pointer; padding: 4px 0; font-size: 13px; }
.module-switch.single { grid-template-columns: 1fr; }
.module-switch.single .switch-pill { width: calc(100% - 8px); transform: none !important; }
.access { display: grid; gap: 12px; }
.acc-mod { border: 1.5px solid var(--line); border-radius: 14px; overflow: hidden; transition: border-color .15s; }
.acc-mod.on { border-color: var(--brand); }
.acc-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; background: var(--surface-2); font-weight: 700; }
.acc-mod.on .acc-head { background: var(--brand-soft); }
.acc-head .ava { width: 32px; height: 32px; }
.acc-head small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.switch { position: relative; width: 40px; height: 22px; flex: none; margin-left: auto; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #cbd5e1; border-radius: 99px; transition: .2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::before { transform: translateX(18px); }
.acc-feats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 12px 14px; }
.acc-feat { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 13px; }
.acc-feat:hover { background: var(--surface-2); }
.acc-feat input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--brand); flex: none; }
.acc-feat small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.perm-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.perm-chips .chip { font-size: 10.5px; padding: 2px 7px; }
@media (max-width: 900px) { .acc-feats { grid-template-columns: 1fr; } }

/* ---------- attendance & work log ---------- */
.att-btn { border: 1.5px solid var(--line); background: var(--surface); }
.att-btn.att-in { background: var(--green); color: #fff; border-color: var(--green); box-shadow: 0 8px 18px -8px rgba(16,185,129,.7); }
.att-btn.att-out { background: var(--green-soft); color: #065f46; border-color: #a7f3d0; }
.att-btn.att-done { color: var(--muted); cursor: default; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(16,185,129,.6); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(16,185,129,0); } 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); } }
.att-hero { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px 24px; flex-wrap: wrap; background: linear-gradient(135deg, #ffffff, #f0fdf4); }
.att-hero h2 { font-size: 22px; margin-top: 4px; }
.att-big { padding: 13px 22px; font-size: 15px; }
.team-today { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.tt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.tt > div { flex: 1; min-width: 0; } .tt b { display: block; font-size: 13.5px; } .tt small { color: var(--muted); font-size: 12px; }
.wl-row { display: grid; grid-template-columns: 1fr 170px 80px 34px; gap: 8px; align-items: center; }
form.wl-row { grid-template-columns: 1fr auto; }
.wl-hist { border-left: 3px solid var(--brand-soft); padding-left: 12px; }
.wl-hist ul { margin: 4px 0 0; padding-left: 18px; font-size: 13px; color: #334155; }
@media (max-width: 900px) { .wl-row { grid-template-columns: 1fr; } }
