/* Mobil & PWA arayüz — 768px ve altı */

@media (max-width: 768px) {
    .mobile-header,
    .mobile-bottom-nav { display: flex !important; }
    .mobile-more-sheet,
    .sidebar-close { display: block !important; }
    .desktop-only { display: none !important; }

    .app { flex-direction: column; }

    /* Üst bar */
    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 56px;
        padding: 0 0.75rem;
        background: var(--primary);
        color: white;
        z-index: 150;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }

    .mobile-header-logo {
        background: transparent;
        height: 36px;
        max-width: 140px;
        object-fit: contain;
    }

    .mobile-icon-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border: none;
        background: transparent;
        color: white;
        font-size: 1.35rem;
        border-radius: 8px;
        cursor: pointer;
    }

    .mobile-icon-btn:active { background: rgba(255, 255, 255, 0.12); }

    /* Sidebar — kaydırmalı */
    .sidebar {
        width: min(280px, 85vw);
        transform: translateX(-100%);
        transition: transform 0.28s ease;
        z-index: 200;
        padding-top: 0.5rem;
    }

    .sidebar.open { transform: translateX(0); }

    .sidebar-close {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        padding: 0.5rem 0.75rem 0;
    }

    .sidebar-close button {
        width: 40px;
        height: 40px;
        border: none;
        background: rgba(255, 255, 255, 0.1);
        color: white;
        border-radius: 8px;
        font-size: 1.2rem;
        cursor: pointer;
    }

    .sidebar .logo-img { width: 100px; }
    .sidebar .nav-btn span:not(.icon) { display: inline !important; }
    .sidebar .nav-btn { justify-content: flex-start; padding: 0.75rem 1rem; }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.55);
        z-index: 190;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.28s ease;
    }

    .sidebar-overlay.visible {
        opacity: 1;
        pointer-events: auto;
    }

    /* İçerik */
    .content {
        margin-left: 0;
        margin-top: 56px;
        padding: 1rem;
        padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
        max-width: none;
    }

    .page-header h2 { font-size: 1.35rem; }

    .two-col { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .item-row { grid-template-columns: 1fr; }
    .order-items-header { display: none; }
    .order-item-row { grid-template-columns: 1fr; }

    .action-bar { flex-wrap: wrap; gap: 0.5rem; }
    .action-bar .btn { flex: 1 1 auto; min-width: 0; font-size: 0.85rem; }

    .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .data-table { min-width: 560px; font-size: 0.82rem; }

    .rates-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
    .rate-card { min-height: 64px; padding: 0.6rem 0.7rem; }
    .rate-value { font-size: 1rem; }
    .announcements-list { max-height: 220px; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.65rem; }
    .stat-card { padding: 0.85rem; }
    .stat-card .value { font-size: 1.25rem; }

    .stock-grid { grid-template-columns: repeat(2, 1fr); gap: 0.65rem; }

    .modal-content {
        width: calc(100vw - 1.5rem);
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
        margin: 1rem;
    }

    .toast {
        left: 1rem;
        right: 1rem;
        bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    }

    /* Alt navigasyon */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: calc(64px + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: var(--card);
        border-top: 1px solid var(--border);
        z-index: 140;
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
    }

    .mobile-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        border: none;
        background: transparent;
        color: var(--text-muted);
        font-size: 0.65rem;
        cursor: pointer;
        padding: 0.35rem 0;
        min-height: 44px;
        transition: color 0.15s;
    }

    .mobile-nav-item .icon { font-size: 1.25rem; line-height: 1; }
    .mobile-nav-item.active { color: var(--accent); font-weight: 600; }

    /* Daha fazla paneli */
    .mobile-more-sheet {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 210;
        background: var(--card);
        border-radius: 16px 16px 0 0;
        padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.15);
        transform: translateY(100%);
        transition: transform 0.3s ease;
        max-height: 70vh;
        overflow-y: auto;
    }

    .mobile-more-sheet.open { transform: translateY(0); }

    .mobile-more-sheet h3 {
        font-size: 1rem;
        color: var(--primary);
        margin-bottom: 0.75rem;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid var(--border);
    }

    .mobile-more-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .mobile-more-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.35rem;
        padding: 0.85rem 0.5rem;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: var(--bg);
        color: var(--text);
        font-size: 0.72rem;
        cursor: pointer;
        transition: background 0.15s;
    }

    .mobile-more-item:active { background: var(--border); }
    .mobile-more-item .icon { font-size: 1.4rem; }
}

@media (min-width: 769px) {
    .mobile-only { display: none !important; }
    .desktop-only { display: block; }
    .sidebar-close { display: none; }
}