.wh-30,
.language-flag {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    object-fit: contain;
    display: block;
    border-radius: 50%;
    flex-shrink: 0;
}

.language .language-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 5px 8px 5px 6px !important;
    line-height: 1;
    background-color: #f4f6fc;
    border: 1px solid #e4e9f2;
    border-radius: 8px;
    overflow: visible;
    box-shadow: none;
}

.language .language-toggle-btn:hover,
.language .language-toggle-btn:focus,
.language .language-toggle-btn.show {
    background-color: #eef2f8;
    border-color: #d5dce8;
    color: inherit;
}

.language .language-toggle-btn.dropdown-toggle::after {
    display: inline-block;
    margin-left: 0;
    vertical-align: middle;
    flex-shrink: 0;
    border: 0;
    width: auto;
    height: auto;
    content: "\ea4e";
    font-family: remixicon !important;
    font-size: 14px;
    line-height: 1;
    color: #64748b;
}

.language .language-toggle-fallback {
    font-size: 20px;
    color: #64748b;
    line-height: 1;
}

.language .dropdown-item img.language-flag {
    flex-shrink: 0;
}

.right-header-content .header-right-item.language-item .language .language-toggle-btn {
    background-color: transparent;
    border-color: transparent;
    padding: 0 18px 0 0 !important;
}

.right-header-content .header-right-item.language-item .language .language-toggle-btn.dropdown-toggle::after {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
}

[data-theme=dark] .language .language-toggle-btn {
    background-color: #28333f;
    border-color: rgba(255, 255, 255, .12);
}

[data-theme=dark] .language .language-toggle-btn:hover,
[data-theme=dark] .language .language-toggle-btn:focus,
[data-theme=dark] .language .language-toggle-btn.show {
    background-color: #323d4a;
    border-color: rgba(255, 255, 255, .18);
}

[data-theme=dark] .language .language-toggle-btn.dropdown-toggle::after,
[data-theme=dark] .language .language-toggle-fallback {
    color: #fff;
}

.right-header-content .header-right-item.language-item .language .language-toggle-btn.dropdown-toggle::after {
    color: #475569;
}

[data-theme=dark] .right-header-content .header-right-item.language-item .language .language-toggle-btn.dropdown-toggle::after {
    color: #fff !important;
}

/* Tenant switcher (master users) */
.right-header-content .header-right-item.tenant-switcher-item {
    margin-right: 20px;
}

.tenant-switcher .tenant-switcher-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 18px 0 0 !important;
    line-height: 1.2 !important;
    background-color: transparent;
    border: 0;
    box-shadow: none;
    max-width: 200px;
    position: relative;
}

.tenant-switcher-icon {
    font-size: 19px;
    color: #475569;
    flex-shrink: 0;
    line-height: 1;
}

.tenant-switcher-label {
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    max-width: 140px;
    line-height: 1.2;
}

.tenant-switcher .tenant-switcher-btn.dropdown-toggle::after {
    display: inline-block;
    margin-left: 0;
    border: 0;
    width: auto;
    height: auto;
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    content: "\ea4e";
    font-family: remixicon !important;
    font-size: 14px;
    line-height: 1;
    color: #475569;
}

.tenant-switcher-menu {
    width: 240px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 4px 45px rgba(0, 0, 0, .1);
    overflow: hidden;
}

.tenant-switcher-menu-title {
    padding: 16px 16px 12px;
    font-size: 15px;
    font-weight: 600;
    color: #475569;
    border-bottom: 1px solid #eef2f7;
}

.tenant-switcher-list {
    padding: 8px;
}

.tenant-switcher-form {
    margin: 0;
}

.tenant-switcher-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    text-align: left;
    transition: background-color .15s ease;
    outline: none;
    box-shadow: none;
}

.tenant-switcher-option:hover,
.tenant-switcher-option:focus,
.tenant-switcher-option:focus-visible {
    background-color: #f4f6fc;
    outline: none;
    box-shadow: none;
}

.tenant-switcher-option.is-active,
.tenant-switcher-option.is-active:hover,
.tenant-switcher-option.is-active:focus {
    background-color: #0f79f3;
}

.tenant-switcher-option-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(15, 121, 243, .1);
    flex-shrink: 0;
}

.tenant-switcher-option-icon .material-symbols-outlined {
    font-size: 20px;
    color: #0f79f3;
    line-height: 1;
}

.tenant-switcher-option-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tenant-switcher-option-name {
    font-size: 15px;
    font-weight: 500;
    color: #334155;
    line-height: 1.3;
}

.tenant-switcher-option-slug {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.2;
}

.tenant-switcher-option.is-active .tenant-switcher-option-icon {
    background-color: rgba(255, 255, 255, .18);
}

.tenant-switcher-option.is-active .tenant-switcher-option-icon .material-symbols-outlined,
.tenant-switcher-option.is-active .tenant-switcher-option-name,
.tenant-switcher-option.is-active .tenant-switcher-option-slug {
    color: #fff;
}

[data-theme=dark] .tenant-switcher-icon,
[data-theme=dark] .tenant-switcher-label,
[data-theme=dark] .tenant-switcher .tenant-switcher-btn.dropdown-toggle::after {
    color: #fff;
}

[data-theme=dark] .tenant-switcher .tenant-switcher-btn:hover,
[data-theme=dark] .tenant-switcher .tenant-switcher-btn:focus,
[data-theme=dark] .tenant-switcher .tenant-switcher-btn.show {
    color: #fff;
}

[data-theme=dark] .tenant-switcher-menu {
    background-color: #1b232d;
    box-shadow: 0 4px 45px rgba(0, 0, 0, .35);
}

[data-theme=dark] .tenant-switcher-menu-title {
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, .09);
}

[data-theme=dark] .tenant-switcher-option:hover,
[data-theme=dark] .tenant-switcher-option:focus,
[data-theme=dark] .tenant-switcher-option:focus-visible {
    background-color: #293542;
}

[data-theme=dark] .tenant-switcher-option-name {
    color: rgba(255, 255, 255, .92);
}

[data-theme=dark] .tenant-switcher-option-slug {
    color: rgba(255, 255, 255, .5);
}

[data-theme=dark] .tenant-switcher-option-icon {
    background-color: rgba(15, 121, 243, .18);
}

[data-theme=dark] .tenant-switcher-option:hover .tenant-switcher-option-name,
[data-theme=dark] .tenant-switcher-option:focus .tenant-switcher-option-name {
    color: #fff;
}

[data-theme=dark] .tenant-switcher-option:hover .tenant-switcher-option-slug,
[data-theme=dark] .tenant-switcher-option:focus .tenant-switcher-option-slug {
    color: rgba(255, 255, 255, .65);
}

/* Hızlı işlemler menüsü: firma seçicisiyle aynı görünüm, iki sütunlu kısayol ızgarası. */
.right-header-content .header-right-item.quick-actions-item {
    margin-right: 20px;
}

.quick-actions .quick-actions-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 18px 0 0 !important;
    line-height: 1.2 !important;
    background-color: transparent;
    border: 0;
    box-shadow: none;
    position: relative;
}

.quick-actions-icon {
    font-size: 20px;
    color: #0f79f3;
    flex-shrink: 0;
    line-height: 1;
}

.quick-actions-label {
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    white-space: nowrap;
}

.quick-actions .quick-actions-btn.dropdown-toggle::after {
    display: inline-block;
    margin-left: 0;
    border: 0;
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    content: "\ea4e";
    font-family: remixicon !important;
    font-size: 14px;
    line-height: 1;
    color: #475569;
}

.quick-actions-menu {
    width: 320px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 4px 45px rgba(0, 0, 0, .1);
    overflow: hidden;
}

.quick-actions-menu-title {
    padding: 16px 16px 12px;
    font-size: 15px;
    font-weight: 600;
    color: #475569;
    border-bottom: 1px solid #eef2f7;
}

.quick-actions-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 8px;
}

.quick-actions-option {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color .15s ease;
}

