/* TaskMinds Lead Hub, sidebar theme: vermilion accent, dark sidebar, white content */

:root {
  /* Brand */
  --accent: #F0412E;
  --accent-hover: #D8331F;
  --accent-soft: #FDECE9;
  --accent-ring: rgba(240, 65, 46, .16);

  /* Sidebar (dark) */
  --side: #14171F;
  --side-2: #1C202B;
  --side-line: rgba(255, 255, 255, .08);
  --side-text: #E7EAF0;
  --side-muted: #8A93A6;

  /* Content (light) */
  --page: #F5F6F8;
  --card: #FFFFFF;
  --border: #E8EBEF;
  --line: #F0F2F5;
  --hover: #F8F9FB;

  /* Text */
  --text: #171A21;
  --text2: #5B6472;
  --text3: #939BA8;

  /* Lead scores (kept distinct from brand) */
  --hot: #F0412E;   --hot-deep: #9A2415;   --hot-bg: #FDECE9;
  --warm: #E89020;  --warm-deep: #7A4A06;  --warm-bg: #FCF1DF;
  --cold: #3B82C4;  --cold-deep: #23517E;  --cold-bg: #E8F1FA;

  /* Statuses */
  --green: #1F9D57;  --green-deep: #10693A;  --green-bg: #E4F5EC;
  --red: #DC2626;    --red-deep: #991B1B;    --red-bg: #FDECEC;
  --purple: #7C5CE0; --purple-deep: #4A339C; --purple-bg: #F0EBFC;
  --gray: #939BA8;   --gray-deep: #4B5563;   --gray-bg: #EEF0F3;

  /* Shape and depth */
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-float: 0 20px 50px rgba(0, 0, 0, .5);

  --side-w: 236px;
  --font: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--page);
  margin: 0;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent-soft); }

.icon { width: 1em; height: 1em; vertical-align: -0.125em; flex-shrink: 0; }

/* App shell */
.app { display: flex; min-height: 100vh; }

/* Mobile top bar (hidden on desktop) */
.mobilebar { display: none; align-items: center; gap: 12px; padding: 12px 16px; background: var(--side); border-bottom: 1px solid var(--side-line); position: sticky; top: 0; z-index: 40; }
.mobilebar .burger { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--side-line); background: rgba(255,255,255,.04); color: var(--side-text); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.mobilebar .burger .icon { width: 20px; height: 20px; }
.mobilebar .mb-brand { display: flex; align-items: center; gap: 9px; color: var(--side-text); font-size: 15px; font-weight: 600; }
.mobilebar .mb-brand .mark { width: 26px; height: 26px; border-radius: 8px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; }
.mobilebar .mb-brand .mark .icon { width: 14px; height: 14px; }
.scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 45; opacity: 0; transition: opacity .2s; }

