/**
 * TerenPRO - theme (Bootstrap 5 overrides).
 *
 * Clean, mostly monochrome SaaS look: white sidebar and header, light canvas,
 * white bordered cards, dark (slate-900) primary actions and active states,
 * with a few colour accents (amber, blue, green, red) for data and status.
 *
 * Chart palette (keep in this order): #f59e0b amber, #111827 ink, #475569 slate,
 * #3b82f6 blue, #22c55e green, #ef4444 red.
 *
 * @package TerenPRO
 * @author  Stefan Iftimie <https://www.ahoi.ro/>
 * @copyright Ahoi Digital SRL
 */

/* ------------------------------------------------------------------
 * Tokens
 * ------------------------------------------------------------------ */
:root {
	--sm-bg: #f6f7f9;
	--sm-surface: #ffffff;
	--sm-surface-2: #f8fafc;
	--sm-surface-3: #f1f5f9;
	--sm-border: #e6e8ec;
	--sm-border-strong: #d5d9e0;
	--sm-text: #0f172a;
	--sm-text-2: #334155;
	--sm-muted: #64748b;
	--sm-subtle: #94a3b8;

	--sm-ink: #111827;
	--sm-ink-hover: #1f2937;

	--sm-amber: #f59e0b;
	--sm-amber-soft: #fef3c7;
	--sm-amber-text: #92400e;
	--sm-blue: #2563eb;
	--sm-blue-soft: #dbeafe;
	--sm-blue-text: #1e40af;
	--sm-green: #16a34a;
	--sm-green-soft: #dcfce7;
	--sm-green-text: #166534;
	--sm-red: #dc2626;
	--sm-red-soft: #fee2e2;
	--sm-red-text: #991b1b;
	--sm-violet-soft: #ede9fe;
	--sm-violet-text: #5b21b6;

	--sm-radius-lg: 14px;
	--sm-radius: 10px;
	--sm-radius-sm: 8px;
	--sm-shadow: 0 1px 2px rgba(16, 24, 40, .04);
	--sm-shadow-md: 0 4px 16px -6px rgba(16, 24, 40, .10);
	--sm-shadow-lg: 0 16px 40px -12px rgba(16, 24, 40, .22);
	--sm-sidebar-w: 260px;
	--sm-topbar-h: 74px;
	--sm-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

	--bs-body-font-family: var(--sm-font);
	--bs-body-font-size: .875rem;
	--bs-body-color: var(--sm-text);
	--bs-body-bg: var(--sm-bg);
	--bs-border-color: var(--sm-border);
	--bs-primary: #111827;
	--bs-primary-rgb: 17, 24, 39;
	--bs-link-color: var(--sm-blue);
	--bs-link-color-rgb: 37, 99, 235;
	--bs-link-hover-color: #1d4ed8;
	--bs-link-hover-color-rgb: 29, 78, 216;
	--bs-border-radius: var(--sm-radius-sm);
	--bs-border-radius-lg: var(--sm-radius);
	--bs-border-radius-sm: 6px;
}

/* ------------------------------------------------------------------
 * Base
 * ------------------------------------------------------------------ */
body {
	font-family: var(--sm-font);
	font-size: .875rem;
	color: var(--sm-text);
	background: var(--sm-bg);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

a {
	color: var(--sm-blue);
	text-decoration: none;
}

a:hover {
	color: #1d4ed8;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
	color: var(--sm-text);
	font-weight: 600;
	letter-spacing: -.01em;
}

hr {
	border-color: var(--sm-border);
	opacity: 1;
}

.text-muted,
.form-text {
	color: var(--sm-muted) !important;
}

::selection {
	background: var(--sm-ink);
	color: #fff;
}

/* ------------------------------------------------------------------
 * Sidebar (white)
 * ------------------------------------------------------------------ */
.sidebar {
	position: fixed;
	inset: 0 auto 0 0;
	z-index: 1040;
	display: flex;
	flex-direction: column;
	width: var(--sm-sidebar-w);
	background: var(--sm-surface);
	border-right: 1px solid var(--sm-border);
	transition: transform .25s ease;
}

.sidebar-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
	height: var(--sm-topbar-h);
	padding: 0 22px;
	color: var(--sm-text);
	text-decoration: none;
}

.sidebar-brand:hover {
	color: var(--sm-text);
}

.sidebar-brand-mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 8px;
	background: #fff;
	border: 1px solid var(--sm-border);
	overflow: hidden;
	flex-shrink: 0;
}

.sidebar-brand-mark img {
	width: 28px;
	height: 28px;
	object-fit: contain;
}

.sidebar-brand-name {
	font-size: 1.125rem;
	font-weight: 700;
	letter-spacing: -.02em;
}

.sidebar-scroll {
	flex: 1 1 auto;
	padding: 4px 14px 16px;
	overflow-y: auto;
	scrollbar-width: thin;
}

.sidebar-heading {
	margin: 18px 10px 8px;
	font-size: .6875rem;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--sm-subtle);
}

.sidebar .nav {
	gap: 2px;
}

.sidebar .nav-link {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 9px 12px;
	border-radius: var(--sm-radius);
	color: var(--sm-text-2);
	font-size: .9063rem;
	font-weight: 500;
	line-height: 1.3;
	transition: background-color .15s ease, color .15s ease;
}

.sidebar .nav-link .bi {
	width: 18px;
	font-size: 1.05rem;
	text-align: center;
	color: var(--sm-muted);
}

.sidebar .nav-link:hover {
	background: var(--sm-surface-3);
	color: var(--sm-text);
}

.sidebar .nav-link:hover .bi {
	color: var(--sm-text);
}

.sidebar .nav-link.active {
	background: var(--sm-ink);
	color: #fff;
	font-weight: 600;
	box-shadow: 0 6px 14px -8px rgba(17, 24, 39, .6);
}

.sidebar .nav-link.active .bi {
	color: #fff;
}

.nav-count {
	margin-left: auto;
	min-width: 20px;
	padding: 1px 7px;
	border-radius: 999px;
	background: var(--sm-amber-soft);
	color: var(--sm-amber-text);
	font-size: .6875rem;
	font-weight: 700;
	text-align: center;
}

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

.sidebar-footer {
	flex-shrink: 0;
	padding: 12px 14px 16px;
}

.sidebar-user {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px;
	border: 1px solid var(--sm-border);
	border-radius: 12px;
	background: var(--sm-surface);
}

.sidebar-user-info {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-width: 0;
	color: var(--sm-text);
}

.sidebar-user-info:hover {
	color: var(--sm-text);
}

.sidebar-user-name {
	overflow: hidden;
	font-weight: 600;
	font-size: .875rem;
	line-height: 1.25;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sidebar-user-role {
	font-size: .75rem;
	color: var(--sm-muted);
	text-transform: capitalize;
}

.sidebar-backdrop {
	display: none;
}

/* ------------------------------------------------------------------
 * Header (white, translucent on scroll)
 * ------------------------------------------------------------------ */
.topbar {
	position: sticky;
	top: 0;
	z-index: 1030;
	display: flex;
	align-items: center;
	gap: 14px;
	height: var(--sm-topbar-h);
	margin-left: var(--sm-sidebar-w);
	padding: 0 28px;
	background: var(--sm-surface);
	border-bottom: 1px solid var(--sm-border);
	transition: background-color .2s ease, box-shadow .2s ease;
}

.topbar.is-scrolled {
	background: rgba(255, 255, 255, .78);
	-webkit-backdrop-filter: saturate(180%) blur(14px);
	backdrop-filter: saturate(180%) blur(14px);
	box-shadow: 0 6px 20px -14px rgba(16, 24, 40, .35);
}

.topbar .topbar-toggle {
	display: none;
}

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

.topbar-breadcrumb {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: .8125rem;
	color: var(--sm-muted);
	white-space: nowrap;
}

.topbar-breadcrumb .sep {
	color: var(--sm-subtle);
}

.topbar-title {
	overflow: hidden;
	font-size: 1.1875rem;
	font-weight: 700;
	letter-spacing: -.02em;
	line-height: 1.3;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.topbar-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-left: auto;
}

.topbar-search {
	width: 240px;
}

.env-badge {
	display: inline-flex;
	align-items: center;
	padding: 4px 10px;
	border: 1px solid #fcd34d;
	border-radius: 999px;
	background: var(--sm-amber-soft);
	color: var(--sm-amber-text);
	font-size: .6875rem;
	font-weight: 700;
	letter-spacing: .06em;
}

.env-badge-danger {
	border-color: #fca5a5;
	background: var(--sm-red-soft);
	color: var(--sm-red-text);
}

.btn-user {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 5px 12px 5px 6px;
	border: 1px solid var(--sm-border);
	border-radius: 12px;
	background: var(--sm-surface);
	color: var(--sm-text);
	font-weight: 500;
}

.btn-user:hover,
.btn-user.show {
	border-color: var(--sm-border-strong);
	background: var(--sm-surface-2);
}

.dot-count {
	position: absolute;
	top: -5px;
	right: -5px;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border: 2px solid #fff;
	border-radius: 999px;
	background: var(--sm-red);
	color: #fff;
	font-size: .625rem;
	font-weight: 700;
	line-height: 14px;
	text-align: center;
}

/* A new field notification arrived (assets/js/app.js, initFieldNotifications()). */
.dot-count.is-new {
	animation: dot-count-pop 1.2s ease 2;
}

@keyframes dot-count-pop {
	0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, .5); }
	40% { transform: scale(1.35); box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
}

@media (prefers-reduced-motion: reduce) {
	.dot-count.is-new { animation: none; }
}

/* ------------------------------------------------------------------
 * Main
 * ------------------------------------------------------------------ */
.main {
	min-width: 0;
	margin-left: var(--sm-sidebar-w);
	padding: 28px 28px 96px;
}

.page-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	margin: 0 0 22px;
}

/* The page title lives in the header; keep it for screen readers only. */
.main .page-title,
.main > .d-flex.border-bottom > h1,
.main > .d-flex.bg-light > h1 {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

.page-subtitle {
	margin: 0;
	color: var(--sm-muted);
	font-size: .875rem;
}

.page-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-left: auto;
}

/* Legacy page header markup (older modules). */
.main > .d-flex.border-bottom,
.main > .d-flex.bg-light {
	justify-content: flex-end !important;
	padding: 0 !important;
	margin-bottom: 18px !important;
	border-bottom: 0 !important;
	background: transparent !important;
}

.main > br:first-of-type {
	display: none;
}

/* ------------------------------------------------------------------
 * Cards
 * ------------------------------------------------------------------ */
.card,
.cardx,
.card-x {
	position: relative;
	margin-bottom: 20px;
	background: var(--sm-surface);
	border: 1px solid var(--sm-border);
	border-radius: var(--sm-radius-lg);
	box-shadow: var(--sm-shadow);
	--bs-card-bg: var(--sm-surface);
	--bs-card-border-color: var(--sm-border);
	--bs-card-cap-bg: transparent;
	--bs-card-border-radius: var(--sm-radius-lg);
	--bs-card-inner-border-radius: calc(var(--sm-radius-lg) - 1px);
}

.card > .card-body,
.cardx > .card-body,
.card-x > .card-body {
	padding: 22px;
}

.card-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 22px;
	background: transparent;
	border-bottom: 1px solid var(--sm-border);
	font-size: .9688rem;
	font-weight: 600;
	color: var(--sm-text);
}

.card-header .card-meta {
	font-size: .8125rem;
	font-weight: 400;
	color: var(--sm-muted);
}

.card-footer {
	padding: 14px 22px;
	background: transparent;
	border-top: 1px solid var(--sm-border);
}

.card-title-sm {
	margin: 0 0 16px;
	font-size: .9688rem;
	font-weight: 600;
	color: var(--sm-text);
}

.card-sticky {
	position: sticky;
	top: calc(var(--sm-topbar-h) + 16px);
}

/* A sticky column taller than the screen scrolls on its own (e.g. the settlement totals + payment). */
.card-sticky.card-sticky-scroll {
	max-height: calc(100vh - var(--sm-topbar-h) - 32px);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding-right: 2px;
}

.card-danger {
	border-color: #fecaca;
}

.card-flush > .card-body {
	padding: 0;
}

.card-flush .table > :not(caption) > * > *:first-child {
	padding-left: 22px;
}

.card-flush .table > :not(caption) > * > *:last-child {
	padding-right: 22px;
}

.form-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 4px;
}

/* KPI tiles */
.kpi {
	display: flex;
	flex-direction: column;
	gap: 8px;
	height: 100%;
	padding: 20px 22px;
	background: var(--sm-surface);
	border: 1px solid var(--sm-border);
	border-radius: var(--sm-radius-lg);
	box-shadow: var(--sm-shadow);
	color: var(--sm-text);
	text-decoration: none;
	transition: box-shadow .15s ease, border-color .15s ease;
}

