/* ==========================================================================
   DHMotopartes - Premium Vanilla CSS Design System
   ========================================================================== */

/* Theme Variables (Default Dark Mode) */
:root {
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-title: 'Outfit', sans-serif;

    /* Orange Theme Accent (Default) */
    --primary: #f97316;
    --primary-hover: #ea580c;
    --primary-light: rgba(249, 115, 22, 0.15);
    --primary-rgb: 249, 115, 22;

    /* Base Colors - Dark Theme (High Contrast layers) */
    --bg-app: #090d16; /* Deep Midnight Navy */
    --bg-sidebar: #0f172a; /* Slate 900 */
    --bg-header: #0f172a; /* Slate 900 */
    --bg-card: #1e293b; /* Slate 800 */
    --bg-card-hover: #243247;
    --bg-input: #090d16;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8; /* Slate 400 - high visibility */
    --border-color: #334155; /* Slate 700 */
    --border-hover: #475569;
    
    /* Semantic Colors */
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.15);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.15);
    
    /* Layout Sizes */
    --sidebar-width: 260px;
    --header-height: 70px;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    /* Shadow System (Flat & Lightweight) */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.15), 0 2px 4px -2px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.15), 0 4px 6px -4px rgba(0, 0, 0, 0.15);
    --shadow-glow: none;
    --card-highlight: none;
}

/* Light Theme Variables */
body.light-theme {
    --bg-app: #f1f5f9; /* Light Slate 100 */
    --bg-sidebar: #0f172a; /* Slate 900 (Opaque Dark Sidebar) */
    --bg-header: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-input: #ffffff;
    
    --text-main: #0f172a; /* Slate 900 */
    --text-muted: #475569; /* Slate 600 - High Contrast Labels */
    --border-color: #cbd5e1; /* Slate 300 */
    --border-hover: #94a3b8;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.02);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --card-highlight: none;
}

/* Theme Color Swaps */
body.theme-blue {
    --primary: #2563eb; --primary-hover: #1d4ed8; --primary-light: rgba(37, 99, 235, 0.15); --primary-rgb: 37, 99, 235;
}
body.theme-emerald {
    --primary: #10b981; --primary-hover: #059669; --primary-light: rgba(16, 185, 129, 0.15); --primary-rgb: 16, 185, 129;
}
body.theme-crimson {
    --primary: #f43f5e; --primary-hover: #e11d48; --primary-light: rgba(244, 63, 94, 0.15); --primary-rgb: 244, 63, 94;
}
body.theme-amber {
    --primary: #f59e0b; --primary-hover: #d97706; --primary-light: rgba(245, 158, 11, 0.15); --primary-rgb: 245, 158, 11;
}

/* ==========================================================================
   Base Resets
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}
::-webkit-scrollbar-thumb {
    background: rgba(var(--primary-rgb), 0.2);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--primary-rgb), 0.45);
}

body {
    font-family: var(--font-body);
    font-size: 15px;
    background-color: var(--bg-app);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    transition: background-color 0.3s ease, color 0.3s ease;
    position: relative;
}

body.light-theme {
    background-color: var(--bg-app);
}

/* Background Aurora Glows with animations */
@keyframes float-glow {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(60px, 40px) scale(1.15); }
    100% { transform: translate(0, 0) scale(1); }
}

@keyframes float-glow-reverse {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-50px, -60px) scale(0.9); }
    100% { transform: translate(0, 0) scale(1); }
}

.aurora-glow-1,
.aurora-glow-2 {
    display: none;
    position: absolute;
    width: 800px;
    height: 800px;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.15;
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.aurora-glow-1 {
    top: -200px;
    left: -200px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 80%);
    animation: float-glow 25s infinite alternate ease-in-out;
}