.quick-actions-option:hover,
.quick-actions-option:focus-visible {
    background-color: #f4f6fc;
    outline: none;
}

.quick-actions-option-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: rgba(15, 121, 243, .1);
    flex-shrink: 0;
}

.quick-actions-option-icon .material-symbols-outlined {
    font-size: 19px;
    color: #0f79f3;
    line-height: 1;
}

.quick-actions-option-name {
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

[data-theme=dark] .quick-actions-label,
[data-theme=dark] .quick-actions .quick-actions-btn.dropdown-toggle::after {
    color: #fff;
}

[data-theme=dark] .quick-actions-menu {
    background-color: #1b232d;
    box-shadow: 0 4px 45px rgba(0, 0, 0, .35);
}

[data-theme=dark] .quick-actions-menu-title {
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, .09);
}

[data-theme=dark] .quick-actions-option:hover,
[data-theme=dark] .quick-actions-option:focus-visible {
    background-color: #293542;
}

[data-theme=dark] .quick-actions-option-name {
    color: rgba(255, 255, 255, .92);
}

[data-theme=dark] .quick-actions-option-icon {
    background-color: rgba(15, 121, 243, .18);
}

/* Language dropdown menus */
.language .dropdown-menu {
    width: 220px;
    border-radius: 7px;
    background: #fff;
    box-shadow: 0 4px 45px rgba(0, 0, 0, .1);
}

.language .dropdown-menu .title {
    padding: 20px 25px;
}

.language .dropdown-menu .notification-menu {
    border-top: 1px dashed #eee;
}

.language .dropdown-menu .dropdown-item {
    padding: 14px 25px;
    white-space: normal;
}

[data-theme=dark] .language .dropdown-menu {
    background-color: #1b232d !important;
    box-shadow: 0 4px 45px rgba(0, 0, 0, .35);
}

[data-theme=dark] .language .dropdown-menu .title {
    color: #fff !important;
}

[data-theme=dark] .language .dropdown-menu .notification-menu {
    border-color: rgba(255, 255, 255, .09) !important;
}

[data-theme=dark] .language .dropdown-menu .dropdown-item {
    color: rgba(255, 255, 255, .85);
}

[data-theme=dark] .language .dropdown-menu .dropdown-item .text-secondary {
    color: rgba(255, 255, 255, .85) !important;
}

[data-theme=dark] .language .dropdown-menu .dropdown-item:hover,
[data-theme=dark] .language .dropdown-menu .dropdown-item:focus {
    background-color: #293542 !important;
    color: #fff;
}

[data-theme=dark] .language .dropdown-menu .dropdown-item:hover .text-secondary,
[data-theme=dark] .language .dropdown-menu .dropdown-item:focus .text-secondary {
    color: #fff !important;
}

[data-theme=dark] .language .dropdown-menu .dropdown-item.active,
[data-theme=dark] .language .dropdown-menu .dropdown-item.active:hover,
[data-theme=dark] .language .dropdown-menu .dropdown-item.active:focus {
    background-color: #0f79f3 !important;
    color: #fff;
}

[data-theme=dark] .language .dropdown-menu .dropdown-item.active .text-secondary {
    color: #fff !important;
}

/* primary buttons: white text on blue background */
.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-color: #fff;
    --bs-btn-disabled-color: #fff;
    color: #fff !important;
}

.btn-primary .material-symbols-outlined {
    color: #fff;
}

/* Toastify overrides */
.toastify-custom {
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    padding: 12px 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
    max-width: 380px;
    word-break: break-word;
}

.toastify-custom .toast-close {
    opacity: .8;
    font-size: 18px;
}

