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

:root {
    /* DARK THEME (Default) */
    --bg-main: #000000;
    --bg-card: #111111;
    --border-color: #333333;
    
    --accent-primary: #ffffff; /* White buttons on dark theme */
    --accent-secondary: #444444;
    --accent-text: #000000;
    
    --text-main: #ffffff;
    --text-muted: #888888;
    
    --sidebar-width: 250px;
    --topbar-height: 60px;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.5);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
}

body.light-theme {
    /* LIGHT THEME */
    --bg-main: #f9fafb;
    --bg-card: #ffffff;
    --border-color: #e5e7eb;
    
    --accent-primary: #000000; /* Black buttons on light theme */
    --accent-secondary: #e5e7eb;
    --accent-text: #ffffff;
    
    --text-main: #111827;
    --text-muted: #6b7280;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    color: var(--text-main);
    background-color: var(--bg-main);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

/* Minimal Top Bar */
.wp-topbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--topbar-height);
    background: linear-gradient(135deg, #0f172a 0%, #3b82f6 100%);
    border-bottom: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 9999;
}

.wp-topbar .site-name {
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.02em;
}

.wp-topbar .user-info {
    display: flex;
    align-items: center;
    gap: 20px;
    color: rgba(255,255,255,0.9);
}

.wp-topbar a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.wp-topbar a:hover {
    color: #ffffff;
    transform: translateY(-1px);
}

.wp-topbar #theme-toggle i {
    color: #ffffff;
}

/* Minimal Sidebar */
.wp-sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--topbar-height));
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    z-index: 9998;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    padding-top: 15px;
}

.wp-sidebar ul {
    list-style: none;
    padding: 0 16px;
    margin: 0;
}

.wp-sidebar ul li {
    margin-bottom: 8px;
}

.wp-sidebar ul li a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.wp-sidebar ul li a i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    margin-right: 12px;
    font-size: 16px;
    text-align: center;
    transition: all 0.2s ease;
}

