/* KMT Toplu Yetki — turuncu + açık mavi tema */
.kmt-bulk-yetki-page {
    --kmt-bulk-blue: #003b95;
    --kmt-bulk-blue-rgb: 0, 59, 149;
    --kmt-bulk-blue-light: #ebf2ff;
    --kmt-bulk-blue-mid: #b8cce8;
    --kmt-bulk-orange: #f59e0b;
    --kmt-bulk-orange-rgb: 245, 158, 11;
    --kmt-bulk-orange-soft: #fff8eb;
    --kmt-bulk-layout-top-offset: calc(
        var(--emm-topbar-height, 56px)
        + var(--emm-shell-sidebar-inset, 3px)
        + var(--emm-page-padding, 1.5rem)
        + 6.25rem
    );
    --kmt-bulk-panel-bonus: 170px;
    --kmt-bulk-layout-height: calc(100dvh - var(--kmt-bulk-layout-top-offset) + var(--kmt-bulk-panel-bonus));
}

.kmt-bulk-yetki-page .kmt-bulk-main-card {
    border: 1px solid var(--kmt-bulk-blue-mid);
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(var(--kmt-bulk-blue-rgb), 0.08);
    overflow: hidden;
}

.kmt-bulk-yetki-page .kmt-bulk-main-card .card-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: none;
    padding: 1rem 1.1rem 1.1rem;
    overflow: hidden;
    box-sizing: border-box;
}

.kmt-bulk-breadcrumb {
    background: linear-gradient(90deg, var(--kmt-bulk-blue-light) 0%, #ffffff 100%) !important;
    border: 1px solid var(--kmt-bulk-blue-mid) !important;
    border-radius: 8px;
    padding: 0.65rem 0.9rem !important;
    font-size: 0.85rem;
    color: #475569;
    flex-shrink: 0;
}

.kmt-bulk-breadcrumb .breadcrumb-item.active {
    color: var(--kmt-bulk-blue);
    font-weight: 600;
}

.kmt-bulk-intro-alert {
    font-size: 0.84rem;
    line-height: 1.45;
    flex-shrink: 0;
    margin-bottom: 0.85rem !important;
    border: 1px solid #fcd34d;
    border-left: 4px solid var(--kmt-bulk-orange);
    border-radius: 8px;
    background: linear-gradient(90deg, var(--kmt-bulk-orange-soft) 0%, var(--kmt-bulk-blue-light) 100%);
    color: #92400e;
}

.kmt-bulk-intro-alert i {
    color: var(--kmt-bulk-orange);
}

.kmt-bulk-yetki-page .kmt-bulk-layout {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
    flex: 1 1 auto;
    min-height: var(--kmt-bulk-layout-height);
    height: var(--kmt-bulk-layout-height);
    max-height: var(--kmt-bulk-layout-height);
    overflow: hidden;
}

.kmt-bulk-kmt-panel,
.kmt-bulk-yetki-panel {
    border: 1px solid var(--kmt-bulk-blue-mid);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 10px rgba(var(--kmt-bulk-blue-rgb), 0.06);
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    height: 100%;
    align-self: stretch;
}

.kmt-bulk-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    padding: 0.7rem 0.9rem;
    font-size: 0.9rem;
}

