/* RED CRM portal — layout from the "RED CRM Portal" design (cards on warm grey, Inter + Space Grotesk, RED accent). */
:root { --bg:#F4F3EF; --card:#FFFFFF; --line:#E2E0DA; --soft:#EFEDE8; --ink:#16181D; --ink2:#3D414A; --mute:#5B606B; --red:#B42318; --red-d:#7A1A12; --red-bg:#FCEDEB; --red-line:#F1C7C2;
  --blue-bg:#E8EEF7; --blue:#1F3F6E; --green-bg:#EDF4EC; --green:#245A2B; --disp:'Space Grotesk', Inter, system-ui, sans-serif; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 Inter, system-ui, -apple-system, 'Segoe UI', sans-serif; }
a { color: #9F1C12; } a:hover { color: #6E130C; }
h1, h2, h3 { font-family: var(--disp); font-weight: 600; margin: 0; }
h1 { font-size: 28px; letter-spacing: -0.3px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
.wrap { max-width: 1360px; margin: 0 auto; padding: 0 24px; }
.sr { position: absolute; left: -9999px; }

.top { background: var(--card); border-bottom: 1px solid var(--line); }
.bar { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; justify-content: space-between; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.logo { width: 36px; height: 36px; border-radius: 8px; background: var(--red); color: #fff; display: flex; align-items: center; justify-content: center; font: 700 13px var(--disp); letter-spacing: .5px; flex: 0 0 36px; }
.brand b { display: block; font: 600 16px var(--disp); } .brand small, .user small { display: block; font-size: 12px; color: var(--mute); }
nav.main { display: flex; flex-wrap: wrap; gap: 4px; background: #F1EFEA; padding: 4px; border-radius: 10px; }
nav.main a { height: 36px; padding: 0 12px; border-radius: 7px; display: inline-flex; align-items: center; color: var(--ink2); text-decoration: none; }
nav.main a.on { background: var(--ink); color: #fff; font-weight: 600; }
nav.main a.log { background: var(--red); color: #fff; font-weight: 600; }
.tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
input, select, textarea, button { font: inherit; color: inherit; }
input[type=search], input[type=text], input[type=date], input[type=email], input[type=tel], select, textarea { height: 40px; border: 1px solid #D6D3CC; border-radius: 8px; padding: 0 12px; background: #FAFAF8; width: 100%; }
textarea { height: auto; padding: 10px 12px; line-height: 1.45; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.search input { width: 240px; max-width: 100%; }
.user { display: flex; align-items: center; gap: 8px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--blue-bg); color: var(--blue); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; flex: 0 0 36px; }
.user b { font-size: 13px; }
.askbar { padding-top: 14px; }
.askbar form { display: flex; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
.askbar input { border: 0; background: transparent; flex: 1 1 auto; min-width: 0; }
.btn { height: 40px; padding: 0 16px; border-radius: 8px; border: 1px solid #D6D3CC; background: var(--card); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink); font-weight: 600; white-space: nowrap; }
.btn.pri { background: var(--red); border-color: var(--red); color: #fff; } .btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn[disabled] { opacity: .55; cursor: default; }
.btn.big { height: 48px; padding: 0 20px; font-size: 15px; }

main.wrap { padding-top: 24px; padding-bottom: 48px; display: flex; flex-direction: column; gap: 24px; }
.hello { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.hello p { margin: 0; color: var(--mute); font-size: 13px; } .hello h1 { margin-top: 4px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; flex: 1 1 480px; max-width: 760px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; text-decoration: none; color: inherit; display: block; }
.tile span { display: block; font-size: 12px; color: var(--mute); } .tile b { font: 600 24px var(--disp); }
.tile.hot { background: var(--red-bg); border-color: var(--red-line); } .tile.hot span, .tile.hot b { color: var(--red-d); }
.cols { display: flex; flex-wrap: wrap; gap: 24px; } .cols > * { flex: 1 1 400px; min-width: 0; }
.cols > aside { flex: 1 1 280px; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.card.hot { border-color: var(--red-line); }
.head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.head span, .hint { font-size: 12px; color: var(--mute); } .hint { margin: 10px 0 0; }
.row { display: flex; gap: 14px; padding: 11px 0; border-top: 1px solid var(--soft); }
.day { width: 52px; flex: 0 0 52px; text-align: center; background: var(--bg); border-radius: 8px; padding: 6px 0; align-self: flex-start; }
.day small { display: block; font-size: 11px; color: var(--mute); text-transform: uppercase; letter-spacing: .5px; } .day b { font: 600 17px/1.1 var(--disp); }
.row .body { flex: 1 1 auto; min-width: 0; } .row .body > div:first-child { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row a.acct, a.acct { font-weight: 600; color: var(--ink); text-decoration: none; } a.acct:hover { text-decoration: underline; }
.what { color: var(--ink2); margin-top: 2px; overflow-wrap: anywhere; } .meta { font-size: 12px; color: var(--mute); margin-top: 2px; }
.pill { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; background: #F1EFEA; color: var(--ink2); }
.pill.call { background: var(--blue-bg); color: var(--blue); } .pill.due { background: var(--red-bg); color: var(--red-d); } .pill.tgt { background: var(--green-bg); color: var(--green); }
.pill.you, .pill.neg { background: var(--ink); color: #fff; } .pill.quo { background: var(--red-bg); color: var(--red-d); } .pill.stage { font-size: 12px; padding: 3px 9px; }
.visit { padding: 11px 0; border-top: 1px solid var(--soft); } .visit > div:first-child { display: flex; justify-content: space-between; gap: 12px; }
.visit .date { font-size: 12px; color: var(--mute); white-space: nowrap; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--mute); font-size: 12px; font-weight: 500; padding: 8px 10px; white-space: nowrap; }
td { padding: 11px 10px; border-top: 1px solid var(--soft); vertical-align: top; overflow-wrap: anywhere; }
th:first-child, td:first-child { padding-left: 0; } th:last-child, td:last-child { padding-right: 0; }
td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; } td.nw { white-space: nowrap; } td.rank { color: var(--mute); font: 600 13px var(--disp); width: 28px; }
td small, .sub { display: block; font-size: 12px; color: var(--mute); }
table.opps { min-width: 980px; } table.opps td.next { max-width: 320px; color: var(--ink2); } table.opps td.line { max-width: 240px; }
.kv { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 4px 0; } .kv span:last-child { color: var(--mute); text-align: right; }
.foot { margin: 0; font-size: 12px; color: var(--mute); }
.empty { color: var(--mute); padding: 8px 0; }
.toggle { display: inline-flex; align-self: flex-start; flex-wrap: wrap; gap: 4px; background: #F1EFEA; padding: 4px; border-radius: 10px; } .toggle a { height: 32px; padding: 0 12px; border-radius: 7px; display: inline-flex; align-items: center; color: var(--ink2); text-decoration: none; font-size: 13px; } .toggle a.on { background: var(--ink); color: #fff; font-weight: 600; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
label { display: block; font-size: 12px; color: var(--mute); margin-bottom: 4px; }
label.btn { display: inline-flex; font-size: inherit; color: var(--ink); margin: 0; }
.field { min-width: 0; }
.msg { border-radius: 10px; padding: 12px 14px; background: var(--blue-bg); color: var(--blue); } .msg.err { background: var(--red-bg); color: var(--red-d); } .msg.ok { background: var(--green-bg); color: var(--green); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; } .chip { display: inline-flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 13px; }
.chip button { border: 0; background: transparent; cursor: pointer; font-size: 16px; line-height: 1; color: var(--mute); padding: 2px 6px; } .chip img { width: 28px; height: 28px; object-fit: cover; border-radius: 6px; margin-left: -6px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.item { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 12px; background: #FCFCFA; }
.readback { font: 500 17px/1.4 var(--disp); }
.answer { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.55; } .answer ul { margin: 6px 0; padding-left: 20px; white-space: normal; }
.rec { color: var(--red); font-weight: 600; }
.center { max-width: 520px; margin: 12vh auto; padding: 0 16px; } .center .card { display: flex; flex-direction: column; gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
[hidden] { display: none !important; }
@media (max-width: 720px) {
  .wrap { padding: 0 14px; } h1 { font-size: 24px; } .card { padding: 16px; } .search { flex: 1 1 100%; } .search input { width: 100%; }
  .user small.org { display: none; } nav.main { order: 3; width: 100%; } nav.main a { flex: 1 1 auto; justify-content: center; }
}
