/* SweetBake — Indian Bakery Multi-Tenant SaaS Styling */
:root {
    --sb-primary: #d97706;
    --sb-primary-hover: #b45309;
    --sb-primary-light: #fef3c7;
    --sb-secondary: #78350f;
    --sb-accent: #e11d48;
    --sb-bg: #f8fafc;
    --sb-surface: #ffffff;
    --sb-border: #e2e8f0;
    --sb-text: #0f172a;
    --sb-text-muted: #64748b;
    --sb-sidebar-width: 260px;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--sb-bg);
    color: var(--sb-text);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .brand-font {
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.02em;
}

/* Glassmorphism & Cards */
.card-sb {
    background: #ffffff;
    border: 1px solid var(--sb-border);
    border-radius: 14px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.card-sb:hover {
    box-shadow: 0 6px 16px -2px rgba(15, 23, 42, 0.08);
}

.card-stat {
    border-radius: 14px;
    border: 1px solid var(--sb-border);
    background: #ffffff;
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
}

.card-stat::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--sb-primary);
}

.card-stat.accent-pink::after { background: #ec4899; }
.card-stat.accent-emerald::after { background: #10b981; }
.card-stat.accent-blue::after { background: #3b82f6; }
.card-stat.accent-purple::after { background: #8b5cf6; }

/* Buttons */
.btn-primary-sb {
    background-color: var(--sb-primary);
    border-color: var(--sb-primary);
    color: #ffffff;
    font-weight: 600;
    border-radius: 8px;
    padding: 0.5rem 1.1rem;
    transition: all 0.15s ease-in-out;
}

.btn-primary-sb:hover {
    background-color: var(--sb-primary-hover);
    border-color: var(--sb-primary-hover);
    color: #ffffff;
    transform: translateY(-1px);
}

.btn-outline-sb {
    border: 1.5px solid var(--sb-primary);
    color: var(--sb-primary);
    font-weight: 600;
    border-radius: 8px;
    background: transparent;
    transition: all 0.15s ease;
}

.btn-outline-sb:hover {
    background: var(--sb-primary);
    color: #ffffff;
}

/* Sidebar */
.sb-sidebar {
    width: var(--sb-sidebar-width);
    background: #ffffff;
    border-right: 1px solid var(--sb-border);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), width 0.25s ease, box-shadow 0.25s ease;
    scrollbar-width: thin;
}

.sb-main-content {
    margin-left: var(--sb-sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.25s ease;
    width: auto;
    overflow-x: hidden;
}

/* Sidebar Backdrop for Mobile/Tablet */
.sb-sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sb-sidebar-backdrop.show {
    opacity: 1;
    visibility: visible;
}

/* Mobile & Tablet Sidebar (Offcanvas style) */
@media (max-width: 991.98px) {
    .sb-sidebar {
        transform: translateX(-100%);
        box-shadow: none;
        width: 290px;
        max-width: 85vw;
    }
    .sb-sidebar.show {
        transform: translateX(0);
        box-shadow: 12px 0 35px -5px rgba(0, 0, 0, 0.3);
    }
    .sb-main-content {
        margin-left: 0 !important;
    }
    .sb-topbar {
        padding: 0 0.85rem !important;
        height: 60px;
    }
}

/* Desktop Collapsed Sidebar State */
@media (min-width: 992px) {
    body.sb-sidebar-collapsed .sb-sidebar {
        width: 72px;
    }
    body.sb-sidebar-collapsed .sb-sidebar .brand-text-block,
    body.sb-sidebar-collapsed .sb-sidebar .nav-section-title,
    body.sb-sidebar-collapsed .sb-sidebar .nav-link-title,
    body.sb-sidebar-collapsed .sb-sidebar .nav-badge,
    body.sb-sidebar-collapsed .sb-sidebar .user-details-block {
        display: none !important;
    }
    body.sb-sidebar-collapsed .sb-sidebar .nav-link-sb {
        justify-content: center;
        padding: 0.65rem 0;
        margin: 0.2rem 0.4rem;
        position: relative;
    }
    body.sb-sidebar-collapsed .sb-sidebar .nav-link-sb i {
        margin: 0;
        font-size: 1.25rem;
    }
    body.sb-sidebar-collapsed .sb-sidebar .brand-wrapper {
        justify-content: center !important;
    }
    body.sb-sidebar-collapsed .sb-sidebar .sidebar-footer {
        justify-content: center !important;
        padding: 0.75rem 0.25rem !important;
    }
    body.sb-sidebar-collapsed .sb-sidebar .sidebar-footer .btn-logout-text {
        display: none !important;
    }
    body.sb-sidebar-collapsed .sb-main-content {
        margin-left: 72px;
    }
}

.nav-link-sb {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    color: var(--sb-text-muted);
    font-weight: 500;
    border-radius: 8px;
    margin: 0.15rem 0.75rem;
    text-decoration: none;
    transition: all 0.15s ease;
}

.nav-link-sb:hover {
    color: var(--sb-primary);
    background-color: var(--sb-primary-light);
}

.nav-link-sb.active {
    color: var(--sb-primary);
    background-color: var(--sb-primary-light);
    font-weight: 600;
}

.nav-link-sb i {
    width: 20px;
    font-size: 1.05rem;
    text-align: center;
}

/* Navbar */
.sb-topbar {
    background: #ffffff;
    border-bottom: 1px solid var(--sb-border);
    height: 65px;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 900;
}

/* POS Specific Styles */
.pos-container {
    height: calc(100vh - 65px);
    display: flex;
    overflow: hidden;
}

.pos-catalog {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.pos-cart {
    width: 420px;
    background: #ffffff;
    border-left: 1px solid var(--sb-border);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card-pos {
    background: #ffffff;
    border: 1.5px solid var(--sb-border);
    border-radius: 12px;
    padding: 0.85rem;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.product-card-pos:hover {
    border-color: var(--sb-primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px -2px rgba(217, 119, 6, 0.15);
}

.product-card-pos:active {
    transform: scale(0.97);
}

.badge-veg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border: 1.5px solid #16a34a;
    border-radius: 2px;
}
.badge-veg::after {
    content: '';
    width: 6px;
    height: 6px;
    background: #16a34a;
    border-radius: 50%;
}

.badge-nonveg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border: 1.5px solid #dc2626;
    border-radius: 2px;
}
.badge-nonveg::after {
    content: '';
    width: 6px;
    height: 6px;
    background: #dc2626;
    border-radius: 50%;
}

/* Print Thermal Receipt (80mm width) */
@media print {
    body * {
        visibility: hidden;
    }
    #thermalReceipt, #thermalReceipt * {
        visibility: visible;
    }
    #thermalReceipt {
        position: absolute;
        left: 0;
        top: 0;
        width: 80mm;
        margin: 0;
        padding: 4mm;
        font-family: 'Courier New', Courier, monospace;
        font-size: 12px;
        color: #000000;
    }
    .no-print {
        display: none !important;
    }
}

/* POS Mobile & Tablet Responsiveness */
@media (max-width: 991.98px) {
    .pos-main {
        position: relative;
        flex-direction: column !important;
        height: calc(100vh - 56px);
    }
    .pos-catalog {
        padding-bottom: 70px !important;
    }
    .pos-cart {
        position: fixed;
        right: 0;
        top: 0;
        bottom: 0;
        width: 100%;
        max-width: 400px;
        z-index: 1060;
        transform: translateX(100%);
        transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
        box-shadow: -8px 0 30px rgba(0, 0, 0, 0.3);
    }
    .pos-cart.show {
        transform: translateX(0);
    }
    .pos-cart-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.5);
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
        z-index: 1055;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s ease, visibility 0.25s ease;
    }
    .pos-cart-backdrop.show {
        opacity: 1;
        visibility: visible;
    }
    .pos-mobile-cart-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #1e293b;
        color: #ffffff;
        padding: 0.75rem 1rem;
        z-index: 1050;
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.2);
    }
}

