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

:root,
:root.dark,
html.dark,
body.dark {
    --bg-dark: #0b0b0f;
    --card-bg: rgba(20, 20, 27, 0.7);
    --card-border: rgba(255, 255, 255, 0.06);
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --bg-image: radial-gradient(at 10% 20%, rgba(139, 92, 246, 0.08) 0px, transparent 50%), radial-gradient(at 90% 80%, rgba(16, 185, 129, 0.05) 0px, transparent 50%);
    
    --primary: #8b5cf6;
    --primary-glow: rgba(139, 92, 246, 0.35);
    --primary-hover: #a78bfa;
    
    --accent-emerald: #10b981;
    --accent-emerald-glow: rgba(16, 185, 129, 0.2);
    --accent-coral: #ef4444;
    --accent-coral-glow: rgba(239, 68, 68, 0.2);
    --accent-amber: #f59e0b;
    --accent-amber-glow: rgba(245, 158, 11, 0.2);
    
    --sidebar-bg: rgba(15, 15, 22, 0.95);
    --select-bg: #14141d;
    --menu-hover-color: #fff;
    --menu-hover-bg: rgba(139, 92, 246, 0.15);
    --input-bg: rgba(255, 255, 255, 0.03);
    --input-border: rgba(255, 255, 255, 0.1);
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

:root.light-theme,
html.light-theme,
body.light-theme,
html.light,
body.light {
    --bg-dark: #f8fafc;
    --card-bg: #ffffff;
    --card-border: #cbd5e1;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --bg-image: none;
    
    --primary: #6d28d9;
    --primary-glow: rgba(109, 40, 217, 0.15);
    --primary-hover: #7c3aed;
    
    --sidebar-bg: #ffffff;
    --select-bg: #ffffff;
    --menu-hover-color: #0f172a;
    --menu-hover-bg: rgba(109, 40, 217, 0.08);
    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    
    --accent-emerald-glow: rgba(16, 185, 129, 0.1);
    --accent-coral-glow: rgba(239, 68, 68, 0.1);
    --accent-amber-glow: rgba(245, 158, 11, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    background-image: var(--bg-image);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Glassmorphism containers */
.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: var(--transition-smooth);
}

.glass-panel:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

/* Auth Layout */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 480px;
    padding: 2.5rem;
}

/* Login Page – auth-page-wrapper + clean-auth-card */
.auth-page-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
    background-color: var(--bg-dark);
    background-image: var(--bg-image);
    background-attachment: fixed;
}

.clean-auth-card {
    width: 100%;
    max-width: 460px;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 40px 0 rgba(0, 0, 0, 0.4);
    padding: 2.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: var(--transition-smooth);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-display {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    color: #fff;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 1rem;
    box-shadow: 0 0 20px var(--primary-glow);
}

.logo-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-md);
}

.auth-title {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #fff, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-smooth);
}

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

select, select option {
    background-color: var(--select-bg) !important;
    color: var(--text-main) !important;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px var(--primary-glow);
    transition: var(--transition-smooth);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
    filter: brightness(1.1);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Alerts */
.alert {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    border-left: 4px solid transparent;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--accent-coral);
    color: #fca5a5;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--accent-emerald);
    color: #a7f3d0;
}

/* General Layout Dashboard */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--card-border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #fff;
    box-shadow: 0 0 10px var(--primary-glow);
}

.sidebar-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.menu-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.menu-link:hover {
    color: var(--menu-hover-color);
    background: var(--menu-hover-bg);
}

.menu-link.active {
    color: #fff !important;
    background: var(--primary);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.menu-bullet {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.6;
    display: inline-block;
}

.sidebar-footer {
    border-top: 1px solid var(--card-border);
    padding-top: 1rem;
    margin-top: auto;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.main-content {
    margin-left: 260px;
    flex-grow: 1;
    padding: 2rem;
    width: calc(100% - 260px);
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.page-actions {
    display: flex;
    gap: 0.75rem;
}

/* POS Interface Layout */
.pos-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 1.5rem;
    height: calc(100vh - 8rem);
}

.pos-catalog {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    height: 100%;
    overflow: hidden;
}

.pos-search-bar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 300px));
    gap: 1rem;
    overflow-y: auto;
    padding-right: 0.5rem;
    flex-grow: 1;
    justify-content: start;
}

/* Product Card */
.product-card {
    width: 100%;
    max-width: 300px;
    height: 300px;
    padding: 1rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(139, 92, 246, 0.15);
}

