/* AquaWave yönetim paneli ortak sayfa iskeleti. */
.panel-page {
    width: 100%;
    max-width: 1680px;
    margin-inline: auto;
    padding: 1.5rem clamp(.75rem, 2.5vw, 3rem) 2.5rem;
}
.panel-page-form { max-width: 1180px; }

.panel-page-header {
    margin-bottom: 1rem;
    overflow: hidden;
    background: #fff;
    border: 0;
    border-top: 4px solid var(--bs-primary);
    border-radius: .75rem;
    box-shadow: 0 .125rem .35rem rgba(31, 45, 61, .09);
}

.panel-page-header .card-body { padding: 1.15rem 1.25rem; }
.panel-page-header h1,
.panel-page-header h2 {
    margin-bottom: 0;
    color: var(--bs-primary);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.25;
}
.panel-page-header h1 + p,
.panel-page-header h2 + p {
    margin: .2rem 0 0;
    color: var(--bs-secondary-color);
    font-size: .875rem;
    line-height: 1.4;
}
.panel-page-title {
    margin: 0;
    color: var(--bs-primary);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.25;
}
.panel-page-description {
    margin: .2rem 0 0;
    color: var(--bs-secondary-color);
    font-size: .875rem;
    line-height: 1.4;
}
.panel-page-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .5rem;
    min-width: 0;
    max-width: 100%;
}

/* Ortak filtre alanı */
.panel-filter-card {
    margin-bottom: 1rem;
    overflow: hidden;
    border: 1px solid #e8edf3 !important;
    border-radius: .75rem;
    background: #f8fafc !important;
    box-shadow: 0 .125rem .3rem rgba(31, 45, 61, .05) !important;
}
.panel-filter-card > .card-header {
    padding: .8rem 1rem;
    border-bottom: 1px solid #e8edf3;
    background: #fff;
    color: #334155;
    font-weight: 700;
}
.panel-filter-card > .card-body { padding: 1rem; }
.panel-filter-card .form-label {
    margin-bottom: .35rem;
    color: #475569;
    font-size: .82rem;
    font-weight: 600;
}

/* Panel içi ekleme/düzenleme formları */
.panel-page-form .form-label {
    margin-bottom: .4rem;
    color: #334155;
    font-size: .875rem;
    font-weight: 600;
}
.panel-page-form .form-control,
.panel-page-form .form-select,
.panel-page-form .input-group-text {
    min-height: 42px;
    border-color: #d9e0e8;
    border-radius: .55rem;
}
.panel-page-form .input-group > :not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}
.panel-page-form .input-group > :not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.panel-page-form .form-control:focus,
.panel-page-form .form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .12);
}
.panel-page-form textarea.form-control { min-height: 96px; }
.panel-page-form .form-text {
    color: #64748b;
    font-size: .78rem;
}
.panel-page-form .card:not(.panel-page-header) {
    border-radius: .75rem;
}