/* Colorful Icon Classes */
.c-purple { color: #a855f7 !important; background: rgba(168, 85, 247, 0.15) !important; }
.c-orange { color: #f97316 !important; background: rgba(249, 115, 22, 0.15) !important; }
.c-green { color: #10b981 !important; background: rgba(16, 185, 129, 0.15) !important; }
.c-blue { color: #3b82f6 !important; background: rgba(59, 130, 246, 0.15) !important; }
.c-pink { color: #ec4899 !important; background: rgba(236, 72, 153, 0.15) !important; }
.c-teal { color: #14b8a6 !important; background: rgba(20, 184, 166, 0.15) !important; }
.c-yellow { color: #eab308 !important; background: rgba(234, 179, 8, 0.15) !important; }
.c-indigo { color: #6366f1 !important; background: rgba(99, 102, 241, 0.15) !important; }
.c-red { color: #ef4444 !important; background: rgba(239, 68, 68, 0.15) !important; }

.wp-sidebar ul li a:hover {
    background-color: var(--bg-main);
    color: var(--text-main);
    transform: translateX(4px);
}

.wp-sidebar ul li a:hover i {
    transform: scale(1.15);
}

.wp-sidebar ul li a.active,
.wp-sidebar ul li.active > a.submenu-toggle {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-weight: 600;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}

/* Submenu styling */
.wp-sidebar ul.submenu {
    padding-left: 0;
    margin-top: 4px;
    margin-bottom: 8px;
    border-left: 2px solid var(--border-color);
    margin-left: 28px;
}
.wp-sidebar ul.submenu li {
    margin-bottom: 4px;
}
.wp-sidebar ul.submenu li a {
    padding: 10px 14px;
    font-size: 13px;
    border-radius: 10px;
}

/* Main Content Area */
.wp-main {
    margin-top: var(--topbar-height);
    margin-left: var(--sidebar-width);
    padding: 40px;
    min-height: calc(100vh - var(--topbar-height));
    transition: margin 0.3s ease;
}

/* Flat Cards */
.wp-card, .card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    box-shadow: var(--shadow-sm) !important;
    color: var(--text-main) !important;
    transition: all 0.2s ease;
    margin-bottom: 24px;
}

.wp-card:hover, .card:hover {
    box-shadow: var(--shadow-md) !important;
}

.card-header {
    background: transparent !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 20px 24px !important;
    font-weight: 600;
    color: var(--text-main) !important;
}

.card-body {
    padding: 24px !important;
}

/* Form Controls */
.form-control, .form-select {
    background-color: var(--bg-main) !important;
    border: 2px solid var(--border-color) !important;
    color: var(--text-main) !important;
    border-radius: 10px !important;
    padding: 12px 16px !important;
    min-height: 48px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.25s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02) !important;
}

.form-control:focus, .form-select:focus {
    border-color: #3b82f6 !important;
    background-color: rgba(59, 130, 246, 0.03) !important;
    outline: none;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15) !important;
    transform: translateY(-1px);
}

label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
}

label .text-danger {
    color: #ec4899 !important; /* Vibrant pink/red for required stars */
    margin-left: 2px;
}

/* Buttons */
.btn {
    font-weight: 500 !important;
    border-radius: 6px !important;
    padding: 10px 18px !important;
    font-size: 14px !important;
    transition: all 0.2s ease !important;
    box-shadow: var(--shadow-sm) !important;
    border: 1px solid transparent !important;
}

.btn-primary {
    background-color: var(--accent-primary) !important;
    color: var(--accent-text) !important;
    border-color: var(--accent-primary) !important;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-secondary, .btn-outline-secondary {
    background-color: var(--bg-main) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

.btn-secondary:hover, .btn-outline-secondary:hover {
    background-color: var(--border-color) !important;
}

/* Tables */
.table {
    color: var(--text-main) !important;
    margin-bottom: 0;
}

.table th {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted) !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-top: none !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 16px !important;
    background: transparent !important;
}

.table td {
    padding: 16px !important;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color) !important;
    border-top: none !important;
}

.table-hover tbody tr:hover {
    background-color: var(--bg-main) !important;
}

/* Alerts */
.alert {
    border-radius: 8px !important;
    border: 1px solid var(--border-color) !important;
    background: var(--bg-card) !important;
    color: var(--text-main) !important;
    box-shadow: var(--shadow-sm);
}

/* Dashboard Metric Cards */
.metric-card {
    padding: 24px;
}
.metric-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 20px;
    color: var(--text-main);
    margin-right: 16px;
}

/* POS Specific UI */
.pos-product-card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    color: var(--text-main) !important;
}
.pos-product-card:hover {
    border-color: var(--text-main) !important;
}
.pos-product-title, .pos-product-price {
    color: var(--text-main) !important;
}
.receipt-card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    color: var(--text-main) !important;
}
.receipt-header {
    background: var(--bg-main) !important;
    border-bottom: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
}
.receipt-item {
    border-bottom: 1px solid var(--border-color) !important;
}
.receipt-item-title, .receipt-item-price, .receipt-total-row {
    color: var(--text-main) !important;
}
.receipt-footer {
    background: var(--bg-main) !important;
    border-top: 1px solid var(--border-color) !important;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Responsive Layout */
@media (max-width: 991.98px) {
    #mobile-menu-toggle {
        display: block !important;
    }
    .wp-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 4px 0 15px rgba(0,0,0,0.2);
    }
    .wp-sidebar.sidebar-open {
        transform: translateX(0);
    }
    .wp-main {
        margin-left: 0 !important;
        padding: 20px !important;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: var(--topbar-height); 
        left: 0; 
        width: 100%; 
        height: calc(100vh - var(--topbar-height));
        background: rgba(0,0,0,0.5);
        z-index: 9997;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        backdrop-filter: blur(2px);
    }
    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    .wp-topbar {
        padding: 0 15px;
    }
    .wp-topbar .site-name {
        font-size: 18px;
    }
    .wp-topbar .user-info {
        gap: 15px;
        font-size: 13px;
    }
    .wp-topbar .user-info > span {
        display: none; /* Hide 'Howdy, user' on mobile */
    }
    
    .table-responsive, table.table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table.table th, table.table td {
        white-space: nowrap; /* Prevent squishing data on small screens */
    }
}
@media (max-width: 575.98px) {
    .wp-main {
        padding: 15px !important;
    }
    .view-store-btn {
        display: none !important; 
    }
}
