/* oGX CRM — AIESEC UK look: Lato, AIESEC blue #037EF3, white/light-grey surfaces. Mobile first. */
:root {
  --blue: #037EF3; --blue-dark: #0263BF; --blue-light: #E8F2FE; --teal: #0F766E; --teal-light: #CCFBF1;
  --bg: #F4F6FA; --card: #FFFFFF; --text: #1F2933; --muted: #6B7280; --line: #E5E7EB;
  --red: #DC2626; --red-light: #FEE2E2; --amber: #D97706; --amber-light: #FEF3C7; --green: #059669; --green-light: #D1FAE5;
  --indigo: #4F46E5; --indigo-light: #E0E7FF; --purple: #7C3AED; --purple-light: #EDE9FE; --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Lato, "Helvetica Neue", Arial, sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.4; }
a { color: var(--blue); text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { background: var(--blue); color: #fff; border: 0; border-radius: 8px; padding: 9px 14px; cursor: pointer; font-weight: 700; }
button:hover { background: var(--blue-dark); }
button:disabled { opacity: .5; cursor: default; }
button.ghost { background: #fff; color: var(--blue); border: 1px solid var(--blue); }
button.ghost:hover { background: var(--blue-light); }
button.subtle { background: #fff; color: var(--text); border: 1px solid var(--line); font-weight: 400; }
button.danger { background: #fff; color: var(--red); border: 1px solid var(--red); }
button.small { padding: 5px 10px; font-size: 13px; }
input, select, textarea { padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; width: 100%; color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue-light); border-color: var(--blue); }
label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 4px; }
h1 { font-size: 22px; margin: 0 0 4px; } h2 { font-size: 17px; margin: 0 0 10px; } h3 { font-size: 15px; margin: 0 0 8px; }
.muted { color: var(--muted); font-size: 13px; }
.red { color: var(--red); font-weight: 700; } .green { color: var(--green); font-weight: 700; } .amber { color: var(--amber); font-weight: 700; }
.hidden { display: none !important; }

header.top { background: var(--blue); color: #fff; position: sticky; top: 0; z-index: 20; }
.top .bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; max-width: 1200px; margin: 0 auto; }
.top .brand { font-weight: 700; font-size: 18px; white-space: nowrap; }
.top .brand small { font-weight: 400; opacity: .85; margin-left: 6px; font-size: 12px; }
.top select { width: auto; padding: 6px 8px; border: 0; border-radius: 8px; background: rgba(255,255,255,.18); color: #fff; }
.top select option { color: var(--text); }
.top .who { margin-left: auto; font-size: 13px; text-align: right; white-space: nowrap; }
.top .who b { display: block; }
.top button.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); padding: 6px 10px; }
nav.tabs { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 52px; z-index: 19; }
nav.tabs .in { display: flex; gap: 2px; overflow-x: auto; max-width: 1200px; margin: 0 auto; padding: 0 8px; scrollbar-width: none; }
nav.tabs a { padding: 12px 12px; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; font-weight: 700; font-size: 14px; }
nav.tabs a.on { color: var(--blue); border-color: var(--blue); }
nav.tabs a .badge { margin-left: 4px; }
main { max-width: 1200px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 0 1 auto; }
.grow { flex: 1 1 160px !important; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-2 { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.badge { display: inline-block; min-width: 20px; padding: 1px 7px; border-radius: 999px; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; text-align: center; }
.badge.blue { background: var(--blue); } .badge.grey { background: var(--line); color: var(--text); }
.status { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #E5E7EB; color: #374151; white-space: nowrap; }
.s-contacted { background: var(--blue-light); color: var(--blue-dark); } .s-interested { background: var(--indigo-light); color: var(--indigo); }
.s-call { background: var(--purple-light); color: var(--purple); } .s-expa { background: var(--teal-light); color: var(--teal); }
.s-closed { background: var(--red-light); color: #991B1B; } .s-side { background: var(--amber-light); color: var(--amber); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.chip { border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 400; }
.chip:hover { background: var(--blue-light); } .chip.on { background: var(--blue); color: #fff; border-color: var(--blue); font-weight: 700; }
.chip .n { opacity: .7; margin-left: 4px; }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 16px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.tile .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tile .v { font-size: 28px; font-weight: 700; margin: 2px 0; }
.tile .s { font-size: 13px; color: var(--muted); }
.tile.alert .v { color: var(--red); }
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; white-space: nowrap; }
td.num, th.num { text-align: right; }
tr.click { cursor: pointer; } tr.click:hover { background: #F5F9FF; }
tr.total td { font-weight: 700; background: var(--bg); }
.ep-name { font-weight: 700; } .ep-sub { font-size: 12px; color: var(--muted); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 10px; }
.empty { color: var(--muted); padding: 16px; text-align: center; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--text); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 100; max-width: 90vw; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.toast.err { background: var(--red); }
.loading { position: fixed; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--blue), var(--teal)); z-index: 30; animation: pulse 1s infinite alternate; }
@keyframes pulse { from { opacity: .3; } to { opacity: 1; } }
/* funnel + chart */
.funnel .f { display: grid; grid-template-columns: 170px 1fr 50px; gap: 8px; align-items: center; margin: 4px 0; font-size: 13px; }
.funnel .bar { height: 18px; border-radius: 4px; background: var(--blue); min-width: 2px; } .funnel .bar.expa { background: var(--teal); } .funnel .bar.closed { background: #9CA3AF; }
.chart svg { width: 100%; height: 180px; display: block; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
/* pipeline */
.board { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.col { flex: 0 0 230px; background: var(--bg); border-radius: var(--radius); padding: 8px; max-height: 75vh; overflow-y: auto; }
.col h3 { font-size: 13px; display: flex; justify-content: space-between; margin: 4px 4px 8px; }
.col.expa h3 { color: var(--teal); }
.kard { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; cursor: pointer; font-size: 13px; }
.kard:hover { border-color: var(--blue); }
/* drawer / panel */
.overlay { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 40; display: flex; justify-content: flex-end; }
.drawer { background: #fff; width: 100%; max-width: 760px; height: 100%; overflow-y: auto; padding: 16px; box-shadow: -8px 0 30px rgba(0,0,0,.2); }
@media (max-width: 640px) { .drawer { padding: 12px; } }
.drawer .head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.tl { border-left: 3px solid var(--line); margin: 8px 0 0 6px; padding-left: 14px; }
.tl .u { margin-bottom: 12px; position: relative; }
.tl .u::before { content: ""; position: absolute; left: -20px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--blue); }
.tl .u.sys::before { background: #9CA3AF; } .tl .u.expa::before { background: var(--teal); }
.tl .t { font-size: 12px; color: var(--muted); }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 14px; } .kv div span { color: var(--muted); font-size: 12px; display: block; }
@media (max-width: 480px) { .kv { grid-template-columns: 1fr; } }
/* mine cards */
.ccard { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
.ccard .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.ccard .actions a, .ccard .actions button { padding: 8px 12px; border-radius: 8px; font-size: 14px; font-weight: 700; }
.ccard .actions a.wa { background: #25D366; color: #fff; }
.login { max-width: 420px; margin: 60px auto; text-align: center; }
.login .logo { font-size: 28px; font-weight: 700; color: var(--blue); margin-bottom: 8px; }
.sel-all { width: auto; }
.rate-g { background: var(--green-light); color: var(--green); } .rate-a { background: var(--amber-light); color: var(--amber); } .rate-r { background: var(--red-light); color: var(--red); }
.pill { padding: 2px 8px; border-radius: 999px; font-weight: 700; font-size: 13px; }
@media (max-width: 640px) { .top .who { display: none; } .top .bar { padding: 10px 12px; } main { padding: 12px; } }