.aurora-glow-2 {
    bottom: -250px;
    right: -200px;
    background: radial-gradient(circle, #8b5cf6 0%, transparent 80%);
    animation: float-glow-reverse 30s infinite alternate ease-in-out;
}

body.light-theme .aurora-glow-1,
body.light-theme .aurora-glow-2 {
    opacity: 0.04;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-title);
    font-weight: 600;
    color: var(--text-main);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* Utility Helpers */
.hidden { display: none !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-amber { color: #f59e0b !important; }
.text-primary { color: var(--primary) !important; }
.text-muted { color: var(--text-muted) !important; }
.w-full { width: 100% !important; }
.flex-1 { flex: 1 !important; }
.flex-gap-10 { display: flex; gap: 10px; }
.flex-align-center { display: flex; align-items: center; gap: 6px; }
.small { font-size: 12px; }
.cursor-pointer { cursor: pointer; }

/* Status Dot & Pulses */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-muted);
}
.status-dot.online { background-color: var(--success); }
.status-dot.pending { background-color: #f59e0b; }
.status-dot.offline { background-color: var(--danger); }
.status-dot.pulse {
    animation: opacity-pulse 1.8s infinite ease-in-out;
}

@keyframes opacity-pulse {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
}

/* ==========================================================================
   Layout & Framework
   ========================================================================== */
.app-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
    position: relative;
    background-color: transparent !important;
    z-index: 10;
}

/* Sidebar styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin: 16px;
    height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    z-index: 100;
    box-shadow: var(--shadow-lg);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease, margin 0.3s ease;
}

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

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary) 0%, #312e81 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.3);
}

.logo-svg {
    width: 20px;
    height: 20px;
    color: #ffffff;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-family: var(--font-title);
    font-size: 19px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.logo-subtitle {
    font-size: 11px;
    color: var(--text-muted);
}

.sidebar-close-btn {
    display: none;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 10px;
    overflow-y: auto;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 6px;
}

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

.nav-link i {
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.nav-link:hover i {
    transform: translateX(2px);
}

.nav-link.active {
    background: rgba(var(--primary-rgb), 0.15);
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), 0.45), 0 0 15px rgba(var(--primary-rgb), 0.15);
    font-weight: 600;
}

.nav-link.active i {
    color: var(--primary);
    transform: scale(1.1);
}

/* Sidebar transition selectors for collapsing */
.logo-text,
.nav-link span,
.store-quick-info div {
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.2s ease, width 0.2s ease;
}

.sidebar-header,
.sidebar-footer,
.sidebar-nav {
    transition: padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 769px) {
    .sidebar.collapsed {
        --sidebar-width: 70px;
        margin-right: 0px;
    }
    
    .sidebar.collapsed .logo-text,
    .sidebar.collapsed .logo-subtitle,
    .sidebar.collapsed .nav-link span,
    .sidebar.collapsed .store-quick-info div {
        opacity: 0;
        width: 0;
        margin: 0;
        padding: 0;
        overflow: hidden;
        display: none !important;
    }
    
    .sidebar.collapsed .sidebar-header {
        padding: 20px 10px;
        justify-content: center;
    }
    
    .sidebar.collapsed .logo-container {
        justify-content: center;
    }
    
    .sidebar.collapsed .nav-link {
        justify-content: center;
        padding: 12px 0;
    }
    
    .sidebar.collapsed .store-quick-info {
        justify-content: center;
    }
    
    .sidebar.collapsed .sidebar-footer {
        padding: 20px 10px;
    }
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background-color: rgba(0, 0, 0, 0.15);
}

.store-quick-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.store-quick-info i {
    width: 20px;
    height: 20px;
}

.store-name-display {
    font-size: 13.5px;
    font-weight: 600;
    color: #ffffff;
}

.store-status-badge {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
}

/* Main Area Layout */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 32px);
    margin: 16px 16px 16px 0px;
    background-color: var(--bg-app);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: margin 0.3s ease;
}

.app-header {
    height: var(--header-height);
    background-color: var(--bg-header);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    z-index: 90;
    transition: background-color 0.3s ease;
}

.header-left {
    display: flex;
    align-items: center;
}

.sidebar-toggle-btn {
    display: inline-flex;
}

.header-store-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
    margin-right: 12px;
}

.header-store-icon {
    width: 18px;
    height: 18px;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

#header-store-logo-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.header-store-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
}

.header-breadcrumb-separator {
    color: var(--text-muted);
    font-size: 18px;
    font-weight: 300;
    margin-right: 12px;
    user-select: none;
}

.header-title {
    font-family: var(--font-title);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.datetime-display {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 13.5px;
    font-weight: 500;
}

.datetime-display i {
    width: 16px;
    height: 16px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 18px;
    border-left: 1px solid var(--border-color);
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
}

.user-name {
    font-weight: 500;
    font-size: 14px;
}

/* Content Container for Views */
.content-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    position: relative;
    background-color: transparent !important;
}