/* Ortak tablo dili */
.panel-page .table-responsive {
    scrollbar-color: #b9c3cf transparent;
    scrollbar-width: thin;
}
.panel-page .table > thead > tr > th {
    padding-top: .8rem;
    padding-bottom: .8rem;
    border-bottom-width: 1px;
    color: #475569;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .015em;
    vertical-align: middle;
}
.panel-page .table > tbody > tr > td {
    border-color: #edf1f5;
    vertical-align: middle;
}
.panel-page .table-hover > tbody > tr { transition: background-color .15s ease; }
.panel-page .table-hover > tbody > tr:hover > * { background-color: #f7faff; }

/* Ortak işlem bildirimi ve boş durum */
/* Bootstrap yardımcı sınıfları bulunan eski ve yeni ekranlarda aynı bildirim yüzeyi. */
#islem-bildirimi-alani {
    position: fixed;
    z-index: 1090;
    inset-inline-end: 1rem;
    bottom: max(1rem, env(safe-area-inset-bottom));
    width: min(32rem, calc(100% - 2rem));
    pointer-events: none;
}
#islem-bildirimi-alani > .alert { pointer-events: auto; margin: 0; }
@media print { #islem-bildirimi-alani { display: none; } }
.alert:is(.alert-success, .alert-info, .alert-primary, .alert-warning, .alert-danger, .alert-secondary) {
    --bildirim-zemin: #d1e7dd;
    --bildirim-kenar: #198754;
    --bildirim-yazi: #0f3627;
    background-color: var(--bildirim-zemin) !important;
    color: var(--bildirim-yazi) !important;
    border: 0 !important;
    border-inline-start: .3rem solid var(--bildirim-kenar) !important;
    border-radius: .375rem !important;
    box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075) !important;
    overflow-wrap: anywhere;
}
.alert.alert-warning {
    --bildirim-zemin: #fff3cd;
    --bildirim-kenar: #b58100;
    --bildirim-yazi: #664d03;
}
.alert.alert-danger {
    --bildirim-zemin: #f8d7da;
    --bildirim-kenar: #dc3545;
    --bildirim-yazi: #58151c;
}
.alert.alert-secondary {
    --bildirim-zemin: #f1f3f5;
    --bildirim-kenar: #6c757d;
    --bildirim-yazi: #343a40;
}
.alert:is(.alert-info, .alert-primary) > i:is(.text-info, .text-primary) {
    color: var(--bildirim-yazi) !important;
}
.alert.alert-dismissible {
    padding-inline-end: 3rem !important;
}
.alert.alert-dismissible > .btn-close {
    top: 50%;
    transform: translateY(-50%);
}
.panel-page .alert-light {
    padding: 1.25rem;
    border: 1px dashed #cbd5e1;
    border-left: 4px solid #94a3b8;
    background: #f8fafc;
    color: #64748b;
}

