@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,wght@0,300;0,600;0,700;1,300&family=Syne:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:       #f0ede8;
    --bg2:      #e8e4de;
    --surface:  #faf8f5;
    --surface2: #f2efe9;
    --border:   #dbd6ce;
    --border2:  #ccc6bc;
    --text:     #1a1714;
    --text2:    #4a4540;
    --text3:    #8a847c;
    --text4:    #b0aa9f;
    --teal:     #1a6b5c;
    --teal2:    #228070;
    --teal3:    #d6ede9;
    --gold:     #b8860b;
    --gold2:    #f0c040;
    --gold3:    #fef3cd;
    --red:      #c0392b;
    --red2:     #fde8e6;
    --green:    #1a7a45;
    --green2:   #d6f0e2;
    --blue:     #1a4fa0;
    --blue2:    #dce8fa;
    --orange:   #c05020;
    --orange2:  #fde8dc;
    --purple:   #5a2d8a;
    --purple2:  #ead6fa;
    --font-d:   'Fraunces', Georgia, serif;
    --font-ui:  'Syne', sans-serif;
    --font-m:   'JetBrains Mono', monospace;
    --r:        10px;
    --r2:       14px;
    --shadow:   0 1px 3px rgba(0,0,0,.07), 0 4px 16px rgba(0,0,0,.05);
    --shadow2:  0 2px 8px rgba(0,0,0,.10), 0 8px 32px rgba(0,0,0,.08);
}