.app-view {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.app-view.active-view {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Form Fields & Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    color: #ffffff;
}

.btn i {
    width: 16px;
    height: 16px;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.02);
}

.btn:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

.btn-primary {
    background-color: var(--primary);
}
.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-hover);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}
.btn-secondary:hover:not(:disabled) {
    background-color: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.btn-danger {
    background-color: var(--danger);
}
.btn-danger:hover:not(:disabled) {
    background-color: #dc2626;
}

.btn-emerald {
    background-color: var(--success);
}
.btn-emerald:hover:not(:disabled) {
    background-color: #059669;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.25);
}

.btn-outline {
    background-color: transparent !important;
}
.btn-primary.btn-outline {
    border: 1px solid var(--primary);
    color: var(--primary);
}
.btn-primary.btn-outline:hover {
    background-color: var(--primary-light) !important;
}
.btn-danger.btn-outline {
    border: 1px solid var(--danger);
    color: var(--danger);
}
.btn-danger.btn-outline:hover {
    background-color: var(--danger-light) !important;
}

.btn-icon-only {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: var(--radius-md);
}

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}
.btn-icon:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

.btn-text-link {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    font-size: 13.5px;
}
.btn-text-link:hover {
    color: var(--primary-hover);
}

.btn-large {
    padding: 12px 24px;
    font-size: 15.5px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Inputs and Forms */
.form-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

input[type="text"],
input[type="number"],
input[type="tel"],
input[type="email"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-family: var(--font-body);
    transition: border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

select option {
    background-color: var(--bg-card);
    color: var(--text-main);
}

#cart-price-list-select,
#cart-stock-source-select,
#cart-price-list-select option,
#cart-stock-source-select option {
    color: var(--primary);
    font-weight: 600;
}

input[type="text"]:hover,
input[type="number"]:hover,
input[type="tel"]:hover,
input[type="email"]:hover,
input[type="date"]:hover,
select:hover,
textarea:hover {
    border-color: var(--border-hover);
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="email"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.25);
}

.form-row {
    display: flex;
    gap: 16px;
}

.col-6 { flex: 0 0 calc(50% - 8px); }
.col-4 { flex: 0 0 calc(33.333% - 10.66px); }

/* Search Boxes */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 280px;
    max-width: 480px;
}

.search-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    width: 16px;
    height: 16px;
}

.search-box input {
    padding-left: 40px;
    padding-right: 36px;
    height: 42px;
}

.btn-clear-search {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}
.btn-clear-search:hover { color: var(--text-main); }

/* Filter Selects */
.filter-select {
    width: auto;
    height: 42px;
}

/* ==========================================================================
   Dashboard Components
   ========================================================================== */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.metric-card {
    background-color: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-md), var(--card-highlight);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

/* Card Accent Indicators (Left border) */
.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--card-accent, var(--primary));
    transition: width 0.2s ease;
}

.metric-card:hover::before {
    width: 6px;
}

/* Assign unique accent color variables to each statistic card */
.metrics-grid > div:nth-child(1) {
    --card-accent: var(--primary);
    --card-accent-rgb: var(--primary-rgb);
}
.metrics-grid > div:nth-child(2) {
    --card-accent: #8b5cf6;
    --card-accent-rgb: 139, 92, 246;
}
.metrics-grid > div:nth-child(3) {
    --card-accent: #f59e0b;
    --card-accent-rgb: 245, 158, 11;
}
.metrics-grid > div:nth-child(4) {
    --card-accent: #10b981;
    --card-accent-rgb: 16, 185, 129;
}

/* Hover effects with colored glow shadow */
.metric-card:hover {
    transform: translateY(-4px);
    border-color: rgba(var(--card-accent-rgb), 0.4);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 0 15px rgba(var(--card-accent-rgb), 0.15), var(--card-highlight);
}

.card-gradient-primary {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.1) 0%, rgba(var(--primary-rgb), 0.02) 100%);
    border: 1.5px solid rgba(var(--primary-rgb), 0.35);
}

.metric-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    background-color: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.metric-icon i {
    width: 24px;
    height: 24px;
}

