:root {
  --navy: #0a1738;
  --navy-2: #102451;
  --ink: #0f172a;
  --muted: #667085;
  --line: #e6ebf2;
  --panel: #ffffff;
  --soft: #f7f9fc;
  --blue: #2854d8;
  --green: #16a34a;
  --green-soft: #dcfce7;
  --red: #ef4444;
  --amber: #d99012;
  --purple: #7c3aed;
  --shadow: 0 16px 38px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: #f5f7fb; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.login-body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, .16), transparent 34%),
    linear-gradient(135deg, #f8fbff 0%, #eef3fb 48%, #f8fafc 100%);
  color: #101828;
}

.login-shell {
  width: min(1120px, 100%);
  min-height: 680px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 28px 80px rgba(15, 23, 42, .16);
  backdrop-filter: blur(18px);
}

.login-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 18px;
  padding: 54px;
  color: white;
  background:
    linear-gradient(160deg, rgba(9, 22, 58, .96), rgba(16, 33, 86, .96)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg fill='none' stroke='%236ea8ff' stroke-opacity='.18'%3E%3Cpath d='M10 40h200M10 90h200M10 140h200M10 190h200M40 10v200M90 10v200M140 10v200M190 10v200'/%3E%3Ccircle cx='110' cy='110' r='62'/%3E%3C/g%3E%3C/svg%3E");
}

.login-brand .brand-mark {
  width: 58px;
  height: 58px;
  font-size: 26px;
  box-shadow: 0 18px 42px rgba(37, 99, 235, .34);
}

.login-brand h1 {
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1;
  letter-spacing: 0;
  margin-top: auto;
}

.login-brand p {
  max-width: 570px;
  color: rgba(255, 255, 255, .78);
  font-size: 18px;
  line-height: 1.6;
}

.login-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.login-highlights span {
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  padding: 9px 13px;
  background: rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .88);
  font-size: 13px;
  font-weight: 800;
}

.login-card {
  display: grid;
  align-content: center;
  gap: 18px;
  padding: clamp(30px, 5vw, 64px);
  background: white;
}

.login-card h2 {
  font-size: 32px;
  margin-bottom: 8px;
}

.login-card p,
.login-demo {
  color: #667085;
  line-height: 1.5;
}

.login-card label {
  display: grid;
  gap: 8px;
  color: #344054;
  font-size: 14px;
  font-weight: 800;
}

