/* ==========================================================================
   Shejda Pharmacy - Premium Ultra-Modern Admin & POS Design System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;600;700&display=swap');

:root {
    --primary: #059669;
    --primary-hover: #047857;
    --primary-light: #ecfdf5;
    --primary-glow: rgba(16, 185, 129, 0.28);
    
    --accent-teal: #0d9488;
    --accent-cyan: #06b6d4;
    --accent-blue: #2563eb;
    --accent-purple: #7c3aed;
    --accent-amber: #d97706;
    --accent-rose: #e11d48;
    
    --bg-app: #f4f6f9;
    --bg-sidebar: #ffffff;
    --bg-navbar: rgba(255, 255, 255, 0.94);
    --card-bg: #ffffff;
    --card-border: rgba(226, 232, 240, 0.9);
    
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    
    --sidebar-width: 275px;
    --navbar-height: 72px;
    --radius-xl: 22px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    
    --shadow-xs: 0 1px 3px rgba(15, 23, 42, 0.05);
    --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 10px 30px -4px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 20px 40px -10px rgba(15, 23, 42, 0.12), 0 4px 12px -2px rgba(15, 23, 42, 0.05);
    --shadow-glow: 0 10px 25px -4px rgba(5, 150, 105, 0.38);
    --shadow-pos-card: 0 4px 16px -2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.04);
    
    --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-bs-theme="dark"] {
    --bg-app: #090e17;
    --bg-sidebar: #0f172a;
    --bg-navbar: rgba(15, 23, 42, 0.94);
    --card-bg: #111827;
    --card-border: rgba(255, 255, 255, 0.08);
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 10px 30px -4px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.7);
    --shadow-glow: 0 10px 25px -4px rgba(16, 185, 129, 0.45);
    --shadow-pos-card: 0 4px 16px -2px rgba(0, 0, 0, 0.5);
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-app);
    color: var(--text-primary);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.font-mono { font-family: 'JetBrains Mono', monospace; }

/* Refined Glass Card */
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.glass-card:hover {
    box-shadow: var(--shadow-md);
}

.app-wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--card-border);
    position: fixed;
    top: 0; bottom: 0; left: 0;
    z-index: 1050;
    display: flex; flex-direction: column;
    transition: var(--transition);
}

.sidebar-header {
    height: var(--navbar-height);
    padding: 0 1.5rem;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--card-border);
}

.brand-logo {
    display: flex; align-items: center; gap: 0.85rem;
    text-decoration: none; color: var(--text-primary);
}

.logo-icon-box {
    width: 44px; height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, #059669, #0d9488);
    color: #ffffff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.35rem; box-shadow: var(--shadow-glow);
}

.sidebar-body {
    padding: 1.25rem 0.85rem;
    overflow-y: auto;
    flex-grow: 1;
}

.nav-label {
    font-size: 0.68rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--text-muted); padding: 0.85rem 1rem 0.4rem;
}

.sidebar .nav-link {
    color: var(--text-secondary);
    font-weight: 600; font-size: 0.9rem;
    padding: 0.85rem 1.15rem;
    border-radius: var(--radius-md);
    display: flex; align-items: center; gap: 0.85rem;
    margin-bottom: 0.35rem; transition: var(--transition);
}

.sidebar .nav-link i { font-size: 1.15rem; width: 22px; text-align: center; }

.sidebar .nav-link:hover {
    color: var(--primary); background: var(--primary-light);
    transform: translateX(4px);
}

[data-bs-theme="dark"] .sidebar .nav-link:hover { background: rgba(5, 150, 105, 0.15); }

.sidebar .nav-link.active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), #047857);
    box-shadow: var(--shadow-glow);
}

.user-profile-box {
    background: rgba(5, 150, 105, 0.06);
    border: 1px solid rgba(5, 150, 105, 0.15);
    border-radius: var(--radius-md);
    padding: 0.85rem; margin: 0.5rem 1rem;
    display: flex; align-items: center; gap: 0.75rem;
}

.main-content {
    margin-left: var(--sidebar-width);
    flex-grow: 1; min-width: 0;
    transition: var(--transition);
}

.top-navbar {
    height: var(--navbar-height);
    background: var(--bg-navbar);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--card-border);
    z-index: 1020; padding: 0 1.75rem;
}

