/* ============================================================
   Argo — design system (ispirato al tema Velzon del CRM Gigama:
   topbar chiara, sidebar scura indaco, card piatte con ombra
   leggera, tipografia Inter, palette soft professionale)
   ============================================================ */

:root {
	--argo-primary: #405189;
	--argo-primary-rgb: 64, 81, 137;
	--argo-secondary: #3577f1;
	--argo-success: #0ab39c;
	--argo-info: #299cdb;
	--argo-warning: #f7b84b;
	--argo-danger: #f06548;
	--argo-body-bg: #f3f3f9;
	--argo-body-color: #212529;
	--argo-muted: #878a99;
	--argo-border: #e9ebec;
	--argo-card-shadow: 0 1px 2px rgba(56, 65, 74, 0.15);
	--argo-sidebar-bg: #405189;
	--argo-sidebar-color: #abb9e8;
	--argo-sidebar-width: 250px;
	--argo-topbar-height: 64px;
	--bs-primary: #405189;
	--bs-primary-rgb: 64, 81, 137;
	--bs-link-color: #405189;
	--bs-link-color-rgb: 64, 81, 137;
	--bs-link-hover-color: #364574;
	--bs-link-hover-color-rgb: 54, 69, 116;
	--bs-body-font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
	background: var(--argo-body-bg);
	color: var(--argo-body-color);
	font-family: var(--bs-body-font-family);
	font-size: 0.875rem;
}

h1, h2, h3, h4, h5, h6 {
	font-weight: 600;
	color: #495057;
}

a {
	text-decoration: none;
}

/* ---- Palette Bootstrap (override soft) ---- */

.btn-primary {
	--bs-btn-bg: var(--argo-primary);
	--bs-btn-border-color: var(--argo-primary);
	--bs-btn-hover-bg: #364574;
	--bs-btn-hover-border-color: #364574;
	--bs-btn-active-bg: #364574;
	--bs-btn-active-border-color: #33416e;
	--bs-btn-disabled-bg: var(--argo-primary);
	--bs-btn-disabled-border-color: var(--argo-primary);
}

.btn-outline-primary {
	--bs-btn-color: var(--argo-primary);
	--bs-btn-border-color: var(--argo-primary);
	--bs-btn-hover-bg: var(--argo-primary);
	--bs-btn-hover-border-color: var(--argo-primary);
	--bs-btn-active-bg: var(--argo-primary);
	--bs-btn-active-border-color: var(--argo-primary);
}

.text-bg-primary { background-color: var(--argo-primary) !important; }
.bg-primary { background-color: var(--argo-primary) !important; }