.metric-icon.bg-violet { background-color: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.metric-icon.bg-emerald { background-color: rgba(16, 185, 129, 0.15); color: #10b981; }
.metric-icon.bg-amber { background-color: rgba(245, 158, 11, 0.15); color: #f59e0b; }

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

.metric-label {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-muted);
}

.metric-value {
    font-size: 24px;
    font-weight: 700;
    font-family: var(--font-title);
    margin: 4px 0;
}

.metric-trend {
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}
.metric-trend i { width: 12px; height: 12px; }
.metric-subtext {
    font-size: 12px;
    color: var(--text-muted);
}

/* Dashboard Panels Layout */
.dashboard-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.dashboard-panel {
    background-color: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md), var(--card-highlight);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.panel-title {
    font-size: 16.5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-link {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}
.panel-link:hover { text-decoration: underline; }

.panel-body {
    padding: 20px;
    flex: 1;
}

.chart-container-wrapper {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dashboard-side-panels {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.side-panel {
    height: 212px;
}

.scrollable-y {
    overflow-y: auto;
}
.scrollable-x {
    overflow-x: auto;
}

.list-feed {
    padding: 10px 20px;
}

/* Feed item templates */
.feed-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}
.feed-item:last-child { border-bottom: none; }

.feed-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.feed-item-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

.feed-item-title {
    font-size: 13.5px;
    font-weight: 600;
}
.feed-item-subtext {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 2px;
}

.feed-item-right {
    text-align: right;
}

.feed-item-value {
    font-size: 14px;
    font-weight: 700;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-primary { background-color: var(--primary-light); color: var(--primary); }
.badge-success { background-color: var(--success-light); color: var(--success); }
.badge-warning { background-color: var(--warning-light); color: var(--warning); }
.badge-danger { background-color: var(--danger-light); color: var(--danger); }

/* Empty States */
.empty-state-small {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
    gap: 12px;
    height: 100%;
}
.empty-state-small i { width: 32px; height: 32px; }
.empty-state-small p { font-size: 13px; font-weight: 500; }

/* ==========================================================================
   POS View (Point of Sale)
   ========================================================================== */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    height: calc(100vh - var(--header-height) - 48px);
    overflow: hidden;
}

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

/* POS Barcode and Search Header */
.pos-controls-header {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    margin-bottom: 12px;
}

.barcode-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background-color: var(--success-light);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-md);
    color: var(--success);
    font-weight: 600;
    font-size: 13px;
    user-select: none;
    height: 42px;
}

.barcode-status-badge i {
    width: 16px;
    height: 16px;
}

.pos-controls {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
}

.category-tabs-container {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-bottom: 4px;
}

.category-tab {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.category-tab:hover {
    color: var(--text-main);
    border-color: var(--border-hover);
}

.category-tab.active {
    background-color: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.pos-products-wrapper {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}

.pos-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

/* Product Card POS */
.prod-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 14px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    user-select: none;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.prod-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.prod-card-image {
    width: 100%;
    height: 100px;
    border-radius: var(--radius-md);
    background-color: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    color: var(--text-muted);
}
.prod-card-image i { width: 36px; height: 36px; }

.prod-card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.prod-card-cat {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.prod-card-title {
    font-size: 13.5px;
    font-weight: 600;
    margin: 4px 0 8px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 35px;
}

.prod-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: auto;
}

.prod-card-price {
    font-family: var(--font-title);
    font-size: 17px;
    font-weight: 800;
    color: var(--text-main);
}

.prod-card-stock {
    font-size: 11.5px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}
.stock-badge-ok { background-color: var(--success-light); color: var(--success); }
.stock-badge-low { background-color: var(--warning-light); color: var(--warning); }
.stock-badge-out { background-color: var(--danger-light); color: var(--danger); }

.prod-card.out-of-stock {
    opacity: 0.55;
    cursor: not-allowed;
}
.prod-card.out-of-stock:hover {
    transform: none;
    border-color: var(--border-color);
}

.prod-card-sku {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 9.5px;
    font-weight: 600;
    background-color: rgba(0, 0, 0, 0.4);
    color: #ffffff;
    padding: 1px 5px;
    border-radius: 4px;
}

/* Wholesale Price Cards & Badges */
.prod-card-wholesale-box {
    margin-top: 6px;
    padding: 5px 8px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.12) 100%);
    border: 1px dashed rgba(99, 102, 241, 0.35);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wholesale-price-badge {
    font-size: 12px;
    color: var(--primary);
    font-weight: 600;
    display: flex;
    align-items: center;
}

.wholesale-price-badge strong {
    font-family: var(--font-title);
    font-size: 13px;
    color: var(--primary);
    margin-left: 4px;
}

.wholesale-min-note {
    font-size: 10.5px;
    color: var(--text-muted);
    font-weight: 500;
}

.catalog-wholesale-banner {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.15) 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 500;
}

.catalog-wholesale-banner i {
    color: var(--primary);
    flex-shrink: 0;
}

.cart-wholesale-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.cart-wholesale-hint {
    font-size: 10.5px;
    color: var(--warning);
    margin-top: 2px;
    font-weight: 500;
}

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

.cart-customer-section {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    background-color: rgba(0, 0, 0, 0.1);
}

.customer-picker-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.customer-picker-wrapper i {
    position: absolute;
    left: 12px;
}

.customer-picker-wrapper select {
    padding-left: 36px;
}

.cart-items-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cart-items-header {
    display: grid;
    grid-template-columns: 2fr 100px 80px;
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
}

.cart-items-list {
    flex: 1;
}

.cart-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    text-align: center;
    color: var(--text-muted);
    height: 100%;
    gap: 12px;
}

.cart-empty-icon {
    width: 48px;
    height: 48px;
    opacity: 0.3;
}

/* Cart Item Layout */
.cart-item {
    display: grid;
    grid-template-columns: 2fr 100px 80px;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.cart-item:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.cart-item-name {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.3;
}
.cart-item-sku {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.qty-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;
}
.qty-btn:hover {
    background-color: var(--border-color);
}

.qty-val {
    font-size: 14px;
    font-weight: 700;
    width: 20px;
    text-align: center;
}

.cart-item-price {
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 14px;
    text-align: right;
}

/* Summary Box POS */
.cart-summary-section {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    background-color: rgba(0, 0, 0, 0.15);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.summary-divider {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 10px 0;
}

.total-row {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 16px;
}
.total-row #cart-summary-total {
    color: var(--primary);
    font-family: var(--font-title);
    font-size: 22px;
}

.cart-actions-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 10px;
}

.btn-checkout {
    font-size: 16px;
}

/* ==========================================================================
   Data Table Components
   ========================================================================== */
.view-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 20px;
}

