:root {
	--tone-good: #27ae60;
	--tone-warn: #f39c12;
	--tone-bad: #e74c3c;
	--tone-mute: #9aa3ab;

	--kpi-good: #27ae60;
	--kpi-warn: #f39c12;
	--kpi-bad: #e74c3c;
	--kpi-mute: #9aa0a6;
}

/* =========================
   Base
   ========================= */
body {
	margin: 0;
	background: #F2F4F6;
	font-family:'Helvetica Neue', Arial, sans-serif;
	color: #333;
}

hr {
	height: 1px;
	color: #ccc;
	background: #ccc;
	font-size: 0;
	border: 0;
}

/* =========================
   Typography
   ========================= */

h2 {
	font-weight: bold;
	font-size: 30px;
	margin: 40px 0 0 0;
}

.h2descr {
	font-size: 18px;
	margin: 0 0 20px 0;
	color: #6b7280;
}

/* =========================
   Layout
   ========================= */
main {
	padding: 100px 0;
	overflow-x:hidden;
}
section,
footer {
	margin-bottom:20px;
	position:relative;
	z-index:1000;
}
.container  {
	width: 1200px;
	margin: auto;
}

/* Grid utilities */
.grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 12px;
	margin: 0 0 12px 0;
}

.grid-2 {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

.grid-3 {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
}

.grid-4 {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
}

.grid-5 {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 12px;
}

.grid-2.ratio-2-1 {
	grid-template-columns: 2fr 1fr;
}

/* helper used in modal body: 2–3 split */
.grid-2-3 {
	display: grid;
	grid-template-columns: 2fr 3fr;
	gap: 16px;
}

/* When a grid-2 is used inside a card, add a separator line */
.card .grid-2 {
    gap: 32px; /* Increase gap for better separation */
}

.card .grid-2 > *:first-child {
    border-right: 1px solid #eee; /* Light grey line */
    padding-right: 32px;          /* Padding between text and line */
}

/* Mobile: Stack vertically and change line to horizontal */
@media (max-width: 640px) {
    .card .grid-2 {
        gap: 24px;
    }

    .card .grid-2 > *:first-child {
        border-right: none;
        padding-right: 0;
        border-bottom: 1px solid #eee;
        padding-bottom: 24px;
    }
}

@media (max-width: 900px) {
	.grid-4 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.grid-3 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.grid-4,#modal
	.grid-3,
	.grid-2,
	.grid-2-3 {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 640px) {
	.grid-2.ratio-2-1 {
		grid-template-columns: 1fr;
	}
}

/* =========================
   Sticky Nav Bar
   ========================= */
nav {
    position: absolute;
	width:100%;
    top: 0;
    z-index: 10000;
    background-color: #fff; /* Matches body background */
    border-bottom: 1px solid rgba(0,0,0,0.06);
    padding: 10px 0;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* Flex container: Pushes Left Group and Right Group apart */
nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* -------------------------
   LEFT SIDE: Logo, Title, Tabs
   ------------------------- */
.nav-left {
    display: flex;
    align-items: center;
    gap: 50px; /* Space between Title Group and Tabs */
}

/* Logo + Title Group */
.logo-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-box {
	width: 40px;
	height: 40px;
	flex: 0 0 72px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	background:#F2F2F2;
	border-radius: 5px;
}

.logo-box img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center;
	display: block;
}

h1#pageTitle {
    margin: 0;
    font-size: 20px;
    font-weight: bold;
    color: #111;
    line-height: 1;
    white-space: nowrap;
	
}

/* Tabs (Now on the left, next to title) */
.page-tabs {
    display: flex;
    gap: 4px;
}

.tab {
    text-decoration: none;
    font-size: 14px;
    padding: 5px 10px;
    color: #555;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.tab:hover {
    color: #000;
    background-color: rgba(0,0,0,0.05);
}

/* Active Tab: Dark & Square */
.tab.active {
    background-color: #333;
    color: #fff;
}

/* -------------------------
   RIGHT SIDE: Controls
   ------------------------- */
.nav-right {
    display: flex;
    align-items: center;
}

/* Reuse existing controls styles but ensure flex alignment */
.controls {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    margin: 0; /* Reset margins */
}

/* Ensure selector looks good on the grey background */
.controls select {
    background-color: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* ──────────────────────────────────────────── */
/* Universal Card System                       */
/* ──────────────────────────────────────────── */
.card {
	display: block;
	padding: 1rem;
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
	position: relative;
	border: 1px solid #eee;
	margin: 0 0 12px 0;
}

.card-controls {
	position: absolute;
	top: 15px;
	right: 15px;
}

/* Grey bubble selector (Target-like style) */
.mini-select {
	appearance: none;
	font-size: 14px;
	color: #666;
	background-color: #f3f4f6;
	border: none;
	border-radius: 9999px;
	padding: 4px 14px 5px 10px;
	cursor: pointer;
	line-height: 1.3;
	transition: background-color 0.2s ease, box-shadow 0.2s ease;
	background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 8px center;
	background-size: 10px 6px;
	padding-right: 22px;
}

.mini-select:hover {
	background-color: #e5e7eb;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.mini-select:focus {
	outline: none;
	background-color: #e5e7eb;
	box-shadow: 0 0 0 2px rgba(107, 114, 128, 0.25);
}

.card .chip {
	border-radius: 10px;
	display: inline-block;
	padding: 0 5px 5px 5px;
	position: relative;
	left: -5px;
}

.card .chip:hover {
	background: #ddd;
}

.card .dot {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	margin-right: 8px;
	vertical-align: middle;
}

.card .h3descr {
	color: #5f6368;
	font-size: 0.9rem;
	line-height: 1.3;
	text-wrap: balance;
}

/* Let Apex tooltips wrap to multiple lines */
.apexcharts-tooltip,
.apexcharts-tooltip-title,
.apexcharts-tooltip-text,
.apexcharts-xaxistooltip,
.apexcharts-yaxistooltip {
	white-space: normal !important;
	max-width: 360px;
	line-height: 1.35;
}

/* ──────────────────────────────────────────── */
/* Tone Control (shared)                        */
/* ──────────────────────────────────────────── */
[data-tone="good"] .dot {
	background: var(--tone-good);
}

[data-tone="warn"] .dot {
	background: var(--tone-warn);
}

[data-tone="bad"] .dot {
	background: var(--tone-bad);
}

[data-tone="mute"] .dot {
	background: var(--tone-mute);
}

/* ──────────────────────────────────────────── */
/* Pill (badge) */
/* ──────────────────────────────────────────── */
.bb-badge {
	font-size: 11px;
	line-height: 1;
	padding: 4px 10px;
	border-radius: 9999px;
	background: #f1f5f9;
	color: #334155;
	white-space: nowrap;
	align-self: flex-start; /* Keep pill at top alignment if needed */
}

.bb-badge.good {
	background: #e9f9ef;
	color: #1e7f3b;
}
.bb-badge.target {
	background: #e6f3ff;
	color: #0b6bdc;
}
.bb-badge.must-evolve {
	background: #fef2f2;
	color: #b91c1c;
}

/* ──────────────────────────────────────────── */
/* Initiative Specific (cards list)             */
/* ──────────────────────────────────────────── */
.card.initiative {
	border-left: 4px solid transparent;
}

.card.initiative[data-status="available"] {
	--tone: var(--tone-mute);
}

.card.initiative[data-status="ongoing"] {
	--tone: var(--tone-good);
}

.card.initiative[data-status="paused"] {
	--tone: var(--tone-warn);
}

.card.initiative .dot {
	background: var(--tone, var(--tone-mute));
}

/* =========================
   Controls
   ========================= */
.controls {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	font-size: 14px;
}

.controls-left {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.controls-left label {
	margin-right: 12px;
	white-space: nowrap;
}

.controls-right {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 8px;
}

.ghost-btn {
	margin-left: auto;
	padding: 6px 10px;
	font-size: 12px;
	border: 1px solid #e1e1e1;
	border-radius: 8px;
	background: #fff;
	color: #333;
	cursor: pointer;
}

.ghost-btn:hover {
	background: #f8f8f8;
}

/* =========================
   Modal shell
   ========================= */
#modal {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, .25);
	display: none;
	z-index: 10000;
}

#modal .modal-inner {
	width: min(1200px, 96vw);
		height: 88vh;
		margin: 4vh auto;
		background: #fff;
		border-radius: 14px;
		box-shadow: 0 10px 30px rgba(0,0,0,.15);
		display: flex;
		flex-direction: column;
		overflow-y: auto;                /* ← allow vertical scroll */
		-webkit-overflow-scrolling: touch; /* smooth scroll on iOS */
		position: relative;
}

/* Modal close button */
#modal .modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: 0;
  font-size: 28px;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  z-index:10;
}
#modal .modal-close:hover { color: #111827; }