.text-bg-success { background-color: rgba(10, 179, 156, 0.15) !important; color: #0ab39c !important; }
.text-bg-danger { background-color: rgba(240, 101, 72, 0.15) !important; color: #f06548 !important; }
.text-bg-warning { background-color: rgba(247, 184, 75, 0.18) !important; color: #d29b3b !important; }
.text-bg-info { background-color: rgba(41, 156, 219, 0.15) !important; color: #299cdb !important; }
.text-bg-secondary { background-color: rgba(64, 81, 137, 0.12) !important; color: var(--argo-primary) !important; }
.text-bg-dark { background-color: rgba(33, 37, 41, 0.85) !important; color: #fff !important; }

.form-control:focus,
.form-select:focus {
	border-color: #a2aec9;
	box-shadow: 0 0 0 0.15rem rgba(var(--argo-primary-rgb), 0.15);
}

.nav-tabs .nav-link.active {
	color: var(--argo-primary);
	font-weight: 600;
}

.nav-tabs .nav-link {
	color: var(--argo-muted);
}

.pagination {
	--bs-pagination-active-bg: var(--argo-primary);
	--bs-pagination-active-border-color: var(--argo-primary);
	--bs-pagination-color: var(--argo-primary);
}

/* ---- Struttura ---- */

.argo-wrapper {
	display: flex;
	min-height: 100vh;
}

.argo-main {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.argo-content {
	padding: 1.5rem;
	flex: 1;
}

/* ---- Topbar ---- */

.argo-topbar {
	height: var(--argo-topbar-height);
	background: #fff;
	box-shadow: 0 1px 2px rgba(56, 65, 74, 0.15);
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 1.5rem;
	position: sticky;
	top: 0;
	z-index: 1020;
}

.argo-topbar .argo-avatar {
	cursor: pointer;
}

.argo-topbar-user {
	background: var(--argo-body-bg);
	border-radius: 0.5rem;
	padding: 0.35rem 0.75rem;
}

/* ---- Sidebar ---- */

.argo-sidebar {
	width: var(--argo-sidebar-width);
	min-width: var(--argo-sidebar-width);
	background: var(--argo-sidebar-bg);
	color: var(--argo-sidebar-color);
	padding: 0;
	position: sticky;
	top: 0;
	height: 100vh;
	overflow-y: auto;
	z-index: 1030;
}

.argo-brand {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	color: #fff;
	font-weight: 700;
	font-size: 1.3rem;
	letter-spacing: -0.02em;
	text-decoration: none;
	padding: 1.1rem 1.25rem;
}

.argo-brand:hover { color: #fff; }

.argo-brand-logo {
	max-width: 160px;
	height: auto;
	display: block;
}

.argo-brand-mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 7px;
	background: rgba(255, 255, 255, 0.18);
	color: #fff;
	font-size: 1rem;
	flex-shrink: 0;
}

.argo-nav {
	padding: 0.25rem 0.85rem 1.5rem;
}

.argo-nav .nav-link {
	display: flex;
	align-items: center;
	gap: 0.7rem;
	color: var(--argo-sidebar-color);
	border-radius: 0.4rem;
	padding: 0.55rem 0.8rem;
	font-size: 0.9rem;
	transition: color 0.15s ease, background 0.15s ease;
}

.argo-nav .nav-link i {
	font-size: 1.05rem;
	width: 1.25rem;
	text-align: center;
	opacity: 0.85;
}

.argo-nav .nav-link:hover {
	color: #fff;
	background: rgba(255, 255, 255, 0.06);
}

.argo-nav .nav-link.active {
	color: #fff;
	background: rgba(255, 255, 255, 0.12);
}

.argo-nav .nav-link.disabled {
	opacity: 0.4;
	cursor: default;
}

.argo-nav .nav-link .badge {
	font-size: 0.62rem;
	background: rgba(255, 255, 255, 0.15) !important;
	color: #dbe1f5 !important;
}

.argo-nav-divider {
	font-size: 0.68rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: rgba(255, 255, 255, 0.45);
	padding: 1.1rem 0.8rem 0.35rem;
	font-weight: 600;
}

/* ---- Card e tabelle ---- */

.card {
	border: none;
	box-shadow: var(--argo-card-shadow);
	border-radius: 0.45rem;
	margin-bottom: 0;
}

.card-header {
	border-bottom: 1px solid var(--argo-border);
	padding: 0.85rem 1.1rem;
	font-weight: 600;
	color: #495057;
}

.table {
	--bs-table-hover-bg: #f7f8fb;
	font-size: 0.875rem;
}

.table thead th {
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--argo-muted);
	font-weight: 600;
	background: #f8f9fc;
	border-bottom: 1px solid var(--argo-border);
	padding: 0.65rem 0.75rem;
	white-space: nowrap;
}

.table td {
	padding: 0.65rem 0.75rem;
	vertical-align: middle;
}

.badge {
	font-weight: 600;
	letter-spacing: 0.01em;
}

/* ---- Avatar e stat ---- */

.argo-avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	color: #fff;
	font-size: 0.78rem;
	font-weight: 600;
	flex-shrink: 0;
}

.argo-avatar-sm {
	width: 24px;
	height: 24px;
	font-size: 0.62rem;
}

.argo-stat .card-body {
	padding: 1.1rem 1.25rem;
}

.argo-stat-icon {
	width: 46px;
	height: 46px;
	border-radius: 0.5rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 1.3rem;
}

.argo-dl dt {
	color: var(--argo-muted);
	font-weight: 500;
}

.argo-dl dd {
	margin-bottom: 0.35rem;
}

/* ---- Kanban ---- */

.argo-kanban {
	display: flex;
	gap: 1rem;
	overflow-x: auto;
	align-items: flex-start;
	padding-bottom: 1rem;
}

.argo-kanban-col {
	background: #eceef4;
	border-radius: 0.5rem;
	min-width: 280px;
	width: 280px;
	flex-shrink: 0;
}

.argo-kanban-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0.75rem 1rem;
	font-weight: 600;
	font-size: 0.82rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #495057;
}

.argo-kanban-body {
	padding: 0 0.6rem 0.6rem;
	min-height: 120px;
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	transition: background 0.15s ease;
	border-radius: 0 0 0.5rem 0.5rem;
}

.argo-kanban-body.dragover {
	background: rgba(64, 81, 137, 0.08);
}

.argo-card {
	background: #fff;
	border-radius: 0.45rem;
	box-shadow: var(--argo-card-shadow);
	padding: 0.75rem 0.85rem;
	cursor: grab;
}

.argo-card.dragging {
	opacity: 0.55;
	transform: rotate(1.5deg);
}

.argo-card-title {
	display: block;
	font-weight: 600;
	color: #495057;
	margin: 0.15rem 0;
	line-height: 1.35;
}

.argo-card-title:hover {
	color: var(--argo-primary);
}

/* ---- Checklist ---- */

.argo-check-item {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	padding: 0.55rem 0.75rem;
	border: 1px solid var(--argo-border);
	border-radius: 0.45rem;
	background: #fff;
	margin-bottom: 0.45rem;
}

.argo-check-item.dragging {
	opacity: 0.5;
}

.argo-check-item.done .argo-check-label {
	text-decoration: line-through;
	color: var(--argo-muted);
}

.argo-check-item .argo-check-grip {
	cursor: grab;
	color: #c2c6d0;
}

.argo-check-label {
	flex: 1;
}

.argo-check-item .btn {
	--bs-btn-padding-y: 0.1rem;
	--bs-btn-padding-x: 0.4rem;
	--bs-btn-font-size: 0.78rem;
}

/* ---- Planning ---- */

.argo-planning {
	display: grid;
	grid-template-columns: 240px repeat(7, minmax(150px, 1fr));
	gap: 0.65rem;
	align-items: start;
}

.argo-plan-day {
	background: #eceef4;
	border-radius: 0.5rem;
	min-height: 200px;
	transition: outline 0.1s ease;
}

.argo-plan-day.dragover {
	outline: 2px dashed var(--argo-primary);
}

.argo-plan-day.today {
	outline: 2px solid rgba(64, 81, 137, 0.45);
}

.argo-plan-head {
	padding: 0.55rem 0.75rem;
	font-weight: 600;
	font-size: 0.78rem;
	color: #495057;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.argo-plan-list {
	padding: 0 0.5rem 0.5rem;
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
	min-height: 60px;
}

.argo-plan-card {
	background: #fff;
	border-radius: 0.4rem;
	box-shadow: var(--argo-card-shadow);
	padding: 0.5rem 0.6rem;
	font-size: 0.8rem;
	cursor: grab;
	border-left: 3px solid var(--argo-primary);
}

.argo-plan-card.dragging {
	opacity: 0.55;
}

/* ---- Login ---- */

.argo-auth-body {
	background: linear-gradient(160deg, #364574 0%, #405189 55%, #4a5da0 100%);
	color: #fff;
	font-family: var(--bs-body-font-family);
}

.argo-auth-logo {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	font-size: 1.75rem;
}

.argo-auth-body .text-secondary {
	color: rgba(255, 255, 255, 0.65) !important;
}

.argo-auth-body .card {
	border-radius: 0.6rem;
}

/* ---- Progress bar sottile ---- */

.argo-progress {
	height: 6px;
	border-radius: 3px;
	background: #e9ebec;
}

.argo-progress .progress-bar {
	background: var(--argo-success);
	border-radius: 3px;
}

/* ---- Topbar icone e badge ---- */

.argo-topbar-icon {
	position: relative;
	color: #495057;
	font-size: 1.15rem;
	padding: 0.25rem;
}

.argo-topbar-icon:hover {
	color: var(--argo-primary);
}

.argo-badge-dot {
	position: absolute;
	top: 0;
	right: -4px;
	min-width: 17px;
	height: 17px;
	padding: 0 4px;
	border-radius: 9px;
	background: var(--argo-danger);
	color: #fff;
	font-size: 0.65rem;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* ---- Chat ---- */

.argo-chat-list {
	max-height: 65vh;
	overflow-y: auto;
}

.argo-chat-card {
	display: flex;
	flex-direction: column;
	height: calc(100vh - var(--argo-topbar-height) - 140px);
	min-height: 420px;
}

.argo-chat-scroll {
	overflow-y: auto;
	flex: 1;
	background: #f7f8fb;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.argo-chat-msg {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	max-width: 78%;
}

.argo-chat-msg.mine {
	align-self: flex-end;
	align-items: flex-end;
}

.argo-chat-bubble {
	background: #fff;
	border-radius: 0.7rem 0.7rem 0.7rem 0.2rem;
	box-shadow: var(--argo-card-shadow);
	padding: 0.5rem 0.75rem;
	font-size: 0.875rem;
}

.argo-chat-msg.mine .argo-chat-bubble {
	background: #dce3f7;
	border-radius: 0.7rem 0.7rem 0.2rem 0.7rem;
}

.argo-chat-time {
	font-size: 0.68rem;
	color: var(--argo-muted);
	margin-left: 0.75rem;
}

.argo-chat-actions {
	opacity: 0;
	transition: opacity 0.15s ease;
	margin-top: 2px;
}

.argo-chat-msg:hover .argo-chat-actions {
	opacity: 1;
}

.argo-mention {
	color: var(--argo-secondary);
	font-weight: 600;
}

/* ---- Filtri colonna nei listati ---- */

.argo-filter {
	min-width: 70px;
	font-weight: 400;
	text-transform: none;
	letter-spacing: normal;
}

table thead .argo-filter {
	font-size: 0.78rem;
}

/* ---- Assistente AI ---- */

.argo-ai-scroll {
	height: calc(100vh - var(--argo-topbar-height) - 200px);
	min-height: 360px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.argo-ai-msg {
	display: flex;
	max-width: 85%;
}

.argo-ai-msg.user {
	align-self: flex-end;
	justify-content: flex-end;
}

.argo-ai-bubble {
	padding: 0.6rem 0.9rem;
	border-radius: 0.8rem;
	font-size: 0.9rem;
	line-height: 1.5;
	white-space: pre-wrap;
}

.argo-ai-msg.assistant .argo-ai-bubble {
	background: #f3f3f9;
	border-bottom-left-radius: 0.2rem;
}

.argo-ai-msg.user .argo-ai-bubble {
	background: var(--argo-primary);
	color: #fff;
	border-bottom-right-radius: 0.2rem;
}

/* ---- Footer ---- */

.argo-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	flex-wrap: wrap;
	padding: 0.85rem 1.5rem;
	background: #fff;
	border-top: 1px solid var(--argo-border);
	font-size: 0.8rem;
	color: var(--argo-muted);
	margin-top: auto;
}

/* ---- Responsive: sidebar off-canvas su mobile ---- */

.argo-sidebar-backdrop {
	display: none;
}

@media (max-width: 991.98px) {
	.argo-sidebar {
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		height: 100%;
		transform: translateX(-100%);
		transition: transform 0.25s ease;
		z-index: 1045;
		box-shadow: 4px 0 20px rgba(0, 0, 0, 0.25);
	}

	body.sidebar-open .argo-sidebar {
		transform: translateX(0);
	}

	body.sidebar-open .argo-sidebar-backdrop {
		display: block;
		position: fixed;
		inset: 0;
		background: rgba(26, 29, 41, 0.5);
		z-index: 1040;
	}

	body.sidebar-open {
		overflow: hidden;
	}

	.argo-planning {
		grid-template-columns: 1fr;
	}

	.argo-content {
		padding: 1rem;
	}

	.argo-topbar {
		padding: 0 1rem;
	}

	.argo-chat-card {
		height: calc(100vh - var(--argo-topbar-height) - 220px);
	}

	.argo-kanban-col {
		min-width: 260px;
		width: 260px;
	}
}

.min-width-0 {
	min-width: 0;
}
