/* =============================================
   Mutual Space Palembang - Mobile App Style
   ============================================= */

:root {
    --bg: #0D0906;
    --bg2: #1A120B;
    --card: #1C1410;
    --card-hover: #261C14;
    --accent: #C8956C;
    --accent-light: #E8B87E;
    --accent-glow: rgba(200,149,108,0.2);
    --text: #F0E4D7;
    --text-muted: #8A7B6B;
    --success: #5CB85C;
    --warning: #E8A838;
    --danger: #D9534F;
    --border: rgba(200,149,108,0.1);
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

body {
    font-family: 'DM Sans', sans-serif;
    background: #040302;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    height: 100vh;
}

h1, h2, h3, h4 { font-family: 'Playfair Display', serif; }
a { text-decoration: none; color: inherit; }

/* =============================================
   PHONE FRAME - Desktop Only
   ============================================= */
.app-shell {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg);
}

@media (min-width: 500px) {
    body {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 16px;
    }
    .app-shell {
        width: 393px;
        height: 852px;
        border-radius: 48px;
        border: 3.5px solid #1a120b;
        box-shadow:
            0 0 0 7px #080503,
            0 0 0 9px #0f0b07,
            0 30px 100px rgba(0,0,0,0.9),
            0 0 80px rgba(200,149,108,0.04);
    }
    /* Dynamic Island */
    .app-shell::before {
        content: '';
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 100px;
        height: 28px;
        background: #000;
        border-radius: 20px;
        z-index: 300;
    }
    .app-content {
        padding-top: 48px !important;
    }
}

/* =============================================
   CANVAS & TOAST (di dalam app-shell)
   ============================================= */
#bgCanvas {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.toast-container {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: calc(100% - 32px);
    max-width: 380px;
}

@media (min-width: 500px) {
    .toast-container { top: 56px; max-width: 350px; }
}

/* =============================================
   APP CONTENT - Area scrollable
   ============================================= */
.app-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    z-index: 1;
    -webkit-overflow-scrolling: touch;
}

.app-content::-webkit-scrollbar { width: 0; }

/* =============================================
   BOTTOM NAVIGATION
   ============================================= */
.bottom-nav {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: rgba(13,9,6,0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    padding: 6px 0;
    padding-bottom: calc(6px + var(--safe-bottom));
    position: relative;
    z-index: 100;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 16px;
    border-radius: 12px;
    transition: all 0.2s;
    position: relative;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item i {
    font-size: 18px;
    color: var(--text-muted);
    transition: color 0.2s;
}

.bottom-nav-item span {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.2s;
}

.bottom-nav-item.active i { color: var(--accent); }
.bottom-nav-item.active span { color: var(--accent); font-weight: 600; }

.bottom-nav-item .cart-badge {
    position: absolute;
    top: 0;
    right: 6px;
    background: var(--danger);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bounce-in 0.3s ease;
    border: 1.5px solid var(--bg);
}

/* =============================================
   ANIMASI
   ============================================= */
@keyframes fadeUp { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:translateY(0)} }
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-10px)} }
@keyframes bounce-in { 0%{transform:scale(0)} 50%{transform:scale(1.2)} 100%{transform:scale(1)} }
@keyframes slide-down { from{opacity:0;transform:translateY(-12px)} to{opacity:1;transform:translateY(0)} }
@keyframes slide-in { from{transform:translateX(100%);opacity:0} to{transform:translateX(0);opacity:1} }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-6px)} 40%,80%{transform:translateX(6px)} }
@keyframes steam { 0%{transform:translateY(0) scaleX(1);opacity:.5} 50%{transform:translateY(-16px) scaleX(1.3);opacity:.2} 100%{transform:translateY(-32px) scaleX(.7);opacity:0} }
@keyframes scan-line { 0%{top:8%;opacity:0} 10%{opacity:1} 90%{opacity:1} 100%{top:88%;opacity:0} }
@keyframes pulse-dot { 0%,100%{opacity:1} 50%{opacity:.4} }

/* =============================================
   TOMBOL
   ============================================= */
.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: var(--bg);
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 14px;
    padding: 15px 24px;
    font-size: 15px;
    font-family: 'DM Sans', sans-serif;
    -webkit-tap-highlight-color: transparent;
}
.btn-primary:active { transform: scale(0.97); }

.btn-outline {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: transparent;
    color: var(--accent);
    font-weight: 600;
    border: 2px solid var(--accent);
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 14px;
    padding: 13px 24px;
    font-size: 15px;
    font-family: 'DM Sans', sans-serif;
    -webkit-tap-highlight-color: transparent;
}
.btn-outline:active { background: rgba(200,149,108,0.1); }

.btn-sm {
    padding: 10px 16px;
    font-size: 13px;
    border-radius: 10px;
}

.btn-success-solid {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: var(--success);
    color: #fff;
    font-weight: 700;
    border: none;
    cursor: pointer;
    border-radius: 12px;
    padding: 13px 16px;
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    -webkit-tap-highlight-color: transparent;
}
.btn-success-solid:active { opacity: 0.8; }

.btn-ghost {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    cursor: pointer;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 500;
    font-family: 'DM Sans', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

/* =============================================
   KARTU
   ============================================= */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: background 0.2s;
}
.card:active { background: var(--card-hover); }

.card-flat {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
}

