/* ═══════════════════════════════════════════
   NEXPRO CHATDESK — style.css
   Theme: NexPro Central
   Sidebar #0A2A3E · Accent #F5C518 · Inter
═══════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --navy: #0A2A3E;
  --navy-2: #163D5A;
  --navy-card: #1E3A5F;
  --gold: #F5C518;
  --gold-dark: #D4A817;
  --gold-ink: #8A6A00;
  --page: #F0F4F8;
  --card: #FFFFFF;
  --line: #E2EAF0;
  --line-soft: #F0F4F8;
  --input: #F8FAFC;
  --text: #1A2B3C;
  --muted: #5A7A90;
  --label: #8A9BB0;
  --red: #E24B4A;
  --green: #2D9E58;
  --blue: #1E6F9F;
  --chart-a: #1E6F9F;
  --chart-b: #E0A800;
  --radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--page); color: var(--text); min-height: 100vh; font-size: 14px; }
button, input, select, textarea { font-family: inherit; }
.hidden { display: none !important; }

/* ─── LOGIN ──────────────────────────────── */
.login-wrapper { min-height: 100vh; background: var(--navy); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; position: relative; overflow: hidden; }
.login-bg-glow { position: absolute; width: 600px; height: 600px; border-radius: 50%; background: radial-gradient(circle, rgba(245,197,24,0.07) 0%, transparent 70%); top: -150px; left: -150px; pointer-events: none; }
.login-box { width: 100%; max-width: 420px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 16px; padding: 36px 32px; position: relative; z-index: 1; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 26px; }
.login-brand img { height: 120px; width: auto; max-width: 320px; object-fit: contain; }
.brand-word { font-size: 24px; font-weight: 700; color: #fff; letter-spacing: -0.3px; }
.brand-word b { color: var(--gold); font-weight: 700; }
.brand-sub { color: #7A9BB0; font-size: 13px; text-align: center; }
.login-error { background: rgba(220,53,69,0.15); border: 1px solid rgba(220,53,69,0.3); border-radius: 8px; padding: 10px 14px; color: #FF8A8A; font-size: 14px; margin-bottom: 18px; }
.demo-note { background: rgba(245,197,24,0.1); border: 1px solid rgba(245,197,24,0.3); color: #F5DD8A; border-radius: 8px; padding: 10px 12px; font-size: 12.5px; margin-bottom: 18px; line-height: 1.5; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; color: #B8CDD8; font-size: 13px; font-weight: 500; margin-bottom: 8px; }
.form-group input, .form-group select { width: 100%; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; padding: 11px 14px; color: #fff; font-size: 14px; outline: none; transition: border-color 0.2s; }
.form-group select option { background: var(--navy); }
.form-group input:focus, .form-group select:focus { border-color: rgba(245,197,24,0.5); }
.form-group input::placeholder { color: #3D6080; }
.login-footer { color: #3D6080; font-size: 12px; margin-top: 24px; text-align: center; position: relative; z-index: 1; }

/* ─── BUTTONS ────────────────────────────── */
.btn-primary { background: var(--gold); border: none; border-radius: 8px; padding: 11px 22px; color: var(--navy); font-weight: 700; font-size: 14px; cursor: pointer; transition: background 0.2s, transform 0.1s; }
.btn-primary:hover { background: var(--gold-dark); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-full { width: 100%; }
.btn-add { background: var(--navy); border: none; border-radius: 7px; padding: 9px 16px; color: var(--gold); font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: background 0.15s; }
.btn-add:hover { background: var(--navy-2); }
.btn-add:disabled { opacity: .5; cursor: not-allowed; }
.btn-secondary { background: #fff; border: 1px solid var(--line); border-radius: 7px; padding: 8px 14px; color: var(--text); font-size: 13px; font-weight: 500; cursor: pointer; }
.btn-secondary:hover { background: var(--page); }
.btn-link { background: none; border: none; color: var(--blue); font-size: 12px; font-weight: 600; cursor: pointer; padding: 2px 4px; }
.btn-danger-link { background: none; border: none; color: var(--red); font-size: 12px; cursor: pointer; }

/* ─── LAYOUT / SIDEBAR ───────────────────── */
#main-app { display: flex; min-height: 100vh; }
.sidebar { width: 215px; min-width: 215px; background: var(--navy); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; border-right: 3px solid var(--gold); }
.sidebar-logo { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 16px 16px 14px; border-bottom: 1px solid rgba(255,255,255,0.07); }
.sidebar-logo img { height: 64px; width: auto; max-width: 195px; object-fit: contain; }
.sidebar-logo .brand-word { font-size: 15px; line-height: 1.15; }
.sidebar-logo .brand-tag { color: rgba(255,255,255,0.4); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; }
.nav-section-label { font-size: 10px; font-weight: 700; letter-spacing: 1.2px; color: rgba(255,255,255,0.28); text-transform: uppercase; padding: 14px 18px 5px; }
.sidebar-nav { flex: 1; padding: 6px 0; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 14px; margin: 1px 6px; border-radius: 7px; cursor: pointer; color: #fff; font-size: 13.5px; font-weight: 500; text-decoration: none; transition: background 0.15s, color 0.15s; }
.nav-item:hover { background: rgba(255,255,255,0.06); }
.nav-item.active { background: rgba(245,197,24,0.14); color: var(--gold); font-weight: 600; }
.nav-icon { width: 16px; height: 16px; flex-shrink: 0; stroke: rgba(255,255,255,0.4); fill: none; transition: stroke .15s; }
.nav-item.active .nav-icon { stroke: var(--gold); }
.nav-item:hover .nav-icon { stroke: rgba(255,255,255,0.85); }
.nav-badge { margin-left: auto; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; border-radius: 10px; padding: 1px 7px; }
.sidebar-user { padding: 10px 8px; border-top: 1px solid rgba(255,255,255,0.07); }
.user-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.user-avatar { width: 34px; height: 34px; background: var(--gold); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; color: var(--navy); flex-shrink: 0; }
.user-name { color: #fff; font-size: 13px; font-weight: 600; }
.user-role { color: rgba(255,255,255,0.38); font-size: 11px; }
.signout-btn { width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: transparent; border: none; color: rgba(255,255,255,0.38); cursor: pointer; border-radius: 8px; font-size: 13px; transition: color .15s, background .15s; }
.signout-btn:hover { color: #FF8A8A; background: rgba(220,53,69,0.08); }
.mode-pill { margin: 6px 14px 0; font-size: 10px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--gold); background: rgba(245,197,24,.1); border: 1px solid rgba(245,197,24,.25); border-radius: 6px; padding: 4px 8px; text-align: center; }

.main-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.page-area { flex: 1; padding: 28px 32px; }
.page-header { margin-bottom: 22px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-label { color: var(--label); font-size: 11px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; margin-bottom: 4px; }
.page-header h1 { font-size: 24px; font-weight: 700; color: var(--text); }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ─── STAT CARDS ─────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card, .stat-card-dark { border-radius: var(--radius); padding: 16px 20px; }
.stat-card { background: #fff; border: 1px solid var(--line); }
.stat-card-dark { background: var(--navy-card); }
.stat-label { color: var(--label); font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 8px; }
.stat-card-dark .stat-label { color: rgba(255,255,255,0.5); }
.stat-value { font-size: 26px; font-weight: 700; color: var(--text); }
.stat-card-dark .stat-value { color: #fff; }
.stat-value.pending { color: var(--red); }
.stat-card-dark .stat-value.pending { color: #FF6B6B; }
.stat-value.success { color: var(--green); }
.stat-hint { font-size: 11.5px; color: var(--label); margin-top: 4px; }
.stat-card-dark .stat-hint { color: rgba(255,255,255,0.45); }

/* ─── CARDS ──────────────────────────────── */
.content-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; }
.content-card h2 { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card-sub { font-size: 12px; font-weight: 400; color: var(--label); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-2 > .content-card { margin-bottom: 0; }
.empty { text-align: center; color: var(--label); padding: 36px 16px; font-size: 13px; }
.muted { color: var(--label); }
.small { font-size: 12px; }

/* ─── FILTER TABS ────────────────────────── */
.filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-tab { padding: 6px 14px; border-radius: 20px; border: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 12.5px; font-weight: 500; cursor: pointer; transition: all .15s; }
.filter-tab:hover { border-color: var(--navy); color: var(--navy); }
.filter-tab.active { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }

/* ─── BADGES ─────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 20px; white-space: nowrap; }
.badge-stage { background: rgba(10,42,62,0.07); color: var(--navy); }
.badge-ok { background: rgba(45,158,88,0.1); color: var(--green); }
.badge-warn { background: rgba(245,197,24,0.2); color: var(--gold-ink); }
.badge-late { background: rgba(226,75,74,0.1); color: var(--red); }
.badge-person { background: rgba(245,197,24,0.14); color: var(--gold-ink); }

/* ─── FORMS (light) ──────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.input, .field input, .field select, .field textarea { background: var(--input); border: 1px solid var(--line); border-radius: 7px; padding: 9px 12px; font-size: 14px; color: var(--text); outline: none; width: 100%; transition: border-color .2s; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--navy); background: #fff; }
.field textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ─── TABLE ──────────────────────────────── */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { background: var(--input); color: var(--label); font-size: 11px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: #FAFBFD; }
.num { font-variant-numeric: tabular-nums; }

/* ─── CHARTS (CSS bars) ──────────────────── */
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); font-weight: 500; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.colchart { display: flex; align-items: flex-end; gap: 10px; height: 190px; padding-top: 10px; border-bottom: 1px solid var(--line); }
.colchart .grp { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; height: 100%; position: relative; cursor: default; }
.colchart .bar { width: 100%; max-width: 18px; border-radius: 4px 4px 0 0; min-height: 2px; }
.colchart .grp:hover .bar { filter: brightness(1.08); }
.colchart .grp:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; font-size: 11px; padding: 5px 8px; border-radius: 6px; white-space: pre; z-index: 5; pointer-events: none; }
.colchart-x { display: flex; gap: 10px; margin-top: 6px; }
.colchart-x span { flex: 1; text-align: center; font-size: 10.5px; color: var(--label); }
.hbar { display: grid; grid-template-columns: 110px 1fr 96px; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.hbar .track { height: 10px; background: var(--line-soft); border-radius: 5px; overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 0 5px 5px 0; background: var(--navy-card); }
.hbar .val { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ─── PIPELINE (KANBAN) ──────────────────── */
.board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.col { background: #E6ECF2; border-radius: var(--radius); padding: 10px; min-height: 340px; }
.col.dim { opacity: .55; }
.col-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 4px 10px; }
.col-head b { font-size: 14px; }
.col-head .t { font-size: 10.5px; color: var(--label); font-weight: 600; }
.col-count { background: var(--navy); color: var(--gold); border-radius: 10px; font-size: 11px; font-weight: 700; padding: 2px 8px; }
.col-sum { font-size: 11px; color: var(--muted); padding: 0 4px 8px; font-weight: 600; }
.deal { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 8px; padding: 11px 12px; margin-bottom: 9px; cursor: pointer; transition: box-shadow .15s; }
.deal:hover { box-shadow: 0 3px 12px rgba(10,42,62,.1); }
.deal.warn { border-left-color: var(--gold); }
.deal.late { border-left-color: var(--red); }
.deal.paid { border-left-color: var(--green); }
.deal .ref { font-size: 10.5px; color: var(--label); font-weight: 600; }
.deal h4 { font-size: 13.5px; font-weight: 700; margin: 2px 0; }
.deal .ttl { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deal .row { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 6px; }
.amt { font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; font-size: 13px; }
.owner { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.av-sm { width: 22px; height: 22px; border-radius: 50%; background: var(--navy); color: var(--gold); display: grid; place-items: center; font-size: 10px; font-weight: 700; flex-shrink: 0; }

/* ─── INBOX ──────────────────────────────── */
.inbox { display: grid; grid-template-columns: 310px minmax(0, 1fr) 290px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; height: calc(100vh - 150px); min-height: 520px; }
.inbox-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.inbox-search { padding: 10px; border-bottom: 1px solid var(--line); }
.inbox-filters { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.inbox-filters .filter-tab { padding: 4px 10px; font-size: 11.5px; }
.conv-list { overflow-y: auto; flex: 1; }
.conv { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); cursor: pointer; display: flex; gap: 10px; border-left: 4px solid transparent; }
.conv:hover { background: #FAFBFD; }
.conv.active { background: rgba(245,197,24,.1); border-left-color: var(--gold); }
.conv .av { width: 38px; height: 38px; border-radius: 50%; background: var(--navy); color: var(--gold); display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.conv .mid { flex: 1; min-width: 0; }
.conv .top { display: flex; justify-content: space-between; gap: 6px; }
.conv .top b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv .top span { font-size: 10.5px; color: var(--label); white-space: nowrap; }
.conv .top span.unans { color: var(--red); font-weight: 700; }
.conv p { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 2px 0 4px; }
.conv .tags { display: flex; gap: 5px; align-items: center; }
.unread { margin-left: auto; background: var(--green); color: #fff; border-radius: 10px; font-size: 10px; font-weight: 700; padding: 1px 7px; }

.chat { display: flex; flex-direction: column; min-height: 0; background: var(--page); }
.chat-head { background: #fff; padding: 10px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.chat-head .av { width: 36px; height: 36px; border-radius: 50%; background: var(--navy); color: var(--gold); display: grid; place-items: center; font-weight: 700; }
.chat-head h3 { font-size: 14.5px; }
.chat-head small { color: var(--label); font-size: 11.5px; }
.chat-head .back { display: none; background: none; border: none; font-size: 20px; cursor: pointer; color: var(--navy); }
.chat-body { flex: 1; overflow-y: auto; padding: 16px; min-height: 0; }
.day-sep { text-align: center; margin: 10px 0; }
.day-sep span { background: #fff; border: 1px solid var(--line); font-size: 11px; color: var(--muted); border-radius: 10px; padding: 2px 10px; }
.bubble { max-width: 72%; padding: 8px 11px; border-radius: 10px; margin-bottom: 8px; font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; box-shadow: 0 1px 1px rgba(10,42,62,.05); }
.bubble.in { background: #fff; border-top-left-radius: 3px; }
.bubble.out { background: #FFF4CC; margin-left: auto; border-top-right-radius: 3px; }
.bubble .who { font-size: 11px; font-weight: 700; color: var(--gold-ink); margin-bottom: 2px; }
.bubble .meta { font-size: 10.5px; color: var(--label); text-align: right; margin-top: 3px; }
.bubble .meta .read { color: var(--blue); }
.bubble .meta .failed { color: var(--red); }
.sys { text-align: center; margin: 8px 0; }
.sys span { display: inline-block; font-size: 11.5px; color: var(--muted); border: 1px dashed #C9D6E2; border-radius: 8px; padding: 3px 10px; background: rgba(255,255,255,.6); }
.chat-foot { background: #fff; border-top: 1px solid var(--line); padding: 10px 12px; }
.window { font-size: 11px; font-weight: 600; margin-bottom: 7px; display: flex; align-items: center; gap: 6px; }
.window.open { color: var(--green); }
.window.closed { color: var(--red); }
.quick { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 8px; padding-bottom: 2px; scrollbar-width: none; }
.quick button { white-space: nowrap; font-size: 11.5px; border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 4px 10px; cursor: pointer; color: var(--muted); }
.quick button:hover { border-color: var(--navy); color: var(--navy); }
.compose { display: flex; gap: 8px; align-items: flex-end; }
.compose textarea { flex: 1; resize: none; height: 42px; max-height: 120px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; outline: none; background: var(--input); }
.compose textarea:focus { border-color: var(--navy); background: #fff; }

.side { border-left: 1px solid var(--line); padding: 14px; overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 16px; }
.side h5 { font-size: 10.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--label); margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.steps { display: flex; gap: 4px; margin: 10px 0 4px; }
.step { flex: 1; text-align: center; font-size: 10px; color: var(--label); font-weight: 600; }
.step i { display: block; height: 5px; border-radius: 3px; background: var(--line); margin-bottom: 5px; }
.step.done i { background: var(--green); }
.step.cur i { background: var(--gold); }
.step.cur { color: var(--text); }
.note { background: #FFFBEA; border: 1px solid #F1E3A6; border-radius: 8px; padding: 8px 10px; font-size: 12.5px; margin-bottom: 6px; white-space: pre-wrap; }
.note .m { font-size: 10.5px; color: var(--label); margin-top: 3px; }
.handoff { background: linear-gradient(180deg, rgba(10,42,62,.03), rgba(245,197,24,.12)); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.handoff p { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.check { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; color: var(--muted); margin: 8px 0; line-height: 1.4; }
.timeline { font-size: 12px; color: var(--muted); }
.timeline div { padding: 4px 0 4px 12px; border-left: 2px solid var(--line); position: relative; }
.timeline div::before { content: ''; position: absolute; left: -5px; top: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.chat-empty { flex: 1; display: grid; place-items: center; color: var(--label); text-align: center; padding: 20px; }

/* ─── BROADCAST ──────────────────────────── */
.phone { background: #E9E4DC; border-radius: 16px; padding: 16px; min-height: 240px; }
.wa { background: #fff; border-radius: 8px; padding: 10px 12px; font-size: 13.5px; max-width: 92%; box-shadow: 0 1px 1px rgba(0,0,0,.08); white-space: pre-wrap; line-height: 1.45; }
.wa .m { font-size: 10.5px; color: var(--label); text-align: right; margin-top: 4px; }
.cost { margin-top: 12px; background: #FFFBEA; border: 1px solid #F1E3A6; border-radius: 8px; padding: 10px 12px; font-size: 12.5px; line-height: 1.5; }
.progress { height: 8px; background: var(--line-soft); border-radius: 4px; overflow: hidden; margin-top: 10px; }
.progress i { display: block; height: 100%; background: var(--green); width: 0; transition: width .3s; }

/* ─── MODAL & TOAST ──────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(10,42,62,.45); z-index: 200; display: grid; place-items: center; padding: 16px; }
.modal { background: #fff; border-radius: 12px; width: min(460px, 100%); max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 50px rgba(10,42,62,.25); }
.modal-head { background: var(--navy); color: #fff; padding: 14px 18px; border-bottom: 3px solid var(--gold); display: flex; justify-content: space-between; align-items: center; border-radius: 12px 12px 0 0; }
.modal-head h3 { font-size: 15px; }
.modal-head button { background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; }
.modal-body { padding: 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 18px 18px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 100px); background: var(--navy); color: #fff; border-left: 4px solid var(--gold); padding: 10px 16px; border-radius: 8px; font-size: 13px; z-index: 300; transition: transform .25s; max-width: 90vw; }
.toast.show { transform: translate(-50%, 0); }
.toast.error { border-left-color: var(--red); }

/* ─── MOBILE ─────────────────────────────── */
.mobile-nav { display: none; }
@media (max-width: 1100px) {
  .inbox { grid-template-columns: 280px minmax(0, 1fr); }
  .inbox .side { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { display: none; }
  .page-area { padding: 16px 14px 90px; }
  .page-header h1 { font-size: 20px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-value { font-size: 22px; }
  .field-row { grid-template-columns: 1fr; }
  .board { grid-template-columns: repeat(4, 82vw); scroll-snap-type: x mandatory; }
  .col { scroll-snap-align: start; }
  .inbox { grid-template-columns: minmax(0, 1fr); height: calc(100vh - 150px); }
  .inbox-filters { overflow-x: auto; scrollbar-width: none; }
  .inbox-filters.filter-tabs { flex-wrap: nowrap; }
  .inbox-filters .filter-tab { white-space: nowrap; }
  .inbox.has-chat .inbox-list { display: none; }
  .inbox:not(.has-chat) .chat { display: none; }
  .chat-head .back { display: block; }
  .bubble { max-width: 86%; }
  .hbar { grid-template-columns: 80px 1fr 80px; }
  .table { display: block; overflow-x: auto; white-space: nowrap; }
  .mobile-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--navy); border-top: 2px solid var(--gold); z-index: 100; padding-bottom: env(safe-area-inset-bottom); }
  .mob-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 2px 8px; color: rgba(255,255,255,0.5); font-size: 10px; font-weight: 500; text-decoration: none; position: relative; }
  .mob-item svg { width: 21px; height: 21px; stroke: currentColor; fill: none; }
  .mob-item.active { color: var(--gold); }
  .mob-item .nav-badge { position: absolute; top: 4px; right: calc(50% - 22px); margin: 0; }
}

/* ─── SETTINGS TABS (NexPro Central style) ── */
.tabbar { display: flex; gap: 4px; background: #fff; border-bottom: 1px solid var(--line); margin: -28px -32px 24px; padding: 0 32px; overflow-x: auto; scrollbar-width: none; }
.tabbar a { padding: 15px 20px 13px; font-size: 13.5px; font-weight: 500; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabbar a:hover { color: var(--text); }
.tabbar a.active { color: var(--text); font-weight: 700; border-bottom-color: var(--gold); }
.sec-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.sec-head h1 { font-size: 22px; font-weight: 700; }
.sec-head p { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.stat-center { text-align: center; }
.stat-center .stat-value { font-size: 28px; }
.table-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table-card .table td, .table-card .table th { padding: 14px 16px; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; }
.btn-edit { background: #F0F4F8; border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: 5px 13px; font-size: 12.5px; font-weight: 500; cursor: pointer; }
.btn-edit:hover { background: #E4EBF2; }
.btn-del { background: #FFF5F5; border: 1px solid #F5C2C2; color: var(--red); border-radius: 6px; padding: 5px 13px; font-size: 12.5px; font-weight: 500; cursor: pointer; }
.btn-del:hover { background: #FDE8E8; }
.btn-del:disabled, .btn-edit:disabled { opacity: .4; cursor: not-allowed; }
.check-row { display: flex; gap: 8px; align-items: center; font-size: 13.5px; margin-bottom: 14px; }
.steps-list { counter-reset: s; list-style: none; }
.steps-list li { counter-increment: s; position: relative; padding: 0 0 16px 40px; font-size: 13.5px; line-height: 1.6; }
.steps-list li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: var(--gold); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.steps-list b { color: var(--text); }
.steps-list code, .content-card code { background: var(--page); padding: 1px 6px; border-radius: 4px; font-size: 12px; }
@media (max-width: 768px) {
  .tabbar { margin: -16px -14px 18px; padding: 0 8px; }
  .tabbar a { padding: 13px 12px 11px; }
  .row-actions { justify-content: flex-start; }
}

/* ─── PIPELINE (NexPro Central CRM layout) ── */
.crm-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.crm-title { font-size: 24px; font-weight: 700; }
.crm-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.search-box { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; height: 38px; min-width: 260px; }
.search-box svg { width: 15px; height: 15px; color: var(--label); flex-shrink: 0; }
.search-box input { border: none; outline: none; font-size: 13px; width: 100%; background: transparent; color: var(--text); }
.tool-select { height: 38px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 0 10px; font-size: 13px; color: var(--text); cursor: pointer; }
.view-toggle { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; height: 38px; }
.view-toggle button { border: none; background: none; padding: 0 12px; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.view-toggle button.on { background: var(--navy); color: var(--gold); }
.stage-cards { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stage-card { border: none; text-align: left; color: #fff; border-radius: 10px; padding: 16px 18px; cursor: pointer; transition: transform .12s, box-shadow .12s; outline: 3px solid transparent; outline-offset: 2px; }
.stage-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(10,42,62,.18); }
.stage-card.sel { outline-color: var(--navy); }
.sc-label { font-size: 10.5px; font-weight: 700; letter-spacing: 1px; opacity: .9; margin-bottom: 6px; }
.sc-value { font-size: 20px; font-weight: 700; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.sc-sub { font-size: 11.5px; opacity: .85; }
.pill-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.btn-new { padding: 10px 18px; font-size: 13.5px; }
.crm-table th { color: var(--gold-dark); background: #fff; }
.crm-table th.sortable { cursor: pointer; user-select: none; }
.crm-table th.sortable:hover { color: var(--navy); }
.crm-table .deal-row { cursor: pointer; }
.crm-table td { vertical-align: middle; }
.r { text-align: right !important; }
.nowrap { white-space: nowrap; }
.stage-pill { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 3px 12px; border-radius: 20px; color: var(--c); border: 1.5px solid var(--c); background: color-mix(in srgb, var(--c) 9%, #fff); white-space: nowrap; }
@media (max-width: 1100px) { .stage-cards { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) {
  .stage-cards { grid-template-columns: 1fr 1fr; }
  .search-box { min-width: 0; flex: 1 1 100%; }
  .crm-tools { width: 100%; }
  .tool-select { flex: 1; }
}