.login-card input[type="email"],
.login-card input[type="password"] {
  width: 100%;
  min-height: 48px;
  border: 1px solid #d7dff0;
  border-radius: 11px;
  padding: 0 14px;
  font: inherit;
  color: #101828;
  background: #fbfdff;
  outline: 0;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.login-card input:focus {
  border-color: #2f5bd7;
  background: white;
  box-shadow: 0 0 0 4px rgba(47, 91, 215, .12);
}

.login-card .check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.login-card .check-row input {
  width: 18px;
  height: 18px;
  accent-color: #2f5bd7;
}

.login-card .primary-btn {
  width: 100%;
  min-height: 50px;
  justify-content: center;
  font-size: 16px;
  border-radius: 12px;
}

.form-error {
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 11px 12px;
  background: #fff1f2;
  color: #be123c;
  font-weight: 800;
}

.topbar { height: 72px; background: linear-gradient(90deg, #091839, #10275a); color: white; display: flex; align-items: center; gap: 22px; padding: 0 20px; position: sticky; top: 0; z-index: 30; box-shadow: 0 12px 30px rgba(9, 24, 57, .22); }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; white-space: nowrap; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 8px; background: linear-gradient(135deg, #2f6bff, #7b61ff); font-size: 24px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.topnav { display: flex; gap: 8px; height: 100%; align-items: center; }
.topnav a { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 10px; color: rgba(255,255,255,.86); font-weight: 600; }
.topnav a.active, .topnav a:hover { background: rgba(255,255,255,.11); color: white; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.global-search { width: min(430px, 27vw); height: 44px; display: flex; align-items: center; gap: 10px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); border-radius: 12px; padding: 0 12px; }
.global-search input { width: 100%; border: 0; outline: 0; color: white; background: transparent; }
.global-search input::placeholder { color: rgba(255,255,255,.72); }
kbd { background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.13); border-radius: 6px; padding: 2px 7px; color: rgba(255,255,255,.78); }
.icon-btn { width: 42px; height: 42px; border-radius: 10px; border: 1px solid #d9e0ea; background: white; color: #233153; display: inline-grid; place-items: center; }
.topbar .icon-btn { color: white; background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.16); }
.icon-btn.small { width: 36px; height: 36px; }
.whatsapp { color: #16a34a !important; }
.with-badge { position: relative; }
.with-badge:after { content: "12"; position: absolute; right: -4px; top: -6px; width: 20px; height: 20px; display: grid; place-items: center; background: #ef4444; color: white; font-size: 11px; border-radius: 999px; font-weight: 800; }
.profile-chip { display: flex; align-items: center; gap: 10px; }
.profile-chip .avatar { width: 42px; height: 42px; border-radius: 999px; background: linear-gradient(135deg, #5263cf, #8796ff); display: grid; place-items: center; font-weight: 800; }
.profile-chip strong, .profile-chip small { display: block; }
.profile-chip small { color: rgba(255,255,255,.72); }

.toast { position: fixed; right: 24px; top: 88px; z-index: 50; background: #0f172a; color: white; padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow); }
.crm-shell { display: grid; grid-template-columns: 360px minmax(560px, 1fr) 340px 320px; gap: 14px; height: calc(100vh - 72px); padding: 18px; overflow: hidden; }
.conversation-sidebar, .conversation-main, .insight-panel, .timeline-panel { min-height: 0; overflow: auto; }
.conversation-sidebar, .conversation-main { background: white; border: 1px solid var(--line); border-radius: 14px; }
.conversation-sidebar { padding: 18px 12px; }
.section-head, .panel-head, .lead-card-top, .lead-card-bottom, .lead-hero, .hero-left, .hero-title, .hero-actions, .reply-tools, .data-card, .score-row { display: flex; align-items: center; }
.section-head, .panel-head, .lead-card-top, .lead-hero { justify-content: space-between; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 28px; letter-spacing: 0; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
.side-search { height: 42px; margin: 16px 4px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; color: var(--muted); }
.side-search input { width: 100%; border: 0; outline: 0; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 0 4px 12px; }
.segmented button { border: 0; background: transparent; color: #475467; border-radius: 9px; height: 34px; font-weight: 700; }
.segmented button.active { color: var(--navy); background: #edf3ff; }
.segmented span { background: #d9deea; border-radius: 999px; padding: 2px 8px; font-size: 12px; }
.lead-list { display: grid; gap: 4px; }
.lead-card { display: grid; grid-template-columns: 42px 1fr; gap: 12px; padding: 14px 10px; border-radius: 12px; border: 1px solid transparent; }
.lead-card.active { background: linear-gradient(100deg, #eefbe9, #f8fff6); border-color: #dcf4d7; box-shadow: 0 18px 32px rgba(22, 163, 74, .12); }
.lead-avatar, .hero-avatar { border-radius: 999px; display: grid; place-items: center; color: white; font-weight: 800; }
.lead-avatar { width: 36px; height: 36px; background: #1d4ed8; }
.lead-avatar.hot { background: #16a34a; }
.lead-avatar.warm { background: #8b5cf6; }
.lead-avatar.cold { background: #64748b; }
.lead-card p { font-size: 13px; line-height: 1.42; color: #344054; margin: 6px 0; }
.lead-card time, .lead-card small { color: var(--muted); font-size: 12px; }
.mini-pill, .count-badge, .priority-pill, .status-pill, .interest, .tag { border-radius: 7px; padding: 4px 8px; font-size: 12px; font-weight: 700; }
.mini-pill.success, .priority-pill, .interest.high, .tag.green { background: var(--green-soft); color: #128236; }
.mini-pill.danger, .tag.red { background: #fee2e2; color: #b91c1c; }
.mini-pill.info, .tag.blue { background: #dbeafe; color: #1d4ed8; }
.count-badge { background: #1fb557; color: white; min-width: 26px; text-align: center; }

.conversation-main { padding: 18px 14px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: #33436c; font-weight: 600; margin-bottom: 22px; }
.hero-left { gap: 14px; }
.hero-avatar { width: 58px; height: 58px; background: linear-gradient(135deg, #4f64c8, #7f8eff); font-size: 24px; }
.hero-title { gap: 12px; justify-content: flex-start; }
.hero-left p { color: #64748b; margin-top: 5px; }
.metric-strip { display: grid; grid-template-columns: repeat(5, 1fr); margin-top: 20px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.metric-strip div { padding: 14px 16px; border-right: 1px solid var(--line); background: linear-gradient(#fff, #fbfcff); }
.metric-strip div:last-child { border-right: 0; }
.metric-strip small { display: block; color: #667085; margin-bottom: 7px; }
.metric-strip strong { display: block; font-size: 14px; }
.hot { color: #dc2626; }
.green { color: var(--green); }
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin-top: 22px; }
.tabs button { border: 0; background: transparent; padding: 14px 0; color: #59667d; font-weight: 700; border-bottom: 3px solid transparent; }
.tabs button.active { color: var(--navy); border-bottom-color: #1d4ed8; }
.tab-panel { display: none; padding-top: 18px; }
.tab-panel.active { display: block; }
.date-divider { display: flex; align-items: center; justify-content: center; color: #667085; font-size: 13px; margin-bottom: 20px; }
.date-divider:before, .date-divider:after { content: ""; flex: 1; height: 1px; background: var(--line); }
.date-divider span { background: #edf1f7; border-radius: 8px; padding: 7px 18px; margin: 0 12px; }
.chat-thread { min-height: 520px; }
.bubble-row { display: flex; margin-bottom: 16px; }
.bubble-row.outbound { justify-content: flex-end; }
.bubble { max-width: 430px; background: white; border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; font-size: 14px; line-height: 1.45; box-shadow: 0 4px 16px rgba(15,23,42,.04); }
.bubble-row.outbound .bubble { background: #dcf8df; border-color: #c7efce; }
.bubble time { display: block; text-align: right; color: #667085; font-size: 11px; margin-top: 8px; }
.file-bubble { display: grid; grid-template-columns: 38px 1fr; column-gap: 10px; align-items: center; min-width: 280px; }
.file-bubble svg { grid-row: span 2; color: #ef4444; }
.file-bubble small { color: #667085; }
.reply-box { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: white; }
.reply-tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line); padding: 0 14px; }
.reply-tabs button { border: 0; background: transparent; padding: 13px 0; font-weight: 700; color: #59667d; border-bottom: 2px solid transparent; }
.reply-tabs button.active { color: var(--navy); border-bottom-color: #1d4ed8; }
.reply-box textarea { width: 100%; min-height: 72px; border: 0; outline: 0; padding: 14px; resize: vertical; }
.reply-tools { justify-content: space-between; gap: 16px; padding: 8px 14px 14px; color: #667085; }
.reply-tools svg { margin-right: 14px; }
.send-btn, .primary-btn, .wide-btn, .warning-btn { border: 0; font-weight: 800; border-radius: 10px; }
.send-btn { width: 42px; height: 42px; margin-left: auto; background: #22c55e; color: white; }
.primary-btn { background: #1d4ed8; color: white; padding: 11px 16px; }

.insight-panel, .timeline-panel { display: grid; gap: 12px; align-content: start; }
.panel-card { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: 0 8px 28px rgba(15,23,42,.04); }
.panel-head button { min-height: 32px; border: 1px solid var(--line); background: #f8fafc; border-radius: 8px; color: #1d4ed8; font-weight: 700; padding: 0 10px; display: inline-flex; align-items: center; gap: 6px; }
.profile-list { display: grid; grid-template-columns: 96px 1fr; gap: 16px 12px; margin: 20px 0 0; font-size: 14px; }
.profile-list dt { color: #667085; }
.profile-list dd { margin: 0; font-weight: 600; }
.interest-list, .tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.interest.medium { background: #ffedd5; color: #c2410c; }
.score-total { display: grid; grid-template-columns: 1fr auto; gap: 4px; align-items: end; border-bottom: 1px solid var(--line); padding: 18px 0; }
.score-total span { color: #667085; font-size: 12px; }
.score-total strong { font-size: 24px; }
.score-total small { font-size: 15px; color: #475467; }
.score-total b { color: #dc2626; }
.score-row { justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid #f0f3f8; font-size: 13px; }
.score-row strong, .score-plus { color: #16a34a; }
.score-row small { color: #667085; }
.text-link { display: inline-flex; align-items: center; gap: 6px; color: #1d4ed8; font-weight: 700; margin-top: 12px; font-size: 13px; }
.timeline { position: relative; display: grid; gap: 18px; margin-top: 18px; }
.timeline:before { content: ""; position: absolute; left: 16px; top: 10px; bottom: 10px; width: 2px; background: #e9ddff; }
.timeline article { position: relative; display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: start; }
.timeline-dot { position: relative; z-index: 1; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: #ede9fe; color: #7c3aed; }
.timeline strong { font-size: 14px; }
.timeline p, .action-card p { color: #475467; font-size: 13px; line-height: 1.45; margin-top: 4px; }
.timeline small { color: #667085; font-size: 12px; display: block; margin-top: 6px; }
.timeline b { color: #16a34a; font-size: 13px; }
.wide-btn { width: 100%; height: 40px; margin-top: 18px; background: #eef2ff; color: #243a9b; }
.action-card { background: linear-gradient(135deg, #fff8e8, #fffdf7); border-color: #f6d99a; }
.action-card strong { display: block; margin-top: 14px; }
.warning-btn { background: #fbbf24; color: #663c00; padding: 10px 20px; margin: 14px 0 10px; }
.action-card a { display: block; color: #1d4ed8; font-weight: 700; font-size: 13px; }
.tag.purple { background: #ede9fe; color: #6d28d9; }

.content-grid { display: grid; gap: 12px; }
.data-card { justify-content: space-between; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.data-card > div:nth-child(2) { flex: 1; }
.data-card p { color: #475467; margin-top: 4px; font-size: 14px; }
.data-card small { color: #667085; margin-top: 7px; display: block; }
.data-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: #dcfce7; color: #16a34a; }
.data-icon.red { background: #fee2e2; color: #dc2626; }
.data-icon.amber { background: #fef3c7; color: #b45309; }
.data-icon.purple { background: #ede9fe; color: #7c3aed; }
.status-pill { background: #eef2ff; color: #1d4ed8; white-space: nowrap; }
.status-pill.success { background: #dcfce7; color: #16a34a; }
.inline-form { display: grid; grid-template-columns: 1fr 160px 160px auto; gap: 10px; margin-bottom: 16px; align-items: start; }
.inline-form textarea { grid-column: 1 / 4; min-height: 88px; }
.inline-form.compact { grid-template-columns: 1fr 160px auto; }
.inline-form input, .inline-form textarea, .inline-form select, .builder-settings input, .builder-inspector input, .builder-inspector textarea, .builder-inspector select { border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; outline: 0; background: white; }

.builder-shell { display: grid; grid-template-columns: 320px minmax(680px, 1fr) 320px; gap: 14px; height: calc(100vh - 72px); padding: 18px; overflow: hidden; }
.builder-sidebar, .builder-inspector, .flow-workspace { background: white; border: 1px solid var(--line); border-radius: 14px; overflow: auto; }
.builder-sidebar, .builder-inspector { padding: 18px; display: grid; align-content: start; gap: 22px; }
.builder-sidebar h1 { font-size: 26px; margin: 14px 0 8px; }
.builder-sidebar p, .builder-inspector p { color: #667085; line-height: 1.45; }
.builder-toolbox { display: grid; gap: 10px; }
.tool-block { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fbfcff; cursor: grab; }
.tool-block svg { color: #1d4ed8; }
.tool-block small { display: block; color: #667085; margin-top: 3px; }
.builder-settings, .builder-inspector label { display: grid; gap: 8px; }
.builder-settings { gap: 10px; }
.builder-settings label, .builder-inspector label { color: #475467; font-size: 13px; font-weight: 700; }
.flow-workspace { position: relative; background: #f8fafc; overflow: hidden; }
.canvas-grid { position: absolute; inset: 0; background-image: linear-gradient(#e8edf5 1px, transparent 1px), linear-gradient(90deg, #e8edf5 1px, transparent 1px); background-size: 28px 28px; opacity: .8; }
.flow-start { position: absolute; left: 34px; top: 34px; display: flex; gap: 12px; align-items: center; background: #0f172a; color: white; border-radius: 13px; padding: 12px 14px; box-shadow: var(--shadow); }
.flow-start small { display: block; color: rgba(255,255,255,.72); margin-top: 3px; }
.flow-node { position: absolute; width: 230px; min-height: 86px; display: grid; grid-template-columns: 42px 1fr 28px; gap: 10px; align-items: center; background: white; border: 1px solid #dce4ef; border-radius: 14px; padding: 13px; box-shadow: 0 16px 38px rgba(15, 23, 42, .12); touch-action: none; }
.flow-node:before { content: ""; position: absolute; left: -54px; top: 50%; width: 54px; border-top: 2px dashed #9aa7bd; }
.flow-node.dragging { box-shadow: 0 20px 44px rgba(37, 84, 216, .22); border-color: #1d4ed8; }
.node-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: #e0ecff; color: #1d4ed8; }
.flow-node.create_task .node-icon { background: #fef3c7; color: #b45309; }
.flow-node.add_tag .node-icon { background: #dcfce7; color: #16a34a; }
.flow-node.update_stage .node-icon { background: #ede9fe; color: #7c3aed; }
.flow-node small { display: block; color: #667085; margin-top: 4px; }
.node-menu { border: 0; background: transparent; color: #667085; }
.suggestion-pill { padding: 10px 12px; border-radius: 10px; background: #eef2ff; color: #1d4ed8; font-weight: 700; margin-top: 10px; font-size: 13px; }

@media (max-width: 1320px) {
  .crm-shell { grid-template-columns: 320px minmax(520px, 1fr) 320px; }
  .timeline-panel { display: none; }
  .global-search { display: none; }
}

@media (max-width: 980px) {
  .topnav { display: none; }
  .crm-shell, .builder-shell { height: auto; overflow: visible; grid-template-columns: 1fr; }
  .conversation-sidebar, .timeline-panel, .insight-panel { max-height: none; }
  .metric-strip { grid-template-columns: 1fr 1fr; }
  .inline-form { grid-template-columns: 1fr; }
  .inline-form textarea { grid-column: auto; }
}

.app-grid.with-sidebar { display: grid; grid-template-columns: 250px 1fr; min-height: calc(100vh - 72px); background: #f8fafc; }
.left-rail { border-right: 1px solid var(--line); background: white; padding: 18px 14px; display: flex; flex-direction: column; gap: 8px; }
.left-rail a { min-height: 42px; display: flex; align-items: center; gap: 12px; padding: 0 12px; border-radius: 9px; font-weight: 700; color: #1f2f55; }
.left-rail a svg { width: 17px; }
.left-rail a span { margin-left: auto; padding: 3px 8px; border-radius: 999px; background: #e7eefc; color: #1d4ed8; font-size: 12px; }
.left-rail a em { margin-left: auto; border: 1px solid #22c55e; color: #16a34a; border-radius: 6px; padding: 2px 7px; font-style: normal; font-size: 12px; }
.left-rail .rail-active { background: #101b55; color: white; }
.rail-title { margin: 16px 0 6px; color: #53627d; font-size: 12px; }
.plan-card { margin-top: auto; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcff; }
.plan-card strong { display: block; color: #4f46e5; margin: 6px 0; }
.plan-card p { font-size: 12px; color: #667085; }
.plan-card div { height: 8px; border-radius: 99px; background: #e7e9f6; margin: 12px 0; overflow: hidden; }
.plan-card div span { display: block; height: 100%; background: #7c3aed; }
.plan-card button { width: 100%; height: 38px; border-radius: 8px; border: 1px solid #d7dff0; background: white; font-weight: 800; }
.dashboard-page, .list-page, .edit-page { padding: 28px 32px; overflow: auto; }
.page-title-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-title-row p { color: #475467; margin-top: 6px; }
.page-title-row > div:last-child { display: flex; gap: 10px; align-items: center; }
.soft-btn { min-height: 38px; border: 1px solid var(--line); background: white; border-radius: 9px; padding: 0 14px; display: inline-flex; align-items: center; gap: 8px; font-weight: 800; color: #1f2f55; }
.stat-row { display: grid; grid-template-columns: repeat(6, minmax(140px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-row.compact { grid-template-columns: repeat(5, minmax(140px, 1fr)); }
.stat-row article { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 18px; position: relative; overflow: hidden; }
.stat-row small { color: #475467; font-weight: 700; }
.stat-row strong { display: block; font-size: 28px; margin: 10px 0; }
.stat-row p { font-size: 13px; }
.up { color: #16a34a !important; }
.down { color: #ef4444 !important; }
.stat-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; margin-bottom: 12px; }
.stat-icon.blue { background: #dbeafe; color: #2563eb; }
.stat-icon.amber { background: #ffedd5; color: #f97316; }
.stat-icon.purple { background: #ede9fe; color: #7c3aed; }
.stat-icon.green { background: #dcfce7; color: #16a34a; }
.stat-icon.red { background: #fee2e2; color: #ef4444; }
.stat-icon.teal { background: #ccfbf1; color: #0fafa4; }
.dashboard-columns { display: grid; grid-template-columns: minmax(560px, 1.35fr) minmax(320px, .85fr); gap: 18px; align-items: start; }
.pro-card { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: 0 8px 28px rgba(15,23,42,.04); }
.mini-tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--line); margin-top: 18px; }
.mini-tabs button { border: 0; background: transparent; padding: 12px 0; font-weight: 800; color: #53627d; border-bottom: 2px solid transparent; }
.mini-tabs button.active { color: #101b55; border-bottom-color: #1d4ed8; }
.priority-table article, .conversation-row, .notification-card article, .agenda-card article { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid #edf1f7; }
.priority-table article > div:nth-child(2), .conversation-row div, .notification-card div { flex: 1; }
.priority-table small, .conversation-row small, .notification-card small { color: #667085; }
.conversation-row p, .notification-card p { color: #475467; font-size: 13px; margin-top: 4px; }
.agenda-card article { justify-content: space-between; padding: 17px; background: #fbfcff; border: 1px solid #edf1f7; border-radius: 12px; margin-top: 12px; }
.agenda-card article span { color: #16a34a; }
.list-layout, .edit-layout { display: grid; grid-template-columns: minmax(680px, 1fr) 360px; gap: 18px; align-items: start; }
.filter-row { display: grid; grid-template-columns: 1fr repeat(4, 150px); gap: 10px; margin-bottom: 16px; }
.filter-row input, .filter-row button, .edit-form input, .edit-form select, .edit-form textarea { border: 1px solid var(--line); border-radius: 9px; min-height: 40px; padding: 10px 12px; background: white; }
.pro-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pro-table th { text-align: left; color: #475467; font-size: 12px; background: #fbfcff; padding: 13px; }
.pro-table td { border-top: 1px solid #edf1f7; padding: 13px; vertical-align: middle; }
.table-lead { display: flex; gap: 12px; align-items: center; }
.table-lead small { color: #667085; line-height: 1.5; }
.mini-pill.warning { background: #ffedd5; color: #c2410c; }
.right-stack { display: grid; gap: 14px; }
.donut { width: 130px; height: 130px; border-radius: 999px; margin: 20px auto; background: conic-gradient(#ef4444 0 32%, #f5b700 32% 73%, #16a34a 73% 100%); position: relative; }
.donut:after { content: ""; position: absolute; inset: 28px; border-radius: 999px; background: white; }
.edit-hero { display: flex; gap: 18px; align-items: center; background: white; border: 1px solid var(--line); border-radius: 14px; padding: 24px; margin-bottom: 14px; }
.edit-hero h1 { display: inline-block; margin-right: 12px; }
.edit-hero p { color: #475467; margin-top: 8px; }
.edit-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-card { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.form-card h3 { margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.edit-form label { display: grid; gap: 8px; color: #344054; font-size: 13px; font-weight: 800; }
.edit-form textarea { min-height: 116px; }
.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 10px; }
.stack-form { display: grid; gap: 12px; margin-top: 14px; }
.stack-form label { display: grid; gap: 8px; color: #344054; font-size: 13px; font-weight: 800; }
.stack-form input, .stack-form select { border: 1px solid var(--line); border-radius: 9px; min-height: 40px; padding: 10px 12px; background: white; }
.permission-grid { display: grid; gap: 10px; min-width: 520px; }
.permission-grid label { display: grid; grid-template-columns: 160px repeat(4, minmax(76px, 1fr)); gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid #edf1f7; }
.permission-grid span { display: inline-flex; align-items: center; gap: 6px; color: #475467; font-size: 12px; font-weight: 700; }
.permission-grid button { justify-self: end; margin-top: 6px; }

@media (max-width: 1180px) {
  .app-grid.with-sidebar, .dashboard-columns, .list-layout, .edit-layout { grid-template-columns: 1fr; }
  .left-rail { display: none; }
  .stat-row, .stat-row.compact { grid-template-columns: repeat(2, 1fr); }
  .filter-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .login-body { padding: 16px; align-items: start; }
  .login-shell { min-height: auto; grid-template-columns: 1fr; border-radius: 18px; }
  .login-brand { min-height: 330px; padding: 32px; }
  .login-card { padding: 28px; }
  .permission-grid { min-width: 0; }
  .permission-grid label { grid-template-columns: 1fr 1fr; }
}