/* Ortak buton hissi; boyutları sayfaların kendi sınıfları belirler. */
.panel-page .btn {
    border-radius: .55rem;
    transition: color .15s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.panel-page .btn:not(:disabled):not(.disabled):active { transform: translateY(1px); }
.panel-page .spinner-border { vertical-align: -.125em; }

/* Satır içi işlem formlarında buton altındaki metin satırı boşluğunu kaldır.
   Bootstrap d-inline kuralı !important olduğu için burada da öncelik gerekir. */
form.d-inline {
    display: inline-flex !important;
    align-items: center;
    vertical-align: middle;
    margin: 0;
    padding: 0;
}

/*
 * Tablo işlem butonları
 * Form ile gönderilen butonlar da bağlantılarla aynı ölçü ve köşe yapısında kalır.
 */
.table-action-group {
    display: inline-flex;
    align-items: stretch;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 0;
    vertical-align: middle;
    border-radius: .55rem;
    box-shadow: 0 .125rem .25rem rgba(31, 45, 61, .08);
}
.table-action-group > form {
    display: flex;
    margin: 0;
    padding: 0;
}
.table-action-group > .btn,
.table-action-group > form > .btn {
    display: inline-flex;
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    margin: 0 0 0 -1px;
    padding: 0;
    border-radius: 0;
    box-shadow: none !important;
    line-height: 1;
}
.table-action-group > :first-child:not(form),
.table-action-group > form:first-child > .btn {
    margin-left: 0;
    border-top-left-radius: .55rem;
    border-bottom-left-radius: .55rem;
}
.table-action-group > :last-child:not(form),
.table-action-group > form:last-child > .btn {
    border-top-right-radius: .55rem;
    border-bottom-right-radius: .55rem;
}
.table-action-group > .btn:hover,
.table-action-group > .btn:focus,
.table-action-group > form > .btn:hover,
.table-action-group > form > .btn:focus {
    z-index: 2;
}
.table-action-group .btn i {
    margin: 0;
    font-size: .9rem;
    line-height: 1;
}

/* Sayfa başlığı eylemlerinin metin ve ikonlarını aynı eksende tutar. */
.panel-page-actions > .btn,
.panel-page-actions > form > .btn {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    white-space: normal;
    max-width: 100%;
}
.panel-page-actions > .btn > i,
.panel-page-actions > form > .btn > i {
    margin-right: 0 !important;
}
.panel-page-actions > form {
    display: flex;
    margin: 0;
}

@media (max-width: 767.98px) {
    .panel-page { padding: .85rem .5rem 1.5rem; }
    .panel-page > .row,
    .panel-page > form > .row { margin-inline: max(-.5rem, calc(-.5 * var(--bs-gutter-x))); }
    .panel-page-header { margin-bottom: .75rem; border-radius: .65rem; }
    .panel-page-header .card-body { padding: 1rem; }
    .panel-page-title { font-size: 1.2rem; }
    .panel-page-header h1,
    .panel-page-header h2 { font-size: 1.2rem; }
    .panel-page-actions { width: 100%; justify-content: stretch; }
    .panel-page-actions > .btn,
    .panel-page-actions > form {
        flex: 1 1 auto;
    }
    .panel-page-actions > form > .btn { width: 100%; }
    .panel-filter-card > .card-body { padding: .85rem; }
    .panel-page .table > thead > tr > th { font-size: .72rem; }

    .table-action-group > .btn,
    .table-action-group > form > .btn {
        width: 40px;
        min-width: 40px;
        height: 40px;
        min-height: 40px;
    }
}

/* Aidat ve urun tahsilatinda ortak odeme secimi. */
.payment-method-group .btn {
    flex: 1 1 0;
    min-width: 0;
}

/* Yalnız belirtilen eylemler: seçim kartları ve mevcut küçük düğmeler değişmez. */
.btn.panel-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    min-height: 40px;
    max-width: 100%;
    padding: .5rem 1rem;
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: normal;
}
.btn.panel-action > i { margin-right: 0 !important; flex-shrink: 0; }
.btn.panel-registration-submit {
    min-height: 48px;
    padding: .7rem 1.25rem;
    font-size: 1rem;
    text-transform: none;
    letter-spacing: normal;
}
.panel-form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
.panel-status-tabs { display: flex; flex-wrap: wrap; gap: .5rem; }
.panel-status-tabs > .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: .5rem .75rem;
    font-size: .9rem;
    line-height: 1.4;
}
.panel-pagination { flex-wrap: wrap; gap: .25rem; }
.panel-pagination .page-link { border-radius: .4rem; min-width: 34px; text-align: center; }
.panel-pagination .page-item .page-link { margin-left: 0; }
.panel-page .dataTables_paginate .pagination { flex-wrap: wrap; gap: .2rem; }
/* Yöntem ve hizmet bedeli aynı düğmede, daha kompakt iki satırda kalır. */
.payment-method-btn.payment-method-compact {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-content: center;
    align-items: center;
    gap: .3rem .65rem;
    min-height: 76px;
    padding: .75rem .85rem !important;
    text-align: left;
}
.payment-method-compact > i {
    grid-row: 1 / span 2;
    margin-bottom: 0 !important;
    font-size: 1.5rem !important;
}
.payment-method-compact > span:not(.badge) { font-size: .875rem; line-height: 1.4; }
.payment-method-compact > .badge {
    grid-column: 2;
    justify-self: start;
    margin-top: 0 !important;
    white-space: normal;
    line-height: 1.3;
}
.btn.panel-icon-action {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    line-height: 1;
}
.btn.panel-icon-action > i,
.table-action-group .btn > i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
@media (min-width: 576px) { .w-sm-auto { width: auto !important; } }
@media (min-width: 768px) { .w-md-auto { width: auto !important; } }
@media (min-width: 768px) {
    .panel-table-pinned > thead > tr > th:last-child,
    .panel-table-pinned > tbody > tr > td:last-child:not([colspan]) {
        position: sticky;
        right: 0;
        z-index: 1;
        background: var(--bs-table-bg, #fff);
        box-shadow: -4px 0 6px -5px rgba(31, 45, 61, .35);
    }
    .panel-table-pinned > thead > tr > th:last-child { z-index: 2; }
}
@media (max-width: 767.98px) {
    .panel-form-actions > .btn { width: 100%; }
    .panel-status-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .panel-status-tabs .btn { min-width: 0; white-space: normal; }
    .btn.panel-icon-action { width: 40px; min-width: 40px; height: 40px; min-height: 40px; }
    .panel-pagination .pagination-number:not(.active),
    .panel-pagination .pagination-gap { display: none; }
}
@media (pointer: coarse) {
    .btn.panel-icon-action { width: 44px; min-width: 44px; height: 44px; min-height: 44px; }
    .table-action-group > .btn,
    .table-action-group > form > .btn { width: 44px; min-width: 44px; height: 44px; min-height: 44px; }
}
@media (max-width: 575.98px) {
    .payment-method-group {
        width: min(100%, calc(100vw - 3rem)) !important;
    }
    .payment-method-group .btn {
        padding: 0.5rem 0.2rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }
    .payment-method-group .btn i {
        display: none;
    }
}

/* Öğrenci listeleri: eşit bilgi sütunları ve aynı satırda kurs/seans eşleşmesi. */
@media (max-width: 768px) {
    .panel-page .student-list-table { table-layout: fixed; width: 100% !important; }
    .panel-page .student-list-table .student-information {
        width: auto !important; min-width: 0 !important; vertical-align: top;
    }
    .panel-page .student-list-table .student-information .ogr-link {
        display: block; padding: 0; font-size: .8125rem; font-weight: 600;
        line-height: 1.4; white-space: normal; word-break: normal; overflow-wrap: anywhere;
    }
    .panel-page .student-list-table .student-mobile-details {
        display: grid; gap: .25rem; margin-top: .2rem; color: var(--bs-secondary-color);
        font-size: .6875rem; line-height: 1.4; overflow-wrap: anywhere;
    }
    .panel-page .student-list-table .student-mobile-details .badge {
        max-width: 100%; font-size: inherit; line-height: inherit; white-space: normal; text-align: left;
    }
    .panel-page .student-list-table .student-secondary {
        box-sizing: border-box; width: calc((100% - 122px) / 2) !important; min-width: 0 !important;
        padding: .5rem !important; vertical-align: top; font-size: .6875rem;
        line-height: 1.4; white-space: normal !important; overflow-wrap: anywhere;
    }
    .panel-page .student-list-table .student-actions {
        box-sizing: border-box; width: 122px !important; min-width: 122px !important;
        padding: .5rem !important; text-align: right !important; vertical-align: top;
        white-space: nowrap !important;
    }
    .panel-page .student-list-table .table-action-group > .btn,
    .panel-page .student-list-table .table-action-group > form > .btn {
        width: 36px; min-width: 36px; height: 44px; min-height: 44px;
    }
    .panel-page .student-list-table .table-action-group .btn i { font-size: .85rem; }
    .panel-page .student-aligned-table,
    .panel-page .student-aligned-table > thead,
    .panel-page .student-aligned-table > tbody { display: block; width: 100%; }
    .panel-page .student-aligned-table > thead > tr,
    .panel-page .student-aligned-table > tbody > tr {
        display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 122px;
        width: 100%; border-bottom: 1px solid var(--bs-border-color);
    }
    .panel-page .student-aligned-table > thead > tr > th,
    .panel-page .student-aligned-table > tbody > tr > td {
        display: block; width: auto !important; min-width: 0 !important;
        margin: 0; border-bottom: 0; box-sizing: border-box;
    }
    .panel-page .student-aligned-table > tbody > tr { row-gap: .25rem; padding-block: .5rem; }
    .panel-page .student-aligned-table > tbody > tr > .student-information,
    .panel-page .student-aligned-table .student-mobile-details,
    .panel-page .student-aligned-table .student-registration { display: contents; }
    .panel-page .student-aligned-table .student-information > .ogr-link {
        grid-column: 1 / 3; grid-row: 1; margin-inline: .5rem;
    }
    .panel-page .student-aligned-table .student-course { grid-column: 1; margin-inline: .5rem; }
    .panel-page .student-aligned-table .student-session { grid-column: 2; margin-inline: .5rem; }
    .panel-page .student-list-table.student-aligned-table > tbody > tr > .student-actions {
        display: flex; grid-column: 3; grid-row: 2; align-self: stretch;
        justify-content: flex-end; padding: 0 .5rem !important; min-height: 44px;
    }
    .panel-page .student-aligned-table .table-action-group > .btn,
    .panel-page .student-aligned-table .table-action-group > form > .btn { height: auto; }

    .panel-page .student-list-table.student-aligned-table .student-secondary { width: auto !important; }
    .panel-page .student-aligned-table > tbody > tr > .student-secondary { display: none !important; }
    .panel-page .student-aligned-table > thead .student-actions { grid-column: 3; grid-row: 1; }
    .panel-page .student-aligned-table .dataTables_empty { grid-column: 1 / -1; }
    .student-list-table .student-course,
    .student-list-table .student-session {
        min-width: 0; min-height: 44px; padding: .25rem; border: 1px solid var(--bs-border-color);
        border-radius: .3rem; background: var(--bs-tertiary-bg, #f8f9fa);
    }
    .student-list-table .student-course { display: flex; align-items: center; }
    .student-list-table .student-session {
        display: flex; flex-direction: column; align-items: center; justify-content: center;
        gap: .15rem; text-align: center;
    }
    .panel-page .student-list-table.student-frozen-table > tbody > tr > .student-secondary { display: contents !important; }
    .student-frozen-table .student-freeze-date {
        flex: 0 0 auto; white-space: nowrap; font-size: .6875rem; line-height: 1.45;
        font-weight: 400; color: var(--bs-body-color);
    }
    .student-frozen-table .student-freeze-reason {
        grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: flex-start;
        gap: .5rem; min-width: 0; margin-inline: .5rem; padding: .35rem .4rem;
        border: 1px solid var(--bs-border-color); border-radius: .3rem;
        background: var(--bs-tertiary-bg, #f8f9fa); color: var(--bs-secondary-color);
        font-size: .6875rem; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere;
    }
    .student-frozen-table .student-freeze-reason-text { min-width: 0; }
    .student-list-table .session-day { display: block; font-size: .625rem; line-height: 1.4; }
    .student-list-table .session-time { display: block; font-weight: 600; white-space: nowrap; }
}
@media (min-width: 769px) {
    .panel-page .student-list-table td.student-actions,
    .panel-page .student-aligned-table td.student-course-column,
    .panel-page .student-aligned-table td.student-secondary,
    .panel-page .student-aligned-table td.student-session-column { vertical-align: top; }
    .panel-page .student-frozen-table td.student-freeze-date-column,
    .panel-page .student-frozen-table td.student-freeze-reason-column { vertical-align: middle; }
    .panel-page .student-frozen-table td.student-freeze-reason-column {
        min-width: 180px; max-width: 300px; white-space: normal; overflow-wrap: anywhere;
    }
    .student-list-table .table-action-group > .btn,
    .student-list-table .table-action-group > form > .btn { height: 44px; min-height: 44px; }
    .student-aligned-table .student-course-column .badge,
    .student-aligned-table .student-secondary .badge,
    .student-aligned-table .student-session-column .badge {
        display: flex; flex-direction: column; justify-content: center; min-height: 44px;
    }
    .student-aligned-table .student-secondary .student-session-badge,
    .student-aligned-table .student-session-column .student-session-badge {
        flex-direction: row; align-items: center; gap: .5rem; white-space: nowrap;
    }
    .student-list-table .session-time { font-weight: 600; white-space: nowrap; }
}
