/* Rizelex CRM — UI (brand: cream / deep forest / saffron) */

:root {
	--cream: #FAF5EC; --paper: #FFFFFF; --ink: #132420; --ink-2: #3D514B; --ink-3: #6B7C76;
	--forest: #0E1F1A; --forest-2: #17342B;
	--saffron: #E8862E; --saffron-2: #F4A94F; --coral: #E85D3D;
	--green: #1DAB55; --red: #D64545; --blue: #3B7DD8;
	--line: rgba(19,36,32,.12); --radius: 16px;
	--shadow: 0 2px 6px rgba(19,36,32,.05), 0 16px 40px -20px rgba(19,36,32,.25);
	--font: "Manrope", -apple-system, sans-serif; --display: "Fraunces", Georgia, serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); font-size: 15px; color: var(--ink); background: var(--cream); }
h1, h2 { letter-spacing: -.01em; }
a { color: inherit; }
.muted { color: var(--ink-3); font-size: 13.5px; line-height: 1.55; }
code { background: rgba(232,134,46,.12); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; }

/* ---------- Auth ---------- */
.auth-body { min-height: 100vh; display: grid; place-items: center; background:
	radial-gradient(700px 400px at 85% -10%, rgba(232,134,46,.15), transparent 60%), var(--cream); }
.auth-card { width: min(420px, 92%); background: var(--paper); border: 1px solid var(--line);
	border-radius: 22px; padding: 36px; box-shadow: var(--shadow); }
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; margin-bottom: 22px; }
.auth-brand em, .side-brand em { font-style: normal; color: var(--saffron); }
.auth-card h1 { font-family: var(--display); font-weight: 600; font-size: 26px; margin-bottom: 8px; }
.auth-card form { margin-top: 18px; display: grid; gap: 14px; }
.alert { background: rgba(214,69,69,.1); border: 1px solid rgba(214,69,69,.35); color: #A22; padding: 10px 14px; border-radius: 10px; font-size: 14px; margin-top: 12px; }

.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none;
	background: linear-gradient(135deg, var(--saffron), var(--coral)); color: #fff; font-family: var(--display); font-weight: 700; font-size: 18px; }

/* ---------- Forms ---------- */
label { display: grid; gap: 6px; font-weight: 700; font-size: 13px; color: var(--ink-2); margin-bottom: 12px; }
input, select, textarea { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(232,134,46,.4); border-color: var(--saffron); }
label.check { display: flex; align-items: center; gap: 9px; font-weight: 600; }
label.check input { width: auto; }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer; font: inherit; font-weight: 800;
	padding: 10px 18px; border-radius: 999px; text-decoration: none; transition: transform .2s, box-shadow .2s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, var(--saffron), var(--coral)); color: #fff; box-shadow: 0 8px 18px -8px rgba(232,93,61,.5); }