.toastify-custom.toastify-success {
    background: linear-gradient(135deg, #3ecf8e 0%, #1a9e6e 100%);
    color: #fff;
}

.toastify-custom.toastify-error {
    background: linear-gradient(135deg, #ff6b6b 0%, #c0392b 100%);
    color: #fff;
}

.toastify-custom.toastify-warning {
    background: linear-gradient(135deg, #f7b731 0%, #e67e22 100%);
    color: #fff;
}

/* Dark mode: keep the same vivid gradients — muted dark chips were nearly invisible. */
[data-theme="dark"] .toastify-custom.toastify-success,
[data-bs-theme="dark"] .toastify-custom.toastify-success {
    background: linear-gradient(135deg, #3ecf8e 0%, #1a9e6e 100%);
    color: #fff;
    border: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
}

[data-theme="dark"] .toastify-custom.toastify-error,
[data-bs-theme="dark"] .toastify-custom.toastify-error {
    background: linear-gradient(135deg, #ff6b6b 0%, #c0392b 100%);
    color: #fff;
    border: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
}

[data-theme="dark"] .toastify-custom.toastify-warning,
[data-bs-theme="dark"] .toastify-custom.toastify-warning {
    background: linear-gradient(135deg, #f7b731 0%, #e67e22 100%);
    color: #fff;
    border: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
}

/* supplier show — avatar initials */
.supplier-initials-avatar {
    width: 130px;
    height: 130px;
    font-size: 2.8rem;
    border: 6px solid #fff;
    flex-shrink: 0;
}

.supplier-contact-avatar {
    width: 48px;
    height: 48px;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* ── Platform Admin sidebar ── */
.platform-sidebar .logo {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-bottom: none;
}
.platform-sidebar .logo .logo-text {
    color: #fff !important;
    opacity: 1;
    position: static;
    transform: none;
    left: auto;
    top: auto;
    font-size: 20px;
}
.platform-sidebar .logo .platform-logo-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: calc(100% - 36px);
}
/* Collapsed (mini) sidebar: sadece logo ikonu ortada görünsün */
[sidebar-data-theme=sidebar-hide] .platform-sidebar:not(:hover) .logo,
[icon-sidebar-none-data-theme=icon-sidebar-block-switch] .platform-sidebar:not(:hover) .logo {
    justify-content: center !important;
}
[sidebar-data-theme=sidebar-hide] .platform-sidebar:not(:hover) .logo .platform-logo-link,
[icon-sidebar-none-data-theme=icon-sidebar-block-switch] .platform-sidebar:not(:hover) .logo .platform-logo-link {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 100%;
    width: 100%;
}
[sidebar-data-theme=sidebar-hide] .platform-sidebar:not(:hover) .logo .logo-text,
[sidebar-data-theme=sidebar-hide] .platform-sidebar:not(:hover) .platform-badge,
[icon-sidebar-none-data-theme=icon-sidebar-block-switch] .platform-sidebar:not(:hover) .logo .logo-text,
[icon-sidebar-none-data-theme=icon-sidebar-block-switch] .platform-sidebar:not(:hover) .platform-badge,
[sidebar-data-theme=sidebar-hide] .platform-sidebar:not(:hover) .logo .platform-logo-link > *:not(img),
[icon-sidebar-none-data-theme=icon-sidebar-block-switch] .platform-sidebar:not(:hover) .logo .platform-logo-link > *:not(img) {
    display: none !important;
}
[sidebar-data-theme=sidebar-hide] .platform-sidebar:not(:hover) .sidebar-burger-menu,
[icon-sidebar-none-data-theme=icon-sidebar-block-switch] .platform-sidebar:not(:hover) .sidebar-burger-menu {
    display: none !important;
}
[sidebar-data-theme=sidebar-hide] .platform-sidebar:not(:hover) .logo img,
[icon-sidebar-none-data-theme=icon-sidebar-block-switch] .platform-sidebar:not(:hover) .logo img {
    margin: 0;
}
.platform-sidebar .logo img {
    filter: brightness(0) invert(1);
    flex-shrink: 0;
}
.platform-sidebar .logo .for-dark-burger {
    border-bottom-color: rgba(255,255,255,.7) !important;
}
.platform-sidebar .platform-badge {
    background: rgba(255,255,255,.15);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    color: #fff;
    padding: 2px 7px;
    text-transform: uppercase;
    flex-shrink: 0;
    line-height: 1.4;
}
/* Close/hover genişlemede badge çakışmasın */
[sidebar-data-theme=sidebar-hide] .platform-sidebar:hover .platform-badge,
[icon-sidebar-none-data-theme=icon-sidebar-block-switch] .platform-sidebar:hover .platform-badge {
    display: none;
}
@media (max-width: 1199px) {
    [sidebar-data-theme=sidebar-hide] .platform-sidebar .platform-badge,
    [icon-sidebar-none-data-theme=icon-sidebar-block-switch] .platform-sidebar .platform-badge {
        display: none;
    }
}

/* ── Dark mode: platform & shared fixes ── */
[data-theme=dark] .text-muted {
    color: rgba(255, 255, 255, .45) !important;
}

[data-theme=dark] .default-table-area p {
    color: #fff !important;
}

[data-theme=dark] .default-table-area small {
    color: rgba(255, 255, 255, .45) !important;
}

[data-theme=dark] .table-light {
    --bs-table-bg: #131920;
    --bs-table-color: #fff;
    --bs-table-border-color: rgba(255, 255, 255, .09);
}

[data-theme=dark] .list-group-item {
    background-color: #1b232d;
    border-color: rgba(255, 255, 255, .09);
    color: #fff;
}

[data-theme=dark] code.bg-light {
    background-color: #131920 !important;
    color: rgba(255, 255, 255, .7) !important;
}

[data-theme=dark] .input-group-text {
    background-color: #1b232d !important;
    border-color: rgba(255, 255, 255, .15) !important;
    color: rgba(255, 255, 255, .7) !important;
}

[data-theme=dark] .form-select {
    background-color: #1b232d !important;
    border-color: rgba(255, 255, 255, .15) !important;
    color: #fff !important;
    --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23dee2e6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

[data-theme=dark] .form-select:focus {
    border-color: #0f79f3 !important;
    box-shadow: none;
}

[data-theme=dark] .form-select option {
    background-color: #1b232d;
    color: #fff;
}

[data-theme=dark] .form-label {
    color: #fff;
}

[data-theme=dark] .form-check-label {
    color: rgba(255, 255, 255, .85);
}

/*
 * Tema (style.css) tüm .form-check-input'ları 18×18 kareye zorluyor;
 * Bootstrap form-switch genişliği/border-radius'u eziliyor → bozuk "kutucuk".
 * Switch'leri temaya uygun pill toggle olarak geri yükle.
 */
.form-check.form-switch {
    padding-left: 0;
    min-height: 1.6em;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.form-check.form-switch .form-check-input {
    --cari-switch-thumb: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
    float: none;
    width: 2.75em;
    height: 1.4em;
    margin-top: 0;
    margin-left: 0;
    border: 1px solid #cbd5e1;
    border-radius: 2em;
    background-color: #cbd5e1;
    background-image: var(--cari-switch-thumb);
    background-position: left center;
    background-repeat: no-repeat;
    background-size: contain;
    transition: background-position 0.15s ease-in-out, background-color 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
    flex-shrink: 0;
}

.form-check.form-switch .form-check-input:focus {
    border-color: #0f79f3;
    box-shadow: 0 0 0 0.2rem rgba(15, 121, 243, 0.25);
}

.form-check.form-switch .form-check-input:checked {
    background-color: #0f79f3;
    border-color: #0f79f3;
    background-position: right center;
}

.form-check.form-switch .form-check-label {
    padding-left: 0;
    cursor: pointer;
    color: inherit;
    line-height: 1.35;
    user-select: none;
}

[data-theme='dark'] .form-check.form-switch .form-check-input:not(:checked),
[data-bs-theme='dark'] .form-check.form-switch .form-check-input:not(:checked) {
    background-color: #3d4a5c;
    border-color: #4a5568;
}

[data-theme='dark'] .form-check.form-switch .form-check-input:checked,
[data-bs-theme='dark'] .form-check.form-switch .form-check-input:checked {
    background-color: #0f79f3;
    border-color: #0f79f3;
}

/* Number / date input native spinner & picker — light/dark uyumu
   Tema data-theme kullanıyor; Bootstrap color-scheme yalnızca data-bs-theme'de. */
input[type="number"],
input[type="date"],
input[type="time"],
input[type="datetime-local"] {
    color-scheme: light;
}

[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] input[type="datetime-local"],
[data-bs-theme="dark"] input[type="number"],
[data-bs-theme="dark"] input[type="date"],
[data-bs-theme="dark"] input[type="time"],
[data-bs-theme="dark"] input[type="datetime-local"] {
    color-scheme: dark;
}

/* WebKit: spinner okları koyu arka planda görünür kalsın */
[data-theme="dark"] input[type="number"]::-webkit-inner-spin-button,
[data-theme="dark"] input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;
}

[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(0.85);
    opacity: 0.9;
}

/* Table radio buttons — clearer unselected border in light mode */
.default-table-area .form-check-input[type=radio] {
    width: 18px;
    height: 18px;
    border: 2px solid #94a3b8;
    cursor: pointer;
}

.default-table-area .form-check-input[type=radio]:focus {
    border-color: #0f79f3;
    box-shadow: 0 0 0 0.2rem rgba(15, 121, 243, 0.2);
}

.default-table-area .form-check-input[type=radio]:checked {
    border-color: #0f79f3;
}

[data-theme=dark] .alert-warning,
[data-bs-theme=dark] .alert-warning {
    background-color: rgba(255, 193, 7, .12) !important;
    border-color: rgba(255, 193, 7, .25) !important;
    color: rgba(255, 255, 255, .9) !important;
}

[data-theme=dark] .alert-danger,
[data-bs-theme=dark] .alert-danger {
    background-color: rgba(220, 53, 69, .14) !important;
    border-color: rgba(220, 53, 69, .32) !important;
    color: #f1aeb5 !important;
}

[data-theme=dark] .alert-warning a {
    color: #6ea8fe;
}

[data-theme=dark] .alert-info,
[data-bs-theme=dark] .alert-info {
    background-color: rgba(13, 202, 240, .12) !important;
    border-color: rgba(13, 202, 240, .28) !important;
    color: rgba(255, 255, 255, .9) !important;
}

[data-theme=dark] .alert-info .alert-link,
[data-bs-theme=dark] .alert-info .alert-link,
[data-theme=dark] .alert-info a,
[data-bs-theme=dark] .alert-info a {
    color: #6ea8fe !important;
}

[data-theme=dark] .btn-outline-secondary {
    color: rgba(255, 255, 255, .7);
    border-color: rgba(255, 255, 255, .2);
}

[data-theme=dark] .btn-outline-secondary:hover {
    background-color: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .3);
    color: #fff;
}

/* Platform permissions list — dark mode */
[data-theme=dark] .default-table-area .table-responsive .table tbody tr td {
    background-color: #1b232d;
    color: rgba(255, 255, 255, .85);
}

[data-theme=dark] .card .card-header h6 {
    color: #fff;
}

[data-theme=dark] code.permission-key-badge {
    background-color: #131920 !important;
    color: rgba(255, 255, 255, .7) !important;
}

[data-theme=dark] .badge.bg-info.bg-opacity-10.text-info {
    color: #6edff6 !important;
    background-color: rgba(13, 202, 240, .15) !important;
}

.platform-table-action-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.platform-table-action-btn .material-symbols-outlined {
    font-size: 16px;
}

code.permission-key-badge {
    color: #64748b;
    background-color: #f1f5f9;
}

/* Permission edit sidebar — scoped contrast overrides */
.permission-edit-sidebar .permission-sidebar-title {
    color: #1e293b !important;
}

.permission-edit-sidebar .permission-sidebar-body {
    color: #334155 !important;
}

.permission-edit-sidebar .permission-sidebar-desc,
.permission-edit-sidebar .permission-sidebar-meta {
    color: #64748b !important;
}

.permission-edit-sidebar .permission-key-badge--sidebar,
.permission-edit-sidebar .permission-key-badge--inline {
    color: #475569 !important;
    background-color: #e2e8f0 !important;
}

.permission-edit-sidebar .permission-related-item .permission-key-badge--inline {
    margin-top: 0.35rem;
    display: inline-block;
}

.permission-related-item--current {
    border-left: 3px solid #0f79f3;
    padding-left: calc(1.5rem - 3px) !important;
}

.permission-current-badge {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    padding: 0.3rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    border-radius: 999px;
    color: #0369a1;
    background-color: #e0f2fe;
    border: 1px solid #7dd3fc;
}

[data-theme=dark] .permission-edit-sidebar .permission-sidebar-title,
[data-theme=dark] .permission-edit-sidebar .permission-related-item--current .permission-related-label {
    color: #fff !important;
}

[data-theme=dark] .permission-edit-sidebar .permission-sidebar-body,
[data-theme=dark] .permission-edit-sidebar .permission-related-label {
    color: rgba(255, 255, 255, 0.85) !important;
}

[data-theme=dark] .permission-edit-sidebar .permission-sidebar-desc,
[data-theme=dark] .permission-edit-sidebar .permission-sidebar-meta {
    color: rgba(255, 255, 255, 0.6) !important;
}

[data-theme=dark] .permission-edit-sidebar .permission-key-badge--sidebar,
[data-theme=dark] .permission-edit-sidebar .permission-key-badge--inline {
    color: #cbd5e1 !important;
    background-color: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme=dark] .permission-edit-sidebar .permission-related-item--current .permission-key-badge--inline {
    color: #bfdbfe !important;
    background-color: rgba(61, 155, 245, 0.15) !important;
    border-color: rgba(61, 155, 245, 0.35) !important;
}

[data-theme=dark] .permission-related-item--current {
    border-left-color: #3d9bf5;
}

[data-theme=dark] .permission-current-badge {
    color: #bfdbfe;
    background-color: rgba(61, 155, 245, 0.15);
    border-color: rgba(61, 155, 245, 0.4);
}

.confirm-modal__dialog {
    max-width: 420px;
}

.confirm-modal__icon {
    width: 64px;
    height: 64px;
}

.confirm-modal__message {
    line-height: 1.6;
    white-space: pre-line;
}

[data-theme=dark] .confirm-modal__icon.bg-danger.bg-opacity-10,
[data-bs-theme=dark] .confirm-modal__icon.bg-danger.bg-opacity-10 {
    background-color: rgba(220, 53, 69, 0.15) !important;
}

[data-theme=dark] .confirm-modal__icon.bg-primary.bg-opacity-10,
[data-bs-theme=dark] .confirm-modal__icon.bg-primary.bg-opacity-10 {
    background-color: rgba(15, 121, 243, 0.15) !important;
}

.confirm-modal__icon--caution {
    background-color: rgba(15, 121, 243, 0.12);
    color: var(--bs-primary);
}

.confirm-modal__btn--caution {
    --bs-btn-color: #fff;
    --bs-btn-bg: #0f79f3;
    --bs-btn-border-color: #0f79f3;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #0d6de0;
    --bs-btn-hover-border-color: #0c66d4;
    --bs-btn-focus-shadow-rgb: 15, 121, 243;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #0c66d4;
    --bs-btn-active-border-color: #0b5fc8;
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #0f79f3;
    --bs-btn-disabled-border-color: #0f79f3;
}

[data-theme=dark] .confirm-modal__icon--caution,
[data-bs-theme=dark] .confirm-modal__icon--caution {
    background-color: rgba(61, 155, 245, 0.15);
    color: #6faef8;
}

[data-theme=dark] .confirm-modal__btn--caution,
[data-bs-theme=dark] .confirm-modal__btn--caution {
    --bs-btn-color: #fff;
    --bs-btn-bg: #3d9bf5;
    --bs-btn-border-color: #3d9bf5;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #6faef8;
    --bs-btn-hover-border-color: #6faef8;
    --bs-btn-focus-shadow-rgb: 61, 155, 245;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #2d8be8;
    --bs-btn-active-border-color: #2d8be8;
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #3d9bf5;
    --bs-btn-disabled-border-color: #3d9bf5;
}

/* Translation files index */
.translation-stat-card {
    transition: box-shadow 0.15s ease;
}

.translation-stat-card:hover {
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08) !important;
}

.translation-stat-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    flex-shrink: 0;
}

.translation-stat-card__icon .material-symbols-outlined {
    font-size: 22px;
}

.translation-progress {
    height: 8px;
    background-color: #e2e8f0;
}

.translation-file-row {
    cursor: pointer;
    transition: background-color 0.12s ease;
}

.translation-file-row:hover {
    background-color: #f8fafc;
}

code.translation-file-badge {
    color: #475569;
    background-color: #f1f5f9;
}

[data-theme=dark] .translation-stat-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25) !important;
}

[data-theme=dark] .translation-progress {
    background-color: rgba(255, 255, 255, 0.08);
}

[data-theme=dark] .translation-file-row:hover {
    background-color: rgba(255, 255, 255, 0.04);
}

[data-theme=dark] code.translation-file-badge {
    color: #cbd5e1;
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

code.translation-key-badge {
    color: #64748b;
    background-color: #f1f5f9;
}

.translation-file-card {
    transition: box-shadow 0.15s ease;
}

.translation-file-card:hover {
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08) !important;
}

.translation-file-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    background-color: #f8fafc;
}

.translation-file-card__title-wrap {
    border-left: 3px solid #0f79f3;
    padding-left: 0.875rem;
}

.translation-file-card__title {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.3;
    color: #1e293b;
    letter-spacing: -0.02em;
}

.translation-file-card__count {
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8125rem;
}

.translation-search-toolbar {
    row-gap: 0.75rem;
}

.translation-search-form-wrap {
    flex: 1 1 280px;
    min-width: min(100%, 280px);
    max-width: 420px;
}

.translation-search-form__input {
    height: 40px;
    padding-left: 2.75rem;
    border-radius: 8px;
    background-color: #f4f6fc;
    border-color: #e4e9f2;
    color: #475569;
}

.translation-search-form__input::placeholder {
    color: #94a3b8;
    font-size: 14px;
}

.translation-search-form__input:focus {
    background-color: #fff;
    border-color: #c7d2e0;
    box-shadow: none;
}

.translation-search-form__icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    line-height: 1;
    color: #64748b;
    pointer-events: none;
}

