/* ================================
   METRONIC 2025 FIXED NOTIFICATIONS
   ================================ */

.fixed-error,
.fixed-success {
	position: fixed !important;
	top: 20px;
	right: 20px;
	z-index: 999999 !important;

	min-width: 340px;
	max-width: 420px;
	padding: 16px 18px 18px 18px;

	border-radius: 14px;
	border: none;

	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);

	box-shadow:
		0 10px 30px rgba(0, 0, 0, .35),
		0 0 0 1px rgba(255,255,255,.08) inset;

	animation: notifySlideIn .55s cubic-bezier(.2,.8,.2,1);
}

/* text */
.fixed-error > div,
.fixed-success > div {
	font-size: 14px;
	line-height: 1.45;
	font-weight: 500;
	padding-right: 25px;
}

/* close button */
.fixed-error .btn-close,
.fixed-success .btn-close {
	position: absolute;
	top: 6px;
	right: 16px;
	filter: invert(1);
	opacity: .65;
}
.fixed-error .btn-close:hover,
.fixed-success .btn-close:hover {
	opacity: 1;
}

/* ================================
   ERROR – red / pink cyber glow
   ================================ */

.fixed-error {
	background: linear-gradient(
		135deg,
		rgba(255, 56, 96, .9),
		rgba(160, 20, 60, .92)
	);
	color: #fff;

	box-shadow:
		0 10px 30px rgba(255, 0, 80, .38),
		0 0 0 1px rgba(255,255,255,.07) inset;
}

/* little progress bar */
.fixed-error::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	height: 3px;
	width: 100%;
	background: rgba(255,255,255,.4);
	animation: notifyProgress linear forwards;
	animation-duration: var(--notify-delay, 6s);
}

/* ================================
   SUCCESS – green / emerald glow
   ================================ */

.fixed-success {
	background: linear-gradient(
		135deg,
		rgba(0, 200, 140, .9),
		rgba(0, 120, 90, .95)
	);
	color: #fff;

	box-shadow:
		0 10px 30px rgba(0, 200, 140, .38),
		0 0 0 1px rgba(255,255,255,.07) inset;
}

.fixed-success::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	height: 3px;
	width: 100%;
	background: rgba(255,255,255,.4);
	animation: notifyProgress linear forwards;
	animation-duration: var(--notify-delay, 6s);
}

/* ================================
   ASIDE SIDEBAR PREMIUM
   ================================ */

.aside.aside-dark {
	background: linear-gradient(180deg,
		#0f0f1a 0%,
		#161625 35%,
		#1a1a2e 65%,
		#10101c 100%
	) !important;
}

/* Subtle glow line on the right edge */
.aside.aside-dark::after {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	width: 1px;
	height: 100%;
	background: linear-gradient(180deg,
		transparent 0%,
		rgba(0, 158, 247, 0.15) 30%,
		rgba(0, 158, 247, 0.08) 70%,
		transparent 100%
	);
	pointer-events: none;
}

/* Logo area - subtle bottom border */
.aside-dark .aside-logo {
	border-bottom: 1px solid rgba(255,255,255,.04) !important;
}

/* Menu hover - softer and more premium */
.aside-dark .menu .menu-link:hover:not(.active) {
	background-color: rgba(255,255,255,.04);
	border-radius: 6px;
}

/* Active menu item - accent glow */
.aside-dark .menu .menu-link.active {
	background: linear-gradient(90deg,
		rgba(0, 158, 247, 0.12) 0%,
		rgba(0, 158, 247, 0.04) 100%
	);
	border-radius: 6px;
}

/* Accordion header hover */
.aside-dark .menu-accordion > .menu-link:hover {
	background-color: rgba(255,255,255,.03);
	border-radius: 6px;
}

/* ================================
   ASIDE MENU SEARCH
   ================================ */

.aside-search {
	border-bottom: 1px solid rgba(255,255,255,.05);
}

.aside-search .form-control {
	height: 34px;
	font-size: 0.8rem;
	background-color: rgba(0, 0, 0, 0.35) !important;
	border: 1px solid rgba(255,255,255,.06) !important;
	color: rgba(255,255,255,.8);
	transition: all 0.25s ease;
}

