:root {
    /* Brand Colors - Constant across themes */
    --brand-primary: #FF6B00;
    --brand-primary-light: #FF8E3C;
    --brand-primary-dark: #E65100;
    --brand-secondary: #0F172A;

    /* Light Theme Variables (Default) */
    --bg-main: #F8FAFC;
    --bg-surface: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-topbar: rgba(255, 255, 255, 0.8);

    --text-main: #0F172A;
    --text-muted: #64748B;
    --text-light: #94A3B8;
    --text-white: #ffffff;

    --border-color: #E2E8F0;
    --border-light: #F1F5F9;

    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --info: #3B82F6;

    --bg-success-subtle: rgba(16, 185, 129, 0.1);
    --bg-danger-subtle: rgba(239, 68, 68, 0.1);
    --bg-warning-subtle: rgba(245, 158, 11, 0.1);

    --bg-primary-subtle: rgba(255, 107, 0, 0.1);

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-orange: 0 10px 20px -5px rgba(255, 107, 0, 0.4);

    --sidebar-width: 280px;
    --topbar-height: 70px;
    --radius-sm: 0.5rem;
    --radius: 0.75rem;
    --radius-md: 1rem;
    --radius-lg: 1.25rem;
    --radius-xl: 1.5rem;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-main: #0B0F1A;
    --bg-surface: #161B29;
    --bg-sidebar: #161B29;
    --bg-topbar: rgba(22, 27, 41, 0.8);

    --text-main: #F1F5F9;
    --text-muted: #CBD5E1;
    --text-light: #64748B;

    --border-color: #2D3748;
    --border-light: #1E293B;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

/* Global Reset & Typography */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6,
.sidebar-brand-text,
.page-title,
.stat-value,
.grand-total {
    font-family: 'Outfit', sans-serif;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #CBD5E0;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

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

/* ─── Sidebar ─── */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2005;
    transition: var(--transition);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.sidebar-brand {
    padding: 2.5rem 1.5rem;
    display: flex;
    align-items: center;
}

.sidebar-brand-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.25rem;
    background: var(--brand-primary);
    border-radius: 12px;
    color: white;
    text-decoration: none;
    box-shadow: 0 8px 16px rgba(255, 107, 0, 0.25);
    width: 100%;
}

.sidebar-brand-icon {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
}

.sidebar-brand-text {
    font-size: 1.25rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.5px;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 0 1rem;
}

.menu-section {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    margin: 2rem 0 1rem 1rem;
    opacity: 0.6;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 12px;
    transition: var(--transition);
    margin-bottom: 0.25rem;
}

.menu-item:hover {
    background-color: var(--bg-main);
    color: var(--brand-primary);
}

.menu-item.active {
    background-color: var(--brand-primary);
    color: white;
    box-shadow: var(--shadow-orange);
}

.menu-item i {
    font-size: 1.1rem;
}

.menu-item.text-danger:hover {
    background-color: var(--bg-danger-subtle);
    color: var(--danger);
}

/* ─── Main Content ─── */
.main-container {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: var(--topbar-height);
    background-color: var(--bg-topbar);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 900;
    border-bottom: 1px solid var(--border-color);
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.sidebar-toggle {
    display: none;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    padding: 0;
}

.theme-toggle {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.theme-toggle:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    transform: rotate(15deg);
}

.theme-toggle .dark-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .light-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .dark-icon {
    display: block;
    color: #FBBF24;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition);
}

.user-profile:hover {
    border-color: var(--brand-primary);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--bg-main);
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.content-body {
    padding: 1rem 2.5rem 2.5rem;
}

/* ─── Modern Components ─── */

/* Cards */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    transition: var(--transition);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Global Overrides for Bootstrap utilities to support themes */
.bg-white {
    background-color: var(--bg-surface) !important;
}

.bg-light {
    background-color: var(--bg-main) !important;
}

.text-dark {
    color: var(--text-main) !important;
}

.border {
    border-color: var(--border-color) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.card-header.bg-white,
.card-header.bg-light {
    background-color: var(--bg-surface) !important;
}

.card-footer.bg-white,
.card-footer.bg-light {
    background-color: var(--bg-surface) !important;
}

.card-body {
    padding: 2rem;
}

/* Stat Cards */
.stat-card {
    padding: 1.5rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Tables */
.table-responsive {
    border-radius: var(--radius);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border-color);
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: var(--bg-main);
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 1rem 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.table tbody td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-main);
    background: transparent;
    font-weight: 500;
    vertical-align: middle;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover td {
    background-color: rgba(var(--brand-primary-rgb, 255, 107, 0), 0.04);
}

/* Buttons */
.btn {
    border-radius: var(--radius);
    padding: 0.75rem 1.5rem;
    font-weight: 700;
    font-size: 0.9rem;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: var(--brand-primary);
    color: white;
    box-shadow: var(--shadow-orange);
}

.btn-primary:hover {
    background: var(--brand-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(255, 107, 0, 0.3);
}

.btn-light {
    background: var(--bg-main);
    color: var(--text-main);
}

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

/* Forms */
.form-control,
.form-select {
    background-color: var(--bg-surface);
    color: var(--text-main);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    background-color: var(--bg-surface);
    color: var(--text-main);
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 4px rgba(255, 107, 0, 0.1);
}

.form-label {
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* Badges */
.badge {
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-weight: 700;
}

.bg-success-subtle {
    background: var(--bg-success-subtle) !important;
    color: var(--success) !important;
}

.bg-danger-subtle {
    background: var(--bg-danger-subtle) !important;
    color: var(--danger) !important;
}

.bg-warning-subtle {
    background: var(--bg-warning-subtle) !important;
    color: var(--warning) !important;
}

.bg-primary-subtle {
    background: var(--bg-primary-subtle) !important;
    color: var(--brand-primary) !important;
}

.badge-soft-primary {
    background: var(--bg-primary-subtle) !important;
    color: var(--brand-primary) !important;
}

.badge-soft-success {
    background: var(--bg-success-subtle) !important;
    color: var(--success) !important;
}

.badge-soft-danger {
    background: var(--bg-danger-subtle) !important;
    color: var(--danger) !important;
}

.badge-soft-warning {
    background: var(--bg-warning-subtle) !important;
    color: var(--warning) !important;
}

.badge-soft-info {
    background: rgba(59, 130, 246, 0.1) !important;
    color: var(--info) !important;
}

/* ─── POS Specific ─── */
.pos-wrapper {
    display: flex;
    gap: 1.5rem;
    height: calc(100vh - 120px);
}

.pos-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.pos-stat-pill {
    background: var(--bg-main);
    border: 1px solid var(--border-light);
    padding: 0.6rem 1.25rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.pos-products {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.pos-cart {
    width: 420px;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: visible;
    /* Support absolute dropdown without clipping */
}

.pos-search-wrapper i {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--brand-primary);
    font-size: 1.25rem;
    z-index: 5;
}

#barcodeInput {
    padding-left: 3.5rem !important;
    border-radius: var(--radius);
    border: 2px solid var(--border-color);
}

#barcodeInput:focus {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 4px rgba(255, 107, 0, 0.1);
}

.pos-search-bar {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-light);
}

.product-grid {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
}

.product-card {
    background: var(--bg-surface);
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    padding: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.product-card:hover {
    border-color: var(--brand-primary);
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.product-name {
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.product-price {
    color: var(--brand-primary);
    font-weight: 800;
    font-size: 1.1rem;
}

.cart-header {
    padding: 1.25rem 1.5rem;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.pos-cart-sidebar {
    width: 400px;
    background: var(--bg-surface);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.pos-search-container {
    padding: 1.5rem;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
}

.pos-footer {
    padding: 1rem;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    position: sticky;
    bottom: 0;
    z-index: 100;
}

.pos-summary-container {
    padding: 2rem;
    background: var(--bg-main);
    border-top: 1px solid var(--border-color);
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-muted);
}

.cart-items {
    flex: 1;
    min-height: 150px;
    /* Prevent container from collapsing to 0 height on smaller resolutions */
    overflow-y: auto;
    padding: 1rem;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid var(--border-light);
}

.cart-footer {
    padding: 1.5rem;
    background: var(--bg-main);
}

margin-bottom: 0.5rem;
font-weight: 600;
color: var(--text-muted);
}

.grand-total {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 1rem 0;
}

/* Responsive */
@media (max-width: 1400px) {
    .pos-cart {
        width: 380px;
    }
}

@media (max-width: 1200px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-container {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: flex;
    }

    .pos-cart {
        width: 350px;
    }
}

/* Payment Mode Buttons */
.payment-btn {
    background: var(--bg-surface);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem 0.5rem;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    width: 100%;
}

.payment-btn i {
    font-size: 1.25rem;
}

.payment-btn.active {
    border-color: var(--brand-primary);
    background: rgba(255, 107, 0, 0.05);
    color: var(--brand-primary);
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.1);
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-container {
        margin-left: 0 !important;
        width: 100% !important;
        min-width: 100% !important;
    }

    .sidebar-toggle {
        display: flex !important;
    }

    .pos-wrapper {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        gap: 1.5rem !important;
        width: 100% !important;
        overflow-x: hidden !important;
    }

    .pos-products {
        order: 1 !important;
        width: 100% !important;
        height: auto !important;
        min-height: 500px !important;
        flex: none !important;
    }

    .pos-cart {
        order: 2 !important;
        width: 100% !important;
        height: auto !important;
        flex: none !important;
    }

    .content-body {
        padding: 0.75rem !important;
    }

    .topbar {
        padding: 0.75rem 1rem !important;
        height: auto !important;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
        padding: 1rem !important;
    }
}

@media (max-width: 576px) {
    .grand-total-row span.h2 {
        font-size: 1.75rem;
    }

    .payment-btn {
        padding: 0.5rem;
        font-size: 0.7rem;
    }

    .payment-btn i {
        font-size: 1rem;
    }
}

/* ─── Premium Auth Layout ─── */
.auth-split-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Fix for large empty state icons */
.cart-items i.bi-cart-x,
#productGrid i.bi-search {
    font-size: 3.5rem !important;
    opacity: 0.2;
}

.pos-footer .total-row {
    padding: 0.2rem 0;
}

.auth-brand-side {
    flex: 1;
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem;
    position: relative;
    overflow: hidden;
    color: white;
}

.auth-brand-side::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    filter: blur(120px);
    z-index: 0;
    opacity: 0.15;
    background: var(--brand-primary);
    top: -10%;
    left: -10%;
}

.auth-logo.user-avatar {
    width: 42px;
    height: 42px;
    background: var(--brand-primary);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
}

.dropdown-menu {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    padding: 0.75rem 1rem;
    color: var(--text-main);
    font-weight: 600;
    border-radius: 10px;
    transition: var(--transition);
}

.dropdown-item:hover {
    background-color: var(--bg-main);
    color: var(--brand-primary);
}

.auth-brand-title {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -2px;
    margin-bottom: 1rem;
    position: relative;
    z-index: 10;
}

.auth-brand-tagline {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    position: relative;
    z-index: 10;
}

.feature-list {
    list-style: none;
    padding: 0;
    position: relative;
    z-index: 10;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    font-weight: 600;
    color: #CBD5E0;
}

.feature-item i {
    color: var(--brand-primary);
    font-size: 1.25rem;
}

.auth-split-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.auth-brand-side {
    flex: 1;
    background: var(--brand-secondary);
    padding: 4rem;
    position: relative;
    overflow: hidden;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-form-side {
    width: 550px;
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem;
}

.auth-form-container {
    width: 100%;
    max-width: 400px;
    background: var(--bg-surface);
    transition: var(--transition);
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-muted);
}

/* ─── Responsive Improvements ─── */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-container {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .sidebar-toggle {
        display: flex;
    }

    .topbar {
        padding: 0 1rem;
        gap: 0.5rem;
    }

    .topbar-left {
        gap: 0.75rem;
        flex: 1;
        min-width: 0;
    }

    .page-title {
        font-size: 1rem;
        max-width: 180px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .topbar-right {
        gap: 0.5rem;
    }

    .user-profile {
        padding: 0.4rem 0.6rem;
    }

    .user-info {
        display: none !important;
    }

    /* Auth Responsive */
    .auth-split-wrapper {
        flex-direction: column;
    }

    .auth-brand-side {
        display: none;
    }

    .auth-form-side {
        width: 100%;
        padding: 2rem;
        background: var(--bg-main);
        min-height: 100vh;
    }

    .auth-form-container {
        background: var(--bg-surface);
        padding: 2.5rem;
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-lg);
        border: 1px solid var(--border-color);
        width: 100%;
    }

    .stat-card {
        padding: 1.25rem;
        gap: 1rem;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    /* Global Table Sticky Header Fix */
    .table-responsive {
        max-height: 70vh;
    }

    .table thead th {
        position: sticky;
        top: 0;
        z-index: 10;
        box-shadow: 0 2px 0 var(--border-color);
    }
}

@media (max-width: 576px) {
    .auth-form-container {
        padding: 1.5rem !important;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
    }

    .topbar-left {
        gap: 0.5rem;
    }

    .sidebar-toggle {
        width: 38px;
        height: 38px;
    }

    .page-title {
        max-width: 140px;
    }

    /* Stack buttons that have flex-grow-1 on mobile */
    .d-flex.gap-2.flex-wrap>.btn.flex-grow-1 {
        flex: 1 1 100% !important;
    }

    /* Standardize Button Touch Targets */
    .btn {
        min-height: 48px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Form Spacing */
    .form-control,
    .form-select {
        min-height: 48px;
    }

    .mb-4 {
        margin-bottom: 1.5rem !important;
    }

    /* Modal Improvements */
    .modal-dialog {
        margin: 0.5rem;
    }

    .modal-content {
        border-radius: var(--radius-md);
    }

    .modal-body {
        padding: 1.25rem;
    }

    /* Sticky Form Actions for Long Forms */
    .sticky-form-actions {
        position: sticky;
        bottom: 0;
        background: var(--bg-surface);
        padding: 1rem 1.5rem;
        border-top: 1px solid var(--border-color);
        margin-top: 2rem;
        z-index: 100;
        margin-left: -2rem;
        margin-right: -2rem;
        margin-bottom: -2rem;
        border-radius: 0 0 var(--radius-md) var(--radius-md);
        display: flex;
        gap: 0.5rem;
    }

    .sticky-form-actions .btn {
        flex: 1;
    }
}

/* ─── POS Specific Fixes (Global Override) ─── */
@media (max-width: 991px) {
    .pos-wrapper {
        flex-direction: column !important;
        height: auto !important;
    }

    .pos-products {
        width: 100% !important;
        height: auto !important;
        min-height: 400px;
    }

    .pos-cart {
        width: 100% !important;
        max-width: 100% !important;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
    }
}

/* ─── UI Polish & Accessibility Normalization ─── */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
    outline: 3px solid rgba(255, 107, 0, 0.45) !important;
    outline-offset: 2px;
}

.btn:active {
    transform: scale(0.97) !important;
}

.modal {
    z-index: 2100 !important;
}
.modal-backdrop {
    z-index: 2090 !important;
}
.z-modal-top {
    z-index: 2100 !important;
}
.z-dropdown-top {
    z-index: 1050 !important;
}

.accessible-focus:focus {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 4px rgba(255, 107, 0, 0.25) !important;
}

/* Live suggestions searchable select styles for Stock Transfers */
.search-suggest-wrapper {
    position: relative;
}
.search-suggest-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 2000;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    max-height: 250px;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    display: none;
}
.search-suggest-item {
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
}
.search-suggest-item:hover {
    background-color: var(--bg-main);
    color: var(--brand-primary);
}
.search-suggest-item:last-child {
    border-bottom: none;
}

/* ─── Pagination ─── */
.pagination {
    margin: 0;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.page-item .page-link {
    border: 1px solid var(--border-color);
    background-color: var(--bg-surface);
    color: var(--text-muted);
    border-radius: var(--radius-sm) !important;
    padding: 0.5rem 0.9rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: var(--transition);
    line-height: 1.4;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    box-shadow: var(--shadow-sm);
}

.page-item .page-link:hover {
    background-color: var(--bg-primary-subtle);
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(255, 107, 0, 0.15);
}

.page-item.active .page-link {
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
    color: #fff !important;
    font-weight: 800;
    box-shadow: var(--shadow-orange);
    transform: translateY(-1px);
}

.page-item.disabled .page-link {
    background-color: var(--bg-main);
    border-color: var(--border-light);
    color: var(--text-light);
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

/* Pagination info text */
nav > div > p.small {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0;
}

nav > div > p.small .fw-semibold {
    color: var(--text-main);
    font-weight: 700;
}

/* card-footer containing pagination */
.card-footer {
    background: var(--bg-surface) !important;
    border-top: 1px solid var(--border-color) !important;
    padding: 1rem 1.5rem !important;
}

[data-theme="dark"] .page-item .page-link {
    background-color: var(--bg-surface);
    border-color: var(--border-color);
    color: var(--text-muted);
}

[data-theme="dark"] .page-item.disabled .page-link {
    background-color: var(--bg-main);
    color: var(--text-light);
}