.translation-search-toolbar__label {
    flex-shrink: 0;
    white-space: nowrap;
}

.translation-search-toolbar__actions {
    flex-shrink: 0;
}

.translation-missing-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    height: 40px;
    padding: 0 1rem;
    border: 1px solid #e4e9f2;
    border-radius: 8px;
    background-color: #f4f6fc;
    color: #475569;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.translation-missing-filter-btn:hover {
    background-color: #eef2f8;
    border-color: #c7d2e0;
    color: #334155;
}

.translation-missing-filter-btn:focus-visible {
    outline: none;
    border-color: #3d9bf5;
    box-shadow: 0 0 0 0.2rem rgba(61, 155, 245, 0.15);
}

.translation-missing-filter-btn.is-active,
.translation-missing-filter-btn[aria-pressed="true"] {
    background-color: rgba(61, 155, 245, 0.12);
    border-color: rgba(61, 155, 245, 0.35);
    color: #2563eb;
}

.translation-missing-filter-btn.is-active:hover,
.translation-missing-filter-btn[aria-pressed="true"]:hover {
    background-color: rgba(61, 155, 245, 0.18);
    border-color: rgba(61, 155, 245, 0.45);
    color: #1d4ed8;
}

.translation-missing-filter-btn__icon {
    font-size: 18px;
    line-height: 1;
}

.translation-input--missing {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.translation-input--missing:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 0.2rem rgba(239, 68, 68, 0.15);
}

.translation-key-row--missing td {
    background-color: rgba(254, 242, 242, 0.45);
}

.translation-key-row--missing td:first-child {
    box-shadow: inset 3px 0 0 #ef4444;
}