.search-filters-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    flex: 1;
    min-width: 320px;
}

.date-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}
.date-input {
    width: auto;
    height: 42px;
}

.data-table-card {
    background-color: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md), var(--card-highlight);
    overflow: hidden;
}

.table-responsive {
    overflow-x: auto;
    width: 100%;
}

/* Fixed horizontal scrollbar & sticky header for Inventory View */
#view-inventario.active-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#view-inventario .data-table-card {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    max-height: calc(100vh - 210px);
}

#view-inventario .table-responsive {
    flex: 1;
    overflow-x: auto;
    overflow-y: auto;
    min-height: 0;
}

#inventory-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 0 var(--border-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.data-table th {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 14px 18px;
    font-family: var(--font-title);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1.5px solid var(--border-color);
}

.data-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    vertical-align: middle;
}

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

.data-table tbody tr {
    transition: background-color 0.15s ease;
}

.data-table tbody tr:hover {
    background-color: rgba(var(--primary-rgb), 0.04);
}

.table-action-btn-group {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.table-footer-pagination {
    padding: 14px 18px;
    border-top: 1px solid var(--border-color);
    background-color: rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-muted);
}

/* Stock status indicators in table */
.stock-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}
.stock-pill.ok { background-color: var(--success-light); color: var(--success); }
.stock-pill.low { background-color: var(--warning-light); color: var(--warning); }
.stock-pill.out { background-color: var(--danger-light); color: var(--danger); }

/* ==========================================================================
   Modals & Backdrop
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(4px);
    transition: opacity 0.25s ease;
}

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

.modal-box {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-backdrop.active .modal-box {
    transform: scale(1);
}

.modal-small { width: 380px; }
.modal-medium { width: 560px; }
.modal-ticket { width: 340px; }
.modal-large { width: 800px; max-width: 95vw; }

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

.modal-title {
    font-size: 18px;
    font-weight: 700;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(85vh - 120px);
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background-color: rgba(0, 0, 0, 0.1);
}

/* Compact Cart Options Bar (Price List & Stock Source) */
.cart-options-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background-color: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
}

