@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* =====================================================================
   BACKOFFICE THEME - one look for every backoffice portal:
     Login / Home (templates/backoffice), Bot (templates/bot_bo),
     Weekly Quiz (templates/quiz_weekly_bo), Daily Quiz (templates/quiz_daily_bo),
     the public live leaderboards / participant report, and the WhatsApp chat
     pages (templates/whatsapp_chat + static/css/style_wa.css & co).

   Loaded by each portal's base.html AFTER its own <style>, so these colours
   win. Change a colour here once -> it changes in all four portals.
   Palette: neutral blue / slate. Status colours (ON = green, OFF = amber,
   error = red) keep their meaning.
   ===================================================================== */

:root {
	/* shared tokens (every portal already uses these variable names) */
	--ink: #1f2937;
	--muted: #5b6474;
	--paper: #f3f5f8;
	--card: #ffffff;
	--line: #e2e7ee;
	--accent: #2563eb;
	--accent-dark: #1d4ed8;
	--accent-soft: #e8f0fe;
	--accent-soft-line: #cfdcfb;
	--danger: #dc2626;
	--danger-soft: #fdecec;
	--warn: #b45309;
	--warn-soft: #fef3c7;
	--info: #2563eb;
	--info-soft: #e8f0fe;
	--radius: 10px;

	/* sidebar */
	--bo-side-top: #1e293b;
	--bo-side-bottom: #0f172a;
	--bo-side-text: #cbd5e1;
	--bo-side-muted: #94a3b8;
	--bo-side-hover: rgba(255, 255, 255, 0.07);
	--bo-side-active: rgba(96, 165, 250, 0.16);
	--bo-side-bar: #60a5fa;
	--bo-brand-from: #3b82f6;
	--bo-brand-to: #1d4ed8;

	/* names used by the live leaderboard / participant report pages */
	--bg-page: var(--paper);
	--bg-card: var(--card);
	--border-color: var(--line);
	--border-hover: #cbd5e1;
	--border-light: #eef2f6;
	--text-main: var(--ink);
	--text-sub: #475569;
	--text-muted: #94a3b8;
	--accent-border: var(--accent-soft-line);

	/* WhatsApp chat */
	--chat-bg: #e9eef4;        /* conversation background */
	--chat-sent: #dbeafe;      /* my (sent) message bubble */

	/* card / icon tints (Home cards) */
	--teal: #0e7490;  --teal-soft: #e0f2f7;
	--amber: #475569; --amber-soft: #eef2f7;
}

body { background: var(--paper); color: var(--ink);
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }

/* =====================================================================
   BOOTSTRAP 5.3 THEME (every page loads Bootstrap 5.3.3 + this file last)
   ===================================================================== */