.product-image-container {
    height: 170px;
    width: 100%;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 0.5rem;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-placeholder-icon {
    font-size: 1.5rem;
    color: var(--text-muted);
}

.product-badge-low {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
}

.product-info-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.product-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-sku {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.35rem;
}

.product-price {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--primary-hover);
}

.product-stock {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.product-stock.low-stock {
    color: #fca5a5;
    font-weight: 600;
}

/* Cart Panel */
.pos-cart-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    padding: 1.5rem;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.cart-title {
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-items-count {
    background: var(--primary);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
}

.cart-items-list {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-right: 0.25rem;
    margin-bottom: 1rem;
}

/* Cart Item */
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    gap: 0.5rem;
}

.cart-item-details {
    flex-grow: 1;
    min-width: 0;
}

.cart-item-name {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-price {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.cart-item-qty-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qty-btn {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.qty-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.qty-val {
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.cart-item-remove {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 1.1rem;
    margin-left: 0.5rem;
    opacity: 0.7;
    transition: var(--transition-smooth);
}

.cart-item-remove:hover {
    opacity: 1;
}

/* Cart Summary & Payments */
.cart-summary {
    border-top: 1px solid var(--card-border);
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.summary-row.total {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    border-top: 1px dashed var(--card-border);
    padding-top: 0.75rem;
    margin-top: 0.25rem;
}

/* Currency Picker inside POS */
.currency-selector-box {
    margin-bottom: 0.75rem;
}

/* Tables styling */
.custom-table-container {
    overflow-x: auto;
    margin-top: 1rem;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

.custom-table th {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 2px solid var(--card-border);
    padding: 1rem;
    font-weight: 600;
    color: var(--text-muted);
}

.custom-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--card-border);
    color: var(--text-main);
}

.custom-table tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

/* General card panels */
.panel-body {
    padding: 1.5rem;
}

/* Badges */
.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.badge-pending { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.badge-received { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.badge-cancelled { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

/* Grid forms */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

@media (max-width: 768px) {
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
    .pos-container {
        grid-template-columns: 1fr;
    }
}

/* TailAdmin Light Theme Overrides for All Components */
html.light-theme,
body.light-theme,
html.light,
body.light,
:root.light-theme,
:root.light {
    --bg-dark: #f8fafc !important;
    --card-bg: #ffffff !important;
    --card-border: #cbd5e1 !important;
    --text-main: #0f172a !important;
    --text-muted: #475569 !important;
    --bg-image: none !important;
    
    --primary: #6d28d9 !important;
    --primary-glow: rgba(109, 40, 217, 0.15) !important;
    --primary-hover: #7c3aed !important;
    
    --sidebar-bg: #ffffff !important;
    --select-bg: #ffffff !important;
    --menu-hover-color: #0f172a !important;
    --menu-hover-bg: rgba(109, 40, 217, 0.08) !important;
    --input-bg: #ffffff !important;
    --input-border: #94a3b8 !important;
    background-color: #f8fafc !important;
    color: #0f172a !important;
}

html.light-theme body,
html.light body {
    background-color: #f8fafc !important;
    color: #0f172a !important;
}

html.light-theme .sidebar,
html.light .sidebar {
    background-color: #ffffff !important;
    border-right: 1px solid #cbd5e1 !important;
}

html.light-theme .sidebar-title,
html.light .sidebar-title,
html.light-theme .page-title,
html.light .page-title,
html.light-theme h1, html.light-theme h2, html.light-theme h3, html.light-theme h4, html.light-theme h5, html.light-theme h6,
html.light h1, html.light h2, html.light h3, html.light h4, html.light h5, html.light h6 {
    color: #0f172a !important;
}

html.light-theme .menu-link,
html.light .menu-link {
    color: #475569 !important;
}

html.light-theme .menu-link:hover,
html.light .menu-link:hover {
    color: #0f172a !important;
    background: rgba(109, 40, 217, 0.08) !important;
}

html.light-theme .menu-link.active,
html.light .menu-link.active {
    color: #ffffff !important;
    background: #6d28d9 !important;
}

html.light-theme .glass-panel,
html.light .glass-panel {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
    color: #0f172a !important;
}

html.light-theme .product-card,
html.light .product-card {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
}

html.light-theme .product-title,
html.light .product-title {
    color: #0f172a !important;
}

html.light-theme .cart-item,
html.light .cart-item {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

html.light-theme .cart-item-name,
html.light .cart-item-name {
    color: #0f172a !important;
}

html.light-theme .summary-row.total,
html.light .summary-row.total {
    color: #0f172a !important;
    border-top-color: #cbd5e1 !important;
}

html.light-theme .custom-table th,
html.light .custom-table th {
    background: #f1f5f9 !important;
    color: #334155 !important;
    border-bottom: 2px solid #cbd5e1 !important;
}

html.light-theme .custom-table td,
html.light .custom-table td {
    color: #0f172a !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

html.light-theme .custom-table tr:hover td,
html.light .custom-table tr:hover td {
    background: #f8fafc !important;
}

html.light-theme .form-input,
html.light-theme select,
html.light-theme input,
html.light-theme textarea,
html.light .form-input,
html.light select,
html.light input,
html.light textarea {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
}

html.light-theme select option,
html.light select option {
    background-color: #ffffff !important;
    color: #0f172a !important;
}

html.light-theme .modal-content,
html.light-theme #pay-vendor-modal > div,
html.light-theme #receipt-modal > div,
html.light .modal-content,
html.light #pay-vendor-modal > div,
html.light #receipt-modal > div {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

/* ==========================================================================
   Luxury Authentication Layout & Showcase Styles
   ========================================================================== */
.auth-page-wrapper {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 0%, rgba(139, 92, 246, 0.08) 0%, transparent 60%), var(--bg-main);
    padding: 2rem 1rem;
    position: relative;
}

.clean-auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(16px);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (max-width: 900px) {
    .auth-split-card {
        grid-template-columns: 1fr;
        max-width: 480px;
    }
    .auth-hero-panel {
        display: none !important;
    }
}

.auth-hero-panel {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.08) 100%),
                rgba(15, 23, 42, 0.4);
    border-right: 1px solid var(--card-border);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.auth-hero-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
    animation: rotateGlow 20s linear infinite;
    pointer-events: none;
}

@keyframes rotateGlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.auth-form-panel {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    left: 1rem;
    font-size: 1.1rem;
    color: var(--text-muted);
    pointer-events: none;
}

.auth-input-field {
    padding-left: 2.8rem !important;
    height: 48px;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-smooth);
}

.auth-input-field:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 15px var(--primary-glow) !important;
}

.password-toggle-btn {
    position: absolute;
    right: 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: var(--transition-smooth);
}

.password-toggle-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

/* Topbar & Multi-Branch Navigation Header */
.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-md);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    position: sticky;
    top: 1rem;
    z-index: 90;
}

.topbar-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.branch-selector-container {
    display: flex;
    align-items: center;
}

.branch-select {
    transition: var(--transition-smooth);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.85rem;
}

.branch-select:hover, .branch-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.mobile-toggle-btn {
    display: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    padding: 0.45rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.mobile-toggle-btn:hover {
    background: rgba(139, 92, 246, 0.15);
    color: var(--primary);
    border-color: var(--primary);
}

.mobile-close-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    margin-left: auto;
    line-height: 1;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
    display: block;
    opacity: 1;
}

/* Responsive Table Container */
.custom-table-container, .table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Media Queries for Mobile UI Responsiveness */
@media (max-width: 1024px) {
    .mobile-toggle-btn {
        display: flex;
    }

    .mobile-close-btn {
        display: block;
    }

    .app-container {
        display: block;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }

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

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1rem;
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .app-topbar {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .topbar-title {
        font-size: 0.95rem;
    }

    .branch-label-text {
        display: none;
    }

    .branch-select {
        font-size: 0.8rem !important;
        padding: 0.35rem 0.6rem !important;
        max-width: 180px;
    }

    .grid-3, .grid-2, .grid-4 {
        grid-template-columns: 1fr !important;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    /* POS Mobile View */
    .pos-layout {
        flex-direction: column !important;
        height: auto !important;
    }

    .pos-products-section, .pos-cart-section {
        width: 100% !important;
        max-height: none !important;
    }

    .pos-product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Modals on mobile */
    .glass-panel[style*="max-width"] {
        width: 95% !important;
        padding: 1.25rem !important;
    }
}

@media (max-width: 480px) {
    .pos-product-grid {
        grid-template-columns: 1fr !important;
    }

    .branch-select {
        max-width: 140px;
    }

    .auth-card {
        padding: 1.5rem !important;
    }
}

