@font-face {
    font-family: "Amasya";
    src: url("../fonts/Amasya-Regular.woff2") format("woff2");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}

@font-face {
    font-family: "Amasya";
    src: url("../fonts/Amasya-Bold.woff2") format("woff2");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}

/* Arapça ve yazma eser formlarında Bootstrap kolon sırasını sağdan sola çevirir. */
.arabicrtl {
    direction: rtl;
}

.arabicrtl .form-group.row > .col-form-label {
    text-align: right;
}

.arabicrtl input:not([type="file"]),
.arabicrtl textarea,
.arabicrtl select {
    direction: rtl;
    text-align: right;
}

.arabicrtl input[type="file"],
.arabicrtl input[type="number"],
.arabicrtl .record-identity {
    direction: ltr;
}

.book-entry-form-rtl {
    direction: rtl;
}

.book-entry-form-rtl .form-group.row > .col-form-label {
    text-align: right;
}

.book-entry-form-ltr {
    direction: ltr;
}

.book-entry-form-ltr .form-group.row > .col-form-label {
    text-align: left;
}

.textarabic,
.arabic-text,
[lang="ar"],
[dir="rtl"] .arabic-content,
.arabicrtl input:not([type="file"]):not([type="number"]),
.arabicrtl textarea,
.arabicrtl select {
    font-family: "Amasya", var(--bs-font-sans-serif), Arial, sans-serif !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    line-height: 1.9;
    direction: rtl;
    text-align: right;
    unicode-bidi: plaintext;
	word-break: normal !important;
	overflow-wrap: normal !important;
}

.textarabic strong, .textarabic b, .textarabic th,
.arabic-text strong, .arabic-text b, .arabic-text th,
[lang="ar"] strong, [lang="ar"] b, [lang="ar"] th {
    font-family: "Amasya", var(--bs-font-sans-serif), Arial, sans-serif !important;
    font-weight: 700;
}

/* Veritabanı kimlikleri karakter dönüşümü yapılmadan standart arayüz fontuyla gösterilir. */
.record-identity,
[data-columns$="-col-0"] {
    font-family: var(--bs-font-sans-serif), Arial, sans-serif !important;
    direction: ltr !important;
    unicode-bidi: isolate;
}

/* Kitap ayrıntıları Qovex/Bootstrap çizgili tablo düzeni. */
.book-details-table {
    table-layout: fixed;
}
.book-details-table th {
    width: 26%;
    font-weight: 700;
}
.book-details-table th,
.book-details-table td {
    padding: .65rem .8rem;
    border: 0;
    vertical-align: top;
    white-space: normal;
    overflow-wrap: anywhere;
}
.book-details-table-rtl {
    direction: rtl;
}
.book-details-table-rtl th,
.book-details-table-rtl td {
    direction: rtl;
    text-align: right !important;
    unicode-bidi: plaintext;
}
.book-details-table-rtl .record-ltr,
.book-details-table-rtl .record-identity {
    direction: ltr !important;
    unicode-bidi: isolate;
}
.book-details-table-rtl .record-identity {
    font-size: 20px;
    line-height: 1.9;
}

/* Bootstrap 4 işaretlemesini Bootstrap 5 geçişinde koruyan küçük uyumluluk katmanı. */
.media { display: flex; align-items: flex-start; }
.media-body { flex: 1; min-width: 0; }
.ml-1 { margin-left: .25rem !important; } .ml-2 { margin-left: .5rem !important; }
.ml-3 { margin-left: 1rem !important; } .ml-4 { margin-left: 1.5rem !important; }
.mr-1 { margin-right: .25rem !important; } .mr-2 { margin-right: .5rem !important; }
.mr-3 { margin-right: 1rem !important; } .mr-4 { margin-right: 1.5rem !important; }
.text-right { text-align: right !important; } .text-left { text-align: left !important; }
.float-right { float: right !important; } .float-left { float: left !important; }
.dropdown-menu-right { right: 0; left: auto; }
.close { border: 0; background: transparent; color: inherit; font-size: 1.5rem; line-height: 1; opacity: .65; }
.close:hover { opacity: 1; }
.bg-soft-primary { background-color: rgba(86,100,210,.15) !important; }
.bg-soft-success { background-color: rgba(52,195,143,.15) !important; }
.bg-soft-info { background-color: rgba(80,165,241,.15) !important; }
.bg-soft-warning { background-color: rgba(241,180,76,.15) !important; }
.bg-soft-danger { background-color: rgba(244,106,106,.15) !important; }

