:root {
  --ink: #0f172a;
  --ink-2: #263246;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --canvas: #f7f9fc;
  --surface: #ffffff;
  --navy: #0f172a;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --teal: #0f766e;
  --teal-soft: #ecfdf5;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --rose: #be123c;
  --rose-soft: #fff1f2;
  --violet: #6d28d9;
  --violet-soft: #f5f3ff;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 5px 16px rgba(15, 23, 42, .04);
  --shadow-lg: 0 22px 60px rgba(15, 23, 42, .16);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 15% 10%, rgba(37,99,235,.16), transparent 32%), linear-gradient(135deg, #0b1220 0%, #111c31 55%, #102d3a 100%); }
.auth-card { width: min(430px, 100%); padding: 32px; border: 1px solid rgba(255,255,255,.14); border-radius: 18px; background: rgba(255,255,255,.97); box-shadow: 0 28px 80px rgba(2,6,23,.38); }
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 38px; }
.auth-brand .brand-name, .auth-brand .brand-product { color: var(--ink); }
.auth-kicker { color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 8px; }
.auth-card h1 { margin: 0; color: var(--ink); font-size: 26px; letter-spacing: -.04em; line-height: 1.16; }
.auth-copy { color: var(--muted); font-size: 12px; line-height: 1.55; margin: 10px 0 24px; }
.auth-form { display: grid; gap: 16px; }
.auth-form .field { gap: 7px; }
.auth-form .field label { color: var(--ink-2); font-size: 11px; }
.auth-form .input { width: 100%; min-height: 42px; font-size: 13px; }
.auth-submit { width: 100%; justify-content: center; min-height: 42px; margin-top: 2px; }
.auth-error { padding: 10px 11px; border: 1px solid #fecdd3; border-radius: 8px; background: var(--rose-soft); color: #9f1239; font-size: 11px; line-height: 1.45; }
.demo-access { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.demo-access-title { color: var(--ink-2); font-size: 11px; font-weight: 800; margin-bottom: 9px; }
.demo-access-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.demo-access-grid button { border: 1px solid var(--line-strong); border-radius: 7px; background: white; color: var(--ink-2); padding: 8px 5px; font-size: 10px; font-weight: 700; }
.demo-access-grid button:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.demo-access-note { color: var(--muted-2); font-size: 9px; line-height: 1.4; margin-top: 8px; }
.auth-help { color: var(--muted-2); font-size: 10px; line-height: 1.45; margin: 20px 0 0; text-align: center; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 250px; flex: 0 0 250px; background: var(--navy); color: #cbd5e1; padding: 22px 14px 18px; display: flex; flex-direction: column; min-height: 100vh; }
.brand-lockup { display: flex; gap: 11px; align-items: center; padding: 3px 12px 24px; color: white; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; background: linear-gradient(145deg, #f59e0b, #f97316); border-radius: 10px; color: white; font-size: 16px; font-weight: 900; box-shadow: 0 6px 18px rgba(249, 115, 22, .25); }
.brand-name { font-size: 11px; font-weight: 800; letter-spacing: .18em; line-height: 1; }
.brand-product { margin-top: 5px; font-size: 12px; letter-spacing: .14em; font-weight: 700; line-height: 1; }
.workspace-switcher { width: 100%; border: 1px solid rgba(148,163,184,.18); background: rgba(255,255,255,.06); color: #e2e8f0; border-radius: 9px; padding: 10px 11px; display: flex; align-items: center; gap: 8px; font-size: 12px; text-align: left; margin-bottom: 21px; }
.workspace-switcher:hover { background: rgba(255,255,255,.1); }
.workspace-dot, .status-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.12); }
.chevron { margin-left: auto; opacity: .65; }
.side-nav { flex: 1; overflow-y: auto; }
.nav-label { padding: 0 12px 8px; color: #64748b; font-size: 9px; letter-spacing: .16em; font-weight: 800; }
.nav-label-spaced { margin-top: 21px; }
.nav-item { position: relative; width: 100%; display: flex; align-items: center; gap: 11px; border: 0; background: transparent; color: #94a3b8; border-radius: 8px; padding: 9px 12px; margin: 2px 0; font-size: 12.5px; text-align: left; transition: .18s ease; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #f8fafc; }
.nav-item.active { background: #1e293b; color: white; box-shadow: inset 3px 0 0 #f59e0b; }
.nav-icon { width: 16px; text-align: center; color: currentColor; font-size: 15px; opacity: .85; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 6px; background: #f59e0b; color: #172033; border-radius: 999px; font-size: 10px; font-weight: 800; }
.sidebar-footer { border-top: 1px solid rgba(148,163,184,.14); padding: 15px 12px 0; margin-top: 18px; }
.health-row { display: flex; align-items: center; gap: 8px; font-size: 10.5px; color: #94a3b8; }
.status-dot.good { background: #34d399; }
.sidebar-footer-meta { color: #475569; font-size: 10px; margin-top: 8px; }
.main-shell { min-width: 0; flex: 1; }
.topbar { height: 68px; background: rgba(255,255,255,.92); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 31px; position: sticky; top: 0; z-index: 20; }
.mobile-menu { display: none; border: 0; background: transparent; font-size: 20px; color: var(--ink); }
.breadcrumb { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted-2); }
.breadcrumb strong { color: var(--ink-2); font-weight: 700; }
.breadcrumb-separator { color: #cbd5e1; }
.topbar-actions { display: flex; align-items: center; gap: 13px; }
.search-box { width: 255px; height: 35px; border: 1px solid var(--line); border-radius: 8px; background: #fff; display: flex; align-items: center; gap: 8px; padding: 0 9px; color: var(--muted-2); }
.search-box input { border: 0; outline: 0; min-width: 0; flex: 1; color: var(--ink); font-size: 11px; }
.search-box kbd { border: 1px solid var(--line); border-radius: 4px; padding: 2px 5px; color: var(--muted-2); font-size: 9px; white-space: nowrap; }
.icon-button { position: relative; width: 35px; height: 35px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--muted); font-size: 18px; }
.notification-dot { position: absolute; width: 6px; height: 6px; top: 8px; right: 8px; border-radius: 50%; background: #f97316; border: 1px solid white; }
.profile-menu { border: 0; background: transparent; display: flex; align-items: center; gap: 9px; min-width: 150px; text-align: left; }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: #e0e7ff; color: #4338ca; font-size: 10px; font-weight: 800; }
.profile-copy { display: flex; flex-direction: column; gap: 2px; font-size: 11px; }
.profile-copy b { font-weight: 700; color: var(--ink-2); }
.profile-copy small { color: var(--muted); font-size: 10px; }
.workspace { max-width: 1440px; margin: 0 auto; padding: 34px 34px 52px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 27px; }
.eyebrow { color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 8px; }
.page-title { margin: 0; font-size: 27px; letter-spacing: -.035em; line-height: 1.16; color: var(--ink); }
.page-subtitle { margin: 8px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.55; max-width: 680px; }
.head-actions { display: flex; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.button { border: 1px solid var(--line-strong); border-radius: 8px; background: white; color: var(--ink-2); padding: 9px 13px; font-weight: 700; font-size: 11px; display: inline-flex; gap: 7px; align-items: center; transition: .18s ease; }
.button:hover { border-color: #94a3b8; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.button.primary { color: white; border-color: var(--ink); background: var(--ink); }
.button.primary:hover { background: #1e293b; }
.button.accent { color: #92400e; background: var(--amber-soft); border-color: #fde68a; }
.button.danger { color: var(--rose); background: var(--rose-soft); border-color: #fecdd3; }
.button.small { padding: 6px 9px; font-size: 10px; }
.button:disabled { opacity: .45; pointer-events: none; }
.notice-banner { display: flex; align-items: center; gap: 11px; padding: 11px 14px; border: 1px solid #bfdbfe; background: var(--blue-soft); color: #1e40af; border-radius: 10px; font-size: 11px; margin-bottom: 20px; }
.notice-banner b { font-weight: 800; }
.notice-banner .close { margin-left: auto; border: 0; background: transparent; color: inherit; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 18px; }
.metric-card { background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 17px 18px 15px; box-shadow: var(--shadow-sm); }
.metric-top { display: flex; justify-content: space-between; align-items: flex-start; color: var(--muted); font-size: 11px; }
.metric-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; background: var(--blue-soft); color: var(--blue); font-size: 16px; }
.metric-value { margin: 12px 0 6px; font-size: 28px; line-height: 1; letter-spacing: -.04em; font-weight: 800; }
.metric-foot { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--muted); }
.metric-trend { color: var(--teal); font-weight: 800; }
.metric-trend.warn { color: var(--amber); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 17px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow-sm); min-width: 0; }
.card-head { padding: 17px 18px 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.card-title { font-size: 12.5px; font-weight: 800; color: var(--ink-2); }
.card-meta { font-size: 10px; color: var(--muted); }
.card-body { padding: 0 18px 18px; }
.chart-wrap { height: 235px; display: flex; gap: 13px; align-items: stretch; }
.axis { width: 25px; display: flex; flex-direction: column; justify-content: space-between; color: var(--muted-2); font-size: 9px; padding: 5px 0 22px; }
.bar-chart { display: flex; flex: 1; align-items: flex-end; justify-content: space-around; gap: 9px; padding: 5px 0 0; background: repeating-linear-gradient(to bottom, transparent 0, transparent 48px, #f1f5f9 49px); border-bottom: 1px solid var(--line); }
.bar-col { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 8px; min-width: 42px; }
.bars { width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 4px; height: 190px; }
.bar { width: 11px; border-radius: 4px 4px 0 0; background: #93c5fd; }
.bar.dark { background: var(--blue); }
.bar-col span { color: var(--muted); font-size: 9px; }
.legend { display: flex; gap: 15px; margin-top: 13px; font-size: 10px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 7px; height: 7px; border-radius: 2px; background: var(--blue); }
.legend i.light { background: #93c5fd; }
.funnel { display: flex; flex-direction: column; gap: 13px; padding-top: 3px; }
.funnel-row { display: grid; grid-template-columns: 76px 1fr 38px; align-items: center; gap: 10px; font-size: 10px; color: var(--muted); }
.funnel-row b { color: var(--ink-2); text-align: right; font-size: 11px; }
.progress { height: 8px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--blue); }
.progress.teal > span { background: #14b8a6; }
.progress.amber > span { background: #f59e0b; }
.progress.violet > span { background: #8b5cf6; }
.full-width { grid-column: 1 / -1; }
.table-card { overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 11px; }
th { padding: 10px 18px; text-align: left; color: var(--muted-2); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 13px 18px; border-bottom: 1px solid #f1f5f9; color: var(--ink-2); white-space: nowrap; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.person-cell { display: flex; align-items: center; gap: 9px; }
.person-avatar { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; color: #334155; background: #e2e8f0; font-size: 9px; font-weight: 800; }
.person-name { font-weight: 700; }
.subtext { display: block; color: var(--muted); font-size: 9.5px; margin-top: 2px; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 999px; font-size: 9.5px; font-weight: 800; }
.status-pill.live { background: var(--teal-soft); color: var(--teal); }
.status-pill.scheduled { background: var(--blue-soft); color: #1d4ed8; }
.status-pill.paused { background: #f1f5f9; color: #475569; }
.status-pill.exhausted { background: #fff7ed; color: #c2410c; }
.status-pill.draft { background: #f8fafc; color: #64748b; }
.status-pill.approved { background: #ecfdf5; color: #047857; }
.status-pill.review { background: #fffbeb; color: #a16207; }
.status-pill.published { background: #eef2ff; color: #4338ca; }
.section-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.campaign-card { padding: 17px; }
.campaign-card .card-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.campaign-title { font-size: 13px; font-weight: 800; color: var(--ink-2); }
.campaign-id { font-size: 9px; color: var(--muted-2); font-family: ui-monospace, monospace; margin-top: 5px; }
.campaign-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 12px 0; margin: 13px 0; }
.meta-label { display: block; color: var(--muted); font-size: 9px; margin-bottom: 3px; }
.meta-value { color: var(--ink-2); font-size: 11px; font-weight: 800; }
.campaign-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.avatar-stack { display: flex; }
.avatar-stack .person-avatar { margin-left: -5px; border: 2px solid white; }
.avatar-stack .person-avatar:first-child { margin-left: 0; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 15px; }
.filter-row input, .filter-row select, .input, .textarea { border: 1px solid var(--line-strong); background: white; color: var(--ink-2); border-radius: 7px; outline: none; padding: 9px 10px; font-size: 11px; }
.filter-row input { min-width: 190px; }
.filter-row select { min-width: 132px; }
.filter-row input:focus, .filter-row select:focus, .input:focus, .textarea:focus { border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(96,165,250,.12); }
.input:disabled, .textarea:disabled, .toggle:disabled { cursor: not-allowed; opacity: .65; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 15px; border: 1px solid var(--line); background: white; border-radius: 10px; margin-bottom: 14px; }
.toolbar-note { color: var(--muted); font-size: 10.5px; }
.toolbar-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.lead-name { font-weight: 800; }
.channel-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 5px; background: #60a5fa; }
.channel-dot.email { background: #a78bfa; }
.channel-dot.instagram { background: #ec4899; }
.channel-dot.linkedin { background: #0284c7; }
.manual-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 15px; }
.form-card { padding: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { color: var(--muted); font-size: 10px; font-weight: 700; }
.textarea { min-height: 80px; resize: vertical; }
.helper { color: var(--muted-2); font-size: 9.5px; line-height: 1.5; }
.upload-drop { border: 1.5px dashed #bfdbfe; border-radius: 10px; padding: 25px 15px; text-align: center; color: #2563eb; background: #f8fbff; }
.upload-drop strong { display: block; font-size: 12px; }
.upload-drop span { display: block; color: var(--muted); font-size: 10px; margin-top: 6px; }
.side-stack { display: flex; flex-direction: column; gap: 14px; }
.mini-stat { display: flex; justify-content: space-between; align-items: center; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.mini-stat:last-child { border-bottom: 0; }
.mini-stat span { color: var(--muted); font-size: 10px; }
.mini-stat b { color: var(--ink-2); font-size: 14px; }
.timeline { display: flex; flex-direction: column; }
.timeline-item { display: grid; grid-template-columns: 15px 1fr auto; gap: 10px; padding: 12px 0; border-bottom: 1px solid #f1f5f9; }
.timeline-item:last-child { border-bottom: 0; }
.timeline-marker { width: 8px; height: 8px; background: #60a5fa; border-radius: 50%; margin-top: 4px; box-shadow: 0 0 0 3px #eff6ff; }
.timeline-copy { font-size: 10.5px; color: var(--ink-2); line-height: 1.45; }
.timeline-copy b { font-weight: 800; }
.timeline-time { color: var(--muted-2); font-size: 9.5px; }
.workflow-list { display: flex; flex-direction: column; gap: 9px; }
.workflow-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid #f1f5f9; }
.workflow-row:last-child { border-bottom: 0; }
.workflow-name { font-size: 10.5px; font-weight: 800; color: var(--ink-2); }
.workflow-meta { font-size: 9px; color: var(--muted); margin-top: 3px; }
.workflow-status { text-align: right; font-size: 9.5px; color: var(--teal); font-weight: 800; }
.workflow-status.warn { color: var(--amber); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: white; }
.calendar-day { min-height: 116px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 10px; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day.muted-day { background: #fafbfc; color: var(--muted-2); }
.day-label { font-size: 9px; color: var(--muted); margin-bottom: 7px; }
.day-num { font-size: 12px; font-weight: 800; color: var(--ink-2); }
.calendar-event { margin-top: 9px; padding: 6px 7px; border-radius: 6px; background: var(--blue-soft); color: #1d4ed8; font-size: 9px; line-height: 1.25; font-weight: 700; }
.calendar-event.green { color: #047857; background: var(--teal-soft); }
.calendar-event.amber { color: #a16207; background: var(--amber-soft); }
.calendar-event { display:flex; align-items:center; gap:6px; }
.calendar-thumb { width:24px; height:24px; flex:none; display:grid; place-items:center; border-radius:5px; color:#fff; background:linear-gradient(145deg,#0f172a,#0e7490); font-size:12px; }
.calendar-thumb-image { width:24px; height:24px; flex:none; object-fit:cover; border-radius:5px; background:#e2e8f0; }
.sheet-grid { display:grid; grid-template-columns: minmax(0,1.15fr) minmax(0,.85fr); gap:16px; }
.sheet-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:16px; }
.followup-list { display:grid; gap:12px; }
.followup-row { display:flex; gap:14px; align-items:flex-start; padding:14px; }
.followup-number { width:28px; height:28px; border-radius:50%; display:grid; place-items:center; background:var(--navy); color:white; font-weight:800; flex:none; }
.check-row { display:flex; align-items:center; gap:8px; font-size:12px; font-weight:700; color:var(--ink-2); }
.check-row input { accent-color:var(--blue); }
@media (max-width: 900px) { .sheet-grid { grid-template-columns:1fr; } .followup-row { flex-direction:column; } }
.template-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.template-card { padding: 16px; }
.template-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.template-type { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .09em; font-weight: 800; }
.template-card h3 { margin: 6px 0 8px; font-size: 13px; }
.template-copy { color: var(--muted); font-size: 10.5px; line-height: 1.55; min-height: 50px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; margin: 13px 0; }
.tag { padding: 4px 7px; background: #f1f5f9; color: #475569; border-radius: 5px; font-size: 9px; }
.integration-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.integration-card { padding: 18px; display: flex; align-items: flex-start; gap: 13px; }
.integration-logo { width: 39px; height: 39px; display: grid; place-items: center; flex: 0 0 39px; border-radius: 10px; background: var(--blue-soft); color: var(--blue); font-weight: 900; font-size: 17px; }
.integration-logo.telegram { background: #e0f2fe; color: #0284c7; }
.integration-logo.sheets { background: #dcfce7; color: #15803d; }
.integration-logo.unipile { background: #f3e8ff; color: #7e22ce; }
.integration-copy { flex: 1; min-width: 0; }
.integration-copy h3 { font-size: 13px; margin: 0 0 5px; }
.integration-copy p { color: var(--muted); font-size: 10px; line-height: 1.45; margin: 0 0 12px; }
.integration-card .status-pill { float: right; }
.setting-layout { display: grid; grid-template-columns: 205px minmax(0, 1fr); gap: 16px; }
.setting-tabs { display: flex; flex-direction: column; gap: 4px; }
.setting-tab { border: 0; text-align: left; background: transparent; padding: 9px 11px; color: var(--muted); border-radius: 7px; font-size: 11px; }
.setting-tab.active, .setting-tab:hover { background: white; color: var(--ink-2); font-weight: 800; box-shadow: var(--shadow-sm); }
.setting-panel { padding: 20px; }
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-copy b { display: block; font-size: 11.5px; color: var(--ink-2); }
.setting-copy span { display: block; color: var(--muted); font-size: 10px; margin-top: 4px; line-height: 1.4; }
.toggle { width: 34px; height: 19px; border: 0; border-radius: 999px; padding: 2px; background: #cbd5e1; }
.toggle span { width: 15px; height: 15px; display: block; border-radius: 50%; background: white; transition: transform .2s; }
.toggle.on { background: var(--teal); }
.toggle.on span { transform: translateX(15px); }
.modal-backdrop { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(15,23,42,.46); padding: 18px; z-index: 50; }
.modal-backdrop[hidden] { display: none; }
.modal { width: min(620px, 100%); max-height: calc(100vh - 36px); overflow: auto; background: white; border-radius: 14px; box-shadow: var(--shadow-lg); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 20px 21px 15px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.modal-head p { margin: 5px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.45; }
.modal-close { border: 0; background: transparent; font-size: 21px; color: var(--muted); }
.modal-body { padding: 19px 21px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 15px 21px 20px; border-top: 1px solid var(--line); }
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: white; border-radius: 9px; padding: 11px 14px; box-shadow: var(--shadow-lg); font-size: 11px; max-width: 340px; animation: toast-in .2s ease-out; }
.toast.success { background: #065f46; }
.toast.warn { background: #92400e; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.empty { padding: 30px; text-align: center; color: var(--muted); font-size: 11px; }
.role-switcher { display: flex; gap: 6px; padding: 5px; background: #f1f5f9; border-radius: 8px; }
.role-switcher button { flex: 1; border: 0; background: transparent; border-radius: 6px; padding: 7px 8px; color: var(--muted); font-size: 10px; }
.role-switcher button.active { background: white; color: var(--ink-2); font-weight: 800; box-shadow: var(--shadow-sm); }
.role-note { color: var(--muted); font-size: 10px; margin: 10px 0 0; line-height: 1.45; }
.role-summary { display: flex; align-items: center; justify-content: space-between; padding: 12px 13px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; }
.role-summary-label { color: var(--muted); font-size: 10px; }
.role-summary strong { color: var(--ink-2); font-size: 12px; }

@media (max-width: 1120px) {
  .sidebar { width: 220px; flex-basis: 220px; }
  .workspace { padding: 27px 23px 45px; }
  .topbar { padding: 0 23px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .section-grid, .template-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .sidebar { position: fixed; left: -270px; top: 0; bottom: 0; width: 250px; flex-basis: auto; z-index: 40; transition: left .22s ease; box-shadow: 12px 0 32px rgba(15,23,42,.18); }
  .sidebar.open { left: 0; }
  .mobile-menu { display: block; }
  .topbar { padding: 0 15px; gap: 11px; }
  .breadcrumb { flex: 1; }
  .search-box { display: none; }
  .profile-copy, .profile-menu .chevron { display: none; }
  .profile-menu { min-width: 32px; }
  .workspace { padding: 23px 15px 38px; }
  .page-head { flex-direction: column; }
  .head-actions { justify-content: flex-start; }
  .metric-grid { gap: 9px; }
  .metric-card { padding: 13px; }
  .metric-value { font-size: 23px; }
  .dashboard-grid, .manual-layout, .setting-layout, .integration-grid { grid-template-columns: 1fr; }
  .section-grid, .template-grid { grid-template-columns: 1fr; }
  .calendar-grid { min-width: 680px; }
  .calendar-scroll { overflow-x: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-actions { width: 100%; }
}

/* Loading states: page start-up and data loading inside the workspace */
.app-loading { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: 12px; font-weight: 600; background: var(--canvas, var(--surface)); z-index: 40; }
.page-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 50vh; color: var(--muted); font-size: 12px; font-weight: 600; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--blue); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }
@media (max-width: 760px) { .tpl-layout { grid-template-columns: 1fr !important; } }