.cart-option-item {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.cart-option-label {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
    user-select: none;
}

.cart-option-select {
    flex: 1;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--bg-input);
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    height: 30px;
}

.cart-option-select:focus {
    border-color: var(--primary);
    outline: none;
}

/* Payment Method Selectors */
.payment-method-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.method-btn {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 13.5px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.method-btn i { width: 18px; height: 18px; }

.method-btn:hover {
    color: var(--text-main);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.method-btn.active {
    background-color: rgba(99, 102, 241, 0.15);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.25);
}

.input-large-text {
    font-size: 26px;
    font-weight: 800;
    height: 54px;
    text-align: center;
    font-family: var(--font-title);
}

.quick-cash-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.quick-cash-btn {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
}
.quick-cash-btn:hover { background-color: var(--border-color); }

.checkout-summary-box {
    background-color: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-md);
    padding: 14px;
    text-align: center;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}
.checkout-summary-box .lbl {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}
.checkout-summary-box .val {
    font-size: 34px;
    font-weight: 800;
    color: var(--primary);
    margin-top: 4px;
    font-family: var(--font-title);
}

.change-return-box {
    margin-top: 20px;
    padding: 12px;
    border-radius: var(--radius-md);
    background-color: rgba(16, 185, 129, 0.05);
    border: 1px dashed var(--success);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.change-value {
    font-size: 20px;
    font-weight: 800;
    font-family: var(--font-title);
}

/* ==========================================================================
   Ticket / Receipt Print Layout
   ========================================================================== */
.ticket-wrapper {
    font-family: monospace;
    font-size: 12px;
    color: #000000;
    padding: 10px 5px;
    background-color: #ffffff;
}

.ticket-header {
    text-align: center;
    margin-bottom: 16px;
}

.ticket-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.ticket-info {
    margin-bottom: 12px;
    line-height: 1.4;
}

.ticket-divider {
    border: 0;
    border-top: 1px dashed #000000;
    margin: 8px 0;
}

.ticket-table {
    width: 100%;
    border-collapse: collapse;
}

.ticket-table th {
    text-align: left;
    font-weight: bold;
    border-bottom: 1px dashed #000000;
    padding-bottom: 4px;
}

.ticket-table td {
    padding: 4px 0;
    vertical-align: top;
}

.ticket-totals {
    margin-top: 8px;
    text-align: right;
    line-height: 1.5;
}

.ticket-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 11px;
}

/* ==========================================================================
   Settings Page Specifics
   ========================================================================== */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 24px;
}

.col-span-2 {
    grid-column: span 2;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.theme-option-selectors {
    display: flex;
    gap: 12px;
}

.theme-select-btn {
    flex: 1;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}
.theme-select-btn:hover {
    color: var(--text-main);
    border-color: var(--border-hover);
}
.theme-select-btn.active {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    color: var(--text-main);
    box-shadow: 0 0 10px rgba(var(--primary-rgb), 0.1);
}

.accent-color-pickers {
    display: flex;
    gap: 14px;
    padding: 5px 0;
}

.color-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease;
}
.color-dot:hover {
    transform: scale(1.15);
}
.color-dot.active {
    border-color: var(--text-main);
    transform: scale(1.15);
}

.alert-info-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background-color: var(--primary-light);
    border: 1px solid rgba(var(--primary-rgb), 0.3);
    padding: 12px;
    border-radius: var(--radius-md);
    color: var(--text-main);
}
.alert-info-box i {
    width: 18px;
    height: 18px;
    color: var(--primary);
    flex-shrink: 0;
}