.aside-search .form-control:focus {
	background-color: rgba(0, 0, 0, 0.5) !important;
	border-color: rgba(0, 158, 247, 0.3) !important;
	color: #fff;
	box-shadow: 0 0 0 3px rgba(0, 158, 247, 0.1),
	            0 2px 8px rgba(0, 0, 0, 0.3);
}

.aside-search .form-control::placeholder {
	color: rgba(255,255,255,.25);
	font-size: 0.8rem;
}

#aside_search_clear {
	transition: color 0.15s ease;
}

#aside_search_clear:hover {
	color: #fff !important;
}

/* When sidebar is minimized, hide search */
body.aside-minimize .aside-search {
	display: none;
}

/* ================================
   MODALS
   ================================ */

.mw-1100px { max-width: 1100px !important; }

/* Fix icon centering in btn-icon inside modals */
.modal .btn.btn-icon > i {
	display: block;
}

.modal .form-control::placeholder,
.modal .select2-container .select2-selection__placeholder,
.modal .form-select option:first-child {
	font-size: 0.9rem;
}

/* Select2 — forteaza inaltime consistenta cu form-control / form-select Bootstrap 5 chiar si fara valoare/placeholder */
.form-select + .select2-container--default .select2-selection--single,
.form-select-solid + .select2-container--default .select2-selection--single {
	min-height: calc(1.5em + 1.55rem + 2px); /* form-select default */
	display: flex;
	align-items: center;
}
.form-select-sm + .select2-container--default .select2-selection--single,
.form-select.form-select-sm + .select2-container--default .select2-selection--single {
	min-height: calc(1.5em + 1.1rem + 2px); /* form-select-sm */
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
	line-height: 1.5;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
	height: 100%;
}

/* VAT select (Select2) — permite truncation pe numele cotei cand spatiul e limitat */
.vat-rate-select + .select2-container .select2-selection__rendered {
	display: flex !important;
	align-items: center;
	padding-right: 22px; /* loc pentru arrow */
}
.vat-rate-select + .select2-container .select2-selection__rendered > span {
	min-width: 0;
	width: 100%;
}
.vat-rate-select + .select2-container .select2-selection__rendered .text-truncate {
	flex: 1;
	min-width: 0;
}

/* ================================
   Animations
   ================================ */

@keyframes notifySlideIn {
	from {
		opacity: 0;
		transform: translateX(50px) scale(.95);
	}
	to {
		opacity: 1;
		transform: translateX(0) scale(1);
	}
}

@keyframes notifyProgress {
	from { width: 100%; }
	to   { width: 0%; }
}

@media (max-width: 768px) {

	.fixed-error,
	.fixed-success {
		left: 50% !important;
		right: auto !important;
		top: 16px;

		transform: translateX(-50%);
		width: calc(100% - 32px);
		max-width: 520px;

		border-radius: 16px;
	}

	/* animație adaptată */
	@keyframes notifySlideIn {
		from {
			opacity: 0;
			transform: translateX(-50%) translateY(-20px) scale(.96);
		}
		to {
			opacity: 1;
			transform: translateX(-50%) translateY(0) scale(1);
		}
	}
}

/* ================================
   FIX Select2 dropdown peste Bootstrap 5 modal
   Bootstrap 5 modal are z-index 1055; .modal-backdrop are 1050.
   Select2 dropdown trebuie sa fie deasupra ca sa fie clickabil.
   ================================ */
.select2-container--open {
	z-index: 10060 !important;
}
.select2-container .select2-dropdown {
	z-index: 10060 !important;
}
/* Permite selectarea text-ului din search input (BS5 il blocheaza altfel) */
.select2-search__field {
	pointer-events: auto !important;
	user-select: text !important;
}
/* Asigura ca optiunile din lista sunt clickabile */
.select2-results__option {
	pointer-events: auto !important;
}

/* ================================
   UX consistency in modale (mai 2026)
   ================================ */

/* Asterisc rosu pe label-urile required (regula proiect: fields obligatorii vizibili) */
label.required::after {
	content: " *";
	color: #f1416c;
	font-weight: 700;
	margin-left: 2px;
}