.translation-form-actions {
    position: sticky;
    bottom: 0;
    z-index: 10;
    padding: 1rem 1.25rem;
    margin-left: -1.25rem;
    margin-right: -1.25rem;
    margin-bottom: -0.5rem;
    background: linear-gradient(to top, #f0f2f8 70%, transparent);
}

[data-theme=dark] code.translation-key-badge {
    color: #cbd5e1;
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme=dark] .translation-file-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25) !important;
}

[data-theme=dark] .translation-file-card__header {
    background-color: rgba(255, 255, 255, 0.04);
}

[data-theme=dark] .translation-file-card__title {
    color: #f1f5f9;
}

[data-theme=dark] .translation-file-card__title-wrap {
    border-left-color: #3d9bf5;
}

[data-theme=dark] .translation-search-form__input {
    background-color: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

[data-theme=dark] .translation-search-form__input:focus {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.18);
}

[data-theme=dark] .translation-search-form__input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

[data-theme=dark] .translation-search-form__icon {
    color: rgba(255, 255, 255, 0.65);
}

[data-theme=dark] .translation-input--missing {
    border-color: rgba(239, 68, 68, 0.65);
    background-color: rgba(239, 68, 68, 0.08);
}

[data-theme=dark] .translation-input--missing:focus {
    border-color: rgba(239, 68, 68, 0.85);
    box-shadow: 0 0 0 0.2rem rgba(239, 68, 68, 0.12);
}

[data-theme=dark] .translation-key-row--missing td {
    background-color: rgba(239, 68, 68, 0.08);
}

[data-theme=dark] .translation-key-row--missing td:first-child {
    box-shadow: inset 3px 0 0 rgba(239, 68, 68, 0.75);
}

[data-theme=dark] .translation-missing-filter-btn {
    background-color: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
}

[data-theme=dark] .translation-missing-filter-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.18);
    color: #f1f5f9;
}

[data-theme=dark] .translation-missing-filter-btn:focus-visible {
    border-color: rgba(61, 155, 245, 0.65);
    box-shadow: 0 0 0 0.2rem rgba(61, 155, 245, 0.12);
}

[data-theme=dark] .translation-missing-filter-btn.is-active,
[data-theme=dark] .translation-missing-filter-btn[aria-pressed="true"] {
    background-color: rgba(61, 155, 245, 0.16);
    border-color: rgba(61, 155, 245, 0.4);
    color: #93c5fd;
}

[data-theme=dark] .translation-missing-filter-btn.is-active:hover,
[data-theme=dark] .translation-missing-filter-btn[aria-pressed="true"]:hover {
    background-color: rgba(61, 155, 245, 0.22);
    border-color: rgba(61, 155, 245, 0.5);
    color: #bfdbfe;
}