/* Sidebar */
.sidebar {
  width: var(--side-w); flex-shrink: 0;
  background: var(--side);
  background-image: radial-gradient(420px 260px at -40px -20px, rgba(240, 65, 46, .18), transparent 70%);
  border-right: 1px solid var(--side-line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.side-brand { display: flex; align-items: center; gap: 11px; padding: 20px 20px 22px; color: var(--side-text); font-size: 15.5px; font-weight: 600; letter-spacing: -.01em; }
.side-brand .mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 16px rgba(240, 65, 46, .4); }
.side-brand .mark .icon { width: 16px; height: 16px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; padding: 6px 12px; }
.side-nav a { display: flex; align-items: center; gap: 11px; color: var(--side-muted); font-size: 13.5px; font-weight: 500; text-decoration: none; padding: 10px 12px; border-radius: 10px; transition: color .15s, background .15s; }
.side-nav a .icon { width: 18px; height: 18px; }
.side-nav a:hover { color: var(--side-text); background: rgba(255, 255, 255, .05); }
.side-nav a.active { color: #fff; background: var(--accent); box-shadow: 0 4px 14px rgba(240, 65, 46, .32); }
.side-nav a.active .icon { color: #fff; }
.side-group { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--side-muted); opacity: .7; padding: 14px 12px 6px; }
.side-foot { margin-top: auto; padding: 14px 16px; border-top: 1px solid var(--side-line); }
.side-user { display: flex; align-items: center; gap: 10px; }
.side-user .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--side-2); color: var(--side-text); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.side-user .who { min-width: 0; flex: 1; }
.side-user .who .n { font-size: 13px; font-weight: 600; color: var(--side-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .who .r { font-size: 11.5px; color: var(--side-muted); }
.side-user a.out { color: var(--side-muted); display: inline-flex; padding: 6px; border-radius: 8px; transition: color .15s, background .15s; }
.side-user a.out:hover { color: var(--side-text); background: rgba(255, 255, 255, .06); }
.side-user a.out .icon { width: 17px; height: 17px; }

/* Main */
.main { flex: 1; min-width: 0; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 28px 36px 48px; }
.pagehead { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 22px; gap: 16px; flex-wrap: wrap; }
.pagehead h1 { font-size: 22px; font-weight: 600; letter-spacing: -.015em; margin: 0; }
.pagehead .subtitle { font-size: 13px; color: var(--text2); margin: 4px 0 0; }
.pagehead .live { font-size: 12px; color: var(--text2); display: flex; align-items: center; gap: 7px; }
.pagehead .live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* Cards and metrics */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.card h2 { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text3); margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.card h2 .icon { color: var(--accent); width: 15px; height: 15px; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.metric { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 17px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.metric::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); opacity: 0; transition: opacity .15s; }
.metric:hover::before { opacity: 1; }
.metric .label { font-size: 12px; font-weight: 500; color: var(--text2); margin: 0; display: flex; align-items: center; gap: 7px; }
.metric .label .icon { color: var(--accent); width: 15px; height: 15px; }
.metric .value { font-size: 27px; font-weight: 700; letter-spacing: -.025em; margin: 6px 0 0; font-variant-numeric: tabular-nums; }
.metric .sub { font-size: 12px; color: var(--text2); margin: 5px 0 0; }
.cols { display: grid; grid-template-columns: 1.65fr 1fr; gap: 12px; align-items: start; }
.sidecol { display: flex; flex-direction: column; gap: 12px; }

/* Feed rows */
.row { display: flex; align-items: center; gap: 12px; padding: 11px 10px; border-radius: var(--radius-sm); transition: background .12s; margin: 0 -10px; }
.row:hover { background: var(--hover); }
.row + .row { border-top: 1px solid var(--line); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dot-new { background: var(--red); }
.dot-contacted { background: var(--cold); }
.dot-chasing { background: var(--purple); }
.dot-booked { background: var(--green); }
.dot-dead { background: var(--gray); }
.row .main { flex: 1; min-width: 0; }
.row .t { font-size: 13.5px; font-weight: 600; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.005em; }
.row .t a { color: var(--text); text-decoration: none; transition: color .12s; }
.row .t a:hover { color: var(--accent); }
.row .s { font-size: 12px; color: var(--text2); margin: 2px 0 0; }

/* Pills and badges */
.pill { font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 99px; white-space: nowrap; letter-spacing: .01em; }
.pill-hot { background: var(--hot-bg); color: var(--hot-deep); }
.pill-warm { background: var(--warm-bg); color: var(--warm-deep); }
.pill-cold { background: var(--cold-bg); color: var(--cold-deep); }
.pill-booked { background: var(--green-bg); color: var(--green-deep); }
.pill-chasing { background: var(--purple-bg); color: var(--purple-deep); }
.pill-contacted { background: var(--cold-bg); color: var(--cold-deep); }
.pill-dead { background: var(--gray-bg); color: var(--gray-deep); }
.badge { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.badge.on { background: var(--green-bg); color: var(--green-deep); }
.badge.off { background: var(--red-bg); color: var(--red-deep); }

/* Queue and client rows */
.qrow { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 9px 0; font-size: 12.5px; }
.qrow + .qrow { border-top: 1px solid var(--line); }
.qrow .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.qrow .who .biz { color: var(--text3); font-weight: 400; }
.qrow .due { color: var(--purple); font-weight: 600; white-space: nowrap; font-size: 12px; font-variant-numeric: tabular-nums; }
.crow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; font-size: 12.5px; }
.crow + .crow { border-top: 1px solid var(--line); }
.crow .cname { font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crow .cname .n30 { color: var(--text3); font-weight: 400; }
.empty { font-size: 12.5px; color: var(--text2); padding: 8px 0; }

/* Auth (dark, standalone, no sidebar) */
.center-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--side); background-image: radial-gradient(600px 400px at 50% -120px, rgba(240, 65, 46, .16), transparent 65%); }
.float-card { background: var(--side-2); border: 1px solid var(--side-line); border-radius: 18px; padding: 36px 32px; width: 100%; max-width: 380px; box-shadow: var(--shadow-float); }
.float-card .mark { width: 42px; height: 42px; border-radius: 13px; margin: 0 0 18px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 20px rgba(240, 65, 46, .4); }
.float-card .mark .icon { width: 21px; height: 21px; }
.float-card h1 { font-size: 19px; font-weight: 600; letter-spacing: -.01em; margin: 0 0 4px; color: var(--side-text); display: flex; align-items: center; gap: 8px; }
.float-card .sub { font-size: 13px; color: var(--side-muted); margin: 0 0 22px; }
.float-card label { color: var(--side-text); }
.float-card input { background: rgba(255,255,255,.05); color: var(--side-text); border-color: var(--side-line); }
.float-card input::placeholder { color: var(--side-muted); }
.float-card input:focus { border-color: var(--accent); background: rgba(255,255,255,.08); }

/* Forms */
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text); margin: 0 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=number] {
  width: 100%; padding: 12px 14px; font-size: 15px; font-family: inherit;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s; margin-bottom: 14px; color: var(--text);
}
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
input.code { font-size: 24px; letter-spacing: .35em; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.btn { width: 100%; padding: 13px; font-size: 15px; font-weight: 600; font-family: inherit; color: #fff; background: var(--accent); border: 0; border-radius: var(--radius-sm); cursor: pointer; transition: background .15s, transform .1s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; box-shadow: 0 6px 18px rgba(240, 65, 46, .28); }
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: scale(.99); }
.btn-green { background: var(--green); box-shadow: 0 6px 18px rgba(31, 157, 87, .25); }
.btn-green:hover { background: #178044; }
.btn-gray { background: var(--gray-deep); box-shadow: none; }
.btn-gray:hover { background: #374151; }

/* Messages */
.msg { font-size: 13px; font-weight: 500; padding: 10px 14px; border-radius: var(--radius-sm); margin: 0 0 14px; }
.msg-err { background: var(--red-bg); color: var(--red-deep); }
.msg-ok { background: var(--green-bg); color: var(--green-deep); }
.float-card .msg-err { background: rgba(220,38,38,.15); color: #FCA5A5; }
.float-card .msg-ok { background: rgba(31,157,87,.15); color: #6EE7A8; }
.alt { font-size: 12.5px; color: var(--side-muted); margin: 16px 0 0; text-align: center; }
.alt a { color: var(--accent); text-decoration: none; font-weight: 500; }

/* Action page states (dark standalone) */
.state-head { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.state-head .icon { width: 26px; height: 26px; }
.state-head h1 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.01em; color: var(--side-text); }
.state-ok { color: var(--green); }
.state-dead { color: var(--red); }
p.body { color: var(--side-muted); font-size: 14px; line-height: 1.55; }
p.body strong { color: var(--side-text); }

/* Reports and shared page pieces */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 18px; }
.select { position: relative; }
.select select { appearance: none; font-family: inherit; font-size: 13.5px; font-weight: 500; color: var(--text); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 34px 10px 14px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.select select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.select .chev { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--text3); width: 15px; height: 15px; }
.seg { display: inline-flex; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.seg a { font-size: 13px; font-weight: 500; color: var(--text2); text-decoration: none; padding: 9px 14px; transition: background .15s, color .15s; }
.seg a + a { border-left: 1px solid var(--border); }
.seg a.on { background: var(--accent); color: #fff; }

.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat .k { font-size: 11.5px; font-weight: 500; letter-spacing: .03em; text-transform: uppercase; color: var(--text3); margin: 0; display: flex; align-items: center; gap: 6px; }
.stat .k .icon { color: var(--accent); width: 14px; height: 14px; }
.stat .v { font-size: 25px; font-weight: 700; letter-spacing: -.02em; margin: 7px 0 0; font-variant-numeric: tabular-nums; }
.stat .d { font-size: 12px; color: var(--text2); margin: 4px 0 0; }

.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 90px 1fr 46px; align-items: center; gap: 12px; font-size: 12.5px; }
.bar-row .bl { color: var(--text2); font-weight: 500; text-transform: capitalize; }
.bar-track { height: 9px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: var(--accent); }
.bar-row .bv { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

.roi-banner { background: linear-gradient(100deg, #14171F, #23272F); color: #fff; border-radius: var(--radius); padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.roi-banner::after { content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(240,65,46,.35), transparent 70%); }
.roi-banner .rl { font-size: 12.5px; color: var(--side-muted); margin: 0 0 4px; letter-spacing: .03em; text-transform: uppercase; }
.roi-banner .rv { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.roi-banner .rx { font-size: 13px; color: var(--side-muted); margin: 4px 0 0; }
.roi-banner .big { font-size: 44px; font-weight: 700; letter-spacing: -.03em; color: #fff; position: relative; z-index: 1; }
.roi-banner .big span { font-size: 18px; color: var(--accent); font-weight: 600; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.section-gap { margin-top: 12px; }

/* Sales page */
.funnel { display: flex; flex-direction: column; gap: 8px; }
.funnel-row { display: grid; grid-template-columns: 120px 1fr auto; align-items: center; gap: 12px; }
.funnel-row .fl { font-size: 12.5px; color: var(--text2); font-weight: 500; }
.funnel-bar { height: 34px; border-radius: 8px; display: flex; align-items: center; padding: 0 12px; color: #fff; font-size: 13px; font-weight: 600; min-width: 44px; transition: width .3s; }
.funnel-row .fv { font-size: 13px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.opp { display: flex; align-items: center; gap: 14px; padding: 13px 0; }
.opp + .opp { border-top: 1px solid var(--line); }
.opp .oi { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.opp .oi .icon { width: 19px; height: 19px; }
.opp .om { flex: 1; min-width: 0; }
.opp .ot { font-size: 13.5px; font-weight: 600; margin: 0; }
.opp .od { font-size: 12px; color: var(--text2); margin: 2px 0 0; }
.opp .op { font-size: 13.5px; font-weight: 700; color: var(--green); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mini-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-size: 12px; color: var(--text2); }
.mini-legend span { display: inline-flex; align-items: center; gap: 6px; }
.mini-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* Data table (leads) */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text3); padding: 0 12px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background .1s; }
table.data tbody tr:hover { background: var(--hover); }
table.data .lead-name { font-weight: 600; color: var(--text); }
table.data .lead-sub { font-size: 11.5px; color: var(--text2); }
table.data a { color: var(--text); text-decoration: none; }
table.data a:hover { color: var(--accent); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 16px; }
.chip { font-size: 12.5px; font-weight: 500; color: var(--text2); background: var(--card); border: 1px solid var(--border); border-radius: 99px; padding: 7px 14px; text-decoration: none; transition: all .12s; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Client cards */
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.client-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.client-card .ch { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.client-card .cav { width: 42px; height: 42px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; flex-shrink: 0; }
.client-card .cn { font-size: 15px; font-weight: 600; margin: 0; }
.client-card .cv { font-size: 12px; color: var(--text2); margin: 1px 0 0; text-transform: capitalize; }
.client-card .cstat { display: flex; gap: 18px; padding: 12px 0 0; border-top: 1px solid var(--line); }
.client-card .cstat .csv { font-size: 18px; font-weight: 700; margin: 0; font-variant-numeric: tabular-nums; }
.client-card .cstat .csl { font-size: 11px; color: var(--text3); margin: 1px 0 0; }

/* Settings + payments */
.setrow { display: grid; grid-template-columns: 220px 1fr; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); align-items: start; }
.setrow:last-child { border-bottom: 0; }
.setrow .sk { font-size: 13.5px; font-weight: 600; }
.setrow .skd { font-size: 12px; color: var(--text2); margin: 3px 0 0; }
.setrow .sv textarea { width: 100%; padding: 11px 13px; font-size: 13px; font-family: inherit; border: 1px solid var(--border); border-radius: var(--radius-sm); resize: vertical; min-height: 80px; color: var(--text); }
.setrow .sv textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.setrow .sv input { margin-bottom: 0; }
.btn-inline { width: auto; padding: 10px 18px; font-size: 13.5px; }
@media (max-width: 640px) { .setrow { grid-template-columns: 1fr; gap: 8px; } }

/* Tenant management */
.page-actions { display: flex; gap: 10px; align-items: center; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }
.field { margin: 0 0 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; margin: 0 0 6px; }
.field .hint { font-size: 11.5px; color: var(--text2); margin: 4px 0 0; }
.field select { width: 100%; appearance: none; font-family: inherit; font-size: 15px; color: var(--text); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 36px 12px 14px; cursor: pointer; }
.field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.field textarea { width: 100%; padding: 12px 14px; font-size: 14px; font-family: inherit; border: 1px solid var(--border); border-radius: var(--radius-sm); resize: vertical; min-height: 90px; color: var(--text); }
.field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.field-wrap { position: relative; }
.field-wrap .chev { position: absolute; right: 12px; top: 42px; pointer-events: none; color: var(--text3); width: 15px; height: 15px; }

.copyfield { display: flex; align-items: stretch; gap: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.copyfield input { border: 0; margin: 0; border-radius: 0; background: var(--hover); font-size: 12.5px; font-family: var(--font); color: var(--text2); }
.copyfield input:focus { box-shadow: none; }
.copyfield button { border: 0; border-left: 1px solid var(--border); background: var(--card); color: var(--accent); font-weight: 600; font-size: 12.5px; padding: 0 16px; cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.copyfield button:hover { background: var(--accent-soft); }
.copyfield button .icon { width: 14px; height: 14px; }

.detail-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; align-items: start; }
@media (max-width: 860px) { .detail-grid { grid-template-columns: 1fr; } }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; font-size: 13.5px; }
.kv .k { color: var(--text2); font-weight: 500; }
.kv .v { font-weight: 500; word-break: break-word; }
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.btn-outline { width: auto; background: var(--card); color: var(--text); border: 1px solid var(--border); box-shadow: none; padding: 10px 16px; font-size: 13.5px; }
.btn-outline:hover { background: var(--hover); border-color: var(--accent); color: var(--accent); }
.btn-danger { width: auto; background: var(--card); color: var(--red); border: 1px solid var(--border); box-shadow: none; padding: 10px 16px; font-size: 13.5px; }
.btn-danger:hover { background: var(--red-bg); border-color: var(--red); }
.card-link { text-decoration: none; color: inherit; display: block; }
.card-link:hover .client-card { border-color: var(--accent); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--green); color: #fff; padding: 12px 20px; border-radius: 10px; font-size: 13.5px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.2); z-index: 100; }

/* Responsive cascade */
@media (max-width: 1100px) {
  .wrap { padding: 26px 24px 44px; }
}
@media (max-width: 860px) {
  .cols { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .mobilebar { display: flex; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
    transform: translateX(-100%); transition: transform .24s ease;
    box-shadow: 0 0 60px rgba(0,0,0,.5);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .scrim { display: block; opacity: 1; }
  .wrap { padding: 20px 18px 40px; }
  .pagehead h1 { font-size: 20px; }
  .metric .value { font-size: 24px; }
  .roi-banner { padding: 20px; }
  .roi-banner .big { font-size: 36px; }
}
@media (max-width: 460px) {
  .wrap { padding: 16px 14px 36px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .statgrid { grid-template-columns: 1fr 1fr; }
  .metric .value { font-size: 22px; }
  .toolbar { width: 100%; }
  .toolbar .select, .toolbar .select select { width: 100%; }
  .bar-row { grid-template-columns: 76px 1fr 38px; gap: 8px; }
  .roi-banner .big { font-size: 30px; }
  .pagehead .subtitle { font-size: 12px; }
}
@media (max-width: 340px) {
  .metrics, .statgrid { grid-template-columns: 1fr; }
}

/* Hero panels for selling-point features (portal dashboard) */
.hero-panel { display: flex; gap: 16px; align-items: flex-start; background: linear-gradient(135deg, #14171F 0%, #23262F 100%); border-radius: var(--radius); padding: 22px 24px; color: #fff; box-shadow: var(--shadow); }
.hero-panel.hero-green { background: linear-gradient(135deg, #0F5132 0%, #1F9D57 100%); }
.hero-panel .hero-ic { width: 44px; height: 44px; border-radius: 12px; background: rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hero-panel .hero-ic .icon { width: 22px; height: 22px; color: #fff; }
.hero-panel .hero-lbl { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; opacity: .8; margin: 0; font-weight: 600; }
.hero-panel .hero-val { font-size: 34px; font-weight: 700; margin: 4px 0 6px; line-height: 1; }
.hero-panel .hero-sub { font-size: 12.5px; opacity: .85; margin: 0; line-height: 1.5; }
@media (max-width: 500px) { .hero-panel .hero-val { font-size: 28px; } }

/* Lead detail: conversation thread */
.thread { display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 82%; padding: 11px 14px; border-radius: 12px; }
.bubble.in { align-self: flex-start; background: var(--hover); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.out { align-self: flex-end; background: var(--accent-soft); border: 1px solid var(--accent-ring); border-bottom-right-radius: 4px; }
.bubble .bmeta { font-size: 11px; color: var(--text3); margin-bottom: 4px; }
.bubble .btext { font-size: 13.5px; line-height: 1.5; color: var(--text); }

/* Lead detail: status timeline */
.timeline { display: flex; flex-direction: column; }
.tl-row { display: flex; gap: 12px; padding: 0 0 16px; position: relative; }
.tl-row:not(:last-child)::before { content: ''; position: absolute; left: 5px; top: 14px; bottom: 0; width: 2px; background: var(--line); }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 2px; z-index: 1; }
.tl-t { font-size: 13.5px; font-weight: 600; margin: 0; }
.tl-s { font-size: 11.5px; color: var(--text2); margin: 2px 0 0; text-transform: capitalize; }

/* Checkbox rows */
.check { display: flex; align-items: center; gap: 9px; font-size: 13.5px; padding: 7px 0; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }

/* Card header row: title left, meta right */
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.card-head h2 { margin: 0; }