/* Standardizare label-uri in modale: fs-6 peste tot pentru main fields, fs-8 pentru helper text.
   Inainte aveam mix fs-6 / fs-7 — acum aliniat. */
.modal label.fw-bold,
.modal label.required {
	font-size: 1rem !important; /* fs-6 echivalent */
}
.modal .form-text {
	font-size: 0.85rem;
	color: #7e8299;
}

/* Read-only inputs (NIR/Achizitie status != draft) — background distinct */
.modal input.form-control:disabled,
.modal select.form-select:disabled,
.modal textarea.form-control:disabled {
	background-color: #f5f8fa !important;
	color: #5e6278 !important;
	cursor: not-allowed;
}

/* ================================
   Fix iconuri NEcentrate in butoane "icon-only" (mai 2026)
   Cauza: tema aplica pe `.btn i` doua reguli — `padding-right: 0.35rem` si `display: inline-flex`.
   Astea sunt OK pentru butoane cu text+icon (gen "<i></i> Salveaza" sau "Salveaza <i></i>"),
   dar in butoane icon-only deplaseaza iconul si rup centrarea.
   Selectorul `i:only-child` se aplica DOAR cand <i> e singurul copil al butonului — deci
   nu afecteaza butoanele cu text+icon, unde iconul are mereu un sibling de tip text.
   ================================ */
.btn > i:only-child {
	padding-right: 0 !important;
	display: inline-block !important;
}

/* ================================
   Fix iconuri "empty state" lipite in stanga desi containerul e centrat (iulie 2026)
   Cauza: FontAwesome 7 pune `width: var(--fa-width, 1.25em)` pe FIECARE icon
   (`.fa, .fa-solid, .fas, ...`) — FA6 nu facea asta. Combinat cu `.d-block`, iconul
   devine un box de 1.25em latime, iar un box de bloc se aliniaza la stanga indiferent
   de `text-align: center` mostenit (text-align centreaza continutul inline, nu boxul).
   Rezultat clasic: icon in stanga, textul de sub el centrat.

   Fix: margini auto, DAR doar cand exista un stramos explicit `.text-center` — deci
   nu atingem iconurile de bloc dintr-un layout aliniat la stanga, unde centrarea ar fi
   o regresie. Acopera toate empty-state-urile / ecranele de "Import finalizat" existente
   si pe cele viitoare, fara sa fie nevoie de `mx-auto` scris de mana in fiecare view.
   ================================ */
.text-center i.d-block {
	margin-left: auto;
	margin-right: auto;
}

/* ================================
   Select2: text selectat DARK peste tot (iulie 2026)
   Cauza: plugins.bundle.css randeaza valoarea selectata cu gri deschis
     .select2-container--bootstrap5 .select2-selection--single .select2-selection__rendered { color:#a1a5b7 }
     .select2-container--bootstrap5 .select2-selection--single.form-select-solid ...  { color:#5e6278 }
   adica exact culoarea de placeholder -> un select CU valoare aleasa arata ca si cum
   ar fi gol sau disabled. Fix global, inlocuieste override-urile per-view.

   ATENTIE la scope (deliberat restrans, nu largi fara motiv):
   - DOAR `--single` -> nu atinge tag-urile din select2 multiple.
   - DOAR `:not(.select2-container--disabled)` -> selecturile blocate (ex. NIR/achizitie
     confirmata) raman gri, coerent cu `.modal select.form-select:disabled`.
   - DOAR proprietatea `color` -> zero impact pe z-index / pozitionare / dropdownParent,
     deci nu afecteaza fix-urile de suprapunere Select2 in modale.
   - Copiii cu clasa proprie de culoare (ex. `.text-muted` din templateResult-ul de
     cote TVA) isi pastreaza culoarea lor, regula nu ii suprascrie.
   ================================ */
.select2-container:not(.select2-container--disabled) .select2-selection--single .select2-selection__rendered {
	color: #181c32 !important;
}
/* Placeholder-ul ramane gri - altfel n-am mai distinge "gol" de "selectat" */
.select2-container:not(.select2-container--disabled) .select2-selection--single .select2-selection__rendered .select2-selection__placeholder {
	color: #a1a5b7 !important;
}