html, body { height: 100%; overflow: hidden; }
body { font-family: var(--font-ui); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── App Shell ────────────────────────────────────────────── */
.app         { display: flex; height: 100vh; overflow: hidden; }
.sidebar     { width: 230px; min-width: 230px; background: var(--text); display: flex; flex-direction: column; overflow: hidden; position: relative; }
.sidebar::after { content:''; position:absolute; bottom:0; left:0; right:0; height:120px; background:linear-gradient(to top,rgba(26,23,20,.9),transparent); pointer-events:none; }
.main        { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar      { height: 58px; min-height: 58px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 24px; gap: 14px; z-index: 10; }
.content     { flex: 1; overflow-y: auto; padding: 26px; }

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar-logo { padding: 22px 20px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.logo-name    { font-family: var(--font-d); font-size: 22px; color: #fff; font-style: italic; letter-spacing: -.5px; }
.logo-sub     { font-size: 9px; letter-spacing: 3px; color: rgba(255,255,255,.35); text-transform: uppercase; margin-top: 2px; }
.sidebar-nav  { flex: 1; padding: 18px 12px; overflow-y: auto; }
.nav-section  { font-size: 9px; letter-spacing: 2.5px; color: rgba(255,255,255,.25); text-transform: uppercase; padding: 0 8px 8px; margin-top: 20px; }
.nav-section:first-child { margin-top: 0; }
.nav-item     { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500; color: rgba(255,255,255,.5); transition: all .18s; margin-bottom: 2px; text-decoration: none; }
.nav-item:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.85); text-decoration: none; }
.nav-item.active { background: var(--teal); color: #fff; }
.nav-icon     { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-badge    { margin-left: auto; background: var(--gold2); color: var(--text); font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 20px; font-family: var(--font-m); }
.sidebar-footer { padding: 14px 14px 20px; position: relative; z-index: 1; }
.user-card    { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.06); cursor: pointer; transition: background .18s; text-decoration: none; }
.user-card:hover { background: rgba(255,255,255,.1); }

/* ── Topbar ───────────────────────────────────────────────── */
.page-title { font-family: var(--font-d); font-size: 20px; color: var(--text); white-space: nowrap; }
.search-form { flex: 1; max-width: 360px; display: flex; position: relative; }
.search-form input { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px 8px 36px; font-size: 13px; font-family: var(--font-ui); color: var(--text); outline: none; transition: border .2s; }
.search-form input:focus { border-color: var(--teal2); }
.search-form input::placeholder { color: var(--text4); }
.search-ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text4); font-size: 14px; pointer-events: none; }
.tb-right   { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ── Avatar ───────────────────────────────────────────────── */
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--teal2), var(--gold)); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0; font-family: var(--font-m); }
.user-name { font-size: 12px; font-weight: 600; color: #fff; }
.user-role { font-size: 10px; color: rgba(255,255,255,.4); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn         { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer; border: none; font-family: var(--font-ui); transition: all .15s; white-space: nowrap; letter-spacing: .3px; text-decoration: none; }
.btn:hover   { text-decoration: none; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal2); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26,107,92,.3); color: #fff; }
.btn-outline { background: transparent; color: var(--text2); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--border2); background: var(--bg); color: var(--text); }
.btn-ghost   { background: transparent; color: var(--text3); border: none; }
.btn-ghost:hover { color: var(--text); background: var(--bg); }
.btn-danger  { background: transparent; color: var(--red); border: 1.5px solid rgba(192,57,43,.25); }
.btn-danger:hover { background: var(--red2); }
.btn-sm      { padding: 5px 11px; font-size: 11px; }
.btn-gold    { background: var(--gold); color: #fff; }
.btn-gold:hover { background: #9a7008; color: #fff; }
.icon-btn    { width: 34px; height: 34px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; border: 1.5px solid var(--border); background: var(--surface); color: var(--text3); font-size: 15px; transition: all .15s; }
.icon-btn:hover { background: var(--bg); border-color: var(--border2); color: var(--text); }

/* ── Cards ────────────────────────────────────────────────── */
.card        { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r2); box-shadow: var(--shadow); }
.card-hd     { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-title  { font-size: 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--text3); }
.card-body   { padding: 20px; }

/* ── Stat Cards ───────────────────────────────────────────── */
.stats-row   { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 20px; }
.stat-card   { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r2); padding: 20px; position: relative; overflow: hidden; transition: box-shadow .2s; }
.stat-card:hover { box-shadow: var(--shadow2); }
.stat-accent { position: absolute; top: 0; left: 0; right: 0; height: 3px; border-radius: var(--r2) var(--r2) 0 0; }
.stat-lbl    { font-size: 10px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text3); margin-bottom: 10px; }
.stat-val    { font-family: var(--font-d); font-size: 32px; color: var(--text); line-height: 1; margin-bottom: 6px; }
.stat-sub    { font-size: 11px; color: var(--text3); }
.trend-up    { color: var(--green); font-weight: 700; }
.trend-dn    { color: var(--red);   font-weight: 700; }
.sparkline   { display: flex; align-items: flex-end; gap: 3px; height: 32px; margin-top: 12px; }
.spark-b     { width: 7px; border-radius: 3px 3px 0 0; }

/* ── Table ────────────────────────────────────────────────── */
.tbl-wrap    { overflow-x: auto; }
table        { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th     { padding: 10px 14px; text-align: left; font-size: 9px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text3); border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface2); }
thead th a   { color: var(--text3); text-decoration: none; }
thead th a:hover { color: var(--text); }
tbody tr     { border-bottom: 1px solid var(--border); transition: background .12s; }
tbody tr:hover { background: var(--bg); }
tbody tr:last-child { border-bottom: none; }
td           { padding: 12px 14px; vertical-align: middle; }
.row-link    { text-decoration: none; color: inherit; display: contents; }

/* ── Badges ───────────────────────────────────────────────── */
.badge       { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; font-size: 10px; font-weight: 700; letter-spacing: .3px; white-space: nowrap; }
.badge-dot   { width: 5px; height: 5px; border-radius: 50%; }
.tag         { display: inline-flex; padding: 2px 7px; border-radius: 4px; font-size: 10px; font-weight: 600; background: var(--teal3); color: var(--teal); margin-right: 4px; }

/* ── Prob bar ─────────────────────────────────────────────── */
.prob-wrap   { display: flex; align-items: center; gap: 8px; }
.prob-track  { width: 54px; height: 5px; background: var(--bg2); border-radius: 3px; flex-shrink: 0; }
.prob-fill   { height: 100%; border-radius: 3px; }