.kmt-bulk-panel-head-kmt,
.kmt-bulk-panel-head-yetki {
    background: linear-gradient(90deg, var(--kmt-bulk-blue) 0%, #2563eb 100%);
    color: #fff;
}

.kmt-bulk-panel-head strong {
    font-weight: 700;
    letter-spacing: 0.01em;
}

.kmt-bulk-badge {
    background: var(--kmt-bulk-orange);
    color: #fff;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.kmt-bulk-apply-btn {
    min-height: 34px;
    padding: 0.45rem 0.9rem !important;
    font-size: 0.8125rem !important;
    border-radius: 6px !important;
    box-shadow: 0 2px 6px rgba(var(--kmt-bulk-orange-rgb), 0.28);
}

.kmt-bulk-panel-body {
    padding: 0.75rem;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
    background: linear-gradient(180deg, #fafcff 0%, #ffffff 40%);
}

.kmt-bulk-kmt-panel .kmt-bulk-panel-body > .alert,
.kmt-bulk-tabs-shell > .alert {
    flex-shrink: 0;
}

.kmt-bulk-tabs-shell > .dxbl-tabs {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.kmt-bulk-tabs-shell {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
    max-width: 100%;
}

.kmt-bulk-tabs-shell .dxbl-tabs,
.kmt-bulk-tabs-shell .tab-content,
.kmt-bulk-tabs-shell .dxbl-tabs-content,
.kmt-bulk-tabs-shell .dxbl-tabs-content-panel,
.kmt-bulk-tabs-shell .dxbl-tabs-content-panel-active {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.kmt-bulk-tabs-shell .kmt-yetki-fieldset,
.kmt-bulk-tabs-shell .kmt-yetki-tab,
.kmt-bulk-tabs-shell .kmt-menu-bulk-toolbar,
.kmt-bulk-tabs-shell .kmt-portfolio-toolbar,
.kmt-bulk-tabs-shell .kmt-menu-yetki-table-wrap,
.kmt-bulk-tabs-shell .kmt-portfolio-grid-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.kmt-bulk-tabs-shell .kmt-yetki-fieldset {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.kmt-bulk-tabs-shell .kmt-yetki-tab-hint,
.kmt-bulk-tabs-shell .kmt-menu-bulk-toolbar,
.kmt-bulk-tabs-shell .kmt-portfolio-toolbar {
    flex-shrink: 0;
}

.kmt-bulk-tabs-shell .kmt-yetki-tab {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}

.kmt-bulk-tabs-shell .kmt-menu-yetki-table-wrap,
.kmt-bulk-tabs-shell .kmt-portfolio-grid-wrap {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.kmt-bulk-tabs-shell .tab-pane.active,
.kmt-bulk-tabs-shell .dxbl-tabs-content-panel-active {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.kmt-bulk-kmt-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.65rem;
    align-items: center;
    margin-bottom: 0.65rem;
    padding: 0.55rem 0.65rem;
    background: var(--kmt-bulk-blue-light);
    border-radius: 8px;
    border: 1px solid var(--kmt-bulk-blue-mid);
    flex-shrink: 0;
}

.kmt-bulk-search {
    flex: 1 1 140px;
    min-width: min(100%, 140px);
    border-color: var(--kmt-bulk-blue-mid) !important;
    background: #fff !important;
}

.kmt-bulk-search:focus {
    border-color: var(--kmt-bulk-blue) !important;
    box-shadow: 0 0 0 2px rgba(var(--kmt-bulk-blue-rgb), 0.12) !important;
}

.kmt-bulk-kmt-table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
    border-radius: 8px;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    border: 1px solid var(--kmt-bulk-blue-mid);
    background: #fff;
}

.kmt-bulk-kmt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
    margin: 0;
    min-width: 0;
    max-width: 100%;
    table-layout: fixed;
}

/* Global DataTables min-width kuralları bu sayfadaki tablolara uygulanmasın */
html body .emm-shell .kmt-bulk-yetki-page .kmt-bulk-kmt-table-wrap table,
html body .emm-shell .kmt-bulk-yetki-page .kmt-menu-yetki-table-wrap table,
html body .emm-shell .kmt-bulk-yetki-page .kmt-portfolio-grid-wrap table {
    min-width: 0 !important;
    max-width: 100% !important;
}

.kmt-bulk-kmt-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--kmt-bulk-blue);
    color: #fff;
    padding: 0.6rem 0.75rem;
    font-weight: 600;
    border: none;
}

.kmt-bulk-th-chk {
    width: 44px;
    text-align: center;
}

.kmt-bulk-kmt-table tbody td {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid #e8eef5;
    vertical-align: middle;
}

.kmt-bulk-kmt-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.kmt-bulk-kmt-table tbody tr:hover {
    background: rgba(var(--kmt-bulk-orange-rgb), 0.1);
}

.kmt-bulk-kmt-row-selected {
    background: rgba(var(--kmt-bulk-orange-rgb), 0.14) !important;
    box-shadow: inset 3px 0 0 var(--kmt-bulk-orange);
}

.kmt-bulk-kmt-row-selected:hover {
    background: rgba(var(--kmt-bulk-orange-rgb), 0.18) !important;
}

/* Sekmeler — turuncu buton (yüksek özgüllük, DevExpress override) */
html body .emm-shell .kmt-bulk-yetki-page .kmt-bulk-tabs-shell .dxbl-tabs .nav.nav-tabs,
html body .emm-shell .kmt-bulk-yetki-page .kmt-bulk-tabs-shell .dxbl-tabs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
    padding: 0;
    border: none;
    background: transparent;
}

html body .emm-shell .kmt-bulk-yetki-page .kmt-bulk-tabs-shell .dxbl-tabs .nav.nav-tabs .nav-link,
html body .emm-shell .kmt-bulk-yetki-page .kmt-bulk-tabs-shell .dxbl-tabs-nav .dxbl-tabs-item {
    flex: 1 1 200px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8125rem;
    min-height: 38px;
    padding: 0.55rem 1.1rem;
    border-radius: 6px !important;
    background: #fff !important;
    color: var(--kmt-bulk-orange) !important;
    border: 2px solid var(--kmt-bulk-orange) !important;
    box-shadow: 0 1px 4px rgba(var(--kmt-bulk-orange-rgb), 0.15);
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
}

html body .emm-shell .kmt-bulk-yetki-page .kmt-bulk-tabs-shell .dxbl-tabs .nav.nav-tabs .nav-link:hover:not(.active),
html body .emm-shell .kmt-bulk-yetki-page .kmt-bulk-tabs-shell .dxbl-tabs-nav .dxbl-tabs-item:hover:not(.dxbl-active) {
    background: var(--kmt-bulk-orange-soft) !important;
    color: #b45309 !important;
    border-color: #d97706 !important;
    box-shadow: 0 2px 8px rgba(var(--kmt-bulk-orange-rgb), 0.22);
    transform: translateY(-1px);
}

html body .emm-shell .kmt-bulk-yetki-page .kmt-bulk-tabs-shell .dxbl-tabs .nav.nav-tabs .nav-link.active,
html body .emm-shell .kmt-bulk-yetki-page .kmt-bulk-tabs-shell .dxbl-tabs-nav .dxbl-tabs-item.dxbl-active {
    background: linear-gradient(180deg, var(--kmt-bulk-orange) 0%, #d97706 100%) !important;
    color: #fff !important;
    border-color: #d97706 !important;
    box-shadow: 0 3px 12px rgba(var(--kmt-bulk-orange-rgb), 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
    transform: translateY(-1px);
}

html body .emm-shell .kmt-bulk-yetki-page .kmt-bulk-tabs-shell .dxbl-tabs .nav.nav-tabs .nav-link:focus,
html body .emm-shell .kmt-bulk-yetki-page .kmt-bulk-tabs-shell .dxbl-tabs-nav .dxbl-tabs-item:focus,
html body .emm-shell .kmt-bulk-yetki-page .kmt-bulk-tabs-shell .dxbl-tabs .nav.nav-tabs .nav-link:focus-visible,
html body .emm-shell .kmt-bulk-yetki-page .kmt-bulk-tabs-shell .dxbl-tabs-nav .dxbl-tabs-item:focus-visible {
    outline: none !important;
}

.kmt-bulk-tabs-shell .dxbl-tabs-content,
.kmt-bulk-tabs-shell .tab-content {
    padding-top: 0.25rem;
    flex: 1;
    min-height: 0;
}

.kmt-bulk-tabs-disabled .dxbl-tabs {
    opacity: 0.82;
}

.kmt-bulk-yetki-page .kmt-yetki-chk,
.kmt-bulk-yetki-page .kmt-yetki-radio {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--kmt-bulk-blue);
}

.kmt-bulk-inline-check,
.kmt-bulk-yetki-page .kmt-inline-check {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    user-select: none;
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--kmt-bulk-blue);
}

/* KmtYetkiEditorTabs — sayfa içi override */
.kmt-bulk-yetki-page .kmt-menu-bulk-toolbar {
    background: var(--kmt-bulk-blue-light);
    border-color: var(--kmt-bulk-blue-mid);
    border-radius: 8px;
}

.kmt-bulk-yetki-page .kmt-menu-yetki-search:focus,
.kmt-bulk-yetki-page .kmt-menu-yetki-search:focus-visible {
    border-color: var(--kmt-bulk-blue);
    box-shadow: 0 0 0 2px rgba(var(--kmt-bulk-blue-rgb), 0.12);
}

.kmt-bulk-yetki-page .kmt-menu-bulk-grant {
    color: var(--kmt-bulk-blue);
}

.kmt-bulk-yetki-page .kmt-menu-bulk-revoke {
    color: #b45309;
}

.kmt-bulk-yetki-page .kmt-menu-yetki-table-wrap,
.kmt-bulk-yetki-page .kmt-portfolio-grid-wrap {
    border-color: var(--kmt-bulk-blue-mid);
    border-radius: 8px;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.kmt-bulk-yetki-page .kmt-menu-yetki-table tbody td {
    border-bottom-color: #e8eef5;
}

.kmt-bulk-yetki-page .kmt-menu-row-leaf:hover {
    background: rgba(var(--kmt-bulk-orange-rgb), 0.1);
}

.kmt-bulk-yetki-page .kmt-menu-grup-badge {
    color: var(--kmt-bulk-blue);
    background: #cfe2f3;
}

.kmt-bulk-yetki-page .kmt-yetki-chk.kmt-yetki-chk-partial {
    border-color: var(--kmt-bulk-orange);
    background: linear-gradient(135deg, var(--kmt-bulk-orange) 0%, var(--kmt-bulk-orange) 48%, #fff 52%, #fff 100%);
}

.kmt-bulk-yetki-page .kmt-portfolio-toolbar {
    background: var(--kmt-bulk-blue-light);
    border-color: var(--kmt-bulk-blue-mid);
    border-radius: 8px;
}

.kmt-bulk-yetki-page .kmt-portfolio-all-check {
    color: var(--kmt-bulk-blue);
}

.kmt-bulk-yetki-page .kmt-portfolio-summary {
    color: #92400e;
    background: var(--kmt-bulk-orange-soft);
    border: 1px solid #fcd34d;
}

.kmt-bulk-yetki-page .kmt-portfolio-table tbody td {
    border-bottom-color: #e8eef5;
}

.kmt-bulk-yetki-page .kmt-portfolio-row-selected {
    background: rgba(var(--kmt-bulk-orange-rgb), 0.14) !important;
    box-shadow: inset 3px 0 0 var(--kmt-bulk-orange);
}

@media (max-width: 1100px) {
    .kmt-bulk-yetki-page .kmt-bulk-main-card .card-body {
        height: auto;
        max-height: none;
        min-height: 0;
        overflow: visible;
    }

    .kmt-bulk-yetki-page .kmt-bulk-layout {
        grid-template-columns: 1fr;
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .kmt-bulk-kmt-panel,
    .kmt-bulk-yetki-panel {
        height: auto;
        max-height: none;
    }

    .kmt-bulk-kmt-table-wrap {
        max-height: min(42vh, 360px);
    }

    .kmt-bulk-yetki-page .kmt-menu-yetki-table-wrap,
    .kmt-bulk-yetki-page .kmt-portfolio-grid-wrap {
        max-height: min(50vh, 420px) !important;
    }
}

html body .emm-shell .kmt-bulk-yetki-page .kmt-menu-yetki-table-wrap,
html body .emm-shell .kmt-bulk-yetki-page .kmt-portfolio-grid-wrap {
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
}

html body .emm-shell .kmt-bulk-yetki-page .kmt-menu-yetki-table {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: fixed !important;
}

html body .emm-shell .kmt-bulk-yetki-page .kmt-menu-yetki-table .kmt-menu-col-name {
    width: auto;
}

html body .emm-shell .kmt-bulk-yetki-page .kmt-menu-yetki-table .kmt-menu-col-chk {
    width: 72px !important;
    min-width: 72px !important;
    max-width: 72px !important;
}

html body .emm-shell .kmt-bulk-yetki-page .kmt-portfolio-table {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: fixed !important;
}

@media (max-width: 767.98px) {
    .kmt-bulk-yetki-page .kmt-bulk-main-card .card-body {
        min-height: 0;
        padding: 0.75rem;
    }

    .kmt-bulk-panel-head {
        flex-direction: column;
        align-items: stretch;
    }

    .kmt-bulk-panel-head-yetki .kmt-bulk-apply-btn {
        width: 100%;
        justify-content: center;
    }

    .kmt-bulk-kmt-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .kmt-bulk-search {
        width: 100%;
        flex: 1 1 100%;
    }

    .kmt-bulk-tabs-shell .dxbl-tabs .nav.nav-tabs .nav-link,
    .kmt-bulk-tabs-shell .dxbl-tabs-nav .dxbl-tabs-item {
        flex: 1 1 auto;
        text-align: center;
        border-radius: 8px;
        margin-bottom: 0.25rem;
    }

    .kmt-bulk-yetki-page .kmt-menu-bulk-toolbar,
    .kmt-bulk-yetki-page .kmt-portfolio-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .kmt-bulk-yetki-page .kmt-menu-yetki-search-wrap,
    .kmt-bulk-yetki-page .kmt-portfolio-search {
        max-width: none;
        width: 100%;
        min-width: 0;
    }

    .kmt-bulk-yetki-page .kmt-menu-yetki-table-wrap,
    .kmt-bulk-yetki-page .kmt-portfolio-grid-wrap {
        max-height: min(50vh, 420px);
    }
}

@media (max-width: 575.98px) {
    .kmt-bulk-breadcrumb {
        font-size: 0.78rem;
    }

    .kmt-bulk-intro-alert {
        font-size: 0.8rem;
    }

    .kmt-bulk-badge {
        font-size: 0.7rem;
    }
}

/* Yükseklik zinciri — emm-content içinde panel görünür alanı doldursun */
html body .emm-shell .emm-main-column {
    min-height: 100dvh;
}

html body .emm-shell .emm-content > .emm-page:has(.kmt-bulk-yetki-page) {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    padding: 0 !important;
}

html body .emm-shell .emm-page:has(.kmt-bulk-yetki-page) > .row.mx-0 {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
}

html body .emm-shell .emm-page:has(.kmt-bulk-yetki-page) > .row.mx-0 > .col-12 {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

html body .emm-shell .kmt-bulk-yetki-page .kmt-bulk-main-card {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    display: flex;
    flex-direction: column;
}

html body .emm-shell .kmt-bulk-yetki-page .kmt-bulk-layout {
    min-height: var(--kmt-bulk-layout-height) !important;
    height: var(--kmt-bulk-layout-height) !important;
    max-height: var(--kmt-bulk-layout-height) !important;
}
