/* Mobile table layout v1: presentation only; no record or calculation changes. */
@media screen and (max-width: 991.98px) {
    .page, .page main, .page .content, .content > div,
    .content section, .content article, .content [class$="-grid"] > * {
        min-width: 0 !important;
        max-width: 100%;
        box-sizing: border-box;
    }
    .page { flex-direction: column !important; }
    .page > .sidebar {
        width: 100% !important;
        height: auto !important;
        position: sticky !important;
        top: 0;
        z-index: 1001;
    }
    .page main > .top-row {
        position: static !important;
        height: auto !important;
        min-height: 54px;
        padding: 6px 12px !important;
    }
    .page article.content { padding: 12px !important; }
    .sidebar .selim-navigation .top-row { height: 64px; min-height: 64px; }
    .sidebar .nav-scrollable { top: 64px; }
    .sidebar .menu-backdrop { top: 64px; }
    .sidebar .navbar-toggler { min-width: 48px; min-height: 44px; }
    .session-area { gap: 8px !important; }
    .session-area > span { min-width: 0; overflow-wrap: anywhere; margin-right: auto; }
    .session-area .session-link, .session-area .logout-button {
        margin: 0 !important;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
    .content .page-header, .content .welcome-panel { padding: 16px !important; }
    .content h1 { font-size: 25px !important; overflow-wrap: anywhere; }
    .content h2 { font-size: 20px !important; }
    .content .content-grid, .content .dashboard-detail-grid,
    .content .form-grid, .content .cash-form-grid,
    .content .filter-grid, .content .filters-grid,
    .content .payment-entry, .content .advance-entry {
        grid-template-columns: minmax(0, 1fr) !important;
    }
    .content .form-grid > *, .content .cash-form-grid > * {
        grid-column: 1 / -1 !important;
        min-width: 0 !important;
    }
    .content .form-panel, .content .records-panel, .content .form-card,
    .content .table-card, .content .table-panel, .content .cash-form-panel {
        padding: 12px !important;
    }
    .content .page-header, .content .records-header, .content .section-header,
    .content .form-actions, .content .filters, .content .toolbar,
    .content .welcome-actions { flex-wrap: wrap !important; gap: 10px !important; }
    .content .records-header, .content .section-header {
        align-items: stretch !important;
        flex-direction: column !important;
    }
    .content .form-field, .content .form-group { min-width: 0 !important; }
    .content input:not([type="checkbox"]):not([type="radio"]),
    .content select, .content textarea {
        box-sizing: border-box;
        width: 100%;
        min-width: 0 !important;
        max-width: 100%;
        font-size: 16px !important;
        min-height: 44px;
    }
    .content input[type="checkbox"], .content input[type="radio"] {
        width: 24px;
        height: 24px;
        vertical-align: middle;
    }
    .content button, .content a[class$="-button"] {
        min-height: 44px;
        padding: 10px 12px !important;
        font-size: 14px !important;
        line-height: 1.35 !important;
        touch-action: manipulation;
    }
    .content .payment-entry, .content .advance-entry {
        border: 1px solid #dbe3ed;
        border-radius: 8px;
        padding: 10px;
        gap: 10px;
    }
    /* Keep native table semantics, overriding legacy mobile card styles. */
    .content .table-container, .content .table-wrapper,
    .content .cash-table-container {
        width: 100%;
        max-width: 100%;
        overflow: auto !important;
        max-height: 65vh;
        border: 1px solid #cbd5e1;
        border-radius: 8px;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        scrollbar-width: auto;
    }
    .content table {
        display: table !important;
        table-layout: auto !important;
        width: 100% !important;
        min-width: 0 !important;
        border-collapse: separate !important;
        border-spacing: 0 !important;
        font-size: 14px !important;
    }
    .content table thead { display: table-header-group !important; }
    .content table tbody { display: table-row-group !important; }
    .content table tfoot { display: table-footer-group !important; }
    .content table tr {
        display: table-row !important;
        padding: 0 !important;
        border: 0 !important;
    }
    .content table th, .content table td {
        display: table-cell !important;
        padding: 10px 12px !important;
        border-bottom: 1px solid #e2e8f0 !important;
        border-radius: 0 !important;
        text-align: left;
        white-space: nowrap;
        vertical-align: middle;
    }
    .content table td::before { display: none !important; content: none !important; }
    .content table th {
        position: sticky;
        top: 0;
        z-index: 2;
        background: #eaf0f8 !important;
        color: #1e293b !important;
    }
    .content table tbody tr:nth-child(even) { background: #f8fafc; }
    .content table td[data-label="Açıklama"], .content table td[data-label="Notlar"] {
        white-space: normal;
        min-width: 160px;
        max-width: 240px;
        overflow-wrap: anywhere;
    }
    .content table input:not([type="checkbox"]):not([type="radio"]),
    .content table select { min-width: 155px !important; }
    .content .table-actions, .content .action-buttons {
        display: flex !important;
        gap: 8px !important;
    }
    .mobile-table-hint {
        display: block !important;
        margin: 8px 0;
        font-size: 13px;
        color: #475569;
    }
    .content .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
    .content .summary-card { padding: 12px !important; overflow-wrap: anywhere; }
    .content .summary-card strong { font-size: 21px !important; }
}
@media screen and (max-width: 379.98px) {
    .content .summary-grid { grid-template-columns: minmax(0, 1fr) !important; }
}
.mobile-table-hint { display: none; }