/* ── Filter pills ─────────────────────────────────────────── */
.filter-row  { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.fpill       { padding: 5px 13px; border-radius: 20px; font-size: 11px; font-weight: 600; cursor: pointer; border: 1.5px solid var(--border); color: var(--text3); background: var(--surface); font-family: var(--font-ui); transition: all .15s; text-decoration: none; display: inline-block; }
.fpill:hover { border-color: var(--border2); color: var(--text); text-decoration: none; }
.fpill.on    { background: var(--teal3); border-color: var(--teal2); color: var(--teal); }

/* ── Pipeline board ───────────────────────────────────────── */
.board       { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 14px; height: calc(100vh - 148px); align-items: flex-start; }
.board-col   { min-width: 220px; width: 220px; flex-shrink: 0; display: flex; flex-direction: column; }
.col-hd      { padding: 10px 12px; border-radius: 10px; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }
.col-title   { font-size: 11px; font-weight: 700; letter-spacing: .5px; }
.col-count   { font-size: 10px; font-family: var(--font-m); padding: 2px 8px; border-radius: 20px; background: rgba(255,255,255,.5); }
.col-cards   { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; flex: 1; }
.p-card      { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; cursor: pointer; transition: all .15s; text-decoration: none; display: block; color: inherit; }
.p-card:hover { box-shadow: var(--shadow2); transform: translateY(-2px); border-color: var(--border2); text-decoration: none; color: inherit; }
.p-card-name { font-size: 13px; font-weight: 600; margin-bottom: 1px; }
.p-card-co   { font-size: 11px; color: var(--text3); margin-bottom: 8px; }
.p-card-val  { font-family: var(--font-m); font-size: 12px; color: var(--teal); font-weight: 600; }
.p-card-ft   { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.p-prob-bar  { height: 3px; background: var(--border); border-radius: 3px; margin-top: 8px; }
.p-prob-fill { height: 100%; border-radius: 3px; }
.empty-col   { border: 2px dashed var(--border); border-radius: 10px; padding: 20px 12px; text-align: center; color: var(--text4); font-size: 11px; }

/* ── Detail page ──────────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 1fr 300px; gap: 18px; }
.detail-hd   { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--r2); padding: 24px; margin-bottom: 16px; display: flex; gap: 20px; }
.lead-av     { width: 54px; height: 54px; border-radius: 50%; background: linear-gradient(135deg, var(--teal), var(--gold)); display: flex; align-items: center; justify-content: center; font-family: var(--font-d); font-size: 20px; font-weight: 700; color: #fff; flex-shrink: 0; }
.lead-name   { font-family: var(--font-d); font-size: 24px; line-height: 1.2; margin-bottom: 4px; }
.lead-meta   { font-size: 12px; color: var(--text3); margin-bottom: 12px; }
.info-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.info-item label { font-size: 9px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text3); display: block; margin-bottom: 3px; }
.info-item span  { font-size: 13px; color: var(--text); }
.deal-box    { text-align: right; margin-left: auto; flex-shrink: 0; }
.deal-lbl    { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 2px; }
.deal-val    { font-family: var(--font-d); font-size: 26px; color: var(--teal); }
.deal-prob   { font-size: 22px; font-weight: 700; margin-top: 8px; }

/* ── Timeline ─────────────────────────────────────────────── */
.timeline    { display: flex; flex-direction: column; }
.tl-item     { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.tl-item:last-child { border-bottom: none; }
.tl-ico      { width: 32px; height: 32px; border-radius: 50%; background: var(--bg); border: 1.5px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.tl-text     { font-size: 12.5px; color: var(--text2); }
.tl-date     { font-size: 10px; color: var(--text3); margin-top: 3px; font-family: var(--font-m); }

/* ── Stage progress ───────────────────────────────────────── */
.stage-prog  { display: flex; flex-direction: column; gap: 8px; }
.sp-item     { display: flex; align-items: center; gap: 10px; }
.sp-dot      { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; flex-shrink: 0; border: 2px solid; }

/* ── Forms ────────────────────────────────────────────────── */
.form-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group  { display: flex; flex-direction: column; gap: 6px; }
.fg-full     { grid-column: 1 / -1; }
.form-group label { font-size: 10px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text3); }
.form-control { background: var(--bg); border: 1.5px solid var(--border); border-radius: 8px; padding: 9px 12px; color: var(--text); font-size: 13px; font-family: var(--font-ui); outline: none; transition: border .2s; width: 100%; }
.form-control:focus { border-color: var(--teal2); background: var(--surface); }
.form-control::placeholder { color: var(--text4); }
select.form-control option { background: var(--surface); }
textarea.form-control { resize: vertical; min-height: 80px; }
.range-wrap  { display: flex; align-items: center; gap: 10px; }
input[type=range] { flex: 1; accent-color: var(--teal); }
.range-val   { font-family: var(--font-m); font-size: 13px; font-weight: 700; color: var(--teal); min-width: 36px; }
.validation-msg { font-size: 11px; color: var(--red); margin-top: 3px; }
.alert-success { background: var(--green2); border: 1px solid var(--green); color: var(--green); padding: 10px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.alert-error   { background: var(--red2);   border: 1px solid var(--red);   color: var(--red);   padding: 10px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }

/* ── Charts (CSS bar charts) ──────────────────────────────── */
.bar-row     { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.bar-lbl     { font-size: 11px; color: var(--text2); width: 90px; flex-shrink: 0; }
.bar-track   { flex: 1; height: 8px; background: var(--bg2); border-radius: 4px; overflow: hidden; }
.bar-fill    { height: 100%; border-radius: 4px; transition: width .7s cubic-bezier(.4,0,.2,1); }
.bar-val     { font-size: 11px; font-family: var(--font-m); color: var(--text3); width: 56px; text-align: right; }

/* ── Donut chart ──────────────────────────────────────────── */
.donut-wrap  { display: flex; align-items: center; gap: 22px; }
.donut-leg   { display: flex; flex-direction: column; gap: 9px; }
.leg-row     { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.leg-dot     { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.leg-val     { margin-left: auto; font-family: var(--font-m); font-size: 11px; padding-left: 14px; }

/* ── Reports grid ─────────────────────────────────────────── */
.rep-grid    { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* ── Settings ─────────────────────────────────────────────── */
.set-layout  { display: grid; grid-template-columns: 200px 1fr; gap: 20px; }
.set-nav     { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r2); padding: 10px; height: fit-content; }
.set-ni      { padding: 9px 12px; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--text2); transition: all .15s; display: block; text-decoration: none; }
.set-ni:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.set-ni.on   { background: var(--teal3); color: var(--teal); }
.toggle-row  { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--border); }
.toggle-row:last-child { border-bottom: none; }
.tog-label   { font-size: 13px; font-weight: 500; }
.tog-desc    { font-size: 11px; color: var(--text3); margin-top: 3px; }
.toggle-btn  { width: 42px; height: 24px; border-radius: 12px; background: var(--border2); position: relative; cursor: pointer; border: none; transition: background .2s; flex-shrink: 0; }
.toggle-btn.on { background: var(--teal); }
.toggle-btn::after { content:''; width:18px; height:18px; border-radius:50%; background:#fff; position:absolute; top:3px; left:3px; transition:left .2s; box-shadow:0 1px 4px rgba(0,0,0,.2); }
.toggle-btn.on::after { left: 21px; }

/* ── Tasks ────────────────────────────────────────────────── */
.task-row    { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.task-row:last-child { border-bottom: none; }
.task-check  { width: 18px; height: 18px; border-radius: 4px; border: 2px solid var(--border2); flex-shrink: 0; cursor: pointer; background: transparent; appearance: none; transition: all .15s; }
.task-check:checked { background: var(--teal); border-color: var(--teal); }
.task-title  { flex: 1; font-size: 13px; }
.task-done   { text-decoration: line-through; color: var(--text3); }
.prio-pill   { font-size: 9px; padding: 2px 8px; border-radius: 4px; font-weight: 700; }

/* ── Plan card ────────────────────────────────────────────── */
.plan-card   { border-radius: 12px; padding: 22px; background: linear-gradient(135deg,#1a6b5c,#1a4fa0); color: #fff; margin-bottom: 20px; }

/* ── Login page ───────────────────────────────────────────── */
.login-page  { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--text); }
.login-card  { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 42px 40px; width: 420px; max-width: 95vw; box-shadow: var(--shadow2); }
.login-logo  { font-family: var(--font-d); font-size: 28px; color: var(--teal); font-style: italic; margin-bottom: 4px; }
.login-sub   { font-size: 11px; letter-spacing: 2px; color: var(--text3); text-transform: uppercase; margin-bottom: 32px; }
.login-title { font-family: var(--font-d); font-size: 20px; margin-bottom: 22px; }

/* ── Misc ─────────────────────────────────────────────────── */
.mono        { font-family: var(--font-m); }
.muted       { color: var(--text3); }
.mb-16       { margin-bottom: 16px; }
.mb-20       { margin-bottom: 20px; }
.grid-2      { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3      { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.flex        { display: flex; }
.items-c     { align-items: center; }
.gap-10      { gap: 10px; }
.ml-auto     { margin-left: auto; }
.divider     { height: 1px; background: var(--border); margin: 18px 0; }
.pill-num    { font-family: var(--font-m); background: var(--bg2); padding: 2px 7px; border-radius: 4px; font-size: 10px; }
.section-hd  { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-title { font-family: var(--font-d); font-size: 15px; color: var(--text); }
.notif-wrap  { position: relative; }
.notif-dot   { width: 8px; height: 8px; background: var(--red); border-radius: 50%; position: absolute; top: 5px; right: 5px; pointer-events: none; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 20px; color: var(--text3); text-align: center; }
.empty-state .empty-icon { font-size: 36px; margin-bottom: 10px; opacity: .5; }
.breadcrumb-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.bc-sep         { color: var(--text4); font-size: 12px; }
.bc-item        { font-size: 12px; color: var(--text3); text-decoration: none; }
.bc-item:hover  { color: var(--text); }
.bc-item.active { color: var(--text); font-weight: 600; }
.pagination     { display: flex; gap: 6px; align-items: center; margin-top: 14px; justify-content: center; }
.page-btn       { width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; border: 1.5px solid var(--border); background: var(--surface); color: var(--text3); text-decoration: none; transition: all .15s; }
.page-btn:hover { border-color: var(--teal2); color: var(--teal); }
.page-btn.active { background: var(--teal); border-color: var(--teal); color: #fff; }
.page-btn.disabled { opacity: .4; pointer-events: none; }

@keyframes fadeUp { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
.fade-in { animation: fadeUp .22s ease; }

@media (max-width: 1100px) {
    .stats-row { grid-template-columns: repeat(2,1fr); }
    .rep-grid, .detail-grid, .grid-2 { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
}

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay  { position:fixed; inset:0; background:rgba(26,23,20,.55); backdrop-filter:blur(3px); z-index:200; display:none; align-items:center; justify-content:center; }
.modal-overlay.open { display:flex; }
.modal          { background:var(--surface); border:1px solid var(--border); border-radius:16px; width:540px; max-width:95vw; max-height:90vh; overflow-y:auto; box-shadow:var(--shadow2); }
.modal-hd       { padding:22px 24px 18px; border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; }
.modal-title    { font-family:var(--font-d); font-size:20px; }
.modal-close    { width:30px; height:30px; border-radius:50%; border:none; background:var(--bg); color:var(--text3); cursor:pointer; font-size:16px; display:flex; align-items:center; justify-content:center; }
.modal-close:hover { background:var(--bg2); color:var(--text); }
.modal-body     { padding:22px 24px; }
.modal-ft       { padding:16px 24px; border-top:1px solid var(--border); display:flex; justify-content:flex-end; gap:10px; }

/* ── Activity log extras ─────────────────────────────────────── */
.type-chip      { font-size:9px; padding:2px 8px; border-radius:4px; background:var(--bg2); color:var(--text3); text-transform:capitalize; font-weight:600; white-space:nowrap; align-self:center; }
.done-text      { text-decoration:line-through; color:var(--text3); }
.task-check.done { background:var(--teal); border-color:var(--teal); }
.btn-icon-del   { border:none; background:transparent; color:var(--text4); cursor:pointer; font-size:12px; padding:2px 6px; border-radius:4px; }
.btn-icon-del:hover { background:var(--red2); color:var(--red); }
.task-check     { border:none; cursor:pointer; }

/* ── Settings tabs ───────────────────────────────────────────── */
.set-layout     { display:grid; grid-template-columns:200px 1fr; gap:20px; }
.set-nav        { background:var(--surface); border:1px solid var(--border); border-radius:var(--r2); padding:10px; height:fit-content; }
.set-ni         { display:block; padding:9px 12px; border-radius:8px; font-size:13px; font-weight:500; cursor:pointer; color:var(--text2); transition:all .15s; text-decoration:none; margin-bottom:2px; }
.set-ni:hover   { background:var(--bg); color:var(--text); text-decoration:none; }
.set-ni.on      { background:var(--teal3); color:var(--teal); }
.toggle-row     { display:flex; align-items:center; justify-content:space-between; padding:14px 0; border-bottom:1px solid var(--border); }
.toggle-row:last-child { border-bottom:none; }
.tog-label      { font-size:13px; font-weight:500; }
.tog-desc       { font-size:11px; color:var(--text3); margin-top:3px; }
.toggle-btn     { width:42px; height:24px; border-radius:12px; background:var(--border2); position:relative; cursor:pointer; border:none; transition:background .2s; flex-shrink:0; }
.toggle-btn.on  { background:var(--teal); }
.toggle-btn::after { content:''; width:18px; height:18px; border-radius:50%; background:#fff; position:absolute; top:3px; left:3px; transition:left .2s; box-shadow:0 1px 4px rgba(0,0,0,.2); }
.toggle-btn.on::after { left:21px; }
.plan-card      { border-radius:12px; padding:22px; background:linear-gradient(135deg,#1a6b5c,#1a4fa0); color:#fff; margin-bottom:20px; }
.plan-card .plan-name { font-family:var(--font-d); font-size:26px; margin-bottom:4px; }
.plan-card .plan-sub  { font-size:13px; opacity:.8; margin-bottom:16px; }
.int-row        { display:flex; align-items:center; gap:14px; padding:14px 0; border-bottom:1px solid var(--border); }
.int-row:last-child { border-bottom:none; }
.int-icon       { width:40px; height:40px; border-radius:10px; background:var(--bg); border:1px solid var(--border); display:flex; align-items:center; justify-content:center; font-size:18px; flex-shrink:0; }
.billing-row    { display:flex; align-items:center; padding:12px 0; border-bottom:1px solid var(--border); font-size:13px; }
.billing-row:last-child { border-bottom:none; }
.member-row     { display:flex; align-items:center; gap:12px; padding:14px 0; border-bottom:1px solid var(--border); }
.member-row:last-child  { border-bottom:none; }
.role-chip      { font-size:10px; padding:3px 9px; border-radius:4px; font-weight:700; }

/* ── Range input ─────────────────────────────────────────────── */
.range-wrap     { padding:4px 0; }
input[type=range] { width:100%; accent-color:var(--teal); }

/* ── Validation ──────────────────────────────────────────────── */
.validation-msg { font-size:11px; color:var(--red); margin-top:2px; display:block; }
.field-error    { border-color:var(--red) !important; }

@media (max-width: 900px) {
    .set-layout { grid-template-columns: 1fr; }
}
