/* =========================================================
   PREMIUM UI DESIGN (MOBILE & DESKTOP)
   ========================================================= */
:root { 
    --primary: #0f172a; 
    --primary-light: #1e293b; 
    --gold: #f59e0b; 
    --green: #10b981; 
    --red: #ef4444; 
    --whatsapp: #25D366; 
    --sms: #3b82f6; 
    --bg: #f4f1ea; 
    --surface: #ffffff; 
    --border: #e2e8f0; 
    --text-main: #334155; 
    --text-muted: #64748b; 
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.02); 
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.05); 
    --shadow-hover: 0 20px 25px -5px rgba(0,0,0,0.1); 
    --radius-sm: 8px; 
    --radius-md: 12px; 
    --radius-lg: 20px; 
}

body { 
    font-family: 'Poppins', sans-serif; 
    margin: 0; 
    padding: 0; 
    background: var(--bg); 
    color: var(--text-main); 
    -webkit-font-smoothing: antialiased; 
}

.pb-logo {
    display: inline-block;
    font-family: 'Poppins', sans-serif;
    font-weight: 900;
    font-size: 1.3em;
    font-style: italic;
    background: linear-gradient(135deg, #FF9933 33%, #FFFFFF 33%, #FFFFFF 66%, #138808 66%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
    padding: 0 10px 0 2px;
    margin-right: 2px;
    letter-spacing: -2px;
    line-height: 1.1;
    filter: drop-shadow(2px 2px 2px rgba(0,0,0,0.3));
}

.container { 
    max-width: 1400px; 
    margin: 0 auto; 
    min-height: 100vh; 
    display: flex; 
    flex-direction: column; 
}

/* --- PREMIUM HEADER & DYNAMIC LOGO --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    padding: 10px 20px;
    z-index: 100;
    border-bottom: 3px solid transparent; 
    border-image: linear-gradient(to right, #FF9933, #FFFFFF, #138808) 1; 
}

.premium-shop-name {
    font-size: 1.4rem;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: -0.5px;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 65vw;
    display: flex;
    align-items: center;
    gap: 8px; /* Space between logo circle and text */
}

/* Visibility Helpers for Desktop/Mobile Logo Switching */
.desktop-only-inline { display: inline-block; }
.mobile-only-inline { display: none; }

/* The dynamic logo circle next to the title */
.header-prof-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 2px solid var(--border);
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.header-prof-placeholder span {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--primary);
}
.header-prof-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: #0f172a;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-toggle svg {
    width: 32px;
    height: 32px;
}

.mobile-menu-header { display: none; }

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.5); 
    backdrop-filter: blur(3px); 
    z-index: 999;
}

.logo h1 { 
    margin: 0; 
    font-size: clamp(1.2rem, 4vw, 1.6rem); 
    font-weight: 700; 
    color: var(--primary); 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis;
}

.nav { 
    display: flex; 
    gap: 10px; 
    align-items: center; 
}

.nav-btn { 
    padding: 10px 20px; 
    border: none; 
    background: transparent; 
    color: var(--text-muted); 
    border-radius: 50px; 
    cursor: pointer; 
    font-weight: 600; 
    font-size: 0.9rem; 
    transition: all 0.3s ease; 
    white-space: nowrap; 
}

.nav-btn:hover { 
    background: #f1f5f9; 
    color: var(--primary); 
}

.nav-btn.active { 
    background: var(--primary); 
    color: white; 
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.2); 
}

.profile-trigger { 
    flex-shrink: 0; 
    width: 42px; 
    height: 42px; 
    background: #004a99; 
    color: white; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-weight: bold; 
    cursor: pointer; 
    font-size: 1rem; 
    text-transform: lowercase; 
    position: relative; 
    margin-left: 5px; 
    transition: 0.3s; 
    z-index: 1; 
    overflow: hidden; 
    box-shadow: var(--shadow-sm); 
}

.profile-trigger:hover { 
    transform: scale(1.08); 
}

.profile-trigger img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
}

.content { 
    padding: 30px; 
    flex: 1; 
}

.card { 
    background: var(--surface); 
    padding: 35px; 
    border-radius: var(--radius-lg); 
    box-shadow: var(--shadow-md); 
    margin-bottom: 25px; 
    border: 1px solid rgba(255, 255, 255, 0.6); 
    transition: box-shadow 0.3s ease;
}

.card:hover { 
    box-shadow: var(--shadow-hover); 
}

.form-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 20px; 
}

.full { grid-column: span 2; }

label { 
    font-size: 0.85rem; 
    font-weight: 600; 
    color: var(--text-muted); 
    margin-bottom: 8px; 
    display: block; 
}

input, select, textarea { 
    width: 100%; 
    padding: 14px 16px; 
    background: #f8fafc; 
    border: 1px solid var(--border); 
    border-radius: var(--radius-md); 
    font-size: 0.95rem; 
    outline: none; 
    transition: all 0.3s ease; 
    box-sizing: border-box; 
    font-family: inherit; 
    color: var(--text-main); 
}