a.kpi:hover {
	border-color: var(--sm-border-strong);
	box-shadow: var(--sm-shadow-md);
	color: var(--sm-text);
}

.kpi-head {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--sm-text-2);
	font-size: .875rem;
	font-weight: 500;
}

.kpi-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 30px;
	height: 30px;
	border: 1px solid var(--sm-border);
	border-radius: 8px;
	background: var(--sm-surface-2);
	color: var(--sm-text-2);
	font-size: .9375rem;
}

.kpi-icon-amber { background: var(--sm-amber-soft); border-color: #fde68a; color: var(--sm-amber-text); }
.kpi-icon-blue { background: var(--sm-blue-soft); border-color: #bfdbfe; color: var(--sm-blue-text); }
.kpi-icon-green { background: var(--sm-green-soft); border-color: #bbf7d0; color: var(--sm-green-text); }
.kpi-icon-red { background: var(--sm-red-soft); border-color: #fecaca; color: var(--sm-red-text); }

.kpi-value {
	font-size: 1.875rem;
	font-weight: 700;
	letter-spacing: -.03em;
	line-height: 1.15;
}

.kpi-meta {
	font-size: .8125rem;
	color: var(--sm-muted);
}

.kpi-trend-up { color: var(--sm-green); font-weight: 600; }
.kpi-trend-down { color: var(--sm-red); font-weight: 600; }

/* Summary rows (e.g. "Plan · 0 abonati ......... 100,00 RON") */
.summary-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.summary-list li {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 9px 0;
	border-bottom: 1px solid var(--sm-border);
	color: var(--sm-text-2);
}

.summary-list li:last-child {
	border-bottom: 0;
}

.summary-list strong {
	color: var(--sm-text);
}

/* ------------------------------------------------------------------
 * Tabs (pills with counters)
 * ------------------------------------------------------------------ */
.tabs-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 16px;
}

.tabs-pills .nav-link,
.tabs-pills a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	border-radius: var(--sm-radius);
	color: var(--sm-text-2);
	font-weight: 500;
	font-size: .9063rem;
}

.tabs-pills .nav-link:hover,
.tabs-pills a:hover {
	background: var(--sm-surface);
	color: var(--sm-text);
}

.tabs-pills .active {
	background: var(--sm-ink) !important;
	color: #fff !important;
	font-weight: 600;
}

.tab-count {
	min-width: 20px;
	padding: 1px 7px;
	border-radius: 999px;
	background: var(--sm-surface-3);
	color: var(--sm-muted);
	font-size: .6875rem;
	font-weight: 700;
	text-align: center;
}

.tabs-pills .active .tab-count {
	background: #fff;
	color: var(--sm-ink);
}

/* ------------------------------------------------------------------
 * Buttons
 * ------------------------------------------------------------------ */
.btn {
	--bs-btn-font-weight: 500;
	--bs-btn-font-size: .875rem;
	--bs-btn-padding-x: 14px;
	--bs-btn-padding-y: 7px;
	--bs-btn-border-radius: var(--sm-radius);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.btn-sm {
	--bs-btn-padding-x: 10px;
	--bs-btn-padding-y: 5px;
	--bs-btn-font-size: .8125rem;
	--bs-btn-border-radius: var(--sm-radius-sm);
}

.btn-lg {
	--bs-btn-padding-x: 18px;
	--bs-btn-padding-y: 10px;
	--bs-btn-font-size: .9375rem;
	--bs-btn-border-radius: 12px;
}

.btn-block {
	display: flex;
	width: 100%;
}

.btn-primary,
.btn-dark {
	--bs-btn-color: #fff;
	--bs-btn-bg: var(--sm-ink);
	--bs-btn-border-color: var(--sm-ink);
	--bs-btn-hover-color: #fff;
	--bs-btn-hover-bg: var(--sm-ink-hover);
	--bs-btn-hover-border-color: var(--sm-ink-hover);
	--bs-btn-active-color: #fff;
	--bs-btn-active-bg: #000;
	--bs-btn-active-border-color: #000;
	--bs-btn-disabled-color: #fff;
	--bs-btn-disabled-bg: #94a3b8;
	--bs-btn-disabled-border-color: #94a3b8;
	--bs-btn-focus-shadow-rgb: 17, 24, 39;
}

.btn-secondary,
.btn-light {
	--bs-btn-color: var(--sm-text);
	--bs-btn-bg: var(--sm-surface);
	--bs-btn-border-color: var(--sm-border);
	--bs-btn-hover-color: var(--sm-text);
	--bs-btn-hover-bg: var(--sm-surface-2);
	--bs-btn-hover-border-color: var(--sm-border-strong);
	--bs-btn-active-color: var(--sm-text);
	--bs-btn-active-bg: var(--sm-surface-3);
	--bs-btn-active-border-color: var(--sm-border-strong);
	--bs-btn-disabled-color: var(--sm-subtle);
	--bs-btn-disabled-bg: var(--sm-surface);
	--bs-btn-disabled-border-color: var(--sm-border);
	--bs-btn-focus-shadow-rgb: 17, 24, 39;
	box-shadow: var(--sm-shadow);
}

.btn-outline-secondary,
.btn-outline-dark,
.btn-outline-primary {
	--bs-btn-color: var(--sm-text);
	--bs-btn-bg: var(--sm-surface);
	--bs-btn-border-color: var(--sm-border-strong);
	--bs-btn-hover-color: #fff;
	--bs-btn-hover-bg: var(--sm-ink);
	--bs-btn-hover-border-color: var(--sm-ink);
	--bs-btn-active-color: #fff;
	--bs-btn-active-bg: #000;
	--bs-btn-active-border-color: #000;
	--bs-btn-focus-shadow-rgb: 17, 24, 39;
}

.btn-success {
	--bs-btn-color: #fff;
	--bs-btn-bg: var(--sm-green);
	--bs-btn-border-color: var(--sm-green);
	--bs-btn-hover-color: #fff;
	--bs-btn-hover-bg: #15803d;
	--bs-btn-hover-border-color: #15803d;
}

.btn-danger {
	--bs-btn-color: #fff;
	--bs-btn-bg: var(--sm-red);
	--bs-btn-border-color: var(--sm-red);
	--bs-btn-hover-color: #fff;
	--bs-btn-hover-bg: #b91c1c;
	--bs-btn-hover-border-color: #b91c1c;
}

.btn-warning {
	--bs-btn-color: #451a03;
	--bs-btn-bg: var(--sm-amber);
	--bs-btn-border-color: var(--sm-amber);
	--bs-btn-hover-color: #451a03;
	--bs-btn-hover-bg: #d97706;
	--bs-btn-hover-border-color: #d97706;
}

.btn-info {
	--bs-btn-color: #fff;
	--bs-btn-bg: var(--sm-blue);
	--bs-btn-border-color: var(--sm-blue);
	--bs-btn-hover-color: #fff;
	--bs-btn-hover-bg: #1d4ed8;
	--bs-btn-hover-border-color: #1d4ed8;
}

.btn-outline-danger {
	--bs-btn-color: var(--sm-red);
	--bs-btn-bg: var(--sm-surface);
	--bs-btn-border-color: #fecaca;
	--bs-btn-hover-color: #fff;
	--bs-btn-hover-bg: var(--sm-red);
	--bs-btn-hover-border-color: var(--sm-red);
}

.btn-outline-success {
	--bs-btn-color: var(--sm-green);
	--bs-btn-bg: var(--sm-surface);
	--bs-btn-border-color: #bbf7d0;
	--bs-btn-hover-color: #fff;
	--bs-btn-hover-bg: var(--sm-green);
	--bs-btn-hover-border-color: var(--sm-green);
}

.btn-icon {
	width: 36px;
	height: 36px;
	padding: 0;
	border: 1px solid transparent;
	border-radius: var(--sm-radius);
	background: transparent;
	color: var(--sm-muted);
}

.btn-icon:hover {
	border-color: var(--sm-border);
	background: var(--sm-surface-2);
	color: var(--sm-text);
}

.btn-icon-bordered {
	border-color: var(--sm-border);
	background: var(--sm-surface);
}

.btn-icon .bi {
	font-size: 1.05rem;
}

.sticky-btn,
.btn-pdf {
	position: fixed;
	right: 28px;
	bottom: 24px;
	z-index: 1020;
	width: auto;
	min-width: 200px;
	box-shadow: var(--sm-shadow-lg) !important;
}

/* ------------------------------------------------------------------
 * Forms
 * ------------------------------------------------------------------ */
.form-label,
.col-form-label {
	margin-bottom: 6px;
	color: var(--sm-text-2);
	font-size: .8125rem;
	font-weight: 500;
}

.form-control,
.form-select {
	min-height: 38px;
	padding: 7px 12px;
	border: 1px solid var(--sm-border);
	border-radius: var(--sm-radius-sm);
	background-color: var(--sm-surface);
	color: var(--sm-text);
	font-size: .875rem;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.form-control-sm,
.form-select-sm {
	min-height: 32px;
	padding: 4px 10px;
	font-size: .8125rem;
}

.form-control-lg {
	min-height: 44px;
	font-size: .9375rem;
}

.form-control::placeholder {
	color: var(--sm-subtle);
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
	border-color: #94a3b8;
	box-shadow: 0 0 0 3px rgba(17, 24, 39, .08);
	outline: 0;
}

.form-control:disabled,
.form-select:disabled,
.form-control[readonly] {
	background-color: var(--sm-surface-2);
	color: var(--sm-muted);
}

.form-check-input:checked {
	border-color: var(--sm-ink);
	background-color: var(--sm-ink);
}

.input-group-text {
	border-color: var(--sm-border);
	background: var(--sm-surface-2);
	color: var(--sm-muted);
}

.input-icon {
	position: relative;
}

.input-icon > .bi {
	position: absolute;
	top: 50%;
	left: 12px;
	color: var(--sm-subtle);
	pointer-events: none;
	transform: translateY(-50%);
}

.input-icon > .form-control {
	padding-left: 36px;
}

.btn-reveal {
	position: absolute;
	top: 50%;
	right: 6px;
	padding: 4px 8px;
	border: 0;
	background: transparent;
	color: var(--sm-subtle);
	transform: translateY(-50%);
}

.btn-reveal:hover {
	color: var(--sm-text);
}

.filter-input {
	float: left;
	width: 150px;
	margin-right: 8px;
}

.toolbar,
.filter-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 16px;
}

.toolbar-search {
	flex: 1 1 260px;
	max-width: 380px;
}

.toolbar-select {
	width: auto;
	min-width: 170px;
}

.filter-bar .form-control,
.filter-bar .form-select {
	width: auto;
	min-width: 140px;
}

/* ------------------------------------------------------------------
 * Tables
 * ------------------------------------------------------------------ */
.table {
	--bs-table-bg: transparent;
	--bs-table-striped-bg: var(--sm-surface-2);
	--bs-table-hover-bg: #f8fafc;
	--bs-table-border-color: var(--sm-border);
	margin-bottom: 0;
	color: var(--sm-text);
	font-size: .875rem;
}

.table > :not(caption) > * > * {
	padding: 13px 12px;
	border-bottom-color: #eef0f3;
	vertical-align: middle;
}

.table-sm > :not(caption) > * > * {
	padding: 9px 10px;
}

.table > thead > tr > th,
.table > thead > tr > td {
	padding-top: 12px;
	padding-bottom: 12px;
	background: var(--sm-surface-2);
	border-bottom: 1px solid var(--sm-border);
	color: var(--sm-muted);
	font-size: .7188rem;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	white-space: nowrap;
}

.table > tbody > tr:last-child > * {
	border-bottom: 0;
}

.table a:not(.btn) {
	color: var(--sm-blue);
	font-weight: 500;
}

.table .cell-sub {
	display: block;
	color: var(--sm-muted);
	font-size: .8125rem;
}

.table .num {
	font-variant-numeric: tabular-nums;
	text-align: right;
	white-space: nowrap;
}

.table-dark {
	--bs-table-color: var(--sm-text);
	--bs-table-bg: var(--sm-surface-2);
	--bs-table-border-color: var(--sm-border);
}

.table-success { --bs-table-bg: #f0fdf4; --bs-table-color: var(--sm-text); }
.table-danger { --bs-table-bg: #fef2f2; --bs-table-color: var(--sm-text); }
.table-warning { --bs-table-bg: #fffbeb; --bs-table-color: var(--sm-text); }
.table-info,
.table-primary { --bs-table-bg: #eff6ff; --bs-table-color: var(--sm-text); }
.table-secondary,
.table-light { --bs-table-bg: var(--sm-surface-2); --bs-table-color: var(--sm-text); }

.table-responsive {
	border-radius: var(--sm-radius);
}

.empty-state {
	padding: 48px 16px;
	color: var(--sm-muted);
	text-align: center;
}

.empty-state .bi {
	display: block;
	margin-bottom: 8px;
	font-size: 1.75rem;
	color: var(--sm-subtle);
}

/* ------------------------------------------------------------------
 * Badges, status, avatars
 * ------------------------------------------------------------------ */
.badge {
	--bs-badge-font-weight: 600;
	--bs-badge-padding-x: .6em;
	--bs-badge-padding-y: .38em;
	border-radius: 999px;
}

.badge.bg-primary,
.badge.bg-dark { background-color: var(--sm-ink) !important; color: #fff !important; }
.badge.bg-secondary { background-color: var(--sm-surface-3) !important; color: var(--sm-text-2) !important; }
.badge.bg-success { background-color: var(--sm-green-soft) !important; color: var(--sm-green-text) !important; }
.badge.bg-danger { background-color: var(--sm-red-soft) !important; color: var(--sm-red-text) !important; }
.badge.bg-warning { background-color: var(--sm-amber-soft) !important; color: var(--sm-amber-text) !important; }
.badge.bg-info { background-color: var(--sm-blue-soft) !important; color: var(--sm-blue-text) !important; }
.badge.bg-light { background-color: var(--sm-surface-3) !important; color: var(--sm-text-2) !important; }

.badge-soft { background: var(--sm-surface-3); color: var(--sm-text-2); text-transform: capitalize; }
.badge-success { background: var(--sm-green-soft); color: var(--sm-green-text); }
.badge-warning { background: var(--sm-amber-soft); color: var(--sm-amber-text); }
.badge-danger { background: var(--sm-red-soft); color: var(--sm-red-text); }
.badge-info { background: var(--sm-blue-soft); color: var(--sm-blue-text); }
.badge-violet { background: var(--sm-violet-soft); color: var(--sm-violet-text); }

.status-dot {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: .8125rem;
	font-weight: 500;
}

.status-dot::before {
	content: "";
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: currentColor;
}

.status-on { color: var(--sm-green); }
.status-off { color: var(--sm-subtle); }

.avatar {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--sm-ink);
	color: #fff;
	font-size: .8125rem;
	font-weight: 600;
}

.avatar-sm { width: 28px; height: 28px; font-size: .75rem; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.375rem; }
.avatar-img { object-fit: cover; background: var(--sm-surface-3); }

.user-avatar-image {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	object-fit: cover;
}

.logo-preview {
	padding: 16px;
	border-radius: var(--sm-radius);
	background: var(--sm-surface-2);
	text-align: center;
}

.logo-preview img {
	max-width: 100%;
	max-height: 80px;
}

/* ------------------------------------------------------------------
 * Alerts, dropdowns, pagination, nav, modals
 * ------------------------------------------------------------------ */
.alert {
	display: block;
	padding: 12px 16px;
	border: 1px solid transparent;
	border-radius: var(--sm-radius);
	font-size: .875rem;
}

.alert-success { border-color: #bbf7d0; background: #f0fdf4; color: var(--sm-green-text); }
.alert-danger { border-color: #fecaca; background: #fef2f2; color: var(--sm-red-text); }
.alert-warning { border-color: #fde68a; background: #fffbeb; color: var(--sm-amber-text); }
.alert-info,
.alert-primary { border-color: #bfdbfe; background: #eff6ff; color: var(--sm-blue-text); }
.alert-secondary,
.alert-light { border-color: var(--sm-border); background: var(--sm-surface); color: var(--sm-text-2); }

.dropdown-menu {
	--bs-dropdown-font-size: .875rem;
	--bs-dropdown-link-active-bg: var(--sm-ink);
	padding: 6px;
	border: 1px solid var(--sm-border);
	border-radius: 12px;
	box-shadow: var(--sm-shadow-lg);
}

.dropdown-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 7px 10px;
	border-radius: var(--sm-radius-sm);
}

.dropdown-header {
	padding: 8px 10px;
}

.pagination {
	--bs-pagination-color: var(--sm-text);
	--bs-pagination-bg: var(--sm-surface);
	--bs-pagination-border-color: var(--sm-border);
	--bs-pagination-hover-color: var(--sm-text);
	--bs-pagination-hover-bg: var(--sm-surface-2);
	--bs-pagination-hover-border-color: var(--sm-border-strong);
	--bs-pagination-focus-box-shadow: 0 0 0 3px rgba(17, 24, 39, .08);
	--bs-pagination-active-bg: var(--sm-ink);
	--bs-pagination-active-border-color: var(--sm-ink);
	gap: 6px;
	margin-top: 16px;
}

.pagination .page-link {
	min-width: 34px;
	border-radius: var(--sm-radius-sm) !important;
	text-align: center;
}

.nav-tabs {
	--bs-nav-tabs-border-color: var(--sm-border);
	--bs-nav-tabs-link-active-color: var(--sm-text);
	--bs-nav-tabs-link-active-bg: var(--sm-surface);
	--bs-nav-tabs-link-active-border-color: var(--sm-border) var(--sm-border) var(--sm-surface);
}

.nav-tabs .nav-link {
	color: var(--sm-muted);
	font-weight: 500;
}

.nav-pills {
	--bs-nav-pills-link-active-bg: var(--sm-ink);
}

.nav-pills .nav-link {
	border-radius: var(--sm-radius);
	color: var(--sm-text-2);
}

.modal-content {
	border: 0;
	border-radius: var(--sm-radius-lg);
	box-shadow: var(--sm-shadow-lg);
}

.list-group {
	--bs-list-group-border-color: var(--sm-border);
	--bs-list-group-active-bg: var(--sm-ink);
	--bs-list-group-active-border-color: var(--sm-ink);
}

.progress {
	--bs-progress-bar-bg: var(--sm-ink);
	--bs-progress-bg: var(--sm-surface-3);
	border-radius: 999px;
}

.bg-light { background-color: var(--sm-surface-2) !important; }
.text-primary { color: var(--sm-ink) !important; }
.text-success { color: var(--sm-green) !important; }
.text-danger { color: var(--sm-red) !important; }
.text-warning { color: #d97706 !important; }
.text-info { color: var(--sm-blue) !important; }

/* Third party widgets: modern Romanian datepicker & high-visibility tooltips */
input.datepicker {
	padding-right: 34px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 11px center;
	background-size: 14px 14px;
	cursor: pointer;
}

body .datepicker-dropdown {
	z-index: 1090 !important;
	min-width: 276px;
	margin-top: 6px;
	padding: 12px;
	border: 1px solid var(--sm-border);
	border-radius: var(--sm-radius-lg);
	background: var(--sm-surface);
	box-shadow: var(--sm-shadow-lg);
	font-family: var(--sm-font);
	font-size: .8438rem;
	color: var(--sm-text);
}

body .datepicker-dropdown::before,
body .datepicker-dropdown::after {
	display: none !important;
}

.datepicker table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 2px;
}

.datepicker table tr th,
.datepicker table tr td {
	width: 34px;
	height: 34px;
	border-radius: 8px !important;
	font-weight: 500;
	line-height: 34px;
	text-align: center;
	text-shadow: none !important;
	transition: background-color .12s ease, color .12s ease;
}

.datepicker thead tr:first-child th {
	height: 36px;
	color: var(--sm-text);
	font-size: .9063rem;
	font-weight: 600;
}

.datepicker .datepicker-switch:hover,
.datepicker .prev:hover,
.datepicker .next:hover {
	background: var(--sm-surface-3) !important;
	color: var(--sm-text);
}

.datepicker .dow {
	height: 28px;
	color: var(--sm-muted);
	font-size: .7188rem;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
}

.datepicker table tr td.day {
	color: var(--sm-text);
}

.datepicker table tr td.day:hover,
.datepicker table tr td.day.focused {
	background: var(--sm-surface-3) !important;
	color: var(--sm-text);
}

.datepicker table tr td.old,
.datepicker table tr td.new {
	color: var(--sm-subtle) !important;
}

.datepicker table tr td.disabled,
.datepicker table tr td.disabled:hover {
	color: #cbd5e1 !important;
	background: transparent !important;
	cursor: not-allowed;
}

.datepicker table tr td.today,
.datepicker table tr td.today:hover {
	border-radius: 8px !important;
	background: var(--sm-amber-soft) !important;
	background-image: none !important;
	color: var(--sm-amber-text) !important;
	font-weight: 700;
}

.datepicker table tr td.active,
.datepicker table tr td.active:hover,
.datepicker table tr td.active.today,
.datepicker table tr td.active.today:hover,
.datepicker table tr td span.active,
.datepicker table tr td span.active:hover {
	border-radius: 8px !important;
	background: var(--sm-ink) !important;
	background-image: none !important;
	color: #fff !important;
	font-weight: 600;
	box-shadow: 0 4px 10px -4px rgba(17, 24, 39, .5);
}

.datepicker table tr td span {
	height: 44px;
	line-height: 44px;
	border-radius: 8px !important;
	font-weight: 500;
}

.datepicker table tr td span:hover,
.datepicker table tr td span.focused {
	background: var(--sm-surface-3) !important;
}

.datepicker tfoot tr th {
	height: 32px;
	padding-top: 4px;
	border-radius: 8px !important;
	color: var(--sm-text-2);
	font-size: .8125rem;
	font-weight: 600;
	line-height: 28px;
}

.datepicker tfoot tr th:hover {
	background: var(--sm-surface-3) !important;
	color: var(--sm-ink);
}

/* Custom visible tooltip */
.tooltip.sm-tooltip,
.tooltip {
	--bs-tooltip-zindex: 1095;
	--bs-tooltip-max-width: 300px;
	--bs-tooltip-padding-x: 11px;
	--bs-tooltip-padding-y: 7px;
	--bs-tooltip-font-size: .8125rem;
	--bs-tooltip-color: #ffffff;
	--bs-tooltip-bg: var(--sm-ink);
	--bs-tooltip-border-radius: 8px;
	--bs-tooltip-opacity: .98;
}

.tooltip .tooltip-inner {
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: -.005em;
	box-shadow: 0 10px 24px -6px rgba(15, 23, 42, .45), 0 0 0 1px rgba(255, 255, 255, .08);
}

.select2-container--default .select2-selection--single {
	height: 38px;
	border-color: var(--sm-border);
	border-radius: var(--sm-radius-sm);
}

/* Legacy helpers */
.loading {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(255, 255, 255, .3) url('../img/loading2.gif') center no-repeat;
}

.col-h260 { min-height: 300px; }
.show-read-more .more-text { display: none; }

/* ------------------------------------------------------------------
 * Responsive
 * ------------------------------------------------------------------ */
@media (max-width: 1199.98px) {
	.topbar-search {
		width: 180px;
	}
}

@media (max-width: 991.98px) {
	.sidebar {
		transform: translateX(-100%);
		box-shadow: var(--sm-shadow-lg);
	}

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

	body.sidebar-open .sidebar-backdrop {
		position: fixed;
		inset: 0;
		z-index: 1035;
		display: block;
		background: rgba(15, 23, 42, .35);
	}

	.topbar,
	.main {
		margin-left: 0;
	}

	.topbar {
		height: 64px;
		padding: 0 16px;
	}

	.topbar .topbar-toggle {
		display: inline-flex;
	}

	.topbar-search,
	.topbar-breadcrumb {
		display: none;
	}

	.main {
		padding: 20px 16px 96px;
	}

	.card-sticky {
		position: static;
	}

	.card-sticky.card-sticky-scroll {
		max-height: none;
		overflow: visible;
	}
}

@media (max-width: 767.98px) {
	.card > .card-body,
	.cardx > .card-body,
	.card-x > .card-body {
		padding: 16px;
	}

	.card-header {
		padding: 14px 16px;
	}

	.kpi-value {
		font-size: 1.5rem;
	}

	.filter-input {
		float: none;
		width: 100%;
		margin: 0 0 8px;
	}

	.mobile-full {
		width: 100% !important;
		margin: 0 0 16px;
	}

	.sticky-btn,
	.btn-pdf {
		right: 16px;
		bottom: 16px;
		left: 16px;
	}

	.topbar-user-name,
	.env-badge {
		display: none;
	}
}

@media print {
	.sidebar,
	.topbar,
	.sticky-btn,
	.btn-pdf {
		display: none !important;
	}

	.main {
		margin: 0;
		padding: 0;
	}

	.card {
		border: 1px solid #ddd;
		box-shadow: none;
	}
}

/* ------------------------------------------------------------------
 * Calendar resurse (page/lucrari/calendar.php)
 * Day view = columns per craftsman / time rows, week view = craftsmen x days,
 * month view = day grid. Scrolls inside the card on small screens.
 * ------------------------------------------------------------------ */
.cal-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 16px;
	margin-bottom: 12px;
}

.cal-toolbar .tabs-pills {
	margin-bottom: 0;
}

.cal-period {
	color: var(--sm-text);
	font-size: .9375rem;
}

.cal-filters .form-check {
	margin: 0 4px;
}

.cal-legend {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 14px;
	margin-bottom: 12px;
	color: var(--sm-muted);
	font-size: .8125rem;
}

.cal-legend-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.cal-swatch {
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 1px solid var(--sm-border-strong);
	border-radius: 4px;
	vertical-align: middle;
}

.cal-off {
	background: var(--sm-surface-2);
}

.cal-unav {
	background: repeating-linear-gradient(45deg, var(--sm-surface-3) 0, var(--sm-surface-3) 6px, var(--sm-border-strong) 6px, var(--sm-border-strong) 8px);
}

.cal-card {
	max-width: 100%;
	overflow: hidden;
}

.cal-scroll {
	max-width: 100%;
	overflow: auto;
	-webkit-overflow-scrolling: touch;
}

.cal-scroll-day {
	max-height: max(420px, calc(100vh - 230px));
}

.cal-dot {
	display: inline-block;
	flex: 0 0 auto;
	width: 9px;
	height: 9px;
	margin-right: 4px;
	border-radius: 50%;
}

.cal-worker-name {
	display: flex;
	align-items: center;
	overflow: hidden;
	color: var(--sm-text);
	font-weight: 600;
	font-size: .8125rem;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cal-worker-meta {
	display: block;
	color: var(--sm-muted);
	font-size: .6875rem;
	font-weight: 400;
}

/* Chips (status colour from .badge-*). */
.cal-chip {
	display: flex;
	flex-direction: column;
	gap: 1px;
	margin-bottom: 4px;
	padding: 5px 7px;
	border-left: 3px solid var(--sm-subtle);
	border-radius: var(--sm-radius-sm);
	font-size: .75rem;
	font-weight: 500;
	line-height: 1.25;
	text-align: left;
	white-space: normal;
	text-decoration: none;
	text-transform: none;
	overflow: hidden;
}

.cal-chip:hover {
	box-shadow: var(--sm-shadow-md);
	filter: brightness(.97);
}

.cal-chip.badge-info { border-left-color: var(--sm-blue); }
.cal-chip.badge-warning { border-left-color: var(--sm-amber); }
.cal-chip.badge-success { border-left-color: var(--sm-green); }

.cal-st-anulata .cal-chip-title {
	text-decoration: line-through;
}

.cal-chip-time {
	font-weight: 700;
	white-space: nowrap;
}

.cal-chip-title,
.cal-chip-sub {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cal-chip-sub {
	opacity: .8;
	font-size: .6875rem;
}

/* Day view. */
.cal-day {
	position: relative;
	display: grid;
	grid-template-columns: 60px repeat(var(--cal-cols), minmax(170px, 1fr));
	min-width: calc(60px + var(--cal-cols) * 170px);
}

.cal-day-corner,
.cal-day-head {
	position: sticky;
	top: 0;
	z-index: 3;
	min-height: 58px;
	padding: 8px 10px;
	border-bottom: 1px solid var(--sm-border);
	background: var(--sm-surface);
}

.cal-day-corner {
	left: 0;
	z-index: 4;
}

.cal-day-head {
	position: sticky;
	padding-right: 34px;
	border-left: 1px solid var(--sm-border);
}

.cal-day-head .cal-add {
	position: absolute;
	top: 10px;
	right: 4px;
}

.cal-times {
	position: sticky;
	left: 0;
	z-index: 2;
	background: var(--sm-surface);
}

.cal-time {
	height: var(--cal-slot-h);
	padding: 0 8px;
	color: var(--sm-muted);
	padding-top: 2px;
	font-size: .6875rem;
	text-align: right;
}

.cal-col {
	position: relative;
	height: calc(var(--cal-slot-h) * var(--cal-rows));
	border-left: 1px solid var(--sm-border);
	background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--cal-slot-h) - 1px), var(--sm-surface-3) calc(var(--cal-slot-h) - 1px), var(--sm-surface-3) var(--cal-slot-h));
}

.cal-block {
	position: absolute;
	right: 0;
	left: 0;
}

.cal-block-full {
	top: 0;
	bottom: 0;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding-top: 16px;
	color: var(--sm-muted);
	font-size: .75rem;
	font-weight: 600;
}

.cal-block-full > span {
	padding: 2px 8px;
	border-radius: 999px;
	background: var(--sm-surface);
}

.cal-chip-abs {
	position: absolute;
	z-index: 1;
	margin: 0;
}

.cal-now {
	position: absolute;
	right: 0;
	left: 60px;
	z-index: 2;
	height: 2px;
	background: var(--sm-red);
	pointer-events: none;
}

/* Week view. */
.cal-week {
	width: 100%;
	min-width: 980px;
	border-collapse: separate;
	border-spacing: 0;
	table-layout: fixed;
}

.cal-week th,
.cal-week td {
	padding: 6px;
	border-right: 1px solid var(--sm-border);
	border-bottom: 1px solid var(--sm-border);
	vertical-align: top;
}

.cal-week thead th {
	position: sticky;
	top: 0;
	z-index: 2;
	background: var(--sm-surface);
	color: var(--sm-text-2);
	font-size: .75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .02em;
}

.cal-week thead th a {
	color: inherit;
	text-decoration: none;
}

.cal-week-date {
	display: block;
	color: var(--sm-text);
	font-size: .9375rem;
	text-transform: none;
}

.cal-week .cal-week-worker {
	position: sticky;
	left: 0;
	z-index: 1;
	width: 160px;
	background: var(--sm-surface);
	text-align: left;
}

.cal-week thead .cal-week-worker {
	z-index: 3;
}

.cal-week td {
	position: relative;
	height: 72px;
	padding-bottom: 26px;
}

.cal-week .is-today {
	box-shadow: inset 0 2px 0 var(--sm-ink);
}

.cal-cell-note {
	display: block;
	margin-bottom: 4px;
	color: var(--sm-muted);
	font-size: .6875rem;
	font-weight: 600;
}

.cal-cell-add {
	position: absolute;
	right: 4px;
	bottom: 4px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border: 1px solid var(--sm-border);
	border-radius: 6px;
	background: var(--sm-surface);
	color: var(--sm-text-2);
	opacity: .7;
}

.cal-week td:hover .cal-cell-add,
.cal-month-cell:hover .cal-cell-add,
.cal-cell-add:hover,
.cal-cell-add:focus {
	background: var(--sm-surface-3);
	color: var(--sm-text);
	opacity: 1;
}

/* Month view: the day link fills the cell; the "+" (add a job) sits in its corner. */
.cal-month-cell {
	position: relative;
	display: flex;
}

.cal-month-cell > .cal-month-day {
	flex: 1;
}

/* Month view. */
.cal-month {
	display: grid;
	grid-template-columns: repeat(7, minmax(120px, 1fr));
	min-width: 840px;
}

.cal-month-head {
	padding: 8px 10px;
	border-bottom: 1px solid var(--sm-border);
	color: var(--sm-text-2);
	font-size: .75rem;
	font-weight: 600;
	text-transform: uppercase;
}

.cal-month-day {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-height: 118px;
	padding: 8px 10px;
	border-right: 1px solid var(--sm-border);
	border-bottom: 1px solid var(--sm-border);
	color: var(--sm-text-2);
	font-size: .75rem;
	text-decoration: none;
}

.cal-month-day:hover {
	background: var(--sm-surface-2);
	color: var(--sm-text);
}

.cal-month-day.is-out {
	background: var(--sm-surface-2);
	color: var(--sm-subtle);
}

.cal-month-day.is-today {
	box-shadow: inset 0 0 0 2px var(--sm-ink);
}

.cal-month-num {
	display: flex;
	align-items: center;
	justify-content: space-between;
	color: var(--sm-text);
	font-size: .875rem;
	font-weight: 600;
}

.cal-month-count {
	min-width: 22px;
	padding: 1px 7px;
	border-radius: 999px;
	background: var(--sm-ink);
	color: #fff;
	font-size: .6875rem;
	text-align: center;
}

.cal-month-st {
	display: flex;
	flex-wrap: wrap;
	gap: 3px;
}

.cal-month-job,
.cal-month-more,
.cal-month-unav {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cal-month-more,
.cal-month-unav {
	color: var(--sm-muted);
	font-size: .6875rem;
}

@media (max-width: 767.98px) {
	.cal-filters .form-control,
	.cal-filters .form-select,
	.cal-filters .input-icon {
		flex: 1 1 140px;
		min-width: 0;
	}
}

/* ------------------------------------------------------------------
 * Programare intervenție (page/lucrari/programare.php, js/programare.js)
 * ------------------------------------------------------------------ */
.sched-steps a.is-done:not(.active) .tab-count {
	background: var(--sm-green-soft);
	color: var(--sm-green-text);
}

.sched-step {
	margin-bottom: 24px;
	scroll-margin-top: calc(var(--sm-topbar-h) + 16px);
}

.sched-title {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 16px;
	color: var(--sm-muted);
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.sched-num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 999px;
	background: var(--sm-ink);
	color: #fff;
	font-size: .6875rem;
	letter-spacing: 0;
}

.sched-label {
	margin: 12px 0 8px;
	color: var(--sm-muted);
	font-size: .75rem;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
}

.sched-search {
	position: relative;
}

.sched-results {
	position: absolute;
	z-index: 1050;
	right: 0;
	left: 0;
	max-height: 320px;
	margin-top: 4px;
	overflow-y: auto;
	border: 1px solid var(--sm-border);
	border-radius: var(--sm-radius);
	background: var(--sm-surface);
	box-shadow: var(--sm-shadow-lg);
}

.col-md-8 > .sched-results {
	right: calc(var(--bs-gutter-x) * .5);
	left: calc(var(--bs-gutter-x) * .5);
}

.sched-result {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 8px;
	width: 100%;
	padding: 10px 14px;
	border: 0;
	border-bottom: 1px solid var(--sm-border);
	background: transparent;
	color: var(--sm-text);
	text-align: left;
}

.sched-result:last-child {
	border-bottom: 0;
}

.sched-result:hover,
.sched-result:focus {
	background: var(--sm-surface-2);
	outline: none;
}

.sched-result span {
	color: var(--sm-muted);
	font-size: .8125rem;
}

.sched-result .badge {
	color: var(--sm-red-text);
}

.sched-result-empty {
	padding: 12px 14px;
	color: var(--sm-muted);
	font-size: .875rem;
}

.sched-client {
	margin-bottom: 16px;
	padding: 16px;
	border: 1px solid var(--sm-border);
	border-radius: var(--sm-radius);
	background: var(--sm-surface-2);
}

.sched-client-head {
	display: flex;
	justify-content: space-between;
	gap: 12px;
}

.sched-client-name {
	font-weight: 600;
	font-size: 1rem;
}

.sched-client-meta {
	color: var(--sm-muted);
	font-size: .8125rem;
}

.sched-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 10px;
}

.sched-chips .badge {
	text-transform: none;
}

.sched-addresses {
	display: grid;
	gap: 6px;
	margin-bottom: 8px;
}

.sched-address {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0;
	padding: 10px 12px;
	border: 1px solid var(--sm-border);
	border-radius: var(--sm-radius-sm);
	background: var(--sm-surface);
	cursor: pointer;
}

.sched-address:has(input:checked) {
	border-color: var(--sm-ink);
}

.sched-address .form-check-input {
	margin-top: 3px;
}

.sched-address-body {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 2px 8px;
}

.sched-address-body > span {
	color: var(--sm-muted);
	font-size: .8125rem;
}

.sched-geo-status {
	min-height: 1.25rem;
	color: var(--sm-muted);
	font-size: .8125rem;
}

.sched-geo-status.is-ok { color: var(--sm-green-text); }
.sched-geo-status.is-warn { color: var(--sm-amber-text); }

.sched-checks {
	padding-top: 6px;
}

.sched-suggestions {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 10px;
}

.sched-empty,
.sched-hint {
	grid-column: 1 / -1;
	margin: 0;
	color: var(--sm-muted);
	font-size: .875rem;
}

.sched-hint {
	color: var(--sm-amber-text);
}

.sched-option {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 12px 14px;
	border: 1px solid var(--sm-border);
	border-radius: var(--sm-radius);
	background: var(--sm-surface);
	color: var(--sm-text);
	text-align: left;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.sched-option:hover {
	border-color: var(--sm-border-strong);
	box-shadow: var(--sm-shadow-md);
}

.sched-option.is-selected {
	border-color: var(--sm-ink);
	box-shadow: 0 0 0 1px var(--sm-ink);
}

.sched-option-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

.sched-option-when {
	font-weight: 600;
	font-size: .875rem;
}

.sched-option-km {
	color: var(--sm-blue-text);
	font-size: .8125rem;
}

.sched-option-reasons {
	color: var(--sm-muted);
	font-size: .75rem;
}

.sched-side {
	position: sticky;
	top: calc(var(--sm-topbar-h) + 16px);
	display: grid;
	gap: 24px;
}

.sched-map {
	height: 360px;
	border: 1px solid var(--sm-border);
	border-radius: var(--sm-radius);
	background: var(--sm-surface-3);
	overflow: hidden;
}

.sched-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
	margin: 12px 0 0;
	padding: 0;
	color: var(--sm-muted);
	font-size: .75rem;
	list-style: none;
}

.sched-legend li {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.sched-marker {
	border: 0;
	background: transparent;
}

.sched-pin {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border: 2px solid #fff;
	border-radius: 999px;
	box-shadow: var(--sm-shadow-md);
	color: #fff;
	font-size: .6875rem;
	font-weight: 700;
	line-height: 1;
}

.sched-marker .sched-pin {
	width: 26px;
	height: 26px;
}

.sched-pin-client { background: var(--sm-ink); }
.sched-pin-job { background: var(--sm-blue); }
.sched-pin-job.is-urgent { background: var(--sm-red); }
.sched-pin-base { background: var(--sm-amber); border-radius: var(--sm-radius-sm); }

.sched-line {
	display: inline-block;
	width: 22px;
	border-top: 3px dashed var(--sm-ink);
}

.leaflet-interactive.sched-route {
	stroke: var(--sm-ink);
	stroke-opacity: .7;
}

.sched-popup {
	font-size: .8125rem;
}

.sched-daylist {
	display: grid;
	gap: 6px;
	margin: 12px 0 0;
	padding: 0;
	list-style: none;
	font-size: .8125rem;
}

.sched-daylist li {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 8px;
}

.sched-daylist a {
	font-weight: 600;
}

.sched-daylist-text {
	color: var(--sm-muted);
}

.sched-missing {
	min-height: 1.25rem;
	margin-bottom: 8px;
	color: var(--sm-amber-text);
	font-size: .8125rem;
}

@media (max-width: 1199.98px) {
	.sched-side {
		position: static;
	}
}

/* ------------------------------------------------------------------
 * Fisa lucrare (page/lucrari/view.php, js/lucrare.js)
 * ------------------------------------------------------------------ */
.job-pre {
	white-space: pre-line;
}

.job-steps {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 0;
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: none;
}

.job-step {
	position: relative;
	display: flex;
	flex: 1 1 0;
	flex-direction: column;
	align-items: center;
	min-width: 84px;
	gap: 6px;
	color: var(--sm-subtle);
	font-size: .75rem;
	font-weight: 500;
	text-align: center;
}

.job-step::before {
	content: "";
	position: absolute;
	top: 15px;
	right: 50%;
	left: -50%;
	height: 2px;
	background: var(--sm-border);
}

.job-step:first-child::before {
	display: none;
}

.job-step-dot {
	position: relative;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: 1px solid var(--sm-border-strong);
	border-radius: 50%;
	background: var(--sm-surface);
	font-size: .875rem;
}

.job-step.is-done {
	color: var(--sm-text-2);
}

.job-step.is-done::before,
.job-step.is-skipped::before,
.job-step.is-current::before {
	background: var(--sm-ink);
}

.job-step.is-skipped .job-step-dot {
	border-style: dashed;
}

.job-step.is-done .job-step-dot {
	border-color: var(--sm-green-soft);
	background: var(--sm-green-soft);
	color: var(--sm-green-text);
}

.job-step.is-current {
	color: var(--sm-text);
	font-weight: 700;
}

.job-step.is-current .job-step-dot {
	border-color: var(--sm-ink);
	background: var(--sm-ink);
	color: var(--sm-surface);
}

.job-steps.is-cancelled .job-step {
	opacity: .55;
}

.job-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-top: 20px;
	padding-top: 16px;
	border-top: 1px solid var(--sm-border);
}

.job-values th[scope="row"] {
	font-weight: 500;
	color: var(--sm-text-2);
}

.job-values thead .cell-sub {
	font-weight: 400;
	text-transform: none;
}

.job-values-total th,
.job-values-total td {
	font-weight: 700;
}

.job-diff {
	background: var(--sm-amber-soft);
	color: var(--sm-amber-text);
}

strong.job-diff {
	padding: 0 6px;
	border-radius: 6px;
}

.job-signature img {
	max-width: 100%;
	max-height: 160px;
	padding: 8px;
	border: 1px solid var(--sm-border);
	border-radius: var(--sm-radius-sm);
	background: var(--sm-surface);
}

.job-photos {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
	gap: 8px;
}

.job-photo img {
	width: 100%;
	height: 120px;
	border: 1px solid var(--sm-border);
	border-radius: var(--sm-radius-sm);
	object-fit: cover;
	background: var(--sm-surface-3);
}

.job-timeline {
	margin: 0;
	padding: 0;
	list-style: none;
}

.job-event {
	position: relative;
	display: flex;
	gap: 12px;
	padding-bottom: 16px;
}

.job-event:not(:last-child)::before {
	content: "";
	position: absolute;
	top: 30px;
	bottom: 2px;
	left: 13px;
	width: 2px;
	background: var(--sm-border);
}

.job-event-icon {
	display: inline-flex;
	flex: 0 0 28px;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--sm-surface-3);
	color: var(--sm-text-2);
	font-size: .8125rem;
}

.job-event-status .job-event-icon { background: var(--sm-blue-soft); color: var(--sm-blue-text); }
.job-event-warranty .job-event-icon { background: var(--sm-violet-soft); color: var(--sm-violet-text); }
.job-event-reopen .job-event-icon { background: var(--sm-amber-soft); color: var(--sm-amber-text); }
.job-event-settlement .job-event-icon { background: var(--sm-green-soft); color: var(--sm-green-text); }

.job-event-body {
	min-width: 0;
	padding-top: 4px;
}

.job-event-message {
	color: var(--sm-text);
	font-weight: 500;
	overflow-wrap: anywhere;
}

.job-event-change {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin: 2px 0;
	font-size: .8125rem;
	overflow-wrap: anywhere;
}

.job-event-old {
	color: var(--sm-muted);
	text-decoration: line-through;
}

.job-event-new {
	color: var(--sm-text);
	font-weight: 600;
}

@media (max-width: 767.98px) {
	.job-step {
		flex: 0 0 25%;
	}

	.job-step::before {
		display: none;
	}
}

/* ------------------------------------------------------------------
 * Registru financiar (page/financiar/*, liste încasări / plăți)
 * ------------------------------------------------------------------ */
.fin-amount-in {
	color: var(--sm-green-text);
}

.fin-amount-out {
	color: var(--sm-red-text);
}

.fin-details {
	max-width: 320px;
	color: var(--sm-text-2);
}

.fin-link {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	margin-right: 6px;
	color: var(--sm-text-2);
	font-size: .8125rem;
	font-weight: 600;
	text-decoration: none;
}

.fin-link:hover {
	color: var(--sm-blue);
}

.fin-balances {
	display: grid;
	gap: 4px;
	margin: 6px 0 4px;
	padding: 0;
	list-style: none;
}

.fin-balances li {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 2px 8px;
	font-size: .875rem;
}

.fin-balances li > span:first-child {
	min-width: 70px;
	color: var(--sm-muted);
}

.fin-balances strong {
	font-size: 1.0625rem;
}

.fin-balance-sub {
	color: var(--sm-subtle);
	font-size: .75rem;
}

.fin-filters .datepicker {
	min-width: 0;
	width: 120px;
}

/* ==========================================================================
   Decontari (page/decontari/*): settlements with the craftsmen
   ========================================================================== */

.dec-amount {
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

/* Direction of a balance: the platform pays (> 0) / collects (< 0). */
.dec-pay { color: var(--sm-red-text); }
.dec-collect { color: var(--sm-green-text); }
.dec-zero { color: var(--sm-muted); }

.dec-date {
	max-width: 150px;
}

.dec-worker-select {
	min-width: 260px;
}

.dec-lines .dec-check {
	width: 36px;
}

.dec-lines tr.dec-cancelled td {
	background: var(--sm-surface-2);
}

.dec-lines tr.dec-cancelled a.fw-semibold {
	color: var(--sm-muted);
	text-decoration: line-through;
}

.dec-note {
	display: block;
	max-width: 420px;
	color: var(--sm-red-text);
	white-space: normal;
}

.dec-warn {
	margin-right: 4px;
	color: var(--sm-amber);
}

.dec-adjustments {
	display: grid;
	gap: 8px;
}

.dec-preview {
	border-color: var(--sm-ink);
}

.dec-preview.is-stale {
	border-color: var(--sm-border);
	opacity: .7;
}

/* ==========================================================================
   Setari FGO (page/setari/firme.php, page/setari/fgo-jurnal.php):
   FGO configuration per company, cron status and the FGO call log
   ========================================================================== */

.fgo-section {
	margin-top: 24px;
	scroll-margin-top: calc(var(--sm-topbar-h) + 16px);
}

.fgo-company-list {
	margin: 0 0 16px;
	padding: 0;
	list-style: none;
}

.fgo-company-list li {
	padding: 9px 0;
	border-bottom: 1px solid var(--sm-border);
}

.fgo-company-list li:last-child {
	border-bottom: 0;
}

.fgo-company-line {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.fgo-company-line a {
	color: var(--sm-text);
	text-decoration: none;
}

.fgo-checklist {
	display: grid;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: .875rem;
}

.fgo-checklist li {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--sm-text-2);
}

.fgo-checklist .is-ok i { color: var(--sm-green); }
.fgo-checklist .is-missing i { color: var(--sm-red); }
.fgo-checklist .is-missing span { color: var(--sm-text); font-weight: 500; }

.fgo-test-message {
	overflow-wrap: anywhere;
}

.fgo-last-doc {
	margin-top: 16px;
	padding: 12px 14px;
	background: var(--sm-surface-2);
	border: 1px solid var(--sm-border);
	border-radius: var(--sm-radius);
}

.fgo-code {
	display: block;
	padding: 8px 10px;
	background: var(--sm-surface-3);
	border-radius: var(--sm-radius-sm);
	color: var(--sm-text);
	font-size: .8125rem;
	overflow-wrap: anywhere;
}

/* Log */
.fgo-method {
	font-family: var(--bs-font-monospace);
	text-transform: none;
}

.fgo-path {
	color: var(--sm-text-2);
	font-size: .8125rem;
	overflow-wrap: anywhere;
}

.fgo-message {
	min-width: 220px;
	max-width: 420px;
	white-space: normal;
}

.fgo-iid {
	color: var(--sm-text-2);
}

.fgo-ok { color: var(--sm-green); margin-left: 4px; }
.fgo-fail { color: var(--sm-red); margin-left: 4px; }

.fgo-date {
	max-width: 170px;
}

.fgo-interaction {
	display: flex;
	align-items: center;
	gap: 6px;
}

.fgo-interaction code {
	overflow-wrap: anywhere;
}

.fgo-body summary {
	font-weight: 600;
	color: var(--sm-text);
	cursor: pointer;
}

.fgo-json {
	max-height: 520px;
	margin: 12px 0 0;
	padding: 14px;
	overflow: auto;
	background: var(--sm-surface-2);
	border: 1px solid var(--sm-border);
	border-radius: var(--sm-radius);
	color: var(--sm-text);
	font-size: .8125rem;
	white-space: pre;
}

/* ==========================================================================
   Facturi (page/facturi/*, card "Facturare" in page/lucrari/view.php): FGO documents
   ========================================================================== */

.inv-lines .inv-col-unit { width: 90px; }
.inv-lines .inv-col-qty { width: 120px; }
.inv-lines .inv-col-total { width: 150px; }

.inv-lines .form-control {
	min-width: 70px;
}

.inv-totals .inv-grand,
.table tr.inv-grand th,
.table tr.inv-grand td {
	font-weight: 600;
	color: var(--sm-text);
}

.inv-totals .inv-grand strong {
	font-size: 1.15rem;
}

.inv-warnings .alert {
	margin-bottom: 10px;
	padding: 8px 12px;
	font-size: .875rem;
}

.inv-toggle .btn-check:checked + .btn {
	background: var(--sm-ink);
	border-color: var(--sm-ink);
	color: var(--sm-surface);
}

.inv-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.inv-actions form {
	display: inline-block;
	margin: 0;
}

.inv-date {
	max-width: 160px;
}

.inv-test-badge {
	letter-spacing: .04em;
}

.table tr.inv-row-void td {
	color: var(--sm-muted);
}

.job-docs {
	margin: 0;
	padding: 0;
	list-style: none;
}

.job-doc {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 6px;
	padding: 8px 0;
	border-bottom: 1px solid var(--sm-border);
}

.job-doc:last-child {
	border-bottom: 0;
}

.job-doc-main .cell-sub {
	display: block;
	color: var(--sm-muted);
	font-size: .8125rem;
}

.job-doc-meta {
	display: flex;
	align-items: center;
	gap: 4px;
}

/* ------------------------------------------------------------------
 * Mentenanta vizite (page/mentenanta/vizite.php, vizita.php, checklist.php)
 * ------------------------------------------------------------------ */
.mv-period-form {
	display: inline-flex;
	gap: 8px;
	margin: 0;
}

.mv-period-form .form-select {
	min-width: 170px;
}

.mv-questions,
.mv-pv-answers {
	margin: 0;
	padding-left: 1.25rem;
}

.mv-question {
	padding: 14px 14px 14px 10px;
	margin-bottom: 10px;
	border: 1px solid var(--sm-border);
	border-radius: var(--sm-radius);
	background: var(--sm-surface);
	transition: border-color .15s ease, background-color .15s ease;
}

.mv-question::marker {
	font-weight: 600;
	color: var(--sm-muted);
}

.mv-question-text {
	margin-bottom: 8px;
	font-weight: 500;
	color: var(--sm-text);
}

.mv-question.is-problem {
	border-color: var(--sm-amber);
	background: var(--sm-amber-soft);
}

.mv-question.is-invalid {
	border-color: var(--sm-red);
}

.mv-answer-options {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin-bottom: 8px;
}

.mv-answer-options .btn {
	min-width: 64px;
}

.mv-answer-options .btn-check:checked + .btn {
	background: var(--sm-ink);
	border-color: var(--sm-ink);
	color: var(--sm-surface);
}

.mv-answer-options .btn-check:checked + .btn.mv-option-problem {
	background: var(--sm-amber);
	border-color: var(--sm-amber);
	color: var(--sm-text);
}

.mv-answer-input {
	max-width: 320px;
	margin-bottom: 8px;
}

.mv-note-label {
	margin-bottom: 4px;
	font-size: .8125rem;
	color: var(--sm-muted);
}

.mv-note-required {
	color: var(--sm-amber-text);
	font-weight: 600;
}

.mv-signature {
	position: relative;
}

.mv-signature-canvas {
	display: block;
	width: 100%;
	height: 170px;
	border: 1px dashed var(--sm-border-strong);
	border-radius: var(--sm-radius);
	background: var(--sm-surface);
	cursor: crosshair;
	touch-action: none;
}

.mv-signature-clear {
	position: absolute;
	top: 8px;
	right: 8px;
}

.mv-signature-img {
	display: block;
	max-width: 260px;
	max-height: 130px;
	margin-top: 6px;
	border: 1px solid var(--sm-border);
	border-radius: var(--sm-radius-sm);
	background: var(--sm-surface);
}

.mv-pv-answers li {
	display: list-item;
	padding: 10px 0;
	border-bottom: 1px solid var(--sm-border);
}

.mv-pv-answers li::marker {
	font-weight: 600;
	color: var(--sm-muted);
}

.mv-pv-answers li.is-problem .mv-pv-answer-main > div:first-child {
	color: var(--sm-red-text);
	font-weight: 500;
}

.mv-pv-answer-action {
	margin-top: 8px;
}

.mv-pv-answer-action form,
.mv-pv-block form,
.mv-actions form {
	display: inline-block;
	margin: 0;
}

.mv-pv-block {
	padding-top: 14px;
	margin-top: 14px;
	border-top: 1px solid var(--sm-border);
}

.mv-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.mv-editor textarea {
	min-width: 140px;
}

.mv-editor .form-select {
	min-width: 84px;
}

.mv-editor .btn-icon {
	width: 30px;
	height: 30px;
}

.mv-row-pos {
	width: 32px;
	font-weight: 600;
}

/* ==========================================================================
   Mentenanta contracte (page/mentenanta/contracte.php, contract.php, facturare.php,
   card "Mentenanță" in page/clienti/view.php)
   ========================================================================== */

.mnt-kpi-of {
	font-size: .95rem;
	font-weight: 500;
	color: var(--sm-muted);
}

.table tr.mnt-row-off td {
	color: var(--sm-muted);
}

.mnt-client-results {
	max-height: 320px;
	overflow-y: auto;
}

.mnt-client-results:empty {
	display: none;
}

.mnt-address {
	padding: 8px 0 8px 1.75em;
	border-bottom: 1px solid var(--sm-border);
}

.mnt-address:last-of-type {
	border-bottom: 0;
}

.mnt-detail {
	max-width: 320px;
}

.mnt-email {
	max-width: 220px;
	vertical-align: bottom;
}

.mnt-col-check {
	width: 44px;
}

.mnt-results {
	margin: 0;
	padding: 0;
	list-style: none;
}

.mnt-results li {
	padding: 8px 0 8px 12px;
	border-bottom: 1px solid var(--sm-border);
	border-left: 3px solid var(--sm-green);
}

.mnt-results li.mnt-result-err {
	border-left-color: var(--sm-red);
	background: var(--sm-red-soft);
}

.mnt-results li:last-child {
	border-bottom: 0;
}

/* ==========================================================================
   Comisioane (page/comisioane/*, page/reports/comisioane.php): registrul și
   raportul comisioanelor de vânzări
   ========================================================================== */

.com-filters .datepicker {
	min-width: 0;
	width: 120px;
}

.com-filters .form-check {
	display: flex;
	align-items: center;
	gap: 6px;
	padding-left: 0;
}

.com-filters .form-check .form-check-input {
	margin: 0;
}

.com-bulk-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	border-bottom: 1px solid var(--sm-border);
	background: var(--sm-surface-2);
}

.com-bulk-info {
	margin-right: auto;
	font-size: .875rem;
	color: var(--sm-muted);
}

.com-bulk-info strong {
	color: var(--sm-text);
}

.com-col-check {
	width: 44px;
}

.table tr.com-row-off td {
	color: var(--sm-muted);
}

.com-notes {
	max-width: 240px;
	font-size: .85rem;
	color: var(--sm-text-2);
}

.com-matrix th[scope="row"],
.com-split th[scope="row"] {
	font-weight: 600;
	white-space: nowrap;
}

.com-matrix tfoot th,
.com-matrix tfoot td,
.com-split tfoot th,
.com-split tfoot td {
	border-top: 2px solid var(--sm-border-strong);
	background: var(--sm-surface-2);
}

.com-zero {
	color: var(--sm-subtle);
}

.com-split .com-group {
	border-bottom: 1px solid var(--sm-border);
}

.com-split .com-sub {
	font-size: .75rem;
	font-weight: 500;
	color: var(--sm-muted);
	white-space: nowrap;
}

/* ==========================================================================
   Vanzari (Etapa 7): Lucrarile mele, rezultatul contactului, eticheta "Legat"
   ========================================================================== */

.sales-rule {
	margin: 0 0 16px;
	color: var(--sm-muted);
	font-size: .875rem;
}

.sales-rule strong {
	color: var(--sm-text);
}

.sales-commission-badges {
	display: flex;
	gap: 4px;
	justify-content: flex-end;
	margin-top: 4px;
}

.sales-cell-detail {
	max-width: 320px;
}

.sales-linked-badge {
	text-decoration: none;
	margin-left: 4px;
}

.sales-link-list li > span:last-child,
.sales-link-list li > a {
	text-align: right;
}

.sales-link-list .badge {
	margin-left: 4px;
}

.sales-link-results {
	margin-top: 12px;
	border: 1px solid var(--sm-border);
	border-radius: var(--sm-radius-sm);
	overflow: hidden;
}

.sales-link-results > .small {
	padding: 8px 12px 0;
}

.sales-link-result {
	display: flex;
	gap: 8px;
	justify-content: space-between;
	align-items: center;
	padding: 8px 12px;
	border-top: 1px solid var(--sm-border);
	color: var(--sm-text);
	text-decoration: none;
	font-size: .875rem;
}

.sales-link-results > .small + .sales-link-result {
	border-top: 0;
}

.sales-link-result:hover {
	background: var(--sm-surface-2);
	color: var(--sm-text);
}

.sales-link-client {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 10px 12px;
	background: var(--sm-surface-2);
	border: 1px solid var(--sm-border);
	border-radius: var(--sm-radius-sm);
}

.sales-link-list + .sales-link-search,
.sales-link-list + form {
	margin-top: 16px;
}

/* ------------------------------------------------------------------
 * Searchable craftsman dropdown (.sm-select-wrap)
 * ------------------------------------------------------------------ */
.sm-select-wrap {
	position: relative;
	display: block;
	width: 100%;
}

.filter-bar .sm-select-wrap {
	width: auto;
	min-width: 210px;
}

.sm-select-native {
	position: absolute !important;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	opacity: 0 !important;
	pointer-events: none !important;
	z-index: -1;
}

.sm-select-trigger {
	width: 100%;
	text-align: left;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	cursor: pointer;
	background-color: var(--sm-surface);
}

.sm-select-trigger.is-placeholder {
	color: var(--sm-muted);
}

.sm-select-trigger:disabled {
	background-color: var(--sm-surface-2);
	cursor: not-allowed;
	opacity: .75;
}

.sm-select-menu {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	min-width: 240px;
	z-index: 1075;
	background: var(--sm-surface);
	border: 1px solid var(--sm-border-strong, var(--sm-border));
	border-radius: var(--sm-radius);
	box-shadow: var(--sm-shadow-lg);
	overflow: hidden;
}

.sm-select-search-wrap {
	position: relative;
	padding: 8px;
	border-bottom: 1px solid var(--sm-border);
	background: var(--sm-surface-2);
}

.sm-select-search-wrap .bi-search {
	position: absolute;
	left: 18px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--sm-muted);
	font-size: .8125rem;
	pointer-events: none;
}

.sm-select-search {
	padding-left: 28px !important;
	font-size: .875rem;
}

.sm-select-list {
	max-height: 260px;
	overflow-y: auto;
	padding: 4px;
}

.sm-select-group {
	padding: 6px 10px 3px;
	font-size: .72rem;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--sm-muted);
}

.sm-select-option {
	display: block;
	width: 100%;
	padding: 7px 10px;
	border: 0;
	border-radius: var(--sm-radius-sm);
	background: transparent;
	color: var(--sm-text);
	font-size: .875rem;
	text-align: left;
	cursor: pointer;
	transition: background-color .1s ease, color .1s ease;
}

.sm-select-option:hover,
.sm-select-option.is-active {
	background: var(--sm-surface-2);
	color: var(--sm-ink);
}

.sm-select-option.is-selected {
	background: var(--sm-ink);
	color: #fff;
	font-weight: 600;
}

.sm-select-empty {
	padding: 12px 10px;
	font-size: .84rem;
	color: var(--sm-muted);
	text-align: center;
}

.form-control.sm-no-autofill-lock {
	background-color: var(--sm-surface) !important;
	cursor: text !important;
}

.clienti-map {
	height: 260px;
	border-radius: var(--sm-radius);
	border: 1px solid var(--sm-border);
}

/* ==========================================================================
 * Rapoarte meseriasi (Etapa 8): caseta „Cum se calculează”, hărți traseu,
 * insigne de punctualitate (page/reports/venituri, meseriasi, colaboratori,
 * materiale, instalatori-plati, locatie).
 * ========================================================================== */
.rpm-calc {
	margin: 0 0 16px;
	border: 1px solid var(--sm-border);
	border-radius: var(--sm-radius);
	background: var(--sm-surface);
	box-shadow: var(--sm-shadow);
}

.rpm-calc > summary {
	padding: 10px 14px;
	font-size: .875rem;
	font-weight: 600;
	color: var(--sm-text-2);
	cursor: pointer;
	list-style: none;
}

.rpm-calc > summary::-webkit-details-marker {
	display: none;
}

.rpm-calc > summary .bi {
	margin-right: 6px;
	color: var(--sm-muted);
}

.rpm-calc[open] > summary {
	border-bottom: 1px solid var(--sm-border);
}

.rpm-calc ul {
	margin: 0;
	padding: 12px 14px 12px 32px;
	font-size: .84rem;
	color: var(--sm-muted);
}

.rpm-calc li + li {
	margin-top: 4px;
}

.rpm-calc strong {
	color: var(--sm-text);
}

.rpm-chart {
	position: relative;
	height: 260px;
}

.rpm-map {
	height: 520px;
	border-radius: var(--sm-radius);
	border: 1px solid var(--sm-border);
}

.rpm-route-marker {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	border: 2px solid var(--sm-surface);
	background: var(--sm-ink);
	color: var(--sm-surface);
	font-size: .75rem;
	font-weight: 700;
	box-shadow: var(--sm-shadow-md);
}

.rpm-route-marker.is-late {
	background: var(--sm-amber);
}

.rpm-route-marker.is-missing {
	background: var(--sm-red);
}

.rpm-num-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 11px;
	background: var(--sm-surface-3);
	color: var(--sm-text);
	font-size: .75rem;
	font-weight: 700;
}

.rpm-meter {
	display: block;
	width: 64px;
	height: 6px;
	margin-top: 4px;
	border-radius: 3px;
	background: var(--sm-surface-3);
	overflow: hidden;
}

.rpm-meter > span {
	display: block;
	height: 100%;
	background: var(--sm-green);
}

.rpm-meter.is-warn > span {
	background: var(--sm-amber);
}

.rpm-meter.is-bad > span {
	background: var(--sm-red);
}

.num .rpm-meter {
	margin-left: auto;
}

/* ==========================================================================
 * Rapoarte financiare (Etapa 8): profit & pierdere, profitabilitate,
 * pâlnie de conversie, refuzuri, caseta „Cum se calculează”, analiza AI.
 * ========================================================================== */
.rep-pl th[scope="row"] {
	font-weight: 500;
	color: var(--sm-text);
}

.rep-pl-head th {
	background: var(--sm-surface-2);
	color: var(--sm-muted);
	font-size: .75rem;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
}

.rep-pl-sub th[scope="row"],
.rep-pl-sub td:first-child {
	padding-left: 1.75rem;
	font-weight: 400;
	color: var(--sm-text-2);
}

.rep-pl-info th[scope="row"],
.rep-pl-info td {
	color: var(--sm-muted);
	font-style: italic;
}

.rep-pl-total th,
.rep-pl-total td {
	font-weight: 600;
	border-top: 1px solid var(--sm-border-strong);
}

.rep-pl-profit th,
.rep-pl-profit td {
	font-weight: 700;
	font-size: 1rem;
	background: var(--sm-surface-2);
	border-top: 2px solid var(--sm-ink);
}

.rep-neg {
	color: var(--sm-red);
}

.rep-delta-up {
	color: var(--sm-green);
	font-weight: 600;
}

.rep-delta-down {
	color: var(--sm-red);
	font-weight: 600;
}

.rep-delta-flat {
	color: var(--sm-subtle);
}

.rep-toggle {
	border: 0;
	background: none;
	padding: 0;
	font: inherit;
	color: inherit;
	cursor: pointer;
}

.rep-toggle .bi {
	display: inline-block;
	transition: transform .15s ease;
}

.rep-toggle[aria-expanded="true"] .bi {
	transform: rotate(90deg);
}

.rep-excluded {
	font-size: .8125rem;
	color: var(--sm-muted);
	background: var(--sm-surface-2);
}

.rep-sort {
	color: inherit;
	text-decoration: none;
	white-space: nowrap;
}

.rep-sort:hover {
	color: var(--sm-ink);
}

.rep-kpi-text {
	font-size: 1.05rem;
	line-height: 1.3;
}

.rep-details {
	max-width: 420px;
	white-space: normal;
	color: var(--sm-text-2);
}

/* Funnel */
.rep-funnel {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 1rem;
}

.rep-funnel-label {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: .35rem;
}

.rep-funnel-track,
.rep-bar {
	display: block;
	height: 10px;
	border-radius: 999px;
	background: var(--sm-surface-3);
	overflow: hidden;
}

.rep-funnel-bar,
.rep-bar > span {
	display: block;
	height: 100%;
	border-radius: 999px;
	background: var(--sm-ink);
}

.rep-bar {
	height: 8px;
	min-width: 80px;
}

.rep-bar > span {
	background: var(--sm-amber);
}

.rep-bar-muted > span {
	background: var(--sm-subtle);
}

.rep-bar-col {
	width: 30%;
}

.rep-funnel-meta {
	margin-top: .25rem;
	font-size: .75rem;
	color: var(--sm-muted);
}

/* "Cum se calculează" */
.rep-formulas > summary {
	cursor: pointer;
	list-style: none;
}

.rep-formulas > summary::-webkit-details-marker {
	display: none;
}

.rep-formulas > summary::after {
	content: "\F282";
	font-family: "bootstrap-icons";
	margin-left: auto;
	transition: transform .15s ease;
}

.rep-formulas[open] > summary::after {
	transform: rotate(180deg);
}

.rep-formulas li {
	margin-bottom: .35rem;
	color: var(--sm-text-2);
}

/* AI */
.rep-ai-result {
	padding: 1rem 1.25rem;
	margin-bottom: 1rem;
	border: 1px solid var(--sm-border);
	border-radius: var(--sm-radius);
	background: var(--sm-surface-2);
}

.rep-ai-result .ai-h {
	font-size: .95rem;
	font-weight: 600;
	margin: .75rem 0 .35rem;
}

.rep-ai-result .ai-h:first-child {
	margin-top: 0;
}

.rep-ai-result p:last-child,
.rep-ai-result ul:last-child,
.rep-ai-result ol:last-child {
	margin-bottom: 0;
}

.rep-ai-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .75rem;
}

.rep-ai-estimate {
	padding: 1rem 1.25rem;
	border: 1px solid var(--sm-amber-soft);
	border-radius: var(--sm-radius);
	background: var(--sm-surface);
}

/* ==========================================================================
 * Rapoarte clienti (page/reports/mentenanta.php, exceptii.php, clienti.php,
 * analiza AI din page/clienti/duplicate.php, cardurile de evaluare client din fisa
 * lucrarii / utilizator / panou)
 * ========================================================================== */
.rapc-filters {
	align-items: flex-end;
}

.rapc-field {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin: 0;
	font-size: .75rem;
	color: var(--sm-muted);
}

.rapc-field-sm .form-control {
	min-width: 0;
	width: 110px;
}

.rapc-howto {
	padding: 0;
	margin-top: 1.5rem;
}

.rapc-howto > summary {
	padding: 14px 18px;
	cursor: pointer;
	font-weight: 600;
	color: var(--sm-text-2);
	list-style-position: inside;
}

.rapc-howto > ul {
	margin: 0;
	padding: 0 18px 16px 36px;
	color: var(--sm-text-2);
	font-size: .84rem;
}

.rapc-howto > ul li + li {
	margin-top: 6px;
}

.rapc-more {
	padding-top: 10px;
	padding-bottom: 12px;
	border-top: 1px solid var(--sm-border);
	font-size: .84rem;
}

.rapc-scroll {
	max-height: 460px;
	overflow-y: auto;
}

.rapc-buckets {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 12px;
}

.rapc-bucket {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 12px;
	border: 1px solid var(--sm-border);
	border-radius: var(--sm-radius-sm);
	background: var(--sm-surface-2);
}

.rapc-bucket .badge {
	align-self: flex-start;
}

.rapc-bars {
	list-style: none;
	margin: 0;
	padding: 0;
}

.rapc-bars li {
	display: grid;
	grid-template-columns: 64px 1fr 40px;
	align-items: center;
	gap: 10px;
	padding: 4px 0;
	font-size: .84rem;
}

.rapc-bars strong {
	text-align: right;
}

.rapc-bar-label {
	color: var(--sm-muted);
}

.rapc-bar {
	height: 10px;
	border-radius: 999px;
	background: var(--sm-surface-3);
	overflow: hidden;
}

.rapc-bar > span {
	display: block;
	height: 100%;
	border-radius: 999px;
	background: var(--sm-ink);
}

.rapc-map {
	height: 420px;
	border: 1px solid var(--sm-border);
	border-radius: var(--sm-radius);
}

.rapc-ai-meta {
	margin-bottom: 8px;
	font-size: .78rem;
	color: var(--sm-muted);
}

.rapc-ai-text {
	padding: 12px 16px;
	border: 1px solid var(--sm-border);
	border-radius: var(--sm-radius-sm);
	background: var(--sm-surface-2);
	font-size: .86rem;
}

.rapc-ai-text .ai-h {
	margin: 10px 0 6px;
	font-size: .9rem;
	font-weight: 600;
}

.rapc-ai-text ul,
.rapc-ai-text ol {
	padding-left: 20px;
	margin-bottom: 8px;
}

.rapc-stars {
	display: flex;
	align-items: center;
	gap: 2px;
	color: var(--sm-amber);
	font-size: 1rem;
}

.rapc-stars strong {
	margin-left: 6px;
	color: var(--sm-text);
	font-size: .9rem;
}

.rapc-stars.is-low {
	color: var(--sm-red);
}

.rapc-rating-message {
	margin: 10px 0 6px;
	padding: 8px 12px;
	border-left: 3px solid var(--sm-border-strong);
	color: var(--sm-text-2);
	font-size: .86rem;
}

.rapc-low-ratings {
	border-color: var(--sm-red-soft);
}

.rapc-low-msg {
	max-width: 520px;
}

/*
 * Public client rating page (/evaluare/{token}, app/actions/evaluare.php):
 * branded, mobile first, stars as radio buttons (row-reverse so the hovered
 * star and the ones before it light up), tags as toggle buttons.
 */
body.rating-public {
	background: var(--sm-bg);
	color: var(--sm-text);
	font-family: var(--sm-font);
	min-height: 100vh;
}
.rating-public-wrap {
	max-width: 520px;
	margin: 0 auto;
	padding: 32px 16px 24px;
}
.rating-public-brand {
	text-align: center;
	margin-bottom: 20px;
}
.rating-public-brand img {
	max-height: 48px;
	max-width: 220px;
}
.rating-public .card {
	border-radius: var(--sm-radius-lg);
	box-shadow: var(--sm-shadow-md);
}
.rating-public .card-body {
	padding: 24px;
}
.rating-public-stars {
	display: inline-flex;
	flex-direction: row-reverse;
	gap: 6px;
}
.rating-public-stars label {
	font-size: 34px;
	line-height: 1;
	color: var(--sm-border-strong);
	cursor: pointer;
	transition: color .12s ease, transform .12s ease;
}
.rating-public-stars label:hover,
.rating-public-stars label:hover ~ label,
.rating-public-stars input:checked ~ label {
	color: var(--sm-amber);
}
.rating-public-stars label:active {
	transform: scale(.92);
}
.rating-public-stars input:focus-visible + label {
	outline: 2px solid var(--sm-ink);
	outline-offset: 2px;
	border-radius: var(--sm-radius-sm);
}
.rating-public-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.rating-public-tags .btn-check:checked + .btn {
	background: var(--sm-ink);
	border-color: var(--sm-ink);
	color: var(--sm-surface);
}
.rating-public-state {
	text-align: center;
	padding: 16px 0;
}
.rating-public-state > .bi {
	font-size: 40px;
	display: block;
	margin-bottom: 12px;
}
.rating-public-footer {
	text-align: center;
	color: var(--sm-muted);
	font-size: 13px;
	margin: 20px 0 0;
}

/* -------------------------------------------------------------------------
 * Reports hub (/rapoarte): categories with report cards.
 * ------------------------------------------------------------------------- */
.report-hub-search {
	width: 280px;
	max-width: 100%;
}

.report-hub-nav {
	margin-bottom: 24px;
}

.report-hub-section {
	margin-bottom: 32px;
	scroll-margin-top: calc(var(--sm-topbar-h) + 16px);
}

.report-hub-heading {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 14px;
}

.report-hub-heading h2 {
	margin: 0;
	font-size: 1.0625rem;
	font-weight: 600;
	color: var(--sm-text);
}

.report-hub-heading p {
	margin: 2px 0 0;
	font-size: .875rem;
	color: var(--sm-muted);
}

.report-hub-heading-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	flex-shrink: 0;
	border-radius: var(--sm-radius);
	background: var(--sm-ink);
	color: var(--sm-surface);
	font-size: 1.0625rem;
}

.report-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 12px;
}

.report-card {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	height: 100%;
	padding: 16px 18px;
	background: var(--sm-surface);
	border: 1px solid var(--sm-border);
	border-radius: var(--sm-radius-lg);
	box-shadow: var(--sm-shadow);
	color: var(--sm-text);
	text-decoration: none;
	transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.report-card:hover,
.report-card:focus-visible {
	border-color: var(--sm-ink);
	box-shadow: var(--sm-shadow-md);
	color: var(--sm-text);
	transform: translateY(-1px);
}

.report-card-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	flex-shrink: 0;
	border-radius: var(--sm-radius);
	background: var(--sm-surface-3);
	color: var(--sm-ink);
	font-size: 1.125rem;
}

.report-card-body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 1;
	min-width: 0;
}

