/* Portal responsive — layout, bildirimler, AllLeaves, Holiday */

/* ---- Layout / üst navbar ---- */
.portal-top-navbar.layout-navbar {
    height: auto !important;
    min-height: 3.875rem;
    flex-wrap: nowrap !important;
    align-items: center !important;
    overflow: visible;
}

.portal-top-navbar .navbar-nav-right.portal-navbar-actions {
    flex-basis: auto !important;
    width: auto;
}

.portal-top-navbar .portal-navbar-main {
    display: flex;
    align-items: center;
    min-height: 2.75rem;
    width: 100%;
    flex-wrap: nowrap;
}

.portal-top-navbar .portal-navbar-actions .navbar-nav {
    gap: 0.25rem;
}

.portal-top-navbar .portal-navbar-end {
    min-width: 0;
}

.portal-top-navbar .portal-navbar-tools {
    min-width: 0;
}

.portal-top-navbar .portal-navbar-role-form {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    min-width: 0;
}

.portal-top-navbar .portal-navbar-role-select {
    width: auto;
    min-width: 7.5rem;
    max-width: 11rem;
    height: calc(1.5em + 0.5rem + 2px);
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    line-height: 1.25;
}

.portal-top-navbar .portal-navbar-company-btn {
    padding: 0.25rem 0.5rem;
    line-height: 1.25;
    white-space: nowrap;
}

@media (min-width: 1200px) {
    .portal-top-navbar.layout-navbar {
        height: 3.875rem !important;
        min-height: 3.875rem;
    }

    .portal-top-navbar .portal-navbar-main {
        justify-content: flex-start;
    }

    .portal-top-navbar .portal-navbar-end {
        margin-left: auto;
        flex-shrink: 0;
        gap: 0.75rem;
    }

    .portal-top-navbar .portal-navbar-tools {
        margin-right: 0;
        padding-right: 0.75rem;
        border-right: 1px solid rgba(67, 89, 113, 0.12);
    }

    .portal-top-navbar .portal-navbar-actions {
        margin-left: 0;
        flex-basis: auto !important;
        width: auto;
    }

    .portal-top-navbar .portal-navbar-role-select {
        min-width: 12rem;
        max-width: 18rem;
    }
}

@media (max-width: 1199.98px) {
    .layout-page .content-wrapper .container-p-y {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    #layout-navbar.layout-navbar {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

@media (max-width: 767.98px) {
    .layout-page .content-wrapper .container-p-y {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        padding-top: 1rem !important;
    }

    .portal-top-navbar.layout-navbar {
        padding-top: 0.35rem;
        padding-bottom: 0.35rem;
    }

    .portal-top-navbar .portal-navbar-end {
        max-width: calc(100% - 2.5rem);
    }

    .portal-top-navbar .portal-navbar-tools {
        padding-right: 0;
        border-right: none;
    }

    .portal-top-navbar .portal-navbar-role-select {
        min-width: 5.5rem;
        max-width: 8.5rem;
        font-size: 0.8125rem;
    }

    .portal-top-navbar .portal-navbar-company-btn {
        padding: 0.25rem 0.4rem;
    }

    .portal-top-navbar .user-info {
        display: none;
    }

    .content-header .breadcrumb {
        font-size: 0.8rem;
        flex-wrap: wrap;
    }

    #toast-container.toast-top-right {
        left: 0.75rem !important;
        right: 0.75rem !important;
        top: 4rem !important;
        width: auto;
    }

    #toast-container > div {
        width: 100% !important;
        max-width: 100%;
    }

    .portal-top-navbar .notification-wrapper .dropdown-menu.notification-dropdown,
    .portal-top-navbar .user-profile-dropdown .dropdown-menu.user-dropdown {
        top: 3.75rem !important;
    }
}

@media (max-width: 575.98px) {
    .portal-top-navbar .layout-menu-toggle.navbar-nav {
        margin-right: 0 !important;
    }

    .portal-top-navbar .portal-navbar-role-select {
        min-width: 4.75rem;
        max-width: 7rem;
    }
}