input:focus, textarea:focus, select:focus { 
    border-color: var(--primary); 
    background: var(--surface); 
    box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.08); 
}

.btn { 
    width: 100%; 
    padding: 16px; 
    border: none; 
    border-radius: var(--radius-md); 
    font-weight: 700; 
    cursor: pointer; 
    font-size: 1rem; 
    margin-top: 20px; 
    color: white; 
    transition: all 0.2s ease;
}

.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--primary); }
.btn-primary:hover { opacity: 0.9; box-shadow: var(--shadow-md); }
.btn-green { background: var(--green); } 
.btn-red { background: var(--red); } 
.btn-blue { background: var(--sms); }
.btn-gold { background: var(--gold); color: #fff; font-weight: 700;}

.btn-edit, .btn-sm { 
    padding: 10px 18px; 
    background: var(--primary); 
    color: white; 
    border-radius: var(--radius-sm); 
    font-size: 0.85rem; 
    cursor:pointer; 
    border:none; 
    font-weight:600; 
    transition: 0.2s;
}

.btn-edit:hover, .btn-sm:hover { 
    opacity: 0.9; 
    transform: translateY(-1px); 
}

.list-container { 
    max-height: 400px; 
    overflow-y: auto; 
    border: 1px solid var(--border); 
    border-radius: var(--radius-md); 
    margin-top: 10px; 
}

.list-item { 
    padding: 16px; 
    border-bottom: 1px solid #f1f5f9; 
    cursor: pointer; 
    background: white; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    transition: 0.2s;
}

.list-item:hover { 
    background: #f8fafc; 
    padding-left: 20px; 
}

.cart-table, .report-table { 
    width:100%; 
    border-collapse:collapse; 
    margin:15px 0; 
}

th { 
    text-align:left; 
    background:#f1f5f9; 
    padding:12px; 
    font-size:0.85rem; 
    color:var(--text-muted); 
    text-transform: uppercase; 
    letter-spacing: 0.5px;
}

td { 
    padding:14px 12px; 
    border-bottom:1px solid #f1f5f9; 
    font-size: 0.95rem; 
}

.status-sale, .status-return, .status-pay { 
    padding: 6px 12px; 
    border-radius: 50px; 
    font-weight: bold; 
    font-size: 0.8rem; 
}

.status-sale { color: var(--green); background: #ecfdf5; }
.status-return { color: var(--red); background: #fef2f2; }
.status-pay { color: var(--sms); background: #eff6ff; }

.info-card { 
    background: #fff; 
    margin-bottom: 12px; 
    padding: 20px; 
    border-radius: var(--radius-md); 
    box-shadow: var(--shadow-sm); 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border: 1px solid var(--border);
}

.border-red { border-left: 5px solid var(--red); } 
.border-green { border-left: 5px solid var(--green); } 
.border-blue { border-left: 5px solid var(--sms); }

.phone-link { 
    color: var(--sms); 
    cursor: pointer; 
    font-size: 0.9rem; 
    margin-left: 5px; 
    font-weight: 600; 
    padding: 4px 8px; 
    background: #eff6ff; 
    border-radius: 6px;
}

.profile-pic-container { 
    width: 100px; 
    height: 100px; 
    border-radius: 50%; 
    background: #f1f5f9; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    overflow: hidden; 
    border: 3px solid var(--border); 
    box-shadow: var(--shadow-sm);
}

.profile-pic-container img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
}

.extra-charges-grid { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 10px; 
}

@media (min-width: 600px) { 
    .extra-charges-grid { 
        grid-template-columns: repeat(5, 1fr); 
    } 
}

.extra-charges-grid .full { grid-column: 1 / -1; }
.extra-charges-grid label { font-size: 0.8rem; color: #64748b; margin-bottom: 2px; display: block; }
.extra-charges-grid input { width: 100%; padding: 8px; font-size: 0.9rem; border: 1px solid #cbd5e1; border-radius: 5px; }

.hidden { display: none !important; }

.modal-overlay { 
    position: fixed; 
    inset: 0; 
    background: rgba(15, 23, 42, 0.6); 
    backdrop-filter: blur(4px); 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    z-index: 1000; 
    padding: 20px;
}

.modal-box { 
    background: white; 
    padding: 30px; 
    border-radius: var(--radius-lg); 
    width: 100%; 
    max-width: 500px; 
    text-align: center; 
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); 
    max-height: 85vh; 
    overflow-y: auto; 
}

.auth-wrapper { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    min-height: 100vh; 
    background: var(--primary); 
    padding: 20px; 
}

.auth-box { 
    background: white; 
    padding: 40px; 
    border-radius: var(--radius-lg); 
    width: 100%; 
    max-width: 420px; 
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.2); 
}

.auth-header { text-align: center; margin-bottom: 30px; }
.auth-header h1 { color: var(--primary); margin: 0; font-size: 1.8rem; font-weight: 800;}
.auth-form { display: flex; flex-direction: column; gap: 18px; }

.loader-overlay { 
    position: fixed; 
    inset: 0; 
    background: var(--primary); 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    z-index: 99999; 
    color: white; 
}

.spinner { 
    width: 60px; 
    height: 60px; 
    border: 6px solid rgba(255,255,255,0.1); 
    border-top-color: var(--gold); 
    border-radius: 50%; 
    animation: spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite; 
}

@keyframes spin { 
    to { transform: rotate(360deg); } 
}

/* =========================================================
   MOBILE RESPONSIVE OVERRIDES
   ========================================================= */

/* Mobile-only and Desktop-only helpers */
.mobile-only-item { display: none !important; }
.desktop-only-nav-item { display: block; }

@media (max-width: 850px) {
    .mobile-only-item { display: block !important; }
    .desktop-only-nav-item { display: none !important; }
    .desktop-only-inline { display: none !important; }
    .mobile-only-inline { display: flex !important; }

    /* Hamburger Menu Logic */
    .mobile-menu-toggle { display: block; }
    
    .nav {
        position: fixed;
        top: 0;
        right: -320px; /* Hidden off-screen initially */
        width: 260px;
        height: 100vh;
        background: white;
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
        box-shadow: -5px 0 25px rgba(0,0,0,0.15);
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        overflow-y: auto;
        display: flex !important; 
    }
    .nav.open { right: 0; }
    .mobile-menu-overlay.open { display: block; }
    .mobile-menu-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        margin-bottom: 20px;
        border-bottom: 1px solid #e2e8f0;
        padding-bottom: 15px;
    }
    .close-menu-btn {
        background: #f1f5f9;
        border: none;
        font-size: 1.5rem;
        color: #64748b;
        width: 35px;
        height: 35px;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .nav-btn {
        width: 100%;
        text-align: left;
        padding: 14px 15px;
        border-bottom: none;
        border-radius: 8px;
        margin: 0 0 5px 0;
        font-size: 1.05rem;
        color: #475569;
    }
    .nav-btn.active {
        background: #f0f9ff;
        color: var(--primary);
        border-left: 4px solid var(--primary);
        font-weight: bold;
        box-shadow: none;
    }

    /* General Mobile Fixes */
    .content { padding: 15px; }
    .card { padding: 25px 20px; }
    .form-grid { grid-template-columns: 1fr; gap: 16px; }
    .full { grid-column: span 1; }
    .cart-table, .report-table { display: block; overflow-x: auto; white-space: nowrap; }
    
    .info-card { flex-direction: column; align-items: flex-start; gap: 15px; }
    .info-card > div { text-align: left !important; width: 100%; }
    
    .date-filter-container, .reports-filter, .form-grid:has(input[type="date"]) { 
        display: flex !important; 
        flex-wrap: wrap !important; 
        gap: 10px !important; 
        align-items: center !important; 
    }
    
    input[type="date"] { 
        flex: 1 1 45% !important; 
        min-width: 130px !important; 
        margin: 5px 0 !important; 
    }
    
    .filter-btn, button[onclick*="filter"] { 
        width: 100% !important; 
        margin-top: 5px !important; 
    }
    
    .list-item, .inventory-item, #inventoryList li { 
        display: flex !important; 
        flex-direction: column !important; 
        align-items: flex-start !important; 
        padding: 15px !important; 
        gap: 12px !important; 
    }
    
    .list-item > div:first-child, .inventory-item-details { 
        width: 100% !important; 
        display: flex !important; 
        justify-content: space-between !important; 
        align-items: center !important; 
        word-break: break-word !important; 
    }
    
    .list-item > div:last-child, .inventory-item-actions { 
        width: 100% !important; 
        display: flex !important; 
        justify-content: flex-end !important; 
        gap: 10px !important; 
        padding-top: 10px !important; 
        border-top: 1px dashed #e2e8f0 !important; 
    }
} 

/* --- WORKER EXCEL SHEET UI --- */
.worker-sheet-table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-top: 15px; 
    text-align: left; 
}
.worker-sheet-table th { 
    background: var(--primary-light); 
    color: white; 
    padding: 12px; 
    font-size: 0.9rem; 
    text-transform: uppercase; 
}
.worker-sheet-table td { 
    padding: 10px; 
    border-bottom: 1px solid #e2e8f0; 
    vertical-align: middle; 
}
.worker-sheet-table input { 
    width: 100%; 
    padding: 8px; 
    border: 1px solid #cbd5e1; 
    border-radius: 4px; 
    font-size: 0.9rem; 
    box-sizing: border-box;
}
.worker-sheet-table button { 
    padding: 8px 12px; 
    border: none; 
    border-radius: 4px; 
    cursor: pointer; 
    font-weight: bold; 
    transition: 0.2s; 
    width: 100%;
}
.worker-sheet-table button:active { 
    transform: scale(0.95); 
}