/*
 * CSS custom minim — restul stilurilor vin din Bootstrap.
 * Se păstrează doar ce nu are echivalent (nici măcar aproximativ) în Bootstrap.
 */

body {
	background-color: #E8F7FE;
}

[data-bs-theme="dark"] body {
	background-color: var(--bs-body-bg);
}

/* Comutatorul de temă: arată luna în tema luminoasă, soarele în cea întunecată. */
.theme-icon-dark {
	display: none;
}

[data-bs-theme="dark"] .theme-icon-dark {
	display: inline-block;
}

[data-bs-theme="dark"] .theme-icon-light {
	display: none;
}

/* Butonul „mergi sus": apare doar după ce s-a derulat suficient în pagină. */
.back-to-top {
	width: 44px;
	height: 44px;
	opacity: 0;
	visibility: hidden;
	transition: opacity .3s ease, visibility .3s ease;
	z-index: 1070;
}

.back-to-top.visible {
	opacity: .85;
	visibility: visible;
}

.back-to-top:hover {
	opacity: 1;
}

/* Mega-meniu — comportament portat din stil.css al vechiului site (culori adaptate temei). */
.navbar .dropdown-menu {
	background-color: var(--bs-body-bg);
	color: var(--bs-body-color);
	border: 2px solid var(--bs-border-color-translucent);
}

.navbar .dropdown-menu div[class*="col"] {
	margin-bottom: 1rem;
}

/* De la breakpoint-ul lg în sus: panou pe toată lățimea, deschis la hover.
   Regulile sunt limitate la meniul principal (.csm-mega), ca să nu afecteze
   dropdown-ul de utilizator din bara de accesibilitate. */
@media (min-width: 992px) {
	.navbar.csm-mega {
		padding-top: 0;
		padding-bottom: 0;
	}

	.navbar.csm-mega .nav-item {
		padding-top: .5rem;
		padding-bottom: .5rem;
	}

	.navbar.csm-mega .dropdown {
		position: static;
	}

	.navbar.csm-mega .dropdown-menu {
		width: 100%;
		left: 0;
		right: 0;
		top: 100%;
		margin-top: 0;
	}

	.navbar.csm-mega .dropdown:hover .dropdown-menu,
	.navbar.csm-mega .dropdown .dropdown-menu:hover {
		display: block;
	}
}

/* Meniu închis forțat după click pe un link (până când cursorul părăsește elementul de meniu). */
.navbar.csm-mega .dropdown-menu.mega-menu-closed {
	display: none !important;
}