/* =========================
   Initiative modal content
   ========================= */
.initiative-modal {
	height: 100%;
	display: flex;
	flex-direction: column;
}

/* Sticky header with small pill above title */
.initiative-modal .im-header {
	position: sticky;
	top: 0;
	background: #fff;
	padding: 18px 22px 12px;
	border-bottom: 1px solid #eef0f3;
	z-index: 1;
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-items: flex-start;
}

.initiative-modal .im-badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	line-height: 1;
	padding: 4px 10px;
	border-radius: 9999px;
	background: #f1f5f9;
	color: #334155;
	width: fit-content;
}

.initiative-modal .im-badge .dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
}

.initiative-modal .im-title {
	margin: 0;
	font-size: 40px;
	font-weight: bold;
	font-weight: normal;
}

.initiative-modal .im-desc {
	margin: 0;
	color: #475569;
}

/* Body grid 2–3 */
.initiative-modal .im-grid {
	padding: 16px 22px 22px;
	overflow: auto;
}

.initiative-modal .im-left {
	min-width: 0;
}

.initiative-modal .im-right {
	background: #f7f8fa;
	border-radius: 12px;
	padding: 12px 14px;
	min-width: 0;
}

/* Smaller h4 (like compact h3) */
.initiative-modal .im-h4 {
	font-size: 14px;
	color: #6b7280;
}