/* ---- Bildirim dropdown (zil) ---- */
@media (max-width: 767.98px) {
    .notification-wrapper .dropdown-menu.notification-dropdown {
        position: fixed !important;
        left: 0.75rem !important;
        right: 0.75rem !important;
        width: auto !important;
        max-width: none !important;
        margin: 0 !important;
        transform: none !important;
        inset-inline: 0.75rem auto;
    }

    .notification-header .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem;
    }

    .notification-header .mark-all-btn {
        align-self: stretch;
        text-align: center;
        white-space: normal;
    }

    .notification-list {
        max-height: min(60vh, 400px);
    }

    .notification-item {
        padding: 12px 14px;
    }

    .notification-item-title {
        font-size: 13px;
    }

    .notification-message {
        font-size: 12px;
        -webkit-line-clamp: 3;
    }
}

@media (max-width: 575.98px) {
    .notification-bell {
        font-size: 20px !important;
    }

    .notification-btn {
        padding: 6px 8px;
    }
}

/* ---- Kullanıcı profil dropdown ---- */
@media (max-width: 767.98px) {
    .user-profile-dropdown .dropdown-menu.user-dropdown {
        position: fixed !important;
        left: 0.75rem !important;
        right: 0.75rem !important;
        width: auto !important;
        max-width: none !important;
        margin: 0 !important;
        transform: none !important;
    }
}

/* ---- /Leave/AllLeaves ---- */
@media (max-width: 767.98px) {
    .page-all-leaves .card-header.leave-link {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.75rem;
    }

    .page-all-leaves .card-header .btn {
        width: 100%;
    }

    .page-all-leaves .filter-actions {
        flex-direction: column;
        align-items: stretch !important;
        width: 100%;
    }

    .page-all-leaves .filter-actions .btn {
        width: 100%;
        margin: 0 !important;
    }

    .page-all-leaves .accordion-button > .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.35rem;
    }

    .page-all-leaves .accordion-button .d-flex.gap-3 {
        gap: 0.25rem !important;
        width: 100%;
    }

    .page-all-leaves .alert {
        font-size: 0.875rem;
    }

    .page-all-leaves .table thead th,
    .page-all-leaves .table tbody td {
        font-size: 0.8rem;
        padding: 0.4rem 0.35rem;
    }

    .page-all-leaves .btn-group {
        flex-direction: column;
        width: 100%;
    }

    .page-all-leaves .btn-group .btn {
        width: 100%;
        margin: 0 0 0.25rem 0 !important;
    }
}

/* ---- /Holiday ---- */
@media (max-width: 767.98px) {
    .page-holiday .card-header > .d-flex {
        flex-direction: column;
        align-items: stretch !important;
        gap: 1rem;
    }

    .page-holiday .card-header .d-flex.align-items-center {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.75rem;
    }

    .page-holiday .card-header .card-title {
        margin-right: 0 !important;
        text-align: center;
    }

    .page-holiday .card-header #yearFilter {
        width: 100%;
    }

    .page-holiday .card-tools {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    .page-holiday .card-tools .btn {
        width: 100%;
        white-space: normal;
    }

    .page-holiday .holiday-table {
        font-size: 0.85rem;
    }

    .page-holiday .holiday-table thead {
        display: none;
    }

    .page-holiday .holiday-table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: 0.5rem;
        padding: 0.75rem;
        background: #fff;
    }

    .page-holiday .holiday-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 0.75rem;
        border: none;
        padding: 0.35rem 0;
        text-align: right;
    }

    .page-holiday .holiday-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #0b1f3b;
        text-align: left;
        flex: 0 0 42%;
    }

    .page-holiday .holiday-table tbody td:last-child {
        flex-direction: column;
        align-items: stretch;
        padding-top: 0.5rem;
        border-top: 1px dashed #dee2e6;
        margin-top: 0.25rem;
    }

    .page-holiday .holiday-table tbody td:last-child::before {
        margin-bottom: 0.35rem;
    }

    .page-holiday .holiday-table tbody td:last-child .btn {
        width: 100%;
        margin-bottom: 0.35rem;
    }
}