/* Culorile de fundal ale elementelor din meniul principal (gradientul istoric al site-ului). */
.csm-nav-1 { background-color: #00519C; }
.csm-nav-2 { background-color: #105DA3; }
.csm-nav-3 { background-color: #2168AA; }
.csm-nav-4 { background-color: #3174B1; }
.csm-nav-5 { background-color: #417FB7; }
.csm-nav-6 { background-color: #518BBE; }
.csm-nav-7 { background-color: #6197C5; }

/* Subsolul folosește albastrul siglei CSM (același cu primul element din meniul principal). */
.csm-footer {
	background-color: #00519C;
}

/* ── Lista modernă de documente ataşate (pagina de anunţ) ─────────────────── */
.csm-doc-list {
	display: flex;
	flex-direction: column;
	gap: .5rem;
}

/* ── Liste de articole/documente pe paginile CMS ─────────────────────────── */
.csm-folder-list {
	display: flex;
	flex-direction: column;
	gap: .85rem;
}

.csm-folder-row {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 1rem 1.1rem;
	background-color: var(--bs-body-bg);
	border: 1px solid var(--bs-border-color);
	border-radius: .75rem;
	box-shadow: 0 6px 18px rgba(0, 81, 156, .06);
	transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.csm-folder-row:hover {
	border-color: rgba(0, 81, 156, .22);
	box-shadow: 0 10px 24px rgba(0, 81, 156, .09);
	background-color: rgba(0, 81, 156, .02);
}

.csm-folder-main {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	align-items: flex-start;
	gap: 1rem;
}

.csm-folder-icon {
	flex: 0 0 3rem;
	width: 3rem;
	height: 3rem;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	background-color: rgba(0, 81, 156, .08);
	color: #00519C;
	font-size: 1.45rem;
	box-shadow: inset 0 0 0 1px rgba(0, 81, 156, .08);
}

.csm-folder-content {
	flex: 1 1 auto;
	min-width: 0;
}

.csm-folder-title-wrap {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .5rem;
	margin-bottom: .2rem;
}

.csm-folder-title {
	color: #16306b;
	font-size: 1.1rem;
	font-weight: 700;
	line-height: 1.35;
	text-decoration: none;
	overflow-wrap: anywhere;
}

.csm-folder-title:hover {
	color: #00519C;
	text-decoration: underline;
}

.csm-folder-description {
	color: var(--bs-secondary-color);
	font-size: .95rem;
	line-height: 1.5;
	margin-top: .35rem;
}

.csm-folder-date {
	flex: 0 0 12.5rem;
	width: 12.5rem;
	padding-left: 1rem;
	border-left: 1px solid var(--bs-border-color);
	color: var(--bs-secondary-color);
	align-self: stretch;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: .2rem;
}

.csm-folder-date-label {
	font-size: .9rem;
	white-space: nowrap;
}

.csm-folder-date-value {
	font-size: 1rem;
	color: var(--bs-body-color);
	font-weight: 500;
	line-height: 1.35;
}

.csm-folder-action {
	flex: 0 0 9rem;
	width: 9rem;
	display: flex;
	justify-content: flex-end;
	align-items: center;
}

.csm-btn-details {
	width: 100%;
	justify-content: center;
	padding: .7rem 1rem;
	border-radius: .5rem;
	border: 1px solid #1b56d7;
	background-color: #1b56d7;
	color: #fff;
	font-weight: 600;
	white-space: nowrap;
	box-shadow: 0 4px 12px rgba(27, 86, 215, .18);
}

.csm-btn-details:hover,
.csm-btn-details:focus-visible {
	background-color: #0d47c5;
	border-color: #0d47c5;
	color: #fff;
}

.csm-btn-details:focus-visible,
.csm-folder-title:focus-visible {
	outline: 2px solid #00519C;
	outline-offset: 2px;
}

.csm-doc {
	display: flex;
	align-items: center;
	gap: .85rem;
	padding: .65rem .85rem;
	background-color: var(--bs-body-bg);
	border: 1px solid var(--bs-border-color);
	border-radius: .5rem;
	transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.csm-doc:hover {
	background-color: rgba(0, 81, 156, .04);
	border-color: rgba(0, 81, 156, .35);
	box-shadow: 0 1px 4px rgba(0, 81, 156, .08);
}

[data-bs-theme="dark"] .csm-doc:hover {
	background-color: rgba(125, 179, 232, .08);
	border-color: rgba(125, 179, 232, .4);
}

[data-bs-theme="dark"] .csm-folder-row:hover {
	background-color: rgba(125, 179, 232, .08);
	border-color: rgba(125, 179, 232, .24);
}

[data-bs-theme="dark"] .csm-folder-icon {
	background-color: rgba(125, 179, 232, .12);
	color: #7db3e8;
	box-shadow: inset 0 0 0 1px rgba(125, 179, 232, .14);
}

[data-bs-theme="dark"] .csm-folder-title {
	color: #c7ddf7;
}

[data-bs-theme="dark"] .csm-folder-title:hover {
	color: #7db3e8;
}

.csm-doc-icon {
	flex-shrink: 0;
	width: 2.5rem;
	height: 2.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.35rem;
	border-radius: .4rem;
}

.csm-doc-icon-pdf     { color: #b02a37; background-color: rgba(176, 42, 55, .09); }
.csm-doc-icon-word    { color: #00519C; background-color: rgba(0, 81, 156, .09); }
.csm-doc-icon-excel   { color: #1a7a4a; background-color: rgba(26, 122, 74, .09); }
.csm-doc-icon-zip     { color: #8a6d1a; background-color: rgba(138, 109, 26, .1); }
.csm-doc-icon-image   { color: #6f42c1; background-color: rgba(111, 66, 193, .09); }
.csm-doc-icon-generic { color: var(--bs-secondary-color); background-color: var(--bs-secondary-bg); }

.csm-doc-main {
	flex: 1 1 auto;
	min-width: 0;
}

.csm-doc-title {
	display: block;
	color: #00519C;
	font-weight: 600;
	text-decoration: none;
	overflow-wrap: anywhere;
}

.csm-doc-title:hover {
	color: #003e78;
	text-decoration: underline;
}

[data-bs-theme="dark"] .csm-doc-title { color: #7db3e8; }
[data-bs-theme="dark"] .csm-doc-title:hover { color: #a6cdf2; }

.csm-doc-meta {
	font-size: .75rem;
	color: var(--bs-secondary-color);
	letter-spacing: .03em;
}

.csm-doc-side {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	gap: .85rem;
}

.csm-doc-date {
	font-size: .8rem;
	color: var(--bs-secondary-color);
	white-space: nowrap;
}

.csm-btn-download {
	color: #fff;
	background-color: #00519C;
	border-color: #00519C;
	white-space: nowrap;
}

.csm-btn-download:hover,
.csm-btn-download:focus-visible {
	color: #fff;
	background-color: #003e78;
	border-color: #003e78;
}

.csm-btn-download:focus-visible,
.csm-doc-title:focus-visible {
	outline: 2px solid #00519C;
	outline-offset: 2px;
	border-radius: .25rem;
}

[data-bs-theme="dark"] .csm-btn-download:focus-visible,
[data-bs-theme="dark"] .csm-doc-title:focus-visible {
	outline-color: #7db3e8;
}

/* Pe ecrane mici data şi butonul coboară sub titlu. */
@media (max-width: 575.98px) {
	.csm-folder-row {
		flex-direction: column;
		align-items: stretch;
		padding: .95rem;
	}

	.csm-folder-main {
		gap: .85rem;
	}

	.csm-folder-icon {
		flex-basis: 2.75rem;
		width: 2.75rem;
		height: 2.75rem;
		font-size: 1.3rem;
	}

	.csm-folder-date,
	.csm-folder-action {
		width: 100%;
		flex-basis: auto;
	}

	.csm-folder-date {
		border-left: 0;
		border-top: 1px solid var(--bs-border-color);
		padding-left: 0;
		padding-top: .85rem;
	}

	.csm-folder-action {
		justify-content: stretch;
	}

	.csm-btn-details {
		width: 100%;
	}

	.csm-doc {
		flex-wrap: wrap;
	}

	.csm-doc-side {
		width: 100%;
		justify-content: space-between;
		padding-left: 3.35rem;
	}
}

/* ── Previzualizarea documentelor PDF ─────────────────────────────────────── */
.csm-preview-frame {
	border: 1px solid var(--bs-border-color);
	border-radius: .5rem;
	overflow: hidden;
	background-color: var(--bs-tertiary-bg);
}

.csm-preview-frame iframe {
	display: block;
	width: 100%;
	height: 75vh;
	border: 0;
}

/* ── Zona de drag & drop pentru fişiere (administrare) ────────────────────── */
.csm-dropzone {
	position: relative;
	border: 2px dashed var(--bs-border-color);
	border-radius: .5rem;
	background-color: var(--bs-tertiary-bg);
	text-align: center;
	padding: 1.5rem 1rem;
	transition: border-color .15s ease, background-color .15s ease;
}

.csm-dropzone:hover,
.csm-dropzone:focus-within {
	border-color: #00519C;
	background-color: rgba(0, 81, 156, .05);
}

.csm-dropzone-full {
	border-style: solid;
	border-color: #1a7a4a;
}

.csm-dropzone input[type="file"] {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

.csm-dropzone-hint {
	color: var(--bs-secondary-color);
	pointer-events: none;
}

/* ── Paginare modernizată ─────────────────────────────────────────────────── */
.csm-pager .page-link {
	border-radius: 50rem;
	margin: 0 .12rem;
	min-width: 1.9rem;
	text-align: center;
	color: #00519C;
}

.csm-pager .page-item.active .page-link {
	background-color: #00519C;
	border-color: #00519C;
	color: #fff;
}

.csm-pager .page-item.disabled .page-link {
	color: var(--bs-secondary-color);
	background-color: transparent;
}

.csm-pager .page-link:focus {
	box-shadow: 0 0 0 .2rem rgba(0, 81, 156, .25);
}

.csm-pager .csm-pager-ellipsis {
	border: none;
	background: transparent;
}

[data-bs-theme="dark"] .csm-pager .page-link { color: #7db3e8; }
[data-bs-theme="dark"] .csm-pager .page-item.active .page-link {
	background-color: #00519C;
	border-color: #00519C;
	color: #fff;
}

/* ── Carduri responsive pentru liste/documente ───────────────────────────── */
.csm-results-stack {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.csm-mobile-card,
.csm-statement-card {
	border-color: rgba(0, 81, 156, .14);
}

.csm-mobile-card-label {
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: #00519C;
	margin-bottom: .2rem;
}

.csm-mobile-card-meta {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: .75rem;
	margin: 0;
	padding: .75rem;
	border-radius: .5rem;
	background-color: rgba(0, 81, 156, .04);
	border: 1px solid rgba(0, 81, 156, .08);
}

.csm-mobile-card-meta dt {
	margin: 0 0 .15rem;
	font-size: .75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .03em;
	color: var(--bs-secondary-color);
}

.csm-mobile-card-meta dd {
	margin: 0;
	font-weight: 600;
	word-break: break-word;
}

.csm-mobile-card-actions {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	align-items: center;
}

.csm-statement-card .card-body,
.csm-mobile-card .card-body {
	padding: 1rem;
}

.csm-statement-actions {
	justify-content: flex-start;
	align-self: flex-start;
	min-width: min(100%, 14rem);
}

.csm-mobile-filters {
	border-color: rgba(0, 81, 156, .18);
	overflow: hidden;
}

.csm-mobile-filters-summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	list-style: none;
	cursor: pointer;
	font-weight: 600;
	background-color: rgba(0, 81, 156, .05);
}

.csm-mobile-filters-summary::-webkit-details-marker {
	display: none;
}

.csm-mobile-filters[open] .csm-mobile-filters-summary {
	border-bottom: 1px solid var(--bs-border-color);
	background-color: rgba(0, 81, 156, .08);
}

.csm-mobile-filters-content {
	font-size: .95rem;
}

.csm-mobile-filters-content .input-group {
	flex-wrap: wrap;
	gap: .5rem;
}

.csm-mobile-filters-content .input-group > .input-group-text,
.csm-mobile-filters-content .input-group > .form-control,
.csm-mobile-filters-content .input-group > .form-select,
.csm-mobile-filters-content .input-group > .btn {
	border-radius: var(--bs-border-radius-sm);
}

.csm-statement-sort-bar .input-group {
	flex-wrap: wrap;
	gap: .5rem;
}

.csm-statement-sort-bar .input-group > .input-group-text,
.csm-statement-sort-bar .input-group > .form-select,
.csm-statement-sort-bar .input-group > .btn {
	border-radius: var(--bs-border-radius-sm);
}

@media (max-width: 575.98px) {
	.csm-statement-search-bar {
		display: flex;
		flex-direction: column;
		gap: .5rem;
	}

	.csm-statement-search-bar > .form-control,
	.csm-statement-search-bar > .btn {
		width: 100%;
		border-radius: var(--bs-border-radius);
	}

	.csm-mobile-card-meta {
		grid-template-columns: 1fr;
	}

	.csm-mobile-card-actions > .btn,
	.csm-statement-actions > .btn {
		flex: 1 1 100%;
	}

	.csm-statement-card .card-body,
	.csm-mobile-card .card-body {
		padding: .9rem;
	}

	.csm-statement-actions {
		width: 100%;
		min-width: 0;
	}

	.csm-statement-sort-bar .input-group > .input-group-text,
	.csm-statement-sort-bar .input-group > .form-select,
	.csm-statement-sort-bar .input-group > .btn {
		width: 100%;
	}

	.csm-mobile-filters .card-body {
		padding: .9rem;
	}

	.csm-mobile-filters-content .input-group > .input-group-text,
	.csm-mobile-filters-content .input-group > .form-control,
	.csm-mobile-filters-content .input-group > .form-select,
	.csm-mobile-filters-content .input-group > .btn {
		width: 100%;
	}
	}

[data-bs-theme="dark"] .csm-mobile-card-label {
	color: #7db3e8;
}

[data-bs-theme="dark"] .csm-mobile-card-meta {
	background-color: rgba(125, 179, 232, .08);
	border-color: rgba(125, 179, 232, .14);
}

[data-bs-theme="dark"] .csm-mobile-filters-summary {
	background-color: rgba(125, 179, 232, .08);
}

[data-bs-theme="dark"] .csm-mobile-filters[open] .csm-mobile-filters-summary {
	background-color: rgba(125, 179, 232, .12);
}

/* Dialogul de consimțământ cookie (poziționarea și tranziția nu au echivalent Bootstrap). */
#cookieConsentDialog {
	position: fixed;
	bottom: -100%;
	left: 0;
	right: 0;
	z-index: 1080;
	padding: 1rem;
	background-color: rgba(33, 37, 41, 0.95);
	transition: bottom .5s ease-in-out;
}

#cookieConsentDialog.active {
	bottom: 0;
}

/* UI-ul standard Blazor pentru erori neprevăzute. */
#blazor-error-ui {
	display: none;
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 1100;
	padding: .6rem 1.25rem .7rem;
	background: lightyellow;
	box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
}

#blazor-error-ui .dismiss {
	cursor: pointer;
	position: absolute;
	right: .75rem;
	top: .5rem;
}

/* ── Breadcrumb (PageCard) ───────────────────────────────────────────────── */
.csm-breadcrumb .breadcrumb {
	margin-bottom: .5rem;
	font-size: .85rem;
}

.csm-breadcrumb .breadcrumb-item a {
	color: #00519C;
	text-decoration: none;
}

.csm-breadcrumb .breadcrumb-item a:hover,
.csm-breadcrumb .breadcrumb-item a:focus-visible {
	text-decoration: underline;
}

.csm-breadcrumb .breadcrumb-item.active {
	color: var(--bs-secondary-color);
}

[data-bs-theme="dark"] .csm-breadcrumb .breadcrumb-item a { color: #7db3e8; }

/* ── Agenda (Membri / Preşedinte / Vicepreşedinte) ───────────────────────── */
.csm-agenda-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: end;
	gap: .75rem;
	padding: .75rem;
	margin-bottom: 1rem;
	border-radius: .5rem;
	background-color: rgba(0, 81, 156, .04);
	border: 1px solid rgba(0, 81, 156, .1);
}

.csm-agenda-toolbar .csm-agenda-filters {
	display: flex;
	flex-wrap: wrap;
	gap: .75rem;
	flex: 1 1 auto;
}

.csm-agenda-table {
	--bs-table-striped-bg: transparent;
	margin-bottom: 0;
}

.csm-agenda-table thead th {
	font-size: .75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: var(--bs-secondary-color);
	background-color: transparent;
	border-bottom: 2px solid rgba(0, 81, 156, .25);
	padding: .6rem .75rem;
}

.csm-agenda-table tbody td {
	padding: .9rem .75rem;
	border-bottom: 1px solid var(--bs-border-color-translucent);
	vertical-align: top;
}

.csm-agenda-table tbody tr:hover {
	background-color: rgba(0, 81, 156, .035);
}

[data-bs-theme="dark"] .csm-agenda-table tbody tr:hover {
	background-color: rgba(125, 179, 232, .07);
}

.csm-agenda-person {
	display: flex;
	align-items: flex-start;
	gap: .6rem;
	min-width: 11rem;
	max-width: 16rem;
}

.csm-agenda-avatar {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.1rem;
	height: 2.1rem;
	border-radius: 50%;
	background-color: rgba(0, 81, 156, .08);
	color: #00519C;
	font-size: 1.05rem;
}

[data-bs-theme="dark"] .csm-agenda-avatar {
	background-color: rgba(125, 179, 232, .15);
	color: #7db3e8;
}

.csm-agenda-name {
	display: block;
	font-weight: 600;
	line-height: 1.25;
	overflow-wrap: break-word;
	hyphens: none;
}

.csm-agenda-role {
	display: block;
	font-size: .8rem;
	color: var(--bs-secondary-color);
}

.csm-agenda-period {
	display: flex;
	align-items: flex-start;
	gap: .45rem;
	white-space: nowrap;
	color: var(--bs-body-color);
}

.csm-agenda-period .bi {
	color: #00519C;
}

[data-bs-theme="dark"] .csm-agenda-period .bi { color: #7db3e8; }

.csm-agenda-period-hours {
	display: block;
	font-size: .8rem;
	color: var(--bs-secondary-color);
	white-space: nowrap;
}

.csm-agenda-desc {
	width: 60%;
	line-height: 1.55;
}

.csm-agenda-desc p:last-child {
	margin-bottom: 0;
}

/* Cardurile agendei pe mobil */
.csm-agenda-card .csm-agenda-period {
	white-space: normal;
}

@media (max-width: 767.98px) {
	.csm-agenda-toolbar {
		flex-direction: column;
		align-items: stretch;
	}

	.csm-agenda-toolbar .csm-agenda-filters {
		flex-direction: column;
	}

	.csm-agenda-toolbar .btn {
		width: 100%;
	}
}

/* ── Căutarea avansată în hotărâri: sidebar-ul de filtre ─────────────────── */
.csm-facet-panel {
	border: 1px solid rgba(0, 81, 156, .12);
	border-radius: .5rem;
	padding: .9rem;
	background-color: rgba(0, 81, 156, .02);
}

.csm-facet {
	border-top: 1px solid var(--bs-border-color-translucent);
	padding: .35rem 0;
}

.csm-facet-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: .5rem;
	width: 100%;
	padding: .45rem 0;
	border: none;
	background: none;
	font-size: .85rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .03em;
	color: var(--bs-body-color);
	text-align: left;
}

.csm-facet-header:hover,
.csm-facet-header:focus-visible {
	color: #00519C;
}

[data-bs-theme="dark"] .csm-facet-header:hover,
[data-bs-theme="dark"] .csm-facet-header:focus-visible {
	color: #7db3e8;
}

.csm-facet-body {
	padding: .25rem 0 .6rem;
}

.csm-facet-list {
	max-height: 16rem;
	overflow-y: auto;
	padding-right: .25rem;
}

.csm-facet .form-check {
	margin-bottom: .35rem;
}

.csm-facet .form-check-label {
	line-height: 1.3;
}

/* Căutarea în interiorul documentului (floating label, /Hotarari/Cautare) */
.csm-content-search .form-control {
	border-color: rgba(0, 81, 156, .35);
}

.csm-content-search .form-control:focus {
	border-color: #00519C;
	box-shadow: 0 0 0 .2rem rgba(0, 81, 156, .15);
}