/* Büyük kaynak logoların doğal ölçülerinin üst menüyü taşırmasını engeller. */
.navbar-brand-box .logo img {
    max-width: 100%;
    object-fit: contain;
}
.navbar-brand-box .logo-sm img { height: 34px; }
.navbar-brand-box .logo-lg img {
    width: 202px;
    height: 70px;
}

/* Üst menü: marka solda, kullanıcı kontrolleri daima sağ kenarda. */
#page-topbar .navbar-header > .container-fluid {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    width: 100%;
}
#page-topbar .header-brand {
    order: 1;
    flex: 0 0 auto;
}
#page-topbar .header-controls {
    order: 2;
    flex: 0 0 auto;
    margin-left: auto;
    white-space: nowrap;
}

.stat-card { border: 0; overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 .75rem 1.5rem rgba(18,38,63,.12); }
.stat-icon { width: 52px; height: 52px; display: inline-flex; align-items: center; justify-content: center; border-radius: 14px; font-size: 25px; }
.stat-value { font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; }
.section-heading { display: flex; align-items: center; gap: .65rem; }
.section-heading i { color: var(--bs-primary); }
.table > :not(caption) > * > * { vertical-align: middle; }
.pagination .page-link { min-width: 38px; text-align: center; }
.history-hero { border: 0; background: linear-gradient(135deg, rgba(86,100,210,.16), rgba(52,195,143,.12)); }
.history-copy { font-size: 1.05rem; line-height: 1.9; }
.history-gallery-slot { min-height: 190px; border: 2px dashed var(--bs-border-color); border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-direction: column; color: var(--bs-secondary-color); background: var(--bs-tertiary-bg); }
.history-gallery-image { width: 100%; height: 240px; object-fit: cover; display: block; }
.profile-cover { min-height: 170px; background: linear-gradient(120deg, #5664d2, #50a5f1); border-radius: .5rem .5rem 0 0; }
.profile-avatar { width: 104px; height: 104px; border: 5px solid var(--bs-body-bg); margin-top: -52px; object-fit: cover; }
.select2-container { width: 100% !important; }
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    min-height: 42px;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    min-height: 40px;
    padding: .55rem 2.25rem .55rem .75rem;
    color: var(--bs-body-color);
    line-height: 1.5;
}
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 40px; }
.select2-container--default .select2-selection--multiple { padding: .25rem .4rem; }
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    margin: .15rem .25rem .15rem 0;
    padding: .22rem .55rem .22rem 1.4rem;
    border: 1px solid rgba(var(--bs-primary-rgb), .35);
    border-radius: .35rem;
    background: rgba(var(--bs-primary-rgb), .14);
    color: var(--bs-body-color);
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    height: 100%;
    border-color: rgba(var(--bs-primary-rgb), .25);
    color: var(--bs-body-color);
}
.select2-container--default .select2-search--inline .select2-search__field {
    margin-top: .35rem;
    color: var(--bs-body-color);
}
.select2-dropdown,
.select2-container--default .select2-search--dropdown .select2-search__field {
    border-color: var(--bs-border-color);
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
}
.select2-container--default .select2-results__option--selected { background: var(--bs-tertiary-bg); }
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background: var(--bs-primary);
    color: #fff;
}

/* Bootstrap 4 custom-select sınıfını Bootstrap 5 form-select görünümüne taşır. */
.custom-select {
    display: block;
    width: 100%;
    min-height: 38px;
    padding: .47rem 2.25rem .47rem .75rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    font-size: .875rem;
    line-height: 1.5;
    color-scheme: light;
}
[data-bs-theme="dark"] .custom-select { color-scheme: dark; }
.custom-select:focus {
    border-color: rgba(var(--bs-primary-rgb), .65);
    outline: 0;
    box-shadow: 0 0 0 .15rem rgba(var(--bs-primary-rgb), .18);
}
.form-group { margin-bottom: 1rem; }
.form-control,
.custom-select { box-shadow: none; }