.report-card-title {
	font-weight: 600;
	line-height: 1.3;
}

.report-card-desc {
	font-size: .8438rem;
	line-height: 1.45;
	color: var(--sm-text-2);
}

.report-card-arrow {
	align-self: center;
	color: var(--sm-muted);
	transition: transform .15s ease, color .15s ease;
}

.report-card:hover .report-card-arrow {
	color: var(--sm-ink);
	transform: translateX(2px);
}

@media (max-width: 575.98px) {
	.report-hub-search {
		width: 100%;
	}

	.report-grid {
		grid-template-columns: 1fr;
	}
}

/*
 * Intervention forms (Etapa 9): builder rows (Setări → Formulare intervenții) and the
 * file fields / file lists on the job pages.
 */
.fb-row {
	border: 1px solid var(--sm-border);
	border-radius: var(--sm-radius);
	padding: 12px;
	margin-bottom: 10px;
	background: var(--sm-surface);
}
.fb-row-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 6px;
}
.fb-row-pos {
	font-size: 12px;
	font-weight: 600;
	color: var(--sm-muted);
	text-transform: uppercase;
	letter-spacing: .04em;
}
.fb-row-actions {
	display: flex;
	gap: 4px;
}
.jf-upload-buttons {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	margin-bottom: 6px;
}
@media (max-width: 575.98px) {
	.jf-upload-buttons {
		grid-template-columns: 1fr;
	}
}
.jf-files {
	list-style: none;
	margin: 6px 0 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}