/* KSF & verbatims */
.initiative-modal .im-ksf {
	margin: 0;
	padding-left: 18px;
}

.initiative-modal .im-verb {
	margin: 8px 0 12px;
	padding-left: 10px;
	border-left: 3px solid #e5e7eb;
}

.initiative-modal .im-verb blockquote {
	margin: 0 0 2px 0;
	font-style: italic;
	color: #111827;
}

.initiative-modal .im-verb .im-verb-src {
	font-size: 12px;
	color: #6b7280;
}

/* Contacts */
.initiative-modal .im-contacts {
	display: grid;
	gap: 8px;
}

.initiative-modal .im-contact {
	display: grid;
	grid-template-columns: 1.2fr 1.2fr 1fr auto;
	gap: 8px;
	align-items: center;
	padding: 6px 0;
	border-top: 1px solid #eceff3;
}

.initiative-modal .im-contact:first-child {
	border-top: none;
}

.initiative-modal .im-contact-site {
	font-weight: 700;
}

.initiative-modal .im-contact-link {
	color: #0b6bdc;
	text-decoration: none;
}

.initiative-modal .im-contact-link:hover {
	text-decoration: underline;
}

/* Tone for pill background in header */
.initiative-modal[data-tone="good"] .im-badge {
	background: #e9f9ef;
	color: #1e7f3b;
}

.initiative-modal[data-tone="target"] .im-badge {
	background: #e6f3ff;
	color: #0b6bdc;
}

/* Responsive modal body */
@media (max-width: 900px) {
	.initiative-modal .im-right {
		background: #fff;
		padding: 0;
	}
}

/* =========================
   Components
   ========================= */

/* Card variants */
.card.kpi {
	padding: 12px 14px;
	flex-direction: column;
	gap: 4px;
}

.card.tight {
	padding: 8px 12px;
}