/* App Opening & Auth Page Styles */
.bakery-auth-wrapper {
    min-height: 100vh;
    background: radial-gradient(circle at 10% 20%, rgba(254, 243, 199, 0.8) 0%, rgba(248, 250, 252, 0.95) 50%, rgba(254, 215, 170, 0.6) 100%), #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
}

.bakery-auth-card {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(120, 53, 15, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    width: 100%;
    max-width: 1060px;
}

.bakery-hero-side {
    position: relative;
    background: linear-gradient(160deg, #451a03 0%, #78350f 50%, #9a3412 100%);
    color: #ffffff;
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.bakery-hero-side::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('../images/bakery-hero.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0.18;
    mix-blend-mode: luminosity;
    pointer-events: none;
}

.bakery-hero-glow {
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.35) 0%, rgba(245, 158, 11, 0) 70%);
    top: -50px;
    right: -50px;
    pointer-events: none;
}

.bakery-form-side {
    padding: 2.75rem 2.5rem;
    background: #ffffff;
}

@media (max-width: 576px) {
    .bakery-form-side {
        padding: 1.75rem 1.25rem !important;
    }
}

.demo-chip-card {
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.65rem 0.85rem;
    background: #ffffff;
    user-select: none;
}

.demo-chip-card:hover {
    border-color: var(--sb-primary);
    background: #fffbeb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.12);
}

.demo-chip-card:active {
    transform: scale(0.98);
}

/* PWA Splash Screen */
.pwa-splash-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(145deg, #78350f, #451a03);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.pwa-splash-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.pwa-splash-logo {
    width: 96px;
    height: 96px;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 40px rgba(245, 158, 11, 0.4);
    animation: pwaSplashPulse 2s infinite ease-in-out;
}

@keyframes pwaSplashPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