@media (min-width: 768px) {
    .page-holiday .holiday-table thead {
        display: table-header-group;
    }

    .page-holiday .holiday-table tbody tr {
        display: table-row;
    }

    .page-holiday .holiday-table tbody td {
        display: table-cell;
        text-align: inherit;
        padding: 0.75rem;
        border: inherit;
    }

    .page-holiday .holiday-table tbody td::before {
        display: none;
        content: none;
    }

    .page-holiday .holiday-table .holiday-actions-cell {
        white-space: nowrap;
        vertical-align: middle;
    }

    .page-holiday .holiday-actions {
        display: inline-flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 0.35rem;
    }

    .page-holiday .holiday-actions .btn {
        display: inline-block;
        width: auto;
        margin: 0;
        white-space: nowrap;
    }
}

/* ---- /OfficeExpense ---- */
@media (max-width: 767.98px) {
    /* Sayfa genelinde yatay taşmayı engelle */
    .page-office-expense {
        width: 100%;
        max-width: 100%;
        overflow-x: clip;
        box-sizing: border-box;
    }

    .layout-page .content-wrapper .container-p-y > .page-office-expense {
        overflow-x: clip;
    }

    .page-office-expense .content-header,
    .page-office-expense .row,
    .page-office-expense .card,
    .page-office-expense .alert {
        max-width: 100%;
        box-sizing: border-box;
    }

    .page-office-expense .row > [class*="col-"] {
        min-width: 0;
    }

    .page-office-expense > .row {
        --bs-gutter-x: 0.5rem;
        max-width: 100%;
    }

    .page-office-expense .office-expense-chart-wrap {
        position: relative;
        min-height: 200px;
        max-width: 100%;
        overflow: hidden;
    }

    .page-office-expense .office-expense-chart-wrap--doughnut {
        min-height: 220px;
    }

    .page-office-expense .office-expense-chart-wrap canvas {
        max-width: 100% !important;
        max-height: 220px;
        height: auto !important;
    }

    .page-office-expense .card-header.bg-white {
        font-size: 0.95rem;
    }

    .page-office-expense .table-responsive {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* DataTable kartı — taşma sadece tablo alanında kalsın */
    .page-office-expense .datatable-card {
        max-width: 100%;
        overflow: hidden;
    }

    .page-office-expense .datatable-card .card-body {
        overflow-x: hidden;
        max-width: 100%;
    }

    .page-office-expense .datatable-card .table-responsive {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .page-office-expense .datatable-card .dataTables_wrapper {
        width: 100% !important;
        max-width: 100%;
        overflow-x: hidden !important;
        box-sizing: border-box;
    }

    .page-office-expense .datatable-card .dataTables_wrapper > .row {
        --bs-gutter-x: 0.5rem;
        max-width: 100%;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .page-office-expense .datatable-card .dataTables_wrapper > .row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
        width: 100%;
        min-width: 0;
    }

    .page-office-expense .datatable-card .dataTables_scrollBody {
        overflow-x: auto !important;
        max-width: 100%;
    }

    .page-office-expense .datatable-card .dropdown {
        position: relative;
    }

    .page-office-expense #officeExpensesTable {
        width: 100% !important;
        max-width: 100%;
    }

    .page-office-expense .dataTables_wrapper .dataTables_length,
    .page-office-expense .dataTables_wrapper .dataTables_filter,
    .page-office-expense .dataTables_wrapper .dataTables_info,
    .page-office-expense .dataTables_wrapper .dataTables_paginate {
        padding: 0.65rem 0.5rem;
        float: none;
        text-align: left;
        max-width: 100%;
        box-sizing: border-box;
    }

    .page-office-expense .dataTables_wrapper .dataTables_length,
    .page-office-expense .dataTables_wrapper .dataTables_filter {
        width: 100%;
    }

    .page-office-expense .dataTables_wrapper .dataTables_filter label {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.35rem;
        margin: 0;
    }

    .page-office-expense .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
        max-width: 100%;
        margin-left: 0 !important;
        box-sizing: border-box;
    }

    .page-office-expense .dataTables_wrapper .dataTables_paginate {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
        justify-content: center;
        width: 100%;
    }

    .page-office-expense .datatable-card .card-header .d-flex {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.5rem;
    }

    .page-office-expense #filterBuilder_officeExpensesTable {
        max-width: 100%;
        overflow-x: hidden;
    }

    .page-office-expense #filterBuilder_officeExpensesTable .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
        --bs-gutter-x: 0.5rem;
    }

    .page-office-expense #filterBuilder_officeExpensesTable .d-flex.gap-2 {
        flex-direction: column;
        float: none !important;
        width: 100%;
        margin: 0 !important;
    }

    .page-office-expense #filterBuilder_officeExpensesTable .btn {
        width: 100%;
    }

    .page-office-expense table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control,
    .page-office-expense table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control {
        padding-left: 2rem;
    }

    .page-office-expense .datatable-card .table thead th,
    .page-office-expense .datatable-card .table tbody td {
        font-size: 0.8125rem;
        padding: 0.65rem 0.5rem;
        white-space: normal;
        word-break: break-word;
    }

    /* Responsive DataTable — genişletilmiş satır okunabilirliği */
    .page-office-expense table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before {
        color: #0b1f3b;
        font-weight: bold;
    }

    .page-office-expense table.dataTable > tbody > tr.child {
        background-color: #f8f9fa;
    }

    .page-office-expense table.dataTable > tbody > tr.child ul.dtr-details {
        display: block;
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0.65rem 0.85rem;
        list-style: none;
        box-sizing: border-box;
    }

    .page-office-expense table.dataTable > tbody > tr.child ul.dtr-details > li {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 0.4rem 0;
        border-bottom: 1px solid rgba(67, 89, 113, 0.12);
        word-break: break-word;
    }

    .page-office-expense table.dataTable > tbody > tr.child ul.dtr-details > li:last-child {
        border-bottom: none;
    }

    .page-office-expense table.dataTable > tbody > tr.child ul.dtr-details span.dtr-title {
        font-weight: 600;
        color: #0b1f3b;
        flex: 0 0 42%;
        font-size: 0.8125rem;
    }

    .page-office-expense table.dataTable > tbody > tr.child ul.dtr-details span.dtr-data {
        flex: 1 1 auto;
        text-align: right;
        font-size: 0.875rem;
    }

    .page-office-expense .datatable-card .table tbody tr.parent td {
        vertical-align: middle;
        white-space: normal;
        word-break: break-word;
    }

    .page-office-expense-form .office-expense-form-actions .btn,
    .page-office-expense-details .d-flex.flex-wrap.gap-2 .btn {
        width: 100%;
    }

    .page-office-expense-form .list-group-item {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.5rem;
    }

    .page-office-expense-form .list-group-item .btn {
        align-self: flex-end;
    }

    .page-office-expense-form #clearDescriptionBtn {
        align-self: flex-start;
    }

    .page-office-expense-form .d-flex.justify-content-between.align-items-center.mb-2 {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.5rem;
    }

    .page-office-expense-details .col-6 .card-body {
        padding: 0.75rem 0.5rem;
    }

    .page-office-expense-details .col-6 .fs-5 {
        font-size: 1rem !important;
    }

    .page-office-expense-details .col-6 i[style*="font-size: 2rem"] {
        font-size: 1.5rem !important;
    }
}

@media (max-width: 575.98px) {
    .page-office-expense-details .row.g-3.mb-4 > .col-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}
