/* AdisGo — mobile & tablet responsive layer */

.settings-mobile-toolbar,
.settings-nav-backdrop {
    display: none;
}

/* ── Safe areas (notch / home indicator) ── */
@supports (padding: env(safe-area-inset-top)) {
    .panel-app .top-header {
        padding-top: max(0.65rem, env(safe-area-inset-top));
    }

    .panel-app .main-content {
        padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
    }

    .panel-app .sidebar {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }

    .login-page .login-form-panel {
        padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    }
}

body.sidebar-scroll-lock {
    overflow: hidden;
    touch-action: none;
}

/* ── Tablet & below (≤991px) ── */
@media (max-width: 991.98px) {
    :root {
        --header-height: 60px;
        --sidebar-width: min(300px, 88vw);
    }

    /* Sidebar drawer */
    .sidebar {
        width: var(--sidebar-width);
        transform: translateX(-105%);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1050;
        box-shadow: none;
    }

    .app-shell.sidebar-open .sidebar {
        transform: translateX(0);
        box-shadow: 8px 0 40px rgba(0, 0, 0, 0.35);
    }

    .sidebar-backdrop {
        opacity: 0;
        transition: opacity 0.28s ease;
        backdrop-filter: blur(2px);
    }

    .app-shell.sidebar-open .sidebar-backdrop {
        display: block;
        opacity: 1;
    }

    .sidebar-brand {
        padding: 0.875rem 0.75rem;
    }

    .brand-logo-box {
        padding: 0.5rem 0.75rem;
    }

    .brand-logo-img {
        max-width: 200px;
        margin: 0 auto;
    }

    .sidebar .nav-link {
        min-height: 46px;
        padding: 0.7rem 0.875rem;
        font-size: 0.9rem;
    }

    .nav-accordion-toggle {
        min-height: 46px;
        font-size: 0.95rem;
        padding: 0.65rem 0.85rem;
    }

    .sidebar .nav-link i {
        width: 36px;
        height: 36px;
    }

    /* Header */
    .top-header {
        display: flex;
        align-items: center;
        gap: 0.625rem;
        min-height: var(--header-height);
        padding: 0.5rem 0.875rem;
        flex-wrap: nowrap;
    }

    .sidebar-toggle-btn {
        order: -1;
        flex-shrink: 0;
        width: 44px;
        height: 44px;
        min-width: 44px;
        border-radius: 12px;
        background: var(--primary-light);
        border-color: color-mix(in srgb, var(--primary) 20%, var(--border-color));
        color: var(--primary-dark);
    }

    .sidebar-toggle-btn:active {
        transform: scale(0.96);
    }

    .top-header-start {
        flex: 1 1 auto;
        min-width: 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }

    .top-header .page-title {
        font-size: 1rem;
        line-height: 1.25;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .top-header-actions {
        flex-shrink: 0;
        gap: 0.5rem;
    }

    .top-header .user-info {
        display: none !important;
    }

    .top-header-actions .user-avatar.d-lg-none {
        width: 38px;
        height: 38px;
        font-size: 0.8125rem;
    }

    .top-header .user-avatar {
        width: 40px;
        height: 40px;
        font-size: 0.8125rem;
    }

    .btn-branch-selector {
        max-width: 100%;
        font-size: 0.72rem;
        padding: 0.35rem 0.75rem;
    }

    .branch-selector .dropdown-menu {
        max-width: min(320px, calc(100vw - 2rem));
    }

    /* Main content */
    .main-wrapper {
        margin-left: 0;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .main-content {
        padding: 1rem 0.875rem 1.5rem;
    }

    .main-content-compact {
        padding: 0.5rem 0.75rem 1rem;
    }

    /* Cards */
    .panel-card {
        border-radius: 14px;
    }

    .panel-card .card-header-custom {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.65rem;
        padding: 1rem;
    }

    .panel-card .card-header-custom form,
    .panel-card .card-header-custom .btn-group {
        width: 100%;
    }

    .panel-card .card-body-custom {
        padding: 1rem;
    }

    /* KPI cards */
    .kpi-card {
        padding: 0.875rem 0.75rem;
        min-height: auto;
    }

    .kpi-card .kpi-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .kpi-card .kpi-value {
        font-size: 1.15rem;
    }

    .kpi-card .kpi-label {
        font-size: 0.65rem;
        line-height: 1.3;
    }

    /* Stat cards */
    .stat-card {
        padding: 1rem;
    }

    .stat-card .stat-value {
        font-size: 1.5rem;
    }

    .stat-card .stat-icon {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
    }

    /* Module cards */
    .module-card {
        padding: 1.125rem 0.75rem;
    }

    .module-card .module-icon {
        width: 48px;
        height: 48px;
        font-size: 1.35rem;
    }

    /* Page actions */
    .page-actions {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }

    .page-actions .btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    /* Forms — prevent iOS zoom on focus */
    .form-control,
    .form-select {
        font-size: 16px;
        min-height: 44px;
    }

    .form-control-sm,
    .form-select-sm {
        font-size: 14px;
        min-height: 38px;
    }

    .input-group-text {
        min-height: 44px;
    }

    /* Buttons touch targets */
    .btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .btn-sm {
        min-height: 38px;
    }

    /* Tables — horizontal scroll with hint */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
        margin-left: -0.25rem;
        margin-right: -0.25rem;
        padding-left: 0.25rem;
        padding-right: 0.25rem;
        position: relative;
    }

    .table-responsive::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 24px;
        background: linear-gradient(to left, color-mix(in srgb, var(--body-bg) 90%, transparent), transparent);
        pointer-events: none;
        opacity: 0.7;
    }

    .table-panel {
        min-width: 560px;
    }

    .order-list-table {
        min-width: 640px;
    }

    /* Modals */
    .modal-dialog {
        margin: 0.75rem;
        max-width: calc(100vw - 1.5rem);
    }

    .modal-fullscreen-sm-down {
        width: 100vw;
        max-width: none;
        margin: 0;
    }

    .modal-footer {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .modal-footer .btn {
        flex: 1 1 calc(50% - 0.25rem);
        min-width: 0;
    }

    /* Settings — mobil yan menü çekmecesi */
    .settings-mobile-toolbar {
        display: flex;
        align-items: center;
        gap: 0.65rem;
        padding: 0.6rem 0.7rem;
        margin-bottom: 0.65rem;
        background: #fff;
        border: 1px solid var(--border-color);
        border-radius: 12px;
        box-shadow: var(--shadow-sm);
        position: sticky;
        top: 0;
        z-index: 35;
    }

    .settings-nav-toggle {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        min-height: 44px;
        padding: 0.5rem 0.85rem;
        border: none;
        border-radius: 10px;
        background: linear-gradient(135deg, var(--brand) 0%, var(--primary-dark, #d94e0f) 100%);
        color: #fff;
        font-weight: 700;
        font-size: 0.85rem;
        touch-action: manipulation;
        flex-shrink: 0;
    }

    .settings-mobile-current {
        flex: 1;
        min-width: 0;
    }

    .settings-mobile-current-label {
        display: block;
        font-size: 0.62rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--text-muted);
        line-height: 1.1;
    }

    .settings-mobile-current strong {
        display: block;
        font-size: 0.92rem;
        font-weight: 700;
        color: var(--text-primary);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.settings-nav-open {
        overflow: hidden;
        touch-action: none;
    }

    .settings-nav-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1055;
        background: rgba(15, 23, 42, 0.45);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }

    .settings-page.is-nav-open .settings-nav-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .settings-page {
        height: auto;
        min-height: calc(100dvh - var(--header-height, 60px));
        overflow: visible;
    }

    .settings-layout {
        flex-direction: column;
        gap: 0;
        overflow: visible;
    }

    .settings-nav {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(320px, 88vw);
        max-height: none;
        z-index: 1060;
        transform: translateX(-108%);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 8px 0 32px rgba(0, 0, 0, 0.18);
        padding-top: env(safe-area-inset-top, 0px);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .settings-page.is-nav-open .settings-nav {
        transform: translateX(0);
    }

    .settings-nav-groups {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        flex: 1;
        min-height: 0;
        padding: 0.35rem 0.5rem 1rem;
    }

    .settings-nav-group-title {
        min-height: 44px;
        font-size: 0.88rem;
        padding: 0.65rem 0.75rem;
    }

    .settings-nav-group .settings-nav-link {
        min-height: 44px;
        font-size: 0.88rem;
        padding: 0.55rem 0.75rem;
    }

    .settings-nav-link i {
        font-size: 1.05rem;
        width: 1.25rem;
    }

    .settings-main {
        width: 100%;
        overflow: visible;
        padding-right: 0;
    }

    .settings-form .panel-card {
        border-radius: 12px;
    }

    .settings-category-handle,
    .list-sort-handle {
        min-width: 2.75rem;
        min-height: 44px;
    }

    .grid-search-wrap {
        padding: 0.75rem 0.85rem 0.65rem;
    }

    .grid-search-input {
        min-height: 44px;
        font-size: 1rem;
    }

    .settings-save-btn {
        min-height: 48px;
        font-size: 0.95rem;
    }

    .delivery-mahalle-row {
        grid-template-columns: auto 1fr 1fr;
        grid-template-areas:
            "check name name"
            "check min fee";
    }

    .delivery-mahalle-row .form-check-input { grid-area: check; }
    .delivery-mahalle-name { grid-area: name; }
    .delivery-mahalle-money--min { grid-area: min; }
    .delivery-mahalle-money--fee { grid-area: fee; max-width: none; }

    .settings-qr-grid {
        grid-template-columns: 1fr;
    }

    /* Reports — mobil okunabilirlik */
    .reports-page {
        height: auto;
        min-height: calc(100dvh - var(--header-height, 60px));
        overflow: visible;
    }

    .reports-hub-scroll,
    .reports-content-scroll {
        overflow: visible;
        padding-right: 0;
    }

    .reports-hub-list {
        grid-template-columns: 1fr;
        gap: 0.55rem;
    }

    .reports-hub-item {
        min-height: 56px;
        padding: 0.85rem 1rem;
        border-radius: 12px;
    }

    .reports-hub-icon {
        width: 2.35rem;
        height: 2.35rem;
        font-size: 1.05rem;
    }

    .reports-hub-label {
        font-size: 0.95rem;
    }

    .reports-quick-toolbar-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .reports-quick-divider {
        width: 100%;
        height: 1px;
    }

    .reports-quick-form {
        flex: 1 1 auto;
    }

    .reports-quick-dates {
        width: 100%;
    }

    .reports-quick-dates .form-control-sm {
        flex: 1;
        width: auto;
        min-width: 0;
    }

    .report-summary-kpi {
        padding: 0.85rem 1rem;
    }

    .report-summary-kpi-label {
        font-size: 0.78rem;
    }

    .report-summary-kpi-value {
        font-size: 1.15rem;
    }

    .reports-summary-section-item {
        min-height: 56px;
        padding: 0.85rem 1rem;
    }

    .reports-summary-section-item strong {
        font-size: 0.92rem;
    }

    .reports-page .table-responsive {
        overflow: visible;
    }

    .reports-table-card-mode {
        min-width: 0 !important;
    }

    .reports-table-card-mode thead {
        display: none;
    }

    .reports-table-card-mode tbody tr {
        display: block;
        margin-bottom: 0.65rem;
        border: 1px solid var(--border-color);
        border-radius: 12px;
        overflow: hidden;
        background: #fff;
        box-shadow: var(--shadow-sm);
    }

    .reports-table-card-mode tbody tr.reports-data-row:hover,
    .reports-table-card-mode tbody tr:hover {
        background: #fff;
    }

    .reports-table-card-mode tbody td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 0.7rem 0.9rem !important;
        font-size: 0.95rem !important;
        line-height: 1.35;
        border-bottom: 1px solid #f1f5f9;
        min-width: 0;
        text-align: left !important;
    }

    .reports-table-card-mode tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: var(--text-muted);
        flex-shrink: 0;
        max-width: 46%;
        line-height: 1.35;
    }

    .reports-table-card-mode tbody td:last-child {
        border-bottom: none;
    }

    .reports-table-card-mode tbody td.text-end {
        justify-content: space-between;
    }

    .reports-table-card-mode tbody td.text-end::after {
        content: none;
    }

    .reports-table-tfoot .reports-total-row {
        display: block;
        margin-top: 0.5rem;
        border-radius: 12px;
        overflow: hidden;
        border: 2px solid var(--brand);
    }

    .reports-table-tfoot .reports-total-row td {
        display: flex;
        justify-content: space-between;
        font-size: 1rem !important;
        padding: 0.75rem 0.9rem !important;
    }

    .reports-table-tfoot .reports-total-row td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: 0.75rem;
        text-transform: uppercase;
        color: var(--text-muted);
    }

    .reports-page-header .btn {
        width: 100%;
    }

    .cash-register-filter-bar .form-control,
    .cash-register-filter-bar .form-select {
        min-height: 44px;
        font-size: 0.92rem;
    }

    .cash-filter-btn {
        min-height: 44px;
        font-size: 0.88rem;
    }

    /* Orders / tables / cash */
    .orders-page-header,
    .tables-floor-top,
    .customers-page-header,
    .cash-register-header,
    .reports-page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .orders-page-actions,
    .customers-page-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .orders-page-actions .btn,
    .customers-page-actions .btn {
        flex: 1 1 calc(50% - 0.25rem);
        min-width: 0;
    }

    .cash-filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .cash-filter-field,
    .cash-filter-field .form-control {
        width: 100% !important;
        min-width: 0 !important;
    }

    .cash-filter-actions {
        width: 100%;
    }

    .cash-filter-actions .btn {
        flex: 1 1 calc(50% - 0.25rem);
    }

    .tables-floor-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .tables-floor-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.25rem;
    }

    .tables-floor-filters .zone-filter-btn {
        flex-shrink: 0;
    }

    .tables-floor-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .tables-floor-page.tables-skin-round .tables-floor-grid {
        grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
        gap: 0.75rem 0.45rem;
    }

    .tables-floor-page.tables-skin-round .tables-floor-tile-wrap {
        max-width: 148px;
    }

    .tables-floor-page.tables-skin-round .tables-floor-tile {
        width: min(100%, 140px);
        padding: 20% 15%;
    }

    .tables-floor-page.tables-skin-round .tables-floor-tile-wrap.is-wide .tables-floor-tile {
        width: min(100%, 148px);
    }

    .tables-floor-page.tables-skin-compact .tables-floor-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.4rem;
    }

    .table-pos-header {
        flex-direction: column;
        align-items: stretch;
    }

    .table-pos-header-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .table-pos-header-actions .btn {
        flex: 1 1 auto;
    }

    .chart-container {
        min-height: 220px;
    }

    .chart-year-select {
        width: 100%;
    }

    /* Pagination */
    .data-grid-pagination-wrap {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 0.75rem;
    }

    .data-grid-pagination {
        justify-content: center;
        flex-wrap: wrap;
    }

    /* Alerts */
    .alert {
        font-size: 0.8125rem;
        padding: 0.75rem 1rem;
    }

    /* Notifications bar */
    .restaurant-notif-bar-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .restaurant-notif-item {
        flex-direction: column;
        align-items: stretch;
    }

    .restaurant-notif-item-actions {
        width: 100%;
    }

    .restaurant-notif-item-actions .btn {
        flex: 1 1 auto;
    }

    /* Login / Register */
    .login-page {
        flex-direction: column;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .login-brand-panel {
        display: none;
    }

    .login-mobile-brand {
        display: flex;
        justify-content: center;
        padding: 1.25rem 1rem 0.75rem;
        background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--navy) 100%);
    }

    .login-mobile-brand .brand-logo-box {
        max-width: 260px;
        width: 100%;
    }

    .login-form-panel {
        width: 100%;
        min-width: 0 !important;
        flex: 1;
        padding: 1.25rem 1rem 1.5rem;
        align-items: flex-start;
        padding-top: 0;
    }

    .login-card {
        max-width: 100%;
        padding-top: 1rem;
    }

    .login-card .login-title {
        font-size: 1.35rem;
    }

    .login-card .login-subtitle {
        font-size: 0.85rem;
        margin-bottom: 1.5rem;
    }

    /* Dropdowns */
    .dropdown-menu {
        max-height: 70vh;
        overflow-y: auto;
    }
}