.jf-file {
	border: 1px solid var(--sm-border);
	border-radius: var(--sm-radius-sm);
	padding: 8px;
	max-width: 220px;
	font-size: 13px;
}
.jf-file a {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--sm-text);
	text-decoration: none;
	word-break: break-all;
}
.jf-file img {
	width: 56px;
	height: 56px;
	object-fit: cover;
	border-radius: var(--sm-radius-sm);
}
.jf-file .bi {
	font-size: 28px;
	color: var(--sm-red);
}

/* ------------------------------------------------------------------
 * Configurable dashboard (app/inc/widgets.php, assets/js/panou.js):
 * 4 columns ≥ 1200px, 2 columns ≥ 576px, 1 column below. Spans and
 * order per column count come from the packing (--w-span4 / --w-order4 …).
 * ------------------------------------------------------------------ */
.dash-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 16px;
}

.dash-widget {
	display: flex;
	flex-direction: column;
	min-width: 0;
	order: var(--w-order1, 0);
}

.dash-widget-body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-width: 0;
	container-type: inline-size;
}

.dash-widget-body > .kpi,
.dash-widget-body > .card {
	flex: 1 1 auto;
	margin: 0;
}

@media (min-width: 576px) {
	.dash-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.dash-widget {
		grid-column: span var(--w-span2, 1);
		order: var(--w-order2, 0);
	}
}

