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

:root {
    --bg-main: #f8fafc;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --primary: #dc2626;
    --primary-hover: #b91c1c;
    --primary-glow: rgba(220, 38, 38, 0.15);
    
    --success: #16a34a;
    --success-glow: rgba(22, 163, 74, 0.15);
    --warning: #ea580c;
    --warning-glow: rgba(234, 88, 12, 0.15);
    --danger: #dc2626;
    --danger-glow: rgba(220, 38, 38, 0.15);
    --info: #2563eb;
    
    --grad-indigo: linear-gradient(135deg, #dc2626, #b91c1c);
    --grad-purple: linear-gradient(135deg, #ef4444, #dc2626);
    --grad-rose: linear-gradient(135deg, #fca5a5, #ef4444);
    --grad-emerald: linear-gradient(135deg, #4ade80, #16a34a);
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --shadow-glow: 0 0 20px rgba(220, 38, 38, 0.08);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
}

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

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

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

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

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand-section {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.brand-logo {
    width: 38px;
    height: 38px;
    background: var(--grad-indigo);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(220, 38, 38, 0.4);
}

.brand-logo i {
    color: white;
    font-size: 1.2rem;
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(120deg, #dc2626, #b91c1c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    list-style: none;
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.nav-item a:hover {
    color: var(--primary);
    background-color: rgba(220, 38, 38, 0.05);
}

.nav-item.active a {
    color: white;
    background: var(--grad-indigo);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.user-profile-section {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background-color: var(--primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: white;
}

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

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.logout-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    transition: color 0.2s ease;
}

.logout-btn:hover {
    color: var(--danger);
}

/* Main Content Area */
.main-wrapper {
    margin-left: 260px;
    flex-grow: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 70px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.page-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.content-body {
    padding: 32px;
    flex-grow: 1;
}

/* Grid & Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0,0,0,0.01) 0%, rgba(0,0,0,0) 100%);
    pointer-events: none;
}

.glass-card:hover {
    transform: translateY(-4px);
    border-color: rgba(220, 38, 38, 0.2);
    box-shadow: 0 10px 20px rgba(0,0,0,0.03), 0 0 15px rgba(220, 38, 38, 0.05);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

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

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.stat-icon.indigo { background: rgba(220, 38, 38, 0.1); color: var(--primary); }
.stat-icon.purple { background: rgba(220, 38, 38, 0.1); color: var(--primary); }
.stat-icon.emerald { background: rgba(22, 163, 74, 0.1); color: var(--success); }
.stat-icon.rose { background: rgba(220, 38, 38, 0.1); color: var(--danger); }
.stat-icon.amber { background: rgba(234, 88, 12, 0.1); color: var(--warning); }

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.stat-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Alert Boxes & Badges */
.alert-strip {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.alert-strip.warning {
    background: rgba(245, 158, 11, 0.05);
    border-color: rgba(245, 158, 11, 0.15);
}

.alert-strip i {
    font-size: 1.25rem;
}

.alert-strip.danger i { color: var(--danger); }
.alert-strip.warning i { color: var(--warning); }

.alert-strip-content {
    flex-grow: 1;
    font-size: 0.9rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.badge.danger { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.1); }
.badge.warning { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.1); }
.badge.success { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.1); }
.badge.info { background: rgba(6, 182, 212, 0.15); color: #22d3ee; border: 1px solid rgba(6, 182, 212, 0.1); }

/* Forms & Tables */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.toolbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--grad-indigo);
    color: white;
    box-shadow: 0 4px 10px var(--primary-glow);
}

.btn-primary:hover {
    box-shadow: 0 6px 14px var(--primary-glow);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #ffffff;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: #f1f5f9;
}

.btn-danger {
    background: var(--grad-rose);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-1px);
}

.btn-success {
    background: var(--grad-emerald);
    color: white;
}

.btn-success:hover {
    transform: translateY(-1px);
}

/* Tables */
.table-container {
    overflow-x: auto;
}

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

.custom-table th {
    padding: 16px 20px;
    background-color: rgba(0, 0, 0, 0.02);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.custom-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    vertical-align: middle;
}

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

.custom-table tbody tr {
    transition: background-color 0.2s ease;
}

.custom-table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.015);
}

/* Product list item thumbnail */
.product-thumb {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background-color: rgba(0,0,0,0.02);
    border: 1px solid var(--border-color);
}

/* Cashier POS Layout */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    height: calc(100vh - 170px);
}

.products-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
}

.search-bar-container {
    display: flex;
    gap: 12px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    grid-auto-rows: max-content;
    align-content: start;
    gap: 16px;
    overflow-y: auto;
    padding-right: 4px;
    flex-grow: 1;
}

.product-card {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    user-select: none;
    box-shadow: var(--shadow-sm);
}

.product-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.product-card-img {
    width: 100%;
    height: 120px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background-color: rgba(0, 0, 0, 0.01);
    border: 1px solid var(--border-color);
}

.product-card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.product-card-name {
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.product-card-stock {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

/* Cart Panel */
.cart-panel {
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: var(--shadow-lg);
}

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

.cart-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.cart-items {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cart-item {
    display: flex;
    gap: 12px;
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding-bottom: 12px;
}

.cart-item-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cart-item-name {
    font-size: 0.85rem;
    font-weight: 600;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.cart-qty-ctrl {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background-color: #f1f5f9;
}

.cart-qty-btn {
    border: none;
    background: none;
    color: var(--text-primary);
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 0.8rem;
}

.cart-qty-btn:hover {
    background-color: rgba(0,0,0,0.05);
}

.cart-qty-val {
    width: 30px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.cart-item-remove {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s ease;
}

.cart-item-remove:hover {
    color: var(--danger);
}

.cart-summary {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-color: #f8fafc;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.summary-row.total {
    font-size: 1.2rem;
    font-weight: 800;
    color: white;
    border-top: 1px dashed var(--border-color);
    padding-top: 12px;
    margin-top: 4px;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.25rem;
}

.modal-close:hover {
    color: white;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Image Upload Preview area */
.image-upload-preview {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-md);
    border: 2px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-top: 8px;
    position: relative;
}

.image-upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Login Page UI */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 10% 20%, rgba(220, 38, 38, 0.08) 0%, transparent 45%),
                radial-gradient(circle at 90% 80%, rgba(220, 38, 38, 0.05) 0%, transparent 45%),
                var(--bg-main);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.05);
}

.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.login-header h2 {
    font-size: 1.6rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-align: center;
    margin-bottom: 32px;
}

/* Light mode overrides for inputs with inline styles */
.pos-layout .form-control,
#digital-form .form-control,
.qty-input-container .form-control {
    background-color: #ffffff !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

#payment-amount, #digital-amount {
    color: #16a34a !important; /* Rich Green */
}

#digital-fee {
    color: #ea580c !important; /* Rich Orange/Amber */
}

.qty-input-container select {
    color: var(--text-primary) !important;
}

/* ==========================================================================
   Responsive Design & Mobile Compatibility
   ========================================================================== */

/* Sidebar Toggle and Layout */
.sidebar-toggle {
    display: none;
    width: 40px;
    height: 40px;
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.sidebar-toggle:hover {
    background-color: rgba(0,0,0,0.02);
}

/* POS Layout Mobile Tabs */
.pos-tabs {
    display: none; /* Hidden on desktop */
    background: rgba(30, 41, 59, 0.03);
    border: 1px solid var(--border-color);
    padding: 6px;
    border-radius: var(--radius-md);
    gap: 8px;
    width: 100%;
    margin-bottom: 20px;
}

.pos-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
}

.pos-tab.active {
    color: var(--primary) !important;
    background: white;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.pos-cart-badge {
    background-color: var(--primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Mobile and Desktop view switches */
.mobile-view {
    display: none;
}
.desktop-view {
    display: block;
}

/* Media Queries */

/* Tablet Viewport (< 1024px) */
@media (max-width: 1024px) {
    .sidebar {
        left: -260px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .main-wrapper {
        margin-left: 0;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow-x: hidden !important;
    }
    
    .sidebar-toggle {
        display: flex;
    }
    
    .topbar {
        padding: 0 20px;
    }
    
    .content-body {
        padding: 20px;
    }
}

/* Mobile Viewport (< 768px) */
@media (max-width: 768px) {
    /* Topbar adjustments */
    .topbar {
        height: auto;
        padding: 16px 20px;
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .topbar-actions {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 8px;
        border-top: 1px solid var(--border-color);
        padding-top: 10px;
    }
    
    .topbar-actions span {
        border-left: none !important;
        padding-left: 0 !important;
    }
    
    /* Stats Grid */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    /* POS cashier layout stacking */
    .pos-tabs {
        display: flex !important;
    }
    
    .pos-layout {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        gap: 16px !important;
    }
    
    .pos-layout .products-panel,
    .pos-layout .cart-panel {
        display: none !important;
        width: 100% !important;
    }
    
    /* Display state togglers for tab switching */
    .pos-layout .products-panel.active-tab,
    .pos-layout .cart-panel.active-tab {
        display: flex !important;
    }
    
    /* Tables responsiveness */
    .custom-table th, .custom-table td {
        padding: 10px 12px !important;
        font-size: 0.8rem !important;
    }
    
    /* Report filters */
    .report-filter-bar {
        padding: 14px;
        flex-direction: column;
        align-items: stretch;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }
    
    .report-filter-bar > div:first-child {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }
    
    .period-tabs {
        flex-wrap: wrap !important;
        gap: 6px !important;
        width: 100%;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
    }
    
    .period-tab-btn {
        flex: 1 1 auto;
        justify-content: center;
        background: rgba(15, 23, 42, 0.6) !important;
        border: 1px solid var(--border-color) !important;
    }
    
    .period-tab-btn.active {
        background: var(--primary) !important;
        color: white !important;
        border-color: var(--primary) !important;
    }
    
    #filter-form {
        display: flex;
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
        width: 100%;
    }
    
    #custom-date-inputs {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }
    
    .search-input-group {
        width: 100%;
    }
    
    #filter-form select, #filter-form button, #filter-form a {
        width: 100% !important;
    }
    
    /* Login card adjust */
    .login-card {
        padding: 24px;
        margin: 16px;
    }
    
    /* Content wrapper & card adjustments to prevent cutoffs */
    .content-body {
        padding: 12px 10px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }
    .glass-card {
        padding: 14px 12px !important;
        border-radius: var(--radius-md) !important;
        margin-bottom: 16px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }
    
    /* 3 Items per row grid inside cashier catalog */
    .products-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
        padding-right: 0 !important;
    }
    .product-card {
        padding: 6px !important;
        gap: 4px !important;
        border-radius: var(--radius-sm) !important;
    }
    .product-card-img {
        height: 70px !important;
    }
    .product-card-name {
        font-size: 0.72rem !important;
        line-height: 1.2 !important;
        white-space: normal !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        height: 2.4em !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    .product-card-price {
        font-size: 0.78rem !important;
    }
    .product-card-stock {
        font-size: 0.65rem !important;
        margin-top: 0 !important;
    }
    
    /* Toolbar & Search form responsive stacking */
    .toolbar-container {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        width: 100% !important;
    }
    .toolbar-form {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .toolbar-form input, .toolbar-form select, .toolbar-form button, .toolbar-form a {
        width: 100% !important;
        max-width: 100% !important;
    }
    .toolbar-container button, .toolbar-container a {
        width: 100% !important;
    }
    .filter-toolbar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }
    .toolbar-actions-group {
        width: 100% !important;
        margin-top: 8px !important;
        display: flex !important;
        gap: 8px !important;
    }
    .toolbar-actions-group button, .toolbar-actions-group a {
        flex: 1 !important;
        width: 100% !important;
    }
    
    /* Financial analytical grids stacking */
    .report-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    
    /* Auto-width overrides for inline-styled history filters */
    #filter-form div[style*="width: 160px"] {
        width: 100% !important;
    }
    #filter-form div[style*="display: flex; gap: 8px"] {
        width: 100% !important;
    }
    #filter-form div[style*="display: flex; gap: 8px"] button,
    #filter-form div[style*="display: flex; gap: 8px"] a {
        flex: 1 !important;
        width: 100% !important;
    }

    /* Restock shopping list footer buttons stacking on mobile */
    .action-buttons-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }
    .action-buttons-row button {
        width: 100% !important;
    }

    .desktop-view {
        display: none !important;
    }
    
    .mobile-view {
        display: block !important;
    }
    
    /* Mobile Card Styles */
    .mobile-list-card {
        background: rgba(255, 255, 255, 0.02) !important;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        padding: 14px;
        margin-bottom: 12px;
        display: flex;
        flex-direction: column;
        gap: 10px;
        box-shadow: var(--shadow-sm);
    }
    
    .mobile-card-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        gap: 10px;
    }
    
    .mobile-card-title {
        font-weight: 700;
        font-size: 0.95rem;
        color: var(--text-primary);
    }
    
    .mobile-card-subtitle {
        font-size: 0.8rem;
        color: var(--text-secondary);
    }
    
    .mobile-card-value {
        font-weight: 700;
        font-size: 0.9rem;
    }
    
    .mobile-card-actions {
        display: flex;
        gap: 8px;
        margin-top: 6px;
        padding-top: 8px;
        border-top: 1px dashed var(--border-color);
        width: 100%;
    }
    
    .mobile-card-actions .btn, .mobile-card-actions form {
        flex: 1;
    }
    
    .mobile-card-actions .btn {
        width: 100% !important;
        font-size: 0.8rem !important;
        padding: 8px 10px !important;
        justify-content: center;
    }

    /* Modal styling for mobile screen view */
    .modal-content {
        margin: 10px !important;
        width: calc(100% - 20px) !important;
        max-width: 100% !important;
        max-height: calc(100vh - 20px) !important;
        overflow-y: auto !important;
    }
    .modal-body {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        padding: 16px !important;
    }
    .debts-detail-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    .info-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
        padding-bottom: 10px !important;
    }
    .info-row strong, .info-row span {
        text-align: left !important;
        display: block !important;
        word-break: break-all !important;
    }

    /* Horizontal Swipable Period Tabs on Mobile */
    .period-tabs {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        width: 100% !important;
        max-width: 100% !important;
        gap: 6px !important;
        background: rgba(15, 23, 42, 0.6) !important;
        padding: 6px !important;
        border-radius: var(--radius-md) !important;
        scrollbar-width: none !important;
    }
    .period-tabs::-webkit-scrollbar {
        display: none !important;
    }
    .period-tab-btn {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        padding: 8px 14px !important;
    }

    /* Higher contrast filter bar styling on mobile */
    .report-filter-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 16px !important;
        padding: 16px 12px !important;
    }
    .report-filter-bar label {
        color: #f1f5f9 !important;
        font-weight: 700 !important;
        font-size: 0.85rem !important;
        opacity: 1 !important;
    }
    .report-filter-bar div[style*="margin-left: auto"],
    .report-filter-bar div[style*="margin-left:auto"] {
        margin-left: 0 !important;
        width: 100% !important;
    }
    .report-filter-bar div[style*="margin-left: auto"] button,
    .report-filter-bar div[style*="margin-left:auto"] button,
    .report-filter-bar button {
        width: 100% !important;
        justify-content: center !important;
    }
}