.data-operations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.data-op-card {
    background-color: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.data-op-card h4 {
    font-size: 14px;
    font-weight: 700;
}
.data-op-card p {
    flex: 1;
    margin-bottom: 8px;
}
.data-op-card.warning-border {
    border-color: rgba(239, 68, 68, 0.3);
    background-color: rgba(239, 68, 68, 0.02);
}

/* ==========================================================================
   Media Queries & Responsive Styling
   ========================================================================== */
@media (max-width: 1024px) {
    .pos-layout {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 340px;
        height: auto;
        overflow: visible;
    }
    .pos-cart-panel {
        height: 340px;
    }
    .settings-grid {
        grid-template-columns: 1fr;
    }
    .col-span-2 {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    /* Hide sidebar by default on mobile */
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        margin: 0;
        height: 100vh;
        border-radius: 0;
        border: none;
        border-right: 1px solid var(--border-color);
        transform: translateX(-100%);
    }
    .main-wrapper {
        margin: 0;
        height: 100vh;
        border-radius: 0;
        border: none;
    }
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    .sidebar-close-btn {
        display: inline-flex;
    }
    .sidebar-toggle-btn {
        display: inline-flex;
    }
    
    .app-header {
        padding: 0 16px;
    }
    .datetime-display {
        display: none;
    }
    .header-store-info,
    .header-breadcrumb-separator {
        display: none !important;
    }
    .header-title {
        font-size: 18px !important;
        font-weight: 600 !important;
        color: var(--text-main) !important;
    }
    .metrics-grid {
        grid-template-columns: 1fr 1fr;
    }
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
    .view-header-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    .search-filters-row {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }
    .search-box {
        max-width: none;
    }
    .date-filter-group {
        width: 100%;
    }
    .date-input {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    .col-6 {
        flex: 0 0 100%;
    }
    .quick-cash-buttons {
        grid-template-columns: 1fr 1fr;
    }
}

/* Print styles override */
@media print {
    /* Ocultar todo */
    body * {
        visibility: hidden !important;
    }

    /* Mostrar solo el recibo */
    #modal-receipt,
    #modal-receipt .modal-box,
    #modal-receipt .modal-body,
    #modal-receipt #receipt-modal-content,
    #modal-receipt .ticket-wrapper,
    #modal-receipt .ticket-wrapper * {
        visibility: visible !important;
    }

    /* Ocultar cabecera y botones del modal en impresión */
    .hide-on-print {
        display: none !important;
    }

    /* Resetear el overlay del modal */
    #modal-receipt {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: auto !important;
        background: none !important;
        backdrop-filter: none !important;
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        z-index: 9999 !important;
        overflow: visible !important;
    }

    #modal-receipt .modal-box {
        position: static !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: none !important;
        border: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        background: #ffffff !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
    }

    #modal-receipt .modal-body,
    #modal-receipt #receipt-modal-content {
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
    }

    .ticket-wrapper {
        width: 100% !important;
        max-width: 80mm !important;
        margin: 0 auto !important;
        padding: 8px 4px !important;
        background: #ffffff !important;
        color: #000000 !important;
        font-family: monospace !important;
        font-size: 12px !important;
    }
}

/* ==========================================================================
   Login Screen UI Overlay
   ========================================================================== */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(7, 10, 19, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background-color: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg), var(--card-highlight);
    animation: login-fade-in 0.4s ease;
}

@keyframes login-fade-in {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.login-logo-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary) 0%, #312e81 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.3);
}

.login-logo-icon i {
    width: 22px;
    height: 22px;
    color: #ffffff;
}

.login-logo-text {
    display: flex;
    flex-direction: column;
}

.login-logo-title {
    font-family: var(--font-title);
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.login-logo-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    font-family: var(--font-title);
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 24px;
}

/* SaaS Brand Customization Styles (Macutech) */
.logo-icon.has-custom-logo {
    background: transparent !important;
    box-shadow: none !important;
    width: auto !important;
    height: 38px !important;
}

.logo-icon.has-custom-logo img {
    height: 38px !important;
    width: auto !important;
    max-width: 150px !important;
}

.login-logo-icon.has-custom-logo {
    background: transparent !important;
    box-shadow: none !important;
    width: auto !important;
    height: 44px !important;
}

.login-logo-icon.has-custom-logo img {
    height: 44px !important;
    width: auto !important;
    max-width: 180px !important;
}

/* Dynamic Card Transitions */
.metric-card, .dashboard-panel, .prod-card, .data-table-card, .data-op-card, .login-card {
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.3s ease, backdrop-filter 0.3s ease, box-shadow 0.2s ease !important;
}

/* Drag and Drop Zone styling for uploads */
.brand-image-upload-zone {
    border: 2px dashed var(--border-color);
    padding: 16px;
    border-radius: var(--radius-md);
    text-align: center;
    background-color: rgba(255, 255, 255, 0.01);
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.brand-image-upload-zone:hover {
    border-color: var(--primary);
    background-color: rgba(var(--primary-rgb), 0.02);
}

.brand-image-preview-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--bg-input);
}