.global-search { position: relative; width: 380px; }

.global-search input {
    background: var(--bg-app); border: 1px solid var(--card-border);
    border-radius: 99px; padding-left: 2.75rem; padding-right: 4.5rem;
    height: 44px; font-size: 0.88rem; transition: var(--transition);
}

.global-search input:focus {
    background: var(--card-bg); border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.global-search .search-icon {
    position: absolute; left: 1.1rem; top: 50%;
    transform: translateY(-50%); color: var(--text-muted);
}

.global-search .kbd-badge {
    position: absolute; right: 0.85rem; top: 50%;
    transform: translateY(-50%); font-size: 0.7rem;
    background: var(--card-bg); border: 1px solid var(--card-border);
    padding: 0.2rem 0.5rem; border-radius: 6px; color: var(--text-muted);
}

.btn-primary-emerald {
    background: linear-gradient(135deg, #059669, #047857);
    color: #ffffff; border: none; border-radius: 99px;
    padding: 0.6rem 1.45rem; font-weight: 700; font-size: 0.9rem;
    box-shadow: var(--shadow-glow); transition: var(--transition);
    display: inline-flex; align-items: center; justify-content: center;
}

.btn-primary-emerald:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px -4px rgba(5, 150, 105, 0.45); color: #ffffff;
}

.btn-outline-teal {
    color: var(--primary);
    border: 1px solid var(--primary);
    transition: var(--transition);
}
.btn-outline-teal:hover {
    background: var(--primary);
    color: #ffffff;
    box-shadow: var(--shadow-glow);
}

.icon-btn-rounded {
    width: 44px; height: 44px; border-radius: 50%;
    border: 1px solid var(--card-border); background: var(--card-bg);
    color: var(--text-secondary); display: inline-flex;
    align-items: center; justify-content: center; transition: var(--transition);
}
.icon-btn-rounded:hover { color: var(--primary); border-color: var(--primary); transform: scale(1.06); }

.hero-gradient-card {
    background: linear-gradient(135deg, #047857 0%, #059669 50%, #0d9488 100%);
    border-radius: var(--radius-xl); padding: 2.25rem;
    color: #ffffff; position: relative; overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.hero-glow-circle {
    position: absolute; width: 340px; height: 340px;
    background: radial-gradient(circle, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0) 70%);
    right: -80px; top: -80px; pointer-events: none;
}

/* KPI Cards */
.kpi-card {
    background: var(--card-bg); border: 1px solid var(--card-border);
    border-radius: var(--radius-lg); padding: 1.5rem;
    box-shadow: var(--shadow-sm); transition: var(--transition);
    position: relative; overflow: hidden;
}
.kpi-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.kpi-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
}
.kpi-card.emerald::before { background: linear-gradient(90deg, #059669, #10b981); }
.kpi-card.blue::before { background: linear-gradient(90deg, #3b82f6, #06b6d4); }
.kpi-card.purple::before { background: linear-gradient(90deg, #8b5cf6, #ec4899); }
.kpi-card.rose::before { background: linear-gradient(90deg, #f43f5e, #fb923c); }

.kpi-icon-box {
    width: 52px; height: 52px; border-radius: 16px;
    display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
}
.kpi-icon-box.emerald { background: rgba(5, 150, 105, 0.12); color: #059669; }
.kpi-icon-box.blue { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }
.kpi-icon-box.purple { background: rgba(139, 92, 246, 0.12); color: #8b5cf6; }
.kpi-icon-box.rose { background: rgba(244, 63, 94, 0.12); color: #f43f5e; }

/* Badges */
.badge-pill-soft { padding: 0.35rem 0.75rem; border-radius: 99px; font-size: 0.75rem; font-weight: 700; }
.badge-emerald { background: rgba(5, 150, 105, 0.12); color: #059669; }
.badge-blue { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }
.badge-amber { background: rgba(245, 158, 11, 0.15); color: #d97706; }
.badge-rose { background: rgba(244, 63, 94, 0.12); color: #f43f5e; }
.badge-purple { background: rgba(139, 92, 246, 0.12); color: #8b5cf6; }

/* Dosage Form Badges */
.badge-dosage {
    padding: 0.3rem 0.65rem;
    border-radius: 8px;
    font-size: 0.74rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    letter-spacing: 0.02em;
}
.badge-tablet { background: rgba(13, 148, 136, 0.14); color: #0f766e; border: 1px solid rgba(13, 148, 136, 0.25); }
.badge-capsule { background: rgba(217, 119, 6, 0.14); color: #b45309; border: 1px solid rgba(217, 119, 6, 0.25); }
.badge-syrup { background: rgba(59, 130, 246, 0.14); color: #1d4ed8; border: 1px solid rgba(59, 130, 246, 0.25); }
.badge-suspension { background: rgba(236, 72, 153, 0.14); color: #be185d; border: 1px solid rgba(236, 72, 153, 0.25); }
.badge-injection { background: rgba(239, 68, 68, 0.14); color: #b91c1c; border: 1px solid rgba(239, 68, 68, 0.25); }
.badge-drop { background: rgba(6, 182, 212, 0.14); color: #0e7490; border: 1px solid rgba(6, 182, 212, 0.25); }
.badge-ointment { background: rgba(168, 85, 247, 0.14); color: #9333ea; border: 1px solid rgba(168, 85, 247, 0.25); }
.badge-inhaler { background: rgba(16, 185, 129, 0.14); color: #047857; border: 1px solid rgba(16, 185, 129, 0.25); }
.badge-suppository { background: rgba(249, 115, 22, 0.14); color: #c2410c; border: 1px solid rgba(249, 115, 22, 0.25); }

/* Modern Table */
.table-modern { border-color: var(--card-border); margin-bottom: 0; }
.table-modern th {
    background: rgba(0, 0, 0, 0.025); color: var(--text-muted);
    font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em;
    font-weight: 800; padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--card-border);
}
[data-bs-theme="dark"] .table-modern th { background: rgba(255, 255, 255, 0.025); }
.table-modern td { padding: 1rem 1.25rem; vertical-align: middle; border-bottom: 1px solid var(--card-border); }

/* ==========================================================================
   ADVANCED HIGH-CONVERTING POS & SALES INTERFACE ENHANCEMENTS
   ========================================================================== */

/* POS Search Bar - High Contrast Touch-Friendly */
.pos-search-box {
    position: relative;
}
.pos-search-box .form-control {
    height: 52px;
    font-size: 1rem;
    padding-left: 3.2rem;
    padding-right: 3rem;
    border-radius: 99px;
    border: 2px solid #e2e8f0;
    background: #ffffff;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
    transition: var(--transition);
}
[data-bs-theme="dark"] .pos-search-box .form-control {
    background: #111827;
    border-color: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}
.pos-search-box .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 5px var(--primary-glow);
}
.pos-search-box .search-prefix-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    color: var(--primary);
    pointer-events: none;
    z-index: 5;
}

/* Category Filter Pills */
.pos-cat-pill {
    padding: 0.55rem 1.25rem;
    font-weight: 700;
    font-size: 0.85rem;
    border-radius: 99px;
    white-space: nowrap;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: var(--text-secondary);
    transition: var(--transition);
}
[data-bs-theme="dark"] .pos-cat-pill {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
}
.pos-cat-pill:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-1px);
}
.pos-cat-pill.active {
    background: linear-gradient(135deg, var(--primary), #047857) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
    box-shadow: var(--shadow-glow);
}

/* Medicine Card - Large Touch Friendly Card */
.pos-medicine-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    cursor: pointer;
    box-shadow: var(--shadow-pos-card);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    user-select: none;
}
.pos-medicine-card::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0; height: 3px;
    background: transparent;
    transition: var(--transition);
}
.pos-medicine-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 14px 28px -4px rgba(5, 150, 105, 0.18), 0 4px 10px rgba(0, 0, 0, 0.04);
}
.pos-medicine-card:hover::after {
    background: linear-gradient(90deg, #059669, #0d9488);
}
.pos-medicine-card:active {
    transform: scale(0.98);
}

.pos-med-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.3;
}

.pos-med-price {
    font-size: 1.35rem;
    font-weight: 800;
    color: #047857;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: -0.02em;
}
[data-bs-theme="dark"] .pos-med-price {
    color: #10b981;
}

/* Touch Friendly Add Button */
.btn-pos-add {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #059669, #047857);
    color: #ffffff;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
    transition: var(--transition);
}
.btn-pos-add:hover {
    transform: scale(1.12);
    box-shadow: 0 6px 18px rgba(5, 150, 105, 0.45);
    color: #ffffff;
}
.btn-pos-add:active {
    transform: scale(0.95);
}

/* Cart Panel Styling */
.pos-cart-panel {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 86px;
    overflow: hidden;
}

.cart-header-gradient {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.08), rgba(13, 148, 136, 0.04));
    border-bottom: 1px solid var(--card-border);
    padding: 1.25rem 1.5rem;
}

.cart-item-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    margin-bottom: 0.65rem;
    transition: var(--transition);
}
[data-bs-theme="dark"] .cart-item-card {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.08);
}
.cart-item-card:hover {
    border-color: rgba(5, 150, 105, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.cart-qty-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}
[data-bs-theme="dark"] .cart-qty-btn {
    background: #0f172a;
    border-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}
.cart-qty-btn:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

/* Total & Net Bill Box */
.net-total-box {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.08), rgba(13, 148, 136, 0.08));
    border: 2px dashed rgba(5, 150, 105, 0.35);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
}

/* Payment Method Select Buttons */
.pay-method-btn {
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-weight: 700;
    color: var(--text-secondary);
    background: #ffffff;
    transition: var(--transition);
    cursor: pointer;
    display: block;
    width: 100%;
}
[data-bs-theme="dark"] .pay-method-btn {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
}
.btn-check:checked + .pay-method-btn {
    border-color: var(--primary);
    background: rgba(5, 150, 105, 0.08);
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.15);
}

/* Checkout Big Button */
.btn-pos-checkout {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    padding: 1.1rem;
    border-radius: 99px;
    border: none;
    box-shadow: 0 10px 25px -4px rgba(5, 150, 105, 0.45);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    width: 100%;
}
.btn-pos-checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px -4px rgba(5, 150, 105, 0.55);
    color: #ffffff;
}
.btn-pos-checkout:active {
    transform: scale(0.98);
}

/* Mobile Responsiveness */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1045;
}
.sidebar-backdrop.show { display: block; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); box-shadow: none; }
    .sidebar.show { transform: translateX(0); box-shadow: 0 0 50px rgba(0, 0, 0, 0.4); }
    .main-content { margin-left: 0; }
    .top-navbar { padding: 0 1rem; }
    .global-search { display: none !important; }
    .pos-cart-panel { position: static; margin-top: 1.5rem; }
    .hero-gradient-card { padding: 1.5rem; }
    .kpi-card { padding: 1.15rem; }
}

@media (max-width: 575.98px) {
    .hero-gradient-card h2 { font-size: 1.35rem; }
    .btn-primary-emerald { padding: 0.48rem 0.95rem; font-size: 0.82rem; }
    .table-modern th, .table-modern td { padding: 0.75rem 0.5rem; font-size: 0.8rem; }
    .pos-search-box .form-control { height: 46px; font-size: 0.92rem; }
}

/* ==========================================================================
   STRICT ISOLATED PRINT STYLESHEET (CLEAN THERMAL & INVOICE RECEIPT)
   ========================================================================== */
@media print {
    html, body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 12pt;
        margin: 0 !important;
        padding: 0 !important;
    }

    body * {
        visibility: hidden !important;
    }

    .modal.show, 
    .modal.show .modal-dialog,
    .modal.show .modal-content,
    .modal.show .modal-body,
    .modal.show .modal-body * {
        visibility: visible !important;
    }

    .modal.show {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
    }

    .modal.show .modal-dialog {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        transform: none !important;
    }

    .modal.show .modal-content {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        background: #ffffff !important;
    }

    .modal.show .modal-header,
    .modal.show .modal-footer,
    .modal.show .btn-close,
    .d-print-none {
        display: none !important;
    }

    .receipt-print-wrapper {
        width: 100% !important;
        max-width: 320px !important;
        margin: 0 auto !important;
        padding: 10px !important;
        font-family: 'JetBrains Mono', 'Courier New', monospace !important;
        font-size: 11px !important;
        color: #000 !important;
    }
}