/* ── Phone (≤575px) ── */
@media (max-width: 575.98px) {
    .top-header .page-title {
        font-size: 0.9rem;
    }

    .main-content {
        padding: 0.75rem 0.65rem 1.25rem;
    }

    .row.g-3 {
        --bs-gutter-x: 0.65rem;
        --bs-gutter-y: 0.65rem;
    }

    .kpi-card .kpi-value {
        font-size: 1rem;
    }

    .tables-floor-stats,
    .tables-floor-grid {
        grid-template-columns: 1fr;
    }

    .tables-floor-title {
        font-size: 1.1rem;
    }

    .order-source-card {
        padding: 0.65rem 0.5rem;
    }

    .orders-filter-main,
    .orders-filter-cluster {
        grid-template-columns: 1fr;
    }

    .orders-toolbar-actions,
    .orders-toolbar-actions .btn {
        width: 100%;
    }

    .orders-overview-kpis {
        grid-template-columns: 1fr 1fr;
    }

    .orders-overview-sources {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .order-channel-card-amount {
        font-size: 1rem;
    }

    .table-payment-amount-box .amount {
        font-size: 1.35rem;
    }

    .table-payment-type-grid {
        grid-template-columns: 1fr;
    }

    .card-header-custom {
        font-size: 0.875rem;
    }

    .modal-footer .btn {
        flex: 1 1 100%;
    }

    .orders-page-actions .btn,
    .customers-page-actions .btn,
    .cash-filter-actions .btn {
        flex: 1 1 100%;
    }

    .login-form-panel {
        padding-left: 0.875rem;
        padding-right: 0.875rem;
    }

    .login-mobile-brand .brand-logo-box {
        max-width: 220px;
        padding: 0.625rem 0.875rem;
    }
}

/* ── Very small phones (≤380px) ── */
@media (max-width: 380px) {
    .sidebar {
        width: 100vw;
    }

    .kpi-card .kpi-label {
        font-size: 0.6rem;
    }

    .sidebar-toggle-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }
}