.btn-ghost { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.btn-sm { padding: 5px 12px; font-size: 12.5px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidenav { background: linear-gradient(170deg, var(--forest), var(--forest-2)); color: rgba(255,253,249,.85);
	padding: 22px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; color: #fff; padding: 4px 10px 20px; }
.sidenav nav { display: grid; gap: 4px; }
.sidenav nav a { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 12px;
	text-decoration: none; font-weight: 700; font-size: 14px; color: rgba(255,253,249,.72); }
.sidenav nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidenav nav a.active { background: rgba(232,134,46,.18); color: var(--saffron-2); }
.side-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid rgba(255,255,255,.1); }
.side-user { font-weight: 800; font-size: 13.5px; color: #fff; }
.side-logout { font-size: 12.5px; color: rgba(255,253,249,.6); text-decoration: none; }
.side-logout:hover { color: #fff; }

.ic { width: 18px; height: 18px; flex: none; background: currentColor; }
.ic-dashboard { -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M3 3h8v10H3zM13 3h8v6h-8zM13 11h8v10h-8zM3 15h8v6H3z'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M3 3h8v10H3zM13 3h8v6h-8zM13 11h8v10h-8zM3 15h8v6H3z'/%3E%3C/svg%3E") center/contain no-repeat; }
.ic-leads { -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 12a5 5 0 1 0-5-5 5 5 0 0 0 5 5zm0 2c-4 0-9 2-9 6v2h18v-2c0-4-5-6-9-6z'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 12a5 5 0 1 0-5-5 5 5 0 0 0 5 5zm0 2c-4 0-9 2-9 6v2h18v-2c0-4-5-6-9-6z'/%3E%3C/svg%3E") center/contain no-repeat; }
.ic-funnel { -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M3 4h18l-7 8v6l-4 2v-8z'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M3 4h18l-7 8v6l-4 2v-8z'/%3E%3C/svg%3E") center/contain no-repeat; }
.ic-import { -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 3v10l4-4 1.5 1.5L12 16 6.5 10.5 8 9l4 4zM4 19h16v2H4z'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 3v10l4-4 1.5 1.5L12 16 6.5 10.5 8 9l4 4zM4 19h16v2H4z'/%3E%3C/svg%3E") center/contain no-repeat; }
.ic-settings { -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 8a4 4 0 1 0 4 4 4 4 0 0 0-4-4zm9 4a7 7 0 0 0-.1-1.2l2-1.5-2-3.5-2.4 1a7 7 0 0 0-2-1.2L16 3H8l-.4 2.6a7 7 0 0 0-2 1.2l-2.4-1-2 3.5 2 1.5A7 7 0 0 0 3 12a7 7 0 0 0 .1 1.2l-2 1.5 2 3.5 2.4-1a7 7 0 0 0 2 1.2L8 21h8l.4-2.6a7 7 0 0 0 2-1.2l2.4 1 2-3.5-2-1.5A7 7 0 0 0 21 12z'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 8a4 4 0 1 0 4 4 4 4 0 0 0-4-4zm9 4a7 7 0 0 0-.1-1.2l2-1.5-2-3.5-2.4 1a7 7 0 0 0-2-1.2L16 3H8l-.4 2.6a7 7 0 0 0-2 1.2l-2.4-1-2 3.5 2 1.5A7 7 0 0 0 3 12a7 7 0 0 0 .1 1.2l-2 1.5 2 3.5 2.4-1a7 7 0 0 0 2 1.2L8 21h8l.4-2.6a7 7 0 0 0 2-1.2l2.4 1 2-3.5-2-1.5A7 7 0 0 0 21 12z'/%3E%3C/svg%3E") center/contain no-repeat; }

.content { padding: 26px 30px 60px; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.topbar h1 { font-family: var(--display); font-weight: 600; font-size: 28px; }

/* ---------- Panels & grids ---------- */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 22px; min-width: 0; }
.panel h2 { font-size: 15px; font-weight: 800; margin-bottom: 14px; color: var(--ink-2); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.grid-2 .panel { margin-bottom: 0; }
section.grid-2 { margin-bottom: 22px; }
.chart-wrap { position: relative; height: 260px; }

/* ---------- KPI cards ---------- */
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 22px; }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.kpi .k-label { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.kpi .k-value { font-family: var(--display); font-weight: 600; font-size: 28px; margin-top: 4px; }
.kpi .k-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.kpi .up { color: var(--green); font-weight: 800; }
.kpi .down { color: var(--red); font-weight: 800; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: rgba(232,134,46,.04); cursor: pointer; }
.table .num { text-align: right; }
.t-name { font-weight: 800; }
.t-sub { font-size: 12px; color: var(--ink-3); }
.mini-table { width: 100%; font-size: 13.5px; border-collapse: collapse; }
.mini-table td, .mini-table th { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.mini-table th { font-size: 11px; text-transform: uppercase; color: var(--ink-3); }
.mini-table .num { text-align: right; }

.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; background: rgba(232,134,46,.12); color: #A85717; white-space: nowrap; }
.chip.c-instagram { background: rgba(214,69,143,.12); color: #B3327A; }
.chip.c-facebook { background: rgba(59,125,216,.12); color: #2E62AC; }
.chip.c-google { background: rgba(232,134,46,.12); color: #A85717; }
.chip.c-whatsapp { background: rgba(29,171,85,.12); color: #157A3F; }
.chip.c-website { background: rgba(19,36,32,.08); color: var(--ink-2); }
.chip.c-referral { background: rgba(140,90,220,.12); color: #6A3FB8; }

.stage-select { padding: 5px 8px; border-radius: 8px; font-size: 12.5px; font-weight: 700; width: auto; }
.stage-new { background: rgba(59,125,216,.1); }
.stage-contacted { background: rgba(232,134,46,.1); }
.stage-demo_booked { background: rgba(244,169,79,.18); }
.stage-demo_attended { background: rgba(29,171,85,.12); }
.stage-enrolled { background: rgba(29,171,85,.22); }
.stage-lost { background: rgba(214,69,69,.1); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filters input, .filters select { width: auto; }
.filters #f-q { flex: 1; min-width: 200px; }
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 16px; align-items: center; font-size: 13.5px; color: var(--ink-3); }

/* ---------- Kanban ---------- */
.board-hint { margin-bottom: 14px; }
.board { display: grid; grid-template-columns: repeat(6, minmax(190px, 1fr)); gap: 14px; align-items: start; overflow-x: auto; }
.col { background: rgba(19,36,32,.04); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 220px; }
.col.drag-over { outline: 2px dashed var(--saffron); outline-offset: -4px; background: rgba(232,134,46,.06); }
.col h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); padding: 6px 8px 10px; display: flex; justify-content: space-between; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; cursor: grab; box-shadow: 0 2px 8px -4px rgba(19,36,32,.2); }
.card:active { cursor: grabbing; }
.card .c-name { font-weight: 800; font-size: 13.5px; }
.card .c-meta { font-size: 12px; color: var(--ink-3); margin-top: 3px; display: flex; justify-content: space-between; gap: 6px; }
.card.dragging { opacity: .4; }

/* ---------- Modal / drawer ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(14,31,26,.5); z-index: 50; display: grid; place-items: center; padding: 20px; }
.modal { background: var(--cream); border-radius: 20px; width: min(860px, 100%); max-height: 92vh; overflow: auto; padding: 26px; box-shadow: 0 40px 80px -30px rgba(0,0,0,.5); }
.modal h2 { font-family: var(--display); font-weight: 600; font-size: 22px; margin-bottom: 16px; }
.modal .form-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px; }
.modal .form-grid .span-3 { grid-column: 1 / -1; }
.modal-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.timeline { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 14px; }
.timeline h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); margin-bottom: 10px; }
.tl-item { display: flex; gap: 10px; padding: 7px 0; font-size: 13.5px; border-bottom: 1px dashed var(--line); }
.tl-item .tl-time { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.tl-note-row { display: flex; gap: 8px; margin-top: 10px; }
.capi-badge { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; }
.capi-ok { background: rgba(29,171,85,.15); color: #157A3F; }
.capi-error { background: rgba(214,69,69,.15); color: #A22; }

/* ---------- Misc ---------- */
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(80px); background: var(--ink); color: #fff;
	padding: 12px 22px; border-radius: 999px; font-weight: 700; font-size: 14px; transition: transform .3s; z-index: 99; }
#toast.show { transform: translateX(-50%) translateY(0); }
.snippet pre { background: var(--forest); color: #CFE8D8; font-size: 12px; padding: 14px; border-radius: 12px; overflow-x: auto; margin-top: 10px; line-height: 1.5; }
.snippet summary { cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--saffron); }
.result-box { margin-top: 12px; font-size: 13px; background: rgba(19,36,32,.05); border-radius: 10px; padding: 12px; word-break: break-all; }
.empty { color: var(--ink-3); font-size: 13.5px; padding: 14px 4px; }

/* ---------- v1.1: demo banner, follow-ups, dropzone, icons ---------- */
.demo-note { background: rgba(232,134,46,.1); border: 1px solid rgba(232,134,46,.35); color: #7A4310;
	padding: 12px 16px; border-radius: 12px; font-size: 13.5px; margin-bottom: 18px; }
.alert-ok { background: rgba(29,171,85,.1); border-color: rgba(29,171,85,.35); color: #157A3F; }

.fu-groups .panel { margin-bottom: 18px; }
.fu-overdue h2 { color: var(--red); }
.fu-today h2 { color: var(--saffron); }
.fu-row { display: flex; align-items: center; gap: 14px; padding: 11px 0; border-bottom: 1px dashed var(--line); flex-wrap: wrap; }
.fu-main { flex: 1; min-width: 200px; display: grid; gap: 2px; }
.fu-date { font-weight: 800; font-size: 13px; color: var(--ink-2); }
.fu-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fu-actions .fu-newdate { width: 140px; padding: 6px 8px; font-size: 12.5px; }

.dropzone { display: grid; place-items: center; gap: 4px; text-align: center; padding: 34px 20px; cursor: pointer;
	border: 2px dashed rgba(232,134,46,.45); border-radius: 14px; background: rgba(232,134,46,.05);
	font-weight: 400; transition: background .2s, border-color .2s; }
.dropzone:hover, .dropzone.drag { background: rgba(232,134,46,.12); border-color: var(--saffron); }
.dropzone .dz-icon { font-size: 26px; color: var(--saffron); }

.ic-followups { -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm4.2 14.2L11 13V7h2v5l4.2 2.5z'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm4.2 14.2L11 13V7h2v5l4.2 2.5z'/%3E%3C/svg%3E") center/contain no-repeat; }

#channels-list .mini-table input.ch-label { padding: 6px 8px; font-size: 13px; }
#channels-list td { vertical-align: middle; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
	.kpis { grid-template-columns: repeat(3, 1fr); }
	.grid-2 { grid-template-columns: 1fr; }
	.board { grid-template-columns: repeat(6, 230px); }
}
@media (max-width: 760px) {
	.shell { grid-template-columns: 1fr; }
	.sidenav { position: static; height: auto; flex-direction: row; align-items: center; gap: 6px; padding: 10px; overflow-x: auto; }
	.side-brand { padding: 0 8px 0 4px; }
	.sidenav nav { display: flex; }
	.sidenav nav a { padding: 8px 10px; white-space: nowrap; }
	.sidenav nav a .ic { display: none; }
	.side-foot { display: none; }
	.content { padding: 18px 14px 50px; }
	.kpis { grid-template-columns: repeat(2, 1fr); }
	.modal .form-grid { grid-template-columns: 1fr; }
}