.brand-image-preview-img {
    height: 40px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: #ffffff; /* White background behind preview to check transparency */
    padding: 2px;
}

/* ==========================================================================
   Public Customer Catalog Fullscreen Preview
   ========================================================================== */
body.catalog-fullscreen .sidebar {
    display: none !important;
}
body.catalog-fullscreen .app-header {
    display: none !important;
}
body.catalog-fullscreen .main-wrapper {
    padding-top: 0 !important;
}
body.catalog-fullscreen .content-container {
    padding: 24px !important;
    height: 100vh;
}

.catalog-preview-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--primary-light);
    border: 1px solid rgba(var(--primary-rgb), 0.25);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-size: 13.5px;
    color: var(--text-main);
    font-weight: 500;
}

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

.catalog-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.catalog-brand h2 {
    font-family: var(--font-title);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.catalog-search {
    flex: 0 0 350px;
}

.catalog-categories {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 4px;
}

.catalog-products-wrapper {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 40px;
}

/* Catalog Brand Information Card (Description & Socials) */
.catalog-info-card {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

.catalog-info-content {
    flex: 1 1 500px;
}

.catalog-description {
    font-size: 14.5px;
    color: var(--text-main);
    line-height: 1.6;
    margin: 0;
    font-weight: 400;
}

.catalog-social-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    filter: brightness(1.1);
}

.social-btn i {
    width: 16px;
    height: 16px;
}

.whatsapp-btn {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: #ffffff !important;
}

.instagram-btn {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: #ffffff !important;
}

/* ==========================================================================
   Catalog Customer Shopping Cart & FAB Styles
   ========================================================================== */
.catalog-cart-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    border: none;
    box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 199; /* slightly below modal backdrops */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.catalog-cart-fab:hover {
    transform: scale(1.08) translateY(-3px);
    box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.6);
    background-color: var(--primary-hover);
}

.catalog-cart-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: #ef4444;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    padding: 2px 7px;
    min-width: 20px;
    height: 20px;
    text-align: center;
    line-height: 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--bg-card);
}

/* Catalog Cart Item List */
.catalog-cart-items {
    padding: 10px 0;
}

.catalog-cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.catalog-cart-item:hover {
    background-color: rgba(255, 255, 255, 0.015);
}

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

.catalog-cart-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.catalog-cart-item-price {
    font-size: 13px;
    color: var(--primary);
    font-weight: 700;
    margin-top: 4px;
}

.catalog-cart-item-qty-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 15px;
}

.catalog-cart-item-total {
    font-family: var(--font-title);
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    width: 90px;
    text-align: right;
    margin-left: 15px;
}

/* Micro animations */
@keyframes pulse-fab {
    0% {
        transform: scale(1);
        box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.45);
    }
    50% {
        transform: scale(1.2);
        box-shadow: 0 0 0 12px rgba(var(--primary-rgb), 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.45);
    }
}

.pulse-animation {
    animation: pulse-fab 0.5s ease-out;
}

/* SaaS Dashboard Selector Styles */
.saas-dash-selector-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    padding: 20px 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    gap: 16px;
    flex-wrap: wrap;
}

.saas-dash-selector-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
}

.saas-dash-selector-label i {
    color: var(--primary);
    width: 24px;
    height: 24px;
}

.saas-dash-select-wrapper {
    position: relative;
    min-width: 320px;
    flex: 1.5;
    max-width: 500px;
}

.saas-dash-select-wrapper select {
    width: 100%;
    background-color: var(--bg-body);
    border: 2px solid var(--border-color);
    color: var(--text-main);
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    appearance: none;
}

.saas-dash-select-wrapper select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

.saas-dash-select-wrapper::after {
    content: "▼";
    font-size: 11px;
    color: var(--text-muted);
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}
.saas-dash-select-wrapper select option {
    color: #111111;
    background-color: #ffffff;
    font-size: 16px;
    padding: 10px;
}

/* Premium Text Gradients for Statistic Values */
#metric-today-sales, #saas-metric-today-sales {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover, #4f46e5) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

#metric-total-products, #saas-metric-total-products {
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

#metric-low-stock-count, #saas-metric-low-stock-count {
    background: linear-gradient(135deg, #fb923c 0%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

#metric-today-profit, #saas-metric-today-profit {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

/* Caja View Mode Tabs */
.caja-view-tabs .btn-secondary.active-tab {
    background-color: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