/* ── Landscape phone ── */
@media (max-width: 991.98px) and (orientation: landscape) {
    .login-page {
        flex-direction: row;
    }

    .login-mobile-brand {
        width: 38%;
        max-width: 320px;
        align-items: center;
        padding: 1rem;
    }

    .login-form-panel {
        flex: 1;
        padding-top: 1rem;
        overflow-y: auto;
        max-height: 100dvh;
    }

    .sidebar-nav {
        max-height: calc(100dvh - 120px);
    }
}

.table-pos-mobile-bar {
    display: none;
}

/* Hide mobile brand on desktop */
@media (min-width: 992px) {
    .login-mobile-brand {
        display: none !important;
    }

    .table-pos-page:not(.pos-picker-mode) .table-pos-mobile-bar,
    .table-pos-page:not(.pos-picker-mode) .table-pos-drawer-backdrop,
    .table-pos-page:not(.pos-picker-mode) .table-pos-products-drawer {
        display: none !important;
    }

    .table-pos-page.pos-picker-mode .table-pos-mobile-bar {
        display: none !important;
    }
}

/* ── POS / Masa sipariş — mobil & tablet ── */
@media (max-width: 991.98px) {
    body.pos-drawer-open {
        overflow: hidden;
        touch-action: none;
    }

    .table-pos-page {
        min-height: calc(100dvh - var(--header-height, 60px));
        display: flex;
        flex-direction: column;
        gap: 0;
        padding-bottom: 0;
    }

    .table-pos-header {
        padding: 0.55rem 0.75rem;
        margin-bottom: 0.45rem;
        border-radius: 10px;
    }

    .table-pos-header-left {
        font-size: 0.82rem;
        gap: 0.45rem;
        min-width: 0;
    }

    .table-pos-title {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .table-pos-back-btn {
        padding: 0.45rem 0.65rem;
        font-size: 0.78rem;
        flex-shrink: 0;
    }

    .table-pos-mobile-bar {
        display: flex;
        align-items: center;
        gap: 0.65rem;
        padding: 0.55rem 0.65rem;
        margin-bottom: 0.5rem;
        background: #fff;
        border: 1px solid var(--border-color);
        border-radius: 12px;
        box-shadow: var(--shadow-sm);
        position: sticky;
        top: 0;
        z-index: 45;
    }

    .table-pos-mobile-add-btn {
        flex: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.45rem;
        min-height: 46px;
        padding: 0.55rem 1rem;
        border: none;
        border-radius: 11px;
        background: linear-gradient(135deg, var(--brand) 0%, var(--primary-dark, #d94e0f) 100%);
        color: #fff;
        font-weight: 700;
        font-size: 0.92rem;
        box-shadow: 0 4px 14px rgba(242, 101, 34, 0.35);
        touch-action: manipulation;
    }

    .table-pos-mobile-add-btn i {
        font-size: 1.15rem;
    }

    .table-pos-mobile-total-wrap {
        text-align: right;
        flex-shrink: 0;
        min-width: 88px;
    }

    .table-pos-mobile-total-label {
        display: block;
        font-size: 0.62rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--text-muted);
        line-height: 1.1;
    }

    .table-pos-mobile-total {
        display: block;
        font-size: 1rem;
        font-weight: 800;
        color: var(--primary);
        line-height: 1.2;
    }

    .table-pos-drawer-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1055;
        background: rgba(15, 23, 42, 0.45);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }

    .table-pos-page.is-products-open .table-pos-drawer-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .table-pos-products-drawer {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1060;
        max-height: 92dvh;
        background: #fff;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.18);
        display: flex;
        flex-direction: column;
        transform: translateY(105%);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .table-pos-page.is-products-open .table-pos-products-drawer {
        transform: translateY(0);
    }

    .table-pos-drawer-header {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.65rem 0.75rem;
        border-bottom: 1px solid var(--border-color);
        flex-shrink: 0;
    }

    .table-pos-drawer-close {
        width: 40px;
        height: 40px;
        border: 1px solid var(--border-color);
        border-radius: 10px;
        background: #fff;
        color: var(--text-secondary);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        touch-action: manipulation;
    }

    .table-pos-drawer-title {
        flex: 1;
        text-align: center;
        font-weight: 700;
        font-size: 0.95rem;
    }

    .table-pos-drawer-spacer {
        width: 40px;
        flex-shrink: 0;
    }

    .table-pos-drawer-body {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }

    .table-pos-products-drawer .table-pos-categories {
        flex-direction: row;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-height: none;
        padding: 0.5rem;
        gap: 0.35rem;
        border-bottom: 1px solid var(--border-color);
        flex-shrink: 0;
    }

    .table-pos-products-drawer .table-pos-category {
        white-space: nowrap;
        min-width: auto;
        padding: 0.45rem 0.75rem;
        font-size: 0.72rem;
        border-left: none;
        border-bottom: 3px solid transparent;
        border-radius: 8px;
        min-height: 36px;
    }

    .table-pos-products-drawer .table-pos-category.active {
        border-bottom-color: var(--brand);
        background: #FFF7ED;
    }

    .table-pos-products-drawer .table-pos-products {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        border: none;
        border-radius: 0;
        box-shadow: none;
        padding: 0.5rem;
    }

    .table-pos-products-drawer .table-pos-search {
        margin-bottom: 0.5rem;
        flex-shrink: 0;
    }

    .table-pos-products-drawer .table-pos-search input {
        min-height: 44px;
        font-size: 0.9rem;
    }

    .table-pos-products-drawer .table-pos-product-list {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-pos-products-drawer .table-pos-product-row {
        min-height: 64px;
        padding: 0.65rem 0.75rem;
    }

    .table-pos-products-drawer .table-pos-product-row .name {
        font-size: 0.88rem;
        font-weight: 600;
    }

    .table-pos-products-drawer .table-pos-product-row .price {
        font-size: 0.85rem;
        font-weight: 700;
    }

    .table-pos-products-drawer .market-pos-categories {
        flex-direction: row !important;
        overflow-x: auto;
        max-height: none !important;
        border: none;
        border-bottom: 1px solid var(--border-color);
        border-radius: 0;
        padding: 0.5rem;
        gap: 0.35rem;
    }

    .table-pos-products-drawer .market-pos-category {
        border-left: none !important;
        border-radius: 999px;
        min-height: 36px;
        padding: 0.45rem 0.8rem;
        white-space: nowrap;
    }

    .table-pos-products-drawer .market-pos-category.active {
        background: #059669 !important;
        color: #fff !important;
        border-left-color: transparent !important;
    }

    .table-pos-products-drawer .market-pos-products {
        flex: 1;
        min-height: 0;
        border: none;
        border-radius: 0;
        box-shadow: none;
        padding: 0.5rem;
    }

    .table-pos-products-drawer .market-pos-product-grid {
        display: grid !important;
        grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
        gap: 0.55rem;
        overflow-y: auto;
        flex: 1;
        min-height: 0;
    }

    .table-pos-products-drawer .market-pos-tile {
        min-height: 128px;
        padding: 0.55rem;
    }

    .table-pos-products-drawer .market-pos-tile-media {
        aspect-ratio: 1;
    }

    .table-pos-products-drawer .market-pos-tile-name {
        font-size: 0.72rem;
        min-height: 2.2em;
    }

    .table-pos-products-drawer .market-pos-tile-price {
        font-size: 0.82rem;
    }

    .table-pos-layout {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        grid-template-columns: unset !important;
        grid-template-rows: unset !important;
        gap: 0 !important;
    }

    .table-pos-page.pos-mobile-ready .table-pos-layout > .market-pos-main,
    .table-pos-page.pos-mobile-ready .table-pos-layout > .table-pos-categories,
    .table-pos-page.pos-mobile-ready .table-pos-layout > .table-pos-products {
        display: none !important;
    }

    .table-pos-cart {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        border-radius: 12px;
        overflow: hidden;
    }

    .table-pos-summary {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.45rem;
        padding: 0.55rem;
    }

    .table-pos-summary-box {
        padding: 0.45rem 0.55rem;
        border-radius: 9px;
    }

    .table-pos-summary-box .label {
        font-size: 0.62rem;
    }

    .table-pos-summary-box strong {
        font-size: 0.88rem;
    }

    .table-pos-selection-bar {
        flex-wrap: wrap;
        gap: 0.45rem;
        padding: 0.45rem 0.55rem;
    }

    .table-pos-cart-table-wrap {
        flex: 1;
        min-height: 120px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-pos-cart-table thead th {
        position: sticky;
        top: 0;
        z-index: 2;
        background: #F8FAFC;
        font-size: 0.68rem;
        padding: 0.4rem 0.35rem;
    }

    .table-pos-cart-table tbody td {
        padding: 0.45rem 0.35rem;
        font-size: 0.78rem;
        vertical-align: middle;
    }

    .table-pos-cart-table thead th:nth-child(3),
    .table-pos-cart-table thead th:nth-child(4),
    .table-pos-cart-table tbody td:nth-child(3),
    .table-pos-cart-table tbody td:nth-child(4) {
        display: none;
    }

    .table-pos-cart-table .btn-remove {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }

    .table-pos-cart-footer {
        flex-shrink: 0;
        padding: 0;
        background: #fff;
        border-top: 1px solid var(--border-color);
        position: sticky;
        bottom: 0;
        z-index: 40;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.08);
    }

    .table-pos-footer-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.45rem;
        padding: 0.55rem;
    }

    .table-pos-footer-actions .table-pos-action-btn {
        min-height: 44px;
        font-size: 0.75rem;
        padding: 0.45rem 0.35rem;
        flex-direction: column;
        gap: 0.15rem;
        text-align: center;
    }

    .table-pos-footer-actions .table-pos-action-btn span {
        line-height: 1.15;
    }

    .table-pos-footer-actions .table-pos-pay-btn {
        grid-column: 1 / -1;
        flex-direction: row;
        font-size: 0.88rem;
        min-height: 48px;
    }

    .tables-floor-stats {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0.5rem;
        padding-bottom: 0.25rem;
        scroll-snap-type: x mandatory;
    }

    .tables-floor-stats .tables-stat-card {
        flex: 0 0 auto;
        min-width: 120px;
        scroll-snap-align: start;
    }

    .tables-floor-top {
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
    }

    .tables-floor-top .btn {
        width: 100%;
    }

    .tables-floor-tile {
        min-height: 96px;
    }

    .quick-sale-page .table-pos-summary,
    .market-pos-page .table-pos-summary {
        grid-template-columns: 1fr;
    }

    .market-pos-page .table-pos-summary {
        grid-template-columns: 1fr;
    }

    .market-pos-page .table-pos-layout {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: unset !important;
    }

    .market-pos-page .market-pos-main {
        display: none !important;
    }

    .market-pos-page .market-pos-cart,
    .market-pos-page .table-pos-cart {
        width: 100% !important;
        max-width: none !important;
        flex: 1;
        min-height: 0;
        height: auto !important;
    }

    .main-content-compact:has(.phone-order-page) {
        padding: 0.35rem;
        height: calc(100dvh - 0.5rem);
    }

    .phone-order-page .phone-order-summary {
        display: none;
    }

    .phone-order-page .phone-order-form {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .phone-order-page .phone-order-panel {
        padding: 0.65rem 0.55rem;
    }

    .phone-order-page .phone-order-fields {
        grid-template-columns: 1fr;
    }

    .phone-order-page .phone-order-payment-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .phone-order-page .phone-order-save-wrap {
        flex-shrink: 0;
        position: sticky;
        bottom: 0;
        z-index: 40;
        padding-bottom: calc(0.65rem + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.08);
    }

    .phone-order-page .phone-order-input,
    .phone-order-page .phone-order-textarea {
        min-height: 44px;
        font-size: 16px;
    }
}

@media (max-width: 575.98px) {
    .table-pos-back-btn span {
        display: none;
    }

    .market-pos-page .market-pos-back-btn span {
        display: none;
    }

    .market-pos-page .market-pos-header-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .market-pos-page .market-pos-meta {
        width: 100%;
    }

    .market-pos-page .market-pos-back-btn {
        width: auto;
        position: absolute;
        top: 0.65rem;
        right: 0.65rem;
        padding: 0.45rem 0.65rem;
    }

    .market-pos-page .market-pos-header {
        position: relative;
        padding-right: 5rem;
    }

    .table-pos-header-row {
        gap: 0.35rem;
    }

    .table-pos-footer-actions .table-pos-action-btn i {
        font-size: 1.1rem;
    }

    .table-pos-cart-table thead th:first-child,
    .table-pos-cart-table tbody td:first-child {
        width: 28px;
        padding-left: 0.25rem;
    }
}

/* Dar ekran / WebView — viewport geniş olsa bile POS alanı mobil kalsın */
@container table-pos (max-width: 991px) {
    .table-pos-mobile-bar {
        display: flex;
    }

    .table-pos-layout {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: unset !important;
        grid-template-rows: unset !important;
        gap: 0 !important;
        flex: 1;
        min-height: 0;
    }

    .table-pos-page.pos-mobile-ready .table-pos-layout > .market-pos-main,
    .table-pos-page.pos-mobile-ready .table-pos-layout > .table-pos-categories,
    .table-pos-page.pos-mobile-ready .table-pos-layout > .table-pos-products,
    .market-pos-page .table-pos-layout > .market-pos-main,
    .table-pos-page:not(.pos-mobile-ready) .table-pos-layout > .table-pos-categories,
    .table-pos-page:not(.pos-mobile-ready) .table-pos-layout > .table-pos-products {
        display: none !important;
    }

    .market-pos-page .table-pos-layout {
        display: flex !important;
        flex-direction: column !important;
    }

    .market-pos-page .table-pos-cart {
        width: 100% !important;
        max-width: none !important;
        flex: 1 !important;
    }

    .table-pos-cart {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        border-radius: 12px;
        overflow: hidden;
    }

    .main-content-compact:has(.phone-order-page) {
        padding: 0.35rem;
        height: calc(100dvh - 0.5rem);
    }

    .phone-order-page .phone-order-summary {
        display: none;
    }

    .phone-order-page .phone-order-form {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .phone-order-page .phone-order-save-wrap {
        flex-shrink: 0;
        position: sticky;
        bottom: 0;
        z-index: 40;
        padding-bottom: calc(0.65rem + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.08);
    }
}

@container table-pos (min-width: 992px) {
    .table-pos-mobile-bar,
    .table-pos-drawer-backdrop,
    .table-pos-products-drawer {
        display: none !important;
    }
}