[data-theme=dark] .translation-form-actions {
    background: linear-gradient(to top, #0f172a 70%, transparent);
}

/* ============================================================
   Tom Select — genel uyum ve dark mode
   ============================================================ */

/* Açık mod: Bootstrap form-select ile aynı görünüm */
.ts-control,
.ts-wrapper.single .ts-control {
    min-height: calc(1.5em + 0.75rem + 2px);
    padding: 0.375rem 2.25rem 0.375rem 0.75rem;
    font-size: 0.9375rem;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.ts-wrapper.focus .ts-control {
    border-color: #0f79f3;
    box-shadow: 0 0 0 0.2rem rgba(15, 121, 243, 0.25);
}

.ts-dropdown {
    border-radius: 0.375rem;
    margin-top: 2px;
    font-size: 0.9375rem;
}

/* Temel input kontrol alanı */
[data-theme=dark] .ts-control,
[data-theme=dark] .ts-wrapper.single .ts-control,
[data-theme=dark] .ts-wrapper.multi .ts-control {
    background-color: #1b232d !important;
    border-color: rgba(255, 255, 255, 0.149) !important;
    color: #fff !important;
}

[data-theme=dark] .ts-wrapper.focus .ts-control,
[data-theme=dark] .ts-wrapper.single.focus .ts-control {
    border-color: #0f79f3 !important;
    box-shadow: 0 0 0 0.2rem rgba(15, 121, 243, 0.25) !important;
}

/* Input içindeki yazı rengi */
[data-theme=dark] .ts-control input,
[data-theme=dark] .ts-control input::placeholder {
    color: rgba(255, 255, 255, 0.45) !important;
    background: transparent !important;
}

[data-theme=dark] .ts-control input:focus {
    color: #fff !important;
}

/* Seçili tek değer */
[data-theme=dark] .ts-wrapper.single .ts-control .item {
    color: #fff !important;
}

/* Çok seçimli etiketler */
[data-theme=dark] .ts-wrapper.multi .ts-control .item {
    background-color: rgba(15, 121, 243, 0.25) !important;
    border-color: rgba(15, 121, 243, 0.5) !important;
    color: #bfdbfe !important;
}

[data-theme=dark] .ts-wrapper.multi .ts-control .item .remove {
    border-color: rgba(15, 121, 243, 0.5) !important;
    color: #bfdbfe !important;
}

/* Dropdown panel */
[data-theme=dark] .ts-dropdown {
    background-color: #1b232d !important;
    border-color: rgba(255, 255, 255, 0.149) !important;
    color: #fff !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
}

[data-theme=dark] .ts-dropdown .ts-dropdown-content {
    background-color: #1b232d !important;
}

/* Seçenek satırları */
[data-theme=dark] .ts-dropdown .option {
    color: #fff !important;
    background-color: transparent !important;
}

[data-theme=dark] .ts-dropdown .option.active,
[data-theme=dark] .ts-dropdown .option:hover {
    background-color: rgba(15, 121, 243, 0.18) !important;
    color: #bfdbfe !important;
}

[data-theme=dark] .ts-dropdown .option.selected {
    background-color: rgba(15, 121, 243, 0.28) !important;
    color: #93c5fd !important;
}

[data-theme=dark] .ts-dropdown .option.selected.active {
    background-color: rgba(15, 121, 243, 0.38) !important;
}

/* Grup başlıkları */
[data-theme=dark] .ts-dropdown .optgroup-header {
    color: rgba(255, 255, 255, 0.45) !important;
    background-color: #131920 !important;
}

/* Arama kutusu */
[data-theme=dark] .ts-dropdown .ts-dropdown-content input.ts-search,
[data-theme=dark] .ts-control input[type="text"] {
    background-color: transparent !important;
    color: #fff !important;
}

/* Ok (caret) simgesi */
[data-theme=dark] .ts-wrapper.single .ts-control::after {
    border-top-color: rgba(255, 255, 255, 0.6) !important;
}

[data-theme=dark] .ts-wrapper.single.open .ts-control::after {
    border-bottom-color: rgba(255, 255, 255, 0.6) !important;
}

/* Devre dışı */
[data-theme=dark] .ts-wrapper.disabled .ts-control {
    background-color: rgba(27, 35, 45, 0.6) !important;
    color: rgba(255, 255, 255, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Scrollbar */
[data-theme=dark] .ts-dropdown .ts-dropdown-content::-webkit-scrollbar {
    width: 6px;
}
[data-theme=dark] .ts-dropdown .ts-dropdown-content::-webkit-scrollbar-track {
    background: #131920;
}
[data-theme=dark] .ts-dropdown .ts-dropdown-content::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

/* Platform panel — açık modda okunabilir metin renkleri */
body.platform-panel:not([data-theme=dark]) {
    --bs-body-color: #334155;
    --bs-body-color-rgb: 51, 65, 85;
    --bs-heading-color: #1e293b;
    --bs-emphasis-color: #1e293b;
    --bs-emphasis-color-rgb: 30, 41, 59;
    --bs-secondary-color: #64748b;
    --bs-secondary-color-rgb: 100, 116, 139;
    --bs-tertiary-color: #94a3b8;
}

/* ============================================================
   Sidebar live search
   ============================================================ */
.sidebar-search {
    position: relative;
    display: flex;
    align-items: center;
    margin: 0 16px 12px;
    padding: 0 10px;
    border: 1px solid var(--bs-border-color, #e2e8f0);
    border-radius: 10px;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.sidebar-search:focus-within {
    border-color: var(--bs-primary, #0f79f3);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb, 15, 121, 243), 0.12);
}
.sidebar-search-icon {
    flex-shrink: 0;
    font-size: 20px;
    color: var(--bs-secondary-color, #64748b);
}
.sidebar-search-input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    padding: 10px 8px;
    font-size: 14px;
    color: var(--bs-body-color, #1e293b);
}
.sidebar-search-input::-webkit-search-cancel-button {
    display: none;
}
.sidebar-search-clear {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--bs-secondary-color, #64748b);
    cursor: pointer;
}
.sidebar-search-clear .material-symbols-outlined {
    font-size: 18px;
}
.sidebar-search-clear:hover {
    background: var(--bs-primary-40, #f1f2fd);
    color: var(--bs-primary, #0f79f3);
}
.sidebar-search-hidden {
    display: none !important;
}
/* Arama sırasında eşleşen alt gruplar açılır; temanın "açık grup" mavi dolgusu
   her eşleşmeyi seçili sayfa gibi gösterirdi. Arama boyunca alt grup başlığı sade kalır. */
.menu-vertical .menu-inner.sidebar-searching .menu-sub .menu-item.after-sub-menu.open > .menu-link:not(.active) {
    background-color: transparent !important;
}
.menu-vertical .menu-inner.sidebar-searching .menu-sub .menu-item.after-sub-menu.open > .menu-link:not(.active) .title {
    color: #475569 !important;
    font-weight: 600;
}
.menu-vertical .menu-inner.sidebar-searching .menu-sub .menu-item.after-sub-menu.open > .menu-link:not(.active)::before {
    background-color: #818093 !important;
}
.menu-vertical .menu-inner.sidebar-searching .menu-sub .menu-item.after-sub-menu.open > .menu-link:not(.active).menu-toggle::after {
    border-color: #475569 !important;
}
[data-theme=dark] .menu-vertical .menu-inner.sidebar-searching .menu-sub .menu-item.after-sub-menu.open > .menu-link:not(.active) .title,
[sidebar-dark-light-data-theme=sidebar-dark] .menu-vertical .menu-inner.sidebar-searching .menu-sub .menu-item.after-sub-menu.open > .menu-link:not(.active) .title {
    color: rgba(255, 255, 255, 0.85) !important;
}
[data-theme=dark] .menu-vertical .menu-inner.sidebar-searching .menu-sub .menu-item.after-sub-menu.open > .menu-link:not(.active).menu-toggle::after,
[sidebar-dark-light-data-theme=sidebar-dark] .menu-vertical .menu-inner.sidebar-searching .menu-sub .menu-item.after-sub-menu.open > .menu-link:not(.active).menu-toggle::after {
    border-color: rgba(255, 255, 255, 0.85) !important;
}
.sidebar-records {
    list-style: none;
    margin: 0;
    padding: 0 8px 8px;
}
.sidebar-records[hidden] {
    display: none !important;
}
.sidebar-records-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    color: var(--bs-tertiary-color, #94a3b8);
    padding: 10px 12px 6px;
}
.sidebar-record-item .menu-link {
    align-items: flex-start;
}
.sidebar-record-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    min-width: 0;
}
.sidebar-record-sub {
    font-size: 12px;
    color: var(--bs-secondary-color, #64748b);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-search-empty {
    padding: 16px 20px;
    text-align: center;
    color: var(--bs-secondary-color, #64748b);
}
.sidebar-search-empty[hidden] {
    display: none !important;
}
.sidebar-search-empty-title {
    display: block;
    font-weight: 600;
    color: var(--bs-body-color, #1e293b);
    margin-bottom: 4px;
    font-size: 13px;
}
.sidebar-search-empty-hint {
    display: block;
    font-size: 12px;
}

[data-theme="dark"] .sidebar-search {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
}
[data-theme="dark"] .sidebar-search-clear:hover {
    background: rgba(var(--bs-primary-rgb, 15, 121, 243), 0.18);
}

/* ============================================================
   Daraltılmış yan menü (60px ikon şeridi)
   Tema iki yoldan daraltır: hamburger (`sidebar-hide`) ve ayarlar
   panelindeki ikon menü anahtarı. 1200px altında `sidebar-hide`
   "menü açık" demektir, bu yüzden kurallar yalnız masaüstündedir.
   Üzerine gelince tema menüyü 260px açar; o hâle dokunulmaz.
   ============================================================ */
@media (min-width: 1200px) {
    [sidebar-data-theme=sidebar-hide] .sidebar-area:not(:hover) .layout-menu,
    [icon-sidebar-none-data-theme=icon-sidebar-block-switch] .sidebar-area:not(:hover) .layout-menu {
        padding: 4px 10px 20px;
    }

    [sidebar-data-theme=sidebar-hide] .sidebar-area:not(:hover) .menu-inner > .menu-item,
    [icon-sidebar-none-data-theme=icon-sidebar-block-switch] .sidebar-area:not(:hover) .menu-inner > .menu-item {
        margin-bottom: 4px;
    }

    [sidebar-data-theme=sidebar-hide] .sidebar-area:not(:hover) .menu-inner > .menu-item > .menu-link,
    [icon-sidebar-none-data-theme=icon-sidebar-block-switch] .sidebar-area:not(:hover) .menu-inner > .menu-item > .menu-link {
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }
    [sidebar-data-theme=sidebar-hide] .sidebar-area:not(:hover) .menu-inner > .menu-item > .menu-link .title,
    [icon-sidebar-none-data-theme=icon-sidebar-block-switch] .sidebar-area:not(:hover) .menu-inner > .menu-item > .menu-link .title {
        display: none;
    }
    [sidebar-data-theme=sidebar-hide] .sidebar-area:not(:hover) .menu-inner > .menu-item > .menu-link .menu-icon,
    [icon-sidebar-none-data-theme=icon-sidebar-block-switch] .sidebar-area:not(:hover) .menu-inner > .menu-item > .menu-link .menu-icon {
        right: 0;
        top: 0;
        font-size: 20px;
    }
    [sidebar-data-theme=sidebar-hide] .sidebar-area:not(:hover) .menu-inner > .menu-item.open > .menu-link.active,
    [icon-sidebar-none-data-theme=icon-sidebar-block-switch] .sidebar-area:not(:hover) .menu-inner > .menu-item.open > .menu-link.active {
        background-color: rgba(var(--bs-primary-rgb, 15, 121, 243), 0.1);
    }
    [sidebar-data-theme=sidebar-hide] .sidebar-area:not(:hover) .menu-inner > .menu-item.open > .menu-link.active .menu-icon,
    [icon-sidebar-none-data-theme=icon-sidebar-block-switch] .sidebar-area:not(:hover) .menu-inner > .menu-item.open > .menu-link.active .menu-icon {
        color: var(--bs-primary, #0f79f3);
    }

    /* Gizlenen bölüm başlıklarının yerinde ince ayırıcı; ilk başlık logoya yapışmasın diye çizilmez. */
    [sidebar-data-theme=sidebar-hide] .sidebar-area:not(:hover) .menu-vertical .menu-title,
    [icon-sidebar-none-data-theme=icon-sidebar-block-switch] .sidebar-area:not(:hover) .menu-vertical .menu-title {
        display: block;
        height: 1px;
        margin: 10px 8px 14px;
        padding: 0;
        background: rgba(148, 163, 184, 0.3);
    }
    [sidebar-data-theme=sidebar-hide] .sidebar-area:not(:hover) .menu-vertical .menu-title:first-child,
    [icon-sidebar-none-data-theme=icon-sidebar-block-switch] .sidebar-area:not(:hover) .menu-vertical .menu-title:first-child {
        display: none;
    }
    [sidebar-data-theme=sidebar-hide] .sidebar-area:not(:hover) .menu-vertical .menu-title::before,
    [sidebar-data-theme=sidebar-hide] .sidebar-area:not(:hover) .menu-vertical .menu-title .menu-title-text,
    [icon-sidebar-none-data-theme=icon-sidebar-block-switch] .sidebar-area:not(:hover) .menu-vertical .menu-title::before,
    [icon-sidebar-none-data-theme=icon-sidebar-block-switch] .sidebar-area:not(:hover) .menu-vertical .menu-title .menu-title-text {
        display: none;
    }

    [sidebar-data-theme=sidebar-hide] .sidebar-area:not(:hover) .simplebar-track.simplebar-vertical,
    [icon-sidebar-none-data-theme=icon-sidebar-block-switch] .sidebar-area:not(:hover) .simplebar-track.simplebar-vertical {
        opacity: 0;
    }

    /* Arama kutusu daraltılınca tek büyüteç düğmesine iner. */
    [sidebar-data-theme=sidebar-hide] .sidebar-area:not(:hover) .sidebar-search,
    [icon-sidebar-none-data-theme=icon-sidebar-block-switch] .sidebar-area:not(:hover) .sidebar-search {
        justify-content: center;
        width: 40px;
        height: 40px;
        margin: 0 10px 8px;
        padding: 0;
        border-color: transparent;
        background: transparent;
    }
    [sidebar-data-theme=sidebar-hide] .sidebar-area:not(:hover) .sidebar-search-input,
    [sidebar-data-theme=sidebar-hide] .sidebar-area:not(:hover) .sidebar-search-clear,
    [icon-sidebar-none-data-theme=icon-sidebar-block-switch] .sidebar-area:not(:hover) .sidebar-search-input,
    [icon-sidebar-none-data-theme=icon-sidebar-block-switch] .sidebar-area:not(:hover) .sidebar-search-clear {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar-search,
    .sidebar-search-clear { transition: none !important; }
}

/* ============================================================
   3-level sidebar (after-sub-menu) — contrast fixes
   Theme rule `.after-sub-menu.open .menu-link .title` lacks `>`,
   so leaf items under an open group inherit white text.
   ============================================================ */
.menu-vertical .menu-sub .menu-item.after-sub-menu.open > .menu-sub .menu-item .menu-link,
.menu-vertical .menu-sub .menu-item.after-sub-menu.open > .menu-sub .menu-item .menu-link .title {
    color: #475569 !important;
}

.menu-vertical .menu-sub .menu-item.after-sub-menu > .menu-sub .menu-item .menu-link {
    background-color: transparent !important;
}

.menu-vertical .menu-sub .menu-item.after-sub-menu > .menu-sub .menu-item .menu-link:hover,
.menu-vertical .menu-sub .menu-item.after-sub-menu > .menu-sub .menu-item .menu-link.active {
    background-color: #ecf0ff !important;
    color: #0f79f3 !important;
}

.menu-vertical .menu-sub .menu-item.after-sub-menu > .menu-sub .menu-item .menu-link:hover .title,
.menu-vertical .menu-sub .menu-item.after-sub-menu > .menu-sub .menu-item .menu-link.active .title {
    color: #0f79f3 !important;
}

.menu-vertical .menu-sub .menu-item.after-sub-menu > .menu-sub .menu-item .menu-link:hover::before,
.menu-vertical .menu-sub .menu-item.after-sub-menu > .menu-sub .menu-item .menu-link.active::before {
    background-color: #0f79f3 !important;
    opacity: 1;
}

[data-theme=dark] .menu-vertical .menu-sub .menu-item.after-sub-menu.open > .menu-sub .menu-item .menu-link,
[data-theme=dark] .menu-vertical .menu-sub .menu-item.after-sub-menu.open > .menu-sub .menu-item .menu-link .title,
[sidebar-dark-light-data-theme=sidebar-dark] .menu-vertical .menu-sub .menu-item.after-sub-menu.open > .menu-sub .menu-item .menu-link,
[sidebar-dark-light-data-theme=sidebar-dark] .menu-vertical .menu-sub .menu-item.after-sub-menu.open > .menu-sub .menu-item .menu-link .title {
    color: rgba(255, 255, 255, 0.85) !important;
}

[data-theme=dark] .menu-vertical .menu-sub .menu-item.after-sub-menu > .menu-sub .menu-item .menu-link:hover,
[data-theme=dark] .menu-vertical .menu-sub .menu-item.after-sub-menu > .menu-sub .menu-item .menu-link.active,
[sidebar-dark-light-data-theme=sidebar-dark] .menu-vertical .menu-sub .menu-item.after-sub-menu > .menu-sub .menu-item .menu-link:hover,
[sidebar-dark-light-data-theme=sidebar-dark] .menu-vertical .menu-sub .menu-item.after-sub-menu > .menu-sub .menu-item .menu-link.active {
    background-color: #2c343e !important;
    color: #0f79f3 !important;
}

[data-theme=dark] .menu-vertical .menu-sub .menu-item.after-sub-menu > .menu-sub .menu-item .menu-link:hover .title,
[data-theme=dark] .menu-vertical .menu-sub .menu-item.after-sub-menu > .menu-sub .menu-item .menu-link.active .title,
[sidebar-dark-light-data-theme=sidebar-dark] .menu-vertical .menu-sub .menu-item.after-sub-menu > .menu-sub .menu-item .menu-link:hover .title,
[sidebar-dark-light-data-theme=sidebar-dark] .menu-vertical .menu-sub .menu-item.after-sub-menu > .menu-sub .menu-item .menu-link.active .title {
    color: #0f79f3 !important;
}

/* main-content-container: yatay taşmayı engelle ama dikey dropdown'lar görünsün */
.main-content-container {
    overflow-x: clip;
    overflow-y: visible;
}

/* TomSelect dropdown body'e eklenir; konum hesabı için z-index garantisi */
.ts-dropdown {
    z-index: 9999 !important;
}

.btn-outline-warning {
    --bs-btn-color: #a9560a;
    --bs-btn-border-color: #a9560a;
    --bs-btn-disabled-color: #a9560a;
    --bs-btn-disabled-border-color: #a9560a;
}

[data-theme='dark'] .btn-outline-warning,
[data-bs-theme='dark'] .btn-outline-warning {
    --bs-btn-color: #ffb264;
    --bs-btn-border-color: #ffb264;
    --bs-btn-disabled-color: #ffb264;
    --bs-btn-disabled-border-color: #ffb264;
}

/* Sticky cari form sidebar */
.cari-form-sidebar {
    padding-bottom: 4.75rem;
}

/* TADB otomatik doldurma: sorgu sırasında formu kilitleyen katman */
.tadb-autofill-locked {
    position: relative;
}

.tadb-autofill-overlay {
    position: absolute;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(2px);
}

[data-theme='dark'] .tadb-autofill-overlay,
[data-bs-theme='dark'] .tadb-autofill-overlay {
    background: rgba(15, 23, 42, 0.72);
}

.tadb-autofill-applied-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: #d1fae5 !important;
    color: #047857 !important;
}

[data-theme='dark'] .tadb-autofill-applied-badge,
[data-bs-theme='dark'] .tadb-autofill-applied-badge {
    background-color: #064e3b !important;
    color: #6ee7b7 !important;
}

.tadb-autofill-choice--faal {
    background-color: #dcfce7 !important;
    color: #166534 !important;
    border-color: #86efac !important;
}

.tadb-autofill-choice--faal:hover,
.tadb-autofill-choice--faal:focus {
    background-color: #bbf7d0 !important;
    color: #14532d !important;
}

.tadb-autofill-choice--inactive {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
    border-color: #fca5a5 !important;
}

.tadb-autofill-choice--inactive:hover,
.tadb-autofill-choice--inactive:focus {
    background-color: #fecaca !important;
    color: #7f1d1d !important;
}

.tadb-autofill-choice__status {
    font-weight: 700;
}

.tadb-autofill-inactive-warning {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

[data-theme='dark'] .tadb-autofill-choice--faal,
[data-bs-theme='dark'] .tadb-autofill-choice--faal,
[data-theme='dark'] .tadb-autofill-choice--faal:hover,
[data-bs-theme='dark'] .tadb-autofill-choice--faal:hover,
[data-theme='dark'] .tadb-autofill-choice--faal:focus,
[data-bs-theme='dark'] .tadb-autofill-choice--faal:focus {
    background-color: #14532d !important;
    color: #bbf7d0 !important;
    border-color: #22c55e !important;
}

[data-theme='dark'] .tadb-autofill-choice--inactive,
[data-bs-theme='dark'] .tadb-autofill-choice--inactive,
[data-theme='dark'] .tadb-autofill-choice--inactive:hover,
[data-bs-theme='dark'] .tadb-autofill-choice--inactive:hover,
[data-theme='dark'] .tadb-autofill-choice--inactive:focus,
[data-bs-theme='dark'] .tadb-autofill-choice--inactive:focus {
    background-color: #7f1d1d !important;
    color: #fecaca !important;
    border-color: #ef4444 !important;
}

[data-theme='dark'] .tadb-autofill-inactive-warning,
[data-bs-theme='dark'] .tadb-autofill-inactive-warning {
    background-color: #7f1d1d;
    color: #fecaca;
    border-color: #ef4444;
}

/* Ortak TR saat alanı — tarayıcı/işletim sistemi AM/PM kontrolünü kullanmaz. */
.malt-time-input {
    width: 7.5rem;
    font-variant-numeric: tabular-nums;
}

/* Bootstrap subtle badge'leri data-theme kullanıldığında otomatik koyu moda geçmez. */
.badge-neutral {
    background-color: #eef1f6 !important;
    color: #64748b !important;
}

[data-theme='dark'] .badge-neutral,
[data-bs-theme='dark'] .badge-neutral {
    background-color: #2d3744 !important;
    color: #cbd5e1 !important;
}

[data-theme='dark'] .badge.bg-primary-subtle,
[data-bs-theme='dark'] .badge.bg-primary-subtle {
    background-color: rgba(59, 130, 246, 0.2) !important;
    color: #93c5fd !important;
}

[data-theme='dark'] .badge.bg-secondary-subtle,
[data-bs-theme='dark'] .badge.bg-secondary-subtle {
    background-color: rgba(148, 163, 184, 0.2) !important;
    color: #cbd5e1 !important;
}

[data-theme='dark'] .badge.bg-success-subtle,
[data-bs-theme='dark'] .badge.bg-success-subtle {
    background-color: rgba(34, 197, 94, 0.18) !important;
    color: #86efac !important;
}

[data-theme='dark'] .badge.bg-danger-subtle,
[data-bs-theme='dark'] .badge.bg-danger-subtle {
    background-color: rgba(239, 68, 68, 0.18) !important;
    color: #fca5a5 !important;
}

[data-theme='dark'] .badge.bg-warning-subtle,
[data-bs-theme='dark'] .badge.bg-warning-subtle {
    background-color: rgba(245, 158, 11, 0.18) !important;
    color: #fde68a !important;
}

[data-theme='dark'] .badge.bg-info-subtle,
[data-bs-theme='dark'] .badge.bg-info-subtle {
    background-color: rgba(6, 182, 212, 0.18) !important;
    color: #a5f3fc !important;
}

/* =========================================================
   Dark mode: jenerik Bootstrap dropdown'ları
   ---------------------------------------------------------
   Tema koyu modda yalnızca element background-color'ını
   değiştiriyor, --bs-body-bg'yi yeniden tanımlamıyor. Bootstrap
   ise --bs-dropdown-bg: var(--bs-body-bg) kullandığı için
   .dropdown-menu koyu modda açık renkte kalıyordu. Değişkenleri
   burada tek yerden çeviriyoruz; .action-opt / .select-dropdown
   gibi daha özgül tema kuralları daha yüksek özgüllükte olduğu
   için etkilenmez.
   ========================================================= */
[data-theme='dark'] .dropdown-menu,
[data-bs-theme='dark'] .dropdown-menu {
    --bs-dropdown-bg: #1b232d;
    --bs-dropdown-color: #cbd5e1;
    --bs-dropdown-border-color: #2d3744;
    --bs-dropdown-link-color: #cbd5e1;
    --bs-dropdown-link-hover-color: #f1f5f9;
    --bs-dropdown-link-hover-bg: #242d38;
    --bs-dropdown-link-active-color: #f1f5f9;
    --bs-dropdown-link-active-bg: rgba(var(--bs-primary-rgb), 0.22);
    --bs-dropdown-link-disabled-color: #64748b;
    --bs-dropdown-header-color: #94a3b8;
    --bs-dropdown-divider-bg: #2d3744;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

/* Menü içindeki serbest metin ve ikonlar da koyu zeminde okunur kalır. */
[data-theme='dark'] .dropdown-menu .dropdown-item,
[data-bs-theme='dark'] .dropdown-menu .dropdown-item {
    color: var(--bs-dropdown-link-color);
}

[data-theme='dark'] .dropdown-menu .dropdown-header,
[data-bs-theme='dark'] .dropdown-menu .dropdown-header {
    color: var(--bs-dropdown-header-color);
}

/* =========================================================
   Dark mode: Tom Select (.ts-*)
   ---------------------------------------------------------
   Satıcı CSS'i .ts-dropdown arka planını var(--bs-body-bg)'den
   alıyor ve metin rengini #343a40 olarak SABİTLİYOR; koyu modda
   sipariş / fatura / tahsilat formlarındaki tüm seçiciler açık
   renk kalıyordu. Satıcı dosyası güncellenebilir olduğu için
   düzeltme burada tutuluyor.
   ========================================================= */
[data-theme='dark'] .ts-control,
[data-theme='dark'] .ts-control input,
[data-theme='dark'] .ts-dropdown,
[data-theme='dark'] .ts-wrapper.single.input-active .ts-control {
    color: #f1f5f9;
    background: #1b232d;
}

[data-theme='dark'] .ts-control {
    border-color: #2d3744;
}

[data-theme='dark'] .ts-dropdown {
    border-color: #2d3744;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

[data-theme='dark'] .ts-dropdown .optgroup-header {
    color: #94a3b8;
    background: #1b232d;
}

[data-theme='dark'] .ts-dropdown .active {
    color: #f1f5f9;
    background-color: #242d38;
}

[data-theme='dark'] .ts-dropdown [data-selectable] .highlight {
    background: rgba(var(--bs-primary-rgb), 0.35);
}

/* Çoklu seçimdeki seçili etiketler (chip). */
[data-theme='dark'] .ts-wrapper.multi .ts-control > div {
    color: #e2e8f0;
    background: #2d3744;
}

[data-theme='dark'] .ts-wrapper.multi .ts-control > div.active {
    color: #fff;
    background: var(--bs-primary);
}

[data-theme='dark'] .ts-wrapper.plugin-remove_button:not(.rtl) .item .remove {
    border-left-color: #475569;
}

[data-theme='dark'] .ts-wrapper.plugin-remove_button .item .remove:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Satıcı CSS'i tek seçimlik ok ikonunu koyu renk SVG olarak gömüyor;
   koyu zeminde görünmüyordu, açık renkli olanla değiştiriliyor. */
[data-theme='dark'] .ts-wrapper:not(.form-control, .form-select).single .ts-control {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23cbd5e1' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
}

/* Geçici "son senkron" bilgisi (üst bar solu). Panel kullanıma geçince kaldırılacak. */
.left-header-content .data-status-item {
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 14px;
    color: #64748b;
}

.data-status-icon {
    font-size: 20px;
    color: #0f79f3;
    line-height: 1;
}

.data-status-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-status-text strong {
    font-weight: 600;
    color: #334155;
}

[data-theme=dark] .data-status-text strong {
    color: #fff;
}