/* Arama sütunlarını görünür ve dokunmatik kullanıma uygun checkbox grubu olarak gösterir. */
.search-filter-options {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: .5rem .65rem;
}
.search-filter-options > .col-form-label {
	flex: 0 0 16.66666667%;
	width: 16.66666667%;
}
.search-filter-options > div {
	flex: 0 0 auto;
	width: auto;
	max-width: 100%;
	margin: 0 !important;
	padding: 0;
}
.search-filter-options .custom-control {
	display: inline-flex;
	align-items: center;
	gap: .45rem;
	min-height: 38px;
	margin: 0 !important;
	padding: .4rem .65rem;
	border: 1px solid var(--bs-border-color);
	border-radius: var(--bs-border-radius);
	background: var(--bs-tertiary-bg);
}
.search-filter-options .custom-control-input {
	position: static !important;
	width: 1.05rem;
	height: 1.05rem;
	margin: 0;
	opacity: 1 !important;
	-webkit-appearance: checkbox;
	appearance: checkbox;
	accent-color: var(--bs-primary);
	cursor: pointer;
}
.search-filter-options .custom-control-label {
	margin: 0;
	line-height: 1.4;
	cursor: pointer;
}
.search-filter-options .custom-control-label::before,
.search-filter-options .custom-control-label::after {
	display: none !important;
}

/* İşlem butonlarında kullanılan MDI ikonlarını aynı optik kutuda hizalar. */
.btn > .mdi.font-size-16 {
    display: inline-flex;
    width: 1rem;
    height: 1rem;
    align-items: center;
    justify-content: center;
    flex: 0 0 1rem;
    font-size: 1rem !important;
    line-height: 1;
    vertical-align: -.125em !important;
}

[data-bs-theme="light"] .card-body,
[data-bs-theme="light"] .history-copy,
[data-bs-theme="light"] .form-label,
[data-bs-theme="light"] .col-form-label { color: #495057; }
[data-bs-theme="light"] .form-control,
[data-bs-theme="light"] .custom-select {
    border-color: #c7ced6;
    background-color: #fff;
    color: #343a40;
}

.page-title-box { min-width: 0; }
.page-title-box .page-title { flex: 0 1 auto; min-width: 0; }
.page-title-box .page-title-right { flex: 0 0 auto; margin-left: auto; padding-left: 1rem; }

.mobile-scroll-hint { scrollbar-color: var(--bs-secondary-color) var(--bs-tertiary-bg); scrollbar-width: thin; }

/* Liste tablolarını sayfayı yatayda büyütmeden okunabilir genişlikte tutar. */
.table-rep-plugin,
.table-rep-plugin .table-wrapper,
.table-rep-plugin .table-responsive {
    min-width: 0;
    max-width: 100%;
}
.table-rep-plugin .table-responsive[data-pattern="priority-columns"] {
    overflow-x: auto;
}
.table-rep-plugin .table-responsive[data-pattern="priority-columns"] > .table {
    width: 100%;
    table-layout: fixed;
}
.table-rep-plugin .table-responsive[data-pattern="priority-columns"] > .table > thead > tr > th,
.table-rep-plugin .table-responsive[data-pattern="priority-columns"] > .table > tbody > tr > td {
    min-width: 0;
	max-width: 18rem;
	white-space: normal;
	overflow-wrap: break-word;
	word-break: normal;
	vertical-align: middle;
}
.table-rep-plugin .sticky-table-header th {
	white-space: normal;
	overflow-wrap: break-word;
	word-break: normal;
}
.table-rep-plugin td[data-columns$="-col-0"] {
    width: 5.5rem;
    white-space: nowrap !important;
}
.table-rep-plugin td[data-columns$="-col-1"] {
    width: 22%;
}
.table-rep-plugin tbody td:last-child {
    width: 11rem;
    white-space: normal;
}
.table-rep-plugin .btn-toolbar {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
}
.table-rep-plugin .dropdown-btn-group {
    margin-left: auto;
}
.table-rep-plugin .dropdown-menu {
    z-index: 1055;
}

.back-to-top-button {
	position: fixed;
	right: 1.5rem;
	bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--bs-primary);
	color: #fff;
	box-shadow: 0 .45rem 1.1rem rgba(var(--bs-primary-rgb), .32);
	font-size: 28px;
	line-height: 1;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(12px) scale(.92);
	transition: opacity .2s ease, transform .2s ease, visibility .2s ease, filter .2s ease;
	z-index: 1040;
}