/* =============================================
   MENU CARD (2 kolom di mobile)
   ============================================= */
.menu-card img {
    width: 100%;
    height: 110px;
    object-fit: cover;
}

.menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* =============================================
   TAB KATEGORI (horizontal scroll)
   ============================================= */
.cat-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 16px 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.cat-scroll::-webkit-scrollbar { display: none; }

.tab-pill {
    flex-shrink: 0;
    padding: 8px 18px;
    border-radius: 50px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    background: var(--card);
    color: var(--text-muted);
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}
.tab-pill.active {
    background: var(--accent);
    color: var(--bg);
    font-weight: 700;
    border-color: var(--accent);
}

/* =============================================
   QUANTITY BUTTON
   ============================================= */
.qty-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'DM Sans', sans-serif;
    -webkit-tap-highlight-color: transparent;
}
.qty-btn:active { background: var(--accent); color: var(--bg); }

.add-btn {
    background: var(--accent);
    color: var(--bg);
    border: none;
    cursor: pointer;
    padding: 7px 14px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 12px;
    font-family: 'DM Sans', sans-serif;
    -webkit-tap-highlight-color: transparent;
}
.add-btn:active { opacity: 0.8; }

/* =============================================
   INPUT & SELECT
   ============================================= */
input[type="text"],
input[type="password"],
select {
    background: var(--card);
    border: 1.5px solid var(--border);
    color: var(--text);
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 15px;
    font-family: 'DM Sans', sans-serif;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
}
input:focus, select:focus { border-color: var(--accent); }
select option { background: var(--card); color: var(--text); }

/* =============================================
   TOAST
   ============================================= */
.toast {
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 500;
    animation: slide-down 0.35s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
    font-family: 'DM Sans', sans-serif;
}
.toast-success { background: #14261a; border: 1px solid rgba(92,184,92,0.25); color: #8fd49f; }
.toast-error { background: #2a1010; border: 1px solid rgba(217,83,79,0.25); color: #f0a0a0; }
.toast-info { background: #101e2a; border: 1px solid rgba(91,192,222,0.25); color: #90cfe8; }

/* =============================================
   STATUS BADGE
   ============================================= */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    font-family: 'DM Sans', sans-serif;
}
.badge-pending { background: rgba(217,83,79,0.12); color: #e88; }
.badge-processing { background: rgba(232,168,56,0.12); color: #e8c060; }
.badge-completed { background: rgba(92,184,92,0.12); color: #8fd49f; }

/* =============================================
   QRIS
   ============================================= */
.qris-frame {
    position: relative;
    background: #fff;
    border-radius: 18px;
    padding: 20px;
    display: inline-block;
}
.qris-frame::after {
    content: '';
    position: absolute;
    left: 20px;
    right: 20px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    animation: scan-line 2.5s ease-in-out infinite;
}

/* =============================================
   ADMIN TABS
   ============================================= */
.admin-tabs {
    display: flex;
    gap: 6px;
    padding: 0 16px 12px;
}
.admin-tab {
    flex: 1;
    text-align: center;
    padding: 10px 6px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid var(--border);
    background: var(--card);
    color: var(--text-muted);
    font-family: 'DM Sans', sans-serif;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}
.admin-tab .tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    border-radius: 50px;
    font-size: 10px;
    font-weight: 800;
    margin-left: 4px;
    padding: 0 5px;
}
.admin-tab.tab-pending.active {
    background: rgba(217,83,79,0.1);
    border-color: rgba(217,83,79,0.3);
    color: #f0a0a0;
}
.admin-tab.tab-pending.active .tab-count { background: var(--danger); color: #fff; }

.admin-tab.tab-processing.active {
    background: rgba(232,168,56,0.1);
    border-color: rgba(232,168,56,0.3);
    color: #f0d080;
}
.admin-tab.tab-processing.active .tab-count { background: var(--warning); color: #1a120b; }

.admin-tab.tab-completed.active {
    background: rgba(92,184,92,0.1);
    border-color: rgba(92,184,92,0.3);
    color: #a0e0a0;
}
.admin-tab.tab-completed.active .tab-count { background: var(--success); color: #fff; }

/* =============================================
   ADMIN STAT GRID
   ============================================= */
.stat-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 0 16px;
    margin-bottom: 16px;
}
.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}

/* =============================================
   ORDER CARD (Mobile Compact)
   ============================================= */
.order-card {
    animation: fadeUp 0.3s ease;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    margin: 0 16px 10px;
}
.order-card-accent {
    border-top: 3px solid;
}
.order-card-accent.type-pending { border-top-color: var(--danger); }
.order-card-accent.type-processing { border-top-color: var(--warning); }
.order-card-accent.type-completed { border-top-color: var(--success); }

.order-item-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    padding: 2px 0;
}

/* =============================================
   STEAM LINES
   ============================================= */
.steam-line {
    position: absolute;
    width: 2.5px;
    border-radius: 3px;
    background: rgba(200,149,108,0.2);
    filter: blur(1.5px);
}

/* =============================================
   SECTION HELPERS
   ============================================= */
.px-4 { padding-left: 16px; padding-right: 16px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.w-full { width: 100%; }
.relative { position: relative; }
.overflow-hidden { overflow: hidden; }

/* =============================================
   REDUCED MOTION
   ============================================= */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}