.card h3 {
	font-size: 14px;
	font-weight: bold;
	font-weight: normal;
	margin: 6px 0 0 0;
	line-height: 1.3;
}

.card .h3descr {
	font-size: 14px;
	color: #6b7280;
}

/* Select */
select {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	min-width: 140px;
	padding: 6px 28px 6px 10px;
	border-radius: 5px;
	border: 1px solid #ccc;
	background-color: #fff;
	font-size: 14px;
	line-height: 1.3;
	cursor: pointer;
	background-image: url("data:image/svg+xml;utf8,<svg fill='black' height='16' viewBox='0 0 24 24' width='16' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
	background-repeat: no-repeat;
	background-position: right 8px center;
	background-size: 12px;
	transition: border-color .2s, box-shadow .2s;
}

select:focus {
	outline: none;
	border-color: #5dade2;
	box-shadow: 0 0 0 2px rgba(93, 173, 226, .3);
}

/* Tables */
table {
	width: 100%;
	border-collapse: collapse;
}

th,
td {
	padding: 8px;
	border-bottom: 1px solid #eee;
	text-align: left;
}

th {
	font-size: 12px;
	color: #6b7280;
	font-weight: 600;
}

/* Pills */
.pill {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 11px;
	color: #fff;
}

.pill.good {
	background: #2ecc71;
}

.pill.must {
	background: #e74c3c;
}

.pill.neutral {
	background: #f1c40f;
	color: #000;
}

/* Utilities */
.muted {
	color: #6b7280;
	font-size: 12px;
}

.empty {
	padding: 12px;
	color: #6b7280;
}

footer {
	margin: 40px 0 0 0;
}

/* Responsive detail */
@media (max-width: 720px) {
	.controls-right {
		margin-left: 0;
		width: 100%;
		justify-content: flex-start;
	}
}

/* Skeleton */
.skeleton {
	height: 1rem;
	background: linear-gradient(90deg, #eee 25%, #ddd 50%, #eee 75%);
	background-size: 200% 100%;
	animation: shimmer 1.2s infinite linear;
	border-radius: 4px;
	margin: .5rem 0;
}

.skeleton.short {
	width: 40%;
}

.skeleton.long {
	width: 90%;
}

.skeleton.big {
	height: 1.5em;
}

@keyframes shimmer {
	0% {
		background-position: -200% 0;
	}
	100% {
		background-position: 200% 0;
	}
}

/* =========================================
   AI ASSISTANT DROPDOWN (NEW)
   ========================================= */

/* The wrapper handles positioning of the dropdown */
.ai-nav-wrapper {
    position: relative;
	display: none; /* <--- HIDDEN BY DEFAULT */
}

/* The Trigger Button in Nav */
.ai-nav-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid #d1d5db;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    color: #111;
    transition: background-color 0.2s, border-color 0.2s;
}

.ai-nav-btn:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

/* Black Icon styling */
.ai-nav-btn svg {
    color: #000;
}

/* The Dropdown Menu */
.ai-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    width: 320px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    /* Default state is visible (block), hidden state is applied via class */
    display: block; 
}

/* Logic inversion: 'collapsed' now means hidden in dropdown mode */
.ai-dropdown.ai-collapsed {
    display: none;
}

/* Internal Layout of the Dropdown */
.ai-header {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    background-color: #f9fafb;
    border-radius: 12px 12px 0 0;
}

.ai-title {
    font-weight: 700;
    font-size: 13px;
    color: #374151;
}

.ai-body {
    padding: 16px;
}

.ai-text {
    font-size: 13px;
    line-height: 1.5;
    color: #4b5563;
    min-height: 40px;
    margin-bottom: 16px;
}

.ai-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.text-link-btn {
    background: none;
    border: none;
    font-size: 11px;
    color: #9ca3af;
    text-decoration: underline;
    cursor: pointer;
}
.text-link-btn:hover {
    color: #6b7280;
}

/* Loading Spinner */
.ai-loading {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #ccc;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}
@keyframes spin { 100% { transform: rotate(360deg); } }