:root {
	--bs-primary: #2563eb;
	--bs-primary-rgb: 37, 99, 235;
	--bs-primary-text-emphasis: #1d4ed8;
	--bs-primary-bg-subtle: #e8f0fe;
	--bs-primary-border-subtle: #cfdcfb;
	--bs-link-color: #1d4ed8;
	--bs-link-color-rgb: 29, 78, 216;
	--bs-link-hover-color: #1e40af;
	--bs-link-hover-color-rgb: 30, 64, 175;
	--bs-body-font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--bs-body-color: #1f2937;
	--bs-body-color-rgb: 31, 41, 55;
	--bs-body-bg: #ffffff;            /* Bootstrap paints cards, inputs, modals, tables with this */
	--bs-body-bg-rgb: 255, 255, 255;
	--bs-tertiary-bg: #f3f5f8;
	--bo-page-bg: #f3f5f8;            /* the page itself */
	--bs-secondary-color: #5b6474;
	--bs-border-color: #e2e7ee;
	--bs-border-radius: .5rem;
	--bs-border-radius-lg: .75rem;
	--bs-focus-ring-color: rgba(37, 99, 235, .25);
}
body { background-color: var(--bo-page-bg); }
.btn-primary {
	--bs-btn-bg: #2563eb; --bs-btn-border-color: #2563eb;
	--bs-btn-hover-bg: #1d4ed8; --bs-btn-hover-border-color: #1d4ed8;
	--bs-btn-active-bg: #1e40af; --bs-btn-active-border-color: #1e40af;
	--bs-btn-disabled-bg: #2563eb; --bs-btn-disabled-border-color: #2563eb;
	--bs-btn-focus-shadow-rgb: 37, 99, 235;
}
.btn-outline-primary {
	--bs-btn-color: #2563eb; --bs-btn-border-color: #2563eb;
	--bs-btn-hover-bg: #2563eb; --bs-btn-hover-border-color: #2563eb;
	--bs-btn-active-bg: #1d4ed8; --bs-btn-active-border-color: #1d4ed8;
	--bs-btn-disabled-color: #2563eb; --bs-btn-disabled-border-color: #2563eb;
	--bs-btn-focus-shadow-rgb: 37, 99, 235;
}
.nav-pills { --bs-nav-pills-link-active-bg: #2563eb; }
.nav { --bs-nav-link-color: #1d4ed8; --bs-nav-link-hover-color: #1e40af; }
.pagination { --bs-pagination-active-bg: #2563eb; --bs-pagination-active-border-color: #2563eb; --bs-pagination-color: #1d4ed8; }
.form-control:focus, .form-select:focus { border-color: #93b4f8; box-shadow: 0 0 0 .25rem rgba(37, 99, 235, .18); }
.form-check-input:checked { background-color: #2563eb; border-color: #2563eb; }
.form-check-input:focus { border-color: #93b4f8; box-shadow: 0 0 0 .25rem rgba(37, 99, 235, .18); }
.card { --bs-card-border-color: #e2e7ee; --bs-card-cap-bg: #ffffff; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.table { --bs-table-hover-bg: rgba(37, 99, 235, .04); }
.table > thead th { color: #5b6474; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

/* ---------------- app shell: topbar + slate sidebar (offcanvas on phones) ---------------- */
.bo-app { display: flex; min-height: 100vh; }
.bo-sidebar {
	--bs-offcanvas-width: 260px;
	--bs-offcanvas-bg: #0f172a;
	--bs-offcanvas-color: #cbd5e1;
	background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
	color: #cbd5e1;
}
@media (min-width: 992px) {
	.bo-sidebar { position: sticky; top: 0; height: 100vh; width: 260px; flex-shrink: 0; overflow-y: auto; }
}
.bo-sidebar .bo-brand { display: flex; align-items: center; gap: .65rem; color: #fff; font-weight: 700; text-decoration: none; padding: 1.1rem 1.1rem 1rem; }
.bo-sidebar .bo-brand .bo-logo { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
	background: linear-gradient(135deg, #3b82f6, #1d4ed8); box-shadow: 0 6px 16px rgba(37, 99, 235, .28); font-size: 1.1rem; }
.bo-sidebar .nav-link { color: #cbd5e1; border-radius: .55rem; padding: .55rem .8rem; display: flex; align-items: center; gap: .65rem; font-weight: 500; font-size: .92rem; }
.bo-sidebar .nav-link .bi { color: #94a3b8; font-size: 1.05rem; }
.bo-sidebar .nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.bo-sidebar .nav-link.active { background: rgba(96, 165, 250, .16); color: #fff; box-shadow: inset 3px 0 0 #60a5fa; }
.bo-sidebar .nav-link.active .bi { color: #60a5fa; }
.bo-sidebar .bo-side-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #94a3b8; margin: 1rem .8rem .4rem; font-weight: 600; }
.bo-sidebar .bo-side-foot { font-size: .75rem; color: #94a3b8; border-top: 1px solid rgba(255, 255, 255, .1); padding: .9rem 1.1rem; }
.bo-sidebar .btn-close { filter: invert(1) grayscale(1) brightness(2); }
.bo-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bo-topbar { background: #fff; border-bottom: 1px solid #e2e7ee; }
.bo-topbar .bo-logo-img { max-height: 44px; max-width: 100%; object-fit: contain; }
.bo-page-title { font-size: 1.45rem; font-weight: 700; margin: 0; }
.bo-stat .bo-stat-value { font-size: 1.6rem; font-weight: 700; color: #1d4ed8; }
.bo-stat .bo-stat-label { font-size: .75rem; color: #5b6474; text-transform: uppercase; letter-spacing: .04em; }

/* utilities the backoffice JavaScript relies on */
.progress { --bs-progress-bar-bg: #2563eb; }
.off { display: none !important; }
.busy { opacity: .55; pointer-events: none; }

/* ---------------- focus (chat pages: inputs outside Bootstrap forms) ---------------- */
input:focus, select:focus, textarea:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