@media (min-width: 1200px) {
	.dash-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.dash-widget {
		grid-column: span var(--w-span4, 1);
		order: var(--w-order4, 0);
	}
}

.dash-chart {
	position: relative;
}

.dash-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.dash-list li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 11px 22px;
	border-top: 1px solid var(--sm-border);
}

.dash-list li:first-child {
	border-top: 0;
}

.dash-list li > a,
.dash-list li > span:first-child {
	flex: 1 1 auto;
	min-width: 0;
	color: inherit;
	text-decoration: none;
}

.dash-list li > a:hover .dash-list-main {
	text-decoration: underline;
}

.dash-list li > .bi {
	color: var(--sm-subtle);
}

.dash-list-main {
	display: block;
	overflow: hidden;
	font-weight: 500;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.dash-list .cell-sub {
	display: block;
	overflow: hidden;
	margin-top: 2px;
	color: var(--sm-muted);
	font-size: .8125rem;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.dash-links {
	display: grid;
	gap: 8px;
}

@container (min-width: 520px) {
	.dash-links {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.dash-guide {
	font-size: .875rem;
	color: var(--sm-text-2);
}

.dash-guide ul {
	padding-left: 18px;
}

.dash-empty {
	border: 1px dashed var(--sm-border-strong);
	border-radius: var(--sm-radius-lg);
	background: var(--sm-surface);
}

.dash-empty .btn {
	display: inline-flex;
}

/* Edit mode */
.dash-widget-tools {
	display: flex;
	align-items: center;
	gap: 2px;
	margin-bottom: 6px;
	padding: 3px 4px;
	border: 1px solid var(--sm-border);
	border-radius: var(--sm-radius-sm);
	background: var(--sm-surface);
	box-shadow: var(--sm-shadow);
}

.dash-widget-tools[hidden] {
	display: none;
}

.dash-tool {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	height: 28px;
	min-width: 28px;
	padding: 0 6px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--sm-muted);
	font-size: .75rem;
	font-weight: 600;
}

.dash-tool:hover,
.dash-tool:focus-visible {
	background: var(--sm-surface-3);
	color: var(--sm-text);
}

.dash-widget-tools {
	cursor: move;
	touch-action: none;
	user-select: none;
}

.dash-widget-tools .dash-tool:not(.dash-handle) {
	cursor: pointer;
}

.dash-handle {
	color: var(--sm-text-2);
	cursor: move;
}

.dash-tool-title {
	flex: 1 1 auto;
	overflow: hidden;
	min-width: 0;
	color: var(--sm-text-2);
	font-size: .8125rem;
	font-weight: 500;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.dash-editing .dash-widget-body {
	border-radius: var(--sm-radius-lg);
	outline: 1.5px dashed var(--sm-border-strong);
	outline-offset: 3px;
	pointer-events: none;
	user-select: none;
}

/* The widget being worked on (last moved / resized / added). */
.dash-editing .dash-widget.is-active .dash-widget-tools {
	border-color: var(--sm-ink);
	box-shadow: var(--sm-shadow-md);
}

.dash-editing .dash-widget.is-active .dash-widget-body {
	outline: 2px solid var(--sm-ink);
}

/* Dragged widget: follows the pointer; the dashed placeholder keeps its place in the grid. */
.dash-editing .dash-widget.is-dragging {
	position: fixed;
	z-index: 1090;
	opacity: .92;
	box-shadow: var(--sm-shadow-lg);
	pointer-events: none;
	transform: rotate(.6deg);
}

.dash-placeholder {
	min-height: 120px;
	border: 2px dashed var(--sm-ink);
	border-radius: var(--sm-radius-lg);
	background: var(--sm-surface-3);
	transition: none;
}

body.dash-dragging,
body.dash-dragging * {
	cursor: move !important;
	user-select: none;
}

/* Width menu */
.dash-size {
	position: relative;
}

.dash-size-toggle[aria-expanded="true"] {
	background: var(--sm-ink);
	color: var(--sm-surface);
}

.dash-size-menu {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	z-index: 1040;
	min-width: 230px;
	padding: 6px;
	border: 1px solid var(--sm-border);
	border-radius: var(--sm-radius);
	background: var(--sm-surface);
	box-shadow: var(--sm-shadow-lg);
	cursor: default;
}

.dash-size-head {
	padding: 4px 8px 6px;
	color: var(--sm-muted);
	font-size: .6875rem;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.dash-size-option {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 7px 8px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--sm-text);
	font-size: .8125rem;
	text-align: left;
}

.dash-size-option:hover,
.dash-size-option:focus-visible {
	background: var(--sm-surface-3);
}

.dash-size-option.is-current {
	font-weight: 600;
}

.dash-size-option.is-current::after {
	margin-left: auto;
	content: "✓";
}

.dash-size-bars {
	display: inline-flex;
	gap: 2px;
}

.dash-size-bars i {
	width: 9px;
	height: 12px;
	border: 1px solid var(--sm-border-strong);
	border-radius: 2px;
}

.dash-size-bars i.on {
	border-color: var(--sm-ink);
	background: var(--sm-ink);
}

.dash-editbar {
	position: fixed;
	bottom: 20px;
	left: 50%;
	z-index: 1030;
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 6px;
	border: 1px solid var(--sm-border);
	border-radius: 999px;
	background: var(--sm-surface);
	box-shadow: var(--sm-shadow-lg);
	transform: translateX(-50%);
}

.dash-editbar[hidden] {
	display: none;
}

.dash-editbar .btn {
	border-radius: 999px;
	white-space: nowrap;
}

.dash-status {
	padding: 0 10px 0 4px;
	color: var(--sm-muted);
	font-size: .8125rem;
	white-space: nowrap;
}

.dash-status:empty {
	display: none;
}

.dash-status.is-error {
	color: var(--sm-red);
}

@media (min-width: 992px) {
	.dash-editbar {
		left: calc(50% + var(--sm-sidebar-w) / 2);
	}
}

@media (max-width: 575.98px) {
	.dash-editbar {
		right: 12px;
		bottom: 12px;
		left: 12px;
		flex-wrap: wrap;
		justify-content: center;
		border-radius: var(--sm-radius-lg);
		transform: none;
	}

	.dash-editbar .btn {
		flex: 1 1 auto;
		padding-right: 10px;
		padding-left: 10px;
		font-size: .8125rem;
	}

	.dash-status {
		flex-basis: 100%;
		text-align: center;
	}
}

body.dash-editing .main {
	padding-bottom: 140px;
}

/* "Modifică widgeturi" panel */
.dash-catalog.offcanvas {
	--bs-offcanvas-width: 400px;
}

.dash-catalog .offcanvas-header {
	align-items: flex-start;
	border-bottom: 1px solid var(--sm-border);
}

.dash-catalog .offcanvas-title {
	margin: 0;
	font-size: 1.0625rem;
	font-weight: 600;
}

.dash-catalog-sub {
	margin: 2px 0 0;
	color: var(--sm-muted);
	font-size: .8125rem;
}

.dash-catalog-cat {
	margin: 20px 0 8px;
	color: var(--sm-muted);
	font-size: .6875rem;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.dash-catalog-cat:first-child {
	margin-top: 0;
}

.dash-catalog-item {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	width: 100%;
	margin-bottom: 8px;
	padding: 12px 14px;
	border: 1px solid var(--sm-border);
	border-radius: var(--sm-radius);
	background: var(--sm-surface);
	color: var(--sm-text);
	text-align: left;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.dash-catalog-item:hover:not(:disabled) {
	border-color: var(--sm-border-strong);
	box-shadow: var(--sm-shadow-md);
}

.dash-catalog-text {
	flex: 1 1 auto;
	min-width: 0;
}

.dash-catalog-title {
	display: block;
	font-size: .875rem;
	font-weight: 600;
}

.dash-catalog-desc {
	display: block;
	margin-top: 2px;
	color: var(--sm-muted);
	font-size: .8125rem;
	line-height: 1.45;
}

.dash-catalog-state {
	flex-shrink: 0;
	font-size: .75rem;
	font-weight: 600;
	white-space: nowrap;
}

.dash-catalog-plus {
	color: var(--sm-text-2);
}

.dash-catalog-added {
	display: none;
	color: var(--sm-green-text);
}

.dash-catalog-remove {
	display: none;
	color: var(--sm-red-text);
}

.dash-catalog-item.is-added {
	border-color: var(--sm-green-soft);
	background: var(--sm-surface-2);
}

.dash-catalog-item.is-added .dash-catalog-plus {
	display: none;
}

.dash-catalog-item.is-added .dash-catalog-added {
	display: inline;
}

.dash-catalog-item.is-added:hover .dash-catalog-added,
.dash-catalog-item.is-added:focus-visible .dash-catalog-added {
	display: none;
}

.dash-catalog-item.is-added:hover .dash-catalog-remove,
.dash-catalog-item.is-added:focus-visible .dash-catalog-remove {
	display: inline;
}

.dash-catalog-item.is-added:hover {
	border-color: var(--sm-red-soft);
}

@media (hover: none) {
	.dash-catalog-item.is-added .dash-catalog-added {
		display: none;
	}

	.dash-catalog-item.is-added .dash-catalog-remove {
		display: inline;
	}
}