.back-to-top-button.is-visible {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0) scale(1);
}

.back-to-top-button:hover {
	color: #fff;
	filter: brightness(.92);
	transform: translateY(-2px) scale(1);
}

.back-to-top-button:focus-visible {
	outline: 3px solid rgba(var(--bs-primary-rgb), .3);
	outline-offset: 3px;
}

.back-to-top-button .mdi {
	display: block;
	line-height: 1;
}

@media (prefers-reduced-motion: reduce) {
	.back-to-top-button {
		transition: none;
	}
}

@media (max-width: 767.98px) {
	.back-to-top-button {
		right: 1rem;
		bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
		width: 42px;
		height: 42px;
		font-size: 25px;
	}

	/* Mobilde içerik alanını büyütür; kart ve form kenar boşluklarını dengeler. */
	.page-content {
		padding-right: .5rem !important;
		padding-left: .5rem !important;
	}
	.page-content > .row,
	.page-content > form > .row {
		--bs-gutter-x: 1rem;
	}
	.page-content .card-body {
		padding: 1rem;
	}
	.form-horizontal .form-group.row > [class*="col-"] {
		flex: 0 0 100%;
		width: 100%;
		max-width: 100%;
		min-width: 0;
	}
	.form-horizontal .col-form-label {
		margin-bottom: .35rem;
	}
	.search-filter-options > .col-form-label {
		flex: 0 0 100%;
		width: 100%;
	}
	.search-filter-options > div {
		flex: 0 0 auto;
		width: auto;
	}
	.form-control,
	.custom-select,
	.select2-container,
	.select2-container .select2-search__field {
		width: 100% !important;
		min-width: 0;
		font-size: 16px !important;
	}

	/* Çok sütunlu tabloları daraltmak yerine tablo alanı içinde kaydırır. */
	.table-rep-plugin .table-responsive[data-pattern="priority-columns"] {
		-webkit-overflow-scrolling: touch;
	}
	.table-rep-plugin .table-responsive[data-pattern="priority-columns"] > .table {
		width: 100%;
		min-width: 44rem;
		table-layout: auto;
	}
	.table-rep-plugin .table-responsive[data-pattern="priority-columns"] > .table > thead > tr > th,
	.table-rep-plugin .table-responsive[data-pattern="priority-columns"] > .table > tbody > tr > td {
		min-width: 7rem;
		max-width: 20rem;
		word-break: normal;
		overflow-wrap: break-word;
	}
	.table-rep-plugin .table-responsive[data-pattern="priority-columns"] > .table [id$="-col-1"],
	.table-rep-plugin .table-responsive[data-pattern="priority-columns"] > .table [id$="-col-2"],
	.table-rep-plugin .table-responsive[data-pattern="priority-columns"] > .table td[data-columns$="-col-1"],
	.table-rep-plugin .table-responsive[data-pattern="priority-columns"] > .table td[data-columns$="-col-2"] {
		min-width: 14rem;
	}
	.table-rep-plugin .table-responsive[data-pattern="priority-columns"] > .table td[data-columns$="-col-0"] {
		min-width: 5.5rem;
	}
	.table-rep-plugin .table-responsive[data-pattern="priority-columns"] > .table tbody td:last-child {
		min-width: 11rem;
	}

	.page-title-box { align-items: flex-start !important; gap: .75rem; }
	.page-title-box .page-title-right { display: none; }
	.history-gallery-slot { min-height: 145px; }
	.mobile-scroll-hint::before,
	.table-rep-plugin .table-responsive[data-pattern="priority-columns"]::before {
		content: "Tablonun devamı için yatay kaydırın →";
		display: block;
		position: sticky;
		left: 0;
		width: max-content;
		margin-bottom: .5rem;
		padding: .3rem .55rem;
		border-radius: .3rem;
		background: rgba(var(--bs-info-rgb), .12);
		color: var(--bs-body-color);
		font-size: .75rem;
		direction: ltr;
	}
}
