/**
 * DUKAXPERT - Main Stylesheet (Dynamic Theme Support)
 * Version: 2.0.0
 * Supports dynamic primary/secondary colors and dark mode
 */

/* ============================================ */
/* 1. CSS VARIABLES (DYNAMIC)                 */
/* ============================================ */

:root {
    --primary-color: #2c3e50;
    --primary-dark: #1a252f;
    --primary-light: #34495e;
    --secondary-color: #3498db;
    --secondary-dark: #2980b9;
    --secondary-light: #5faee3;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #17a2b8;
    --light-bg: #f4f6f9;
    --white: #ffffff;
    --dark: #2d3436;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --header-height: 60px;
    --footer-height: 60px;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    --box-shadow-lg: 0 5px 20px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Dynamic color variables - will be overridden by PHP settings */
body {
    --app-primary: var(--primary-color);
    --app-secondary: var(--secondary-color);
    --app-primary-dark: var(--primary-dark);
    --app-primary-light: var(--primary-light);
    --app-secondary-dark: var(--secondary-dark);
    --app-secondary-light: var(--secondary-light);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--light-bg);
    color: var(--gray-800);
    font-size: 14px;
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: var(--app-primary);
    transition: var(--transition);
}

a:hover {
    color: var(--app-secondary);
}

/* ============================================ */
/* 2. DARK MODE STYLES                        */
/* ============================================ */

body.dark-mode {
    --light-bg: #0f172a;
    --white: #1e293b;
    --gray-100: #1e293b;
    --gray-200: #334155;
    --gray-300: #475569;
    --gray-400: #64748b;
    --gray-500: #94a3b8;
    --gray-600: #cbd5e1;
    --gray-700: #e2e8f0;
    --gray-800: #f1f5f9;
    --gray-900: #f8fafc;
    --dark: #0f172a;
    background-color: var(--light-bg);
    color: var(--gray-700);
}

body.dark-mode .card,
body.dark-mode .stat-card,
body.dark-mode .chart-container,
body.dark-mode .navbar,
body.dark-mode .footer,
body.dark-mode .modal-content,
body.dark-mode .table,
body.dark-mode .sidebar {
    background-color: var(--white);
    border-color: var(--gray-200);
}

body.dark-mode .card-header,
body.dark-mode .modal-header,
body.dark-mode .modal-footer {
    background-color: var(--gray-100);
    border-color: var(--gray-200);
}

body.dark-mode .table th {
    background-color: var(--gray-100);
    color: var(--gray-700);
    border-color: var(--gray-300);
}

body.dark-mode .table td {
    border-color: var(--gray-200);
}

body.dark-mode .table tbody tr:hover {
    background-color: var(--gray-100);
}

body.dark-mode .form-control,
body.dark-mode .form-select {
    background-color: var(--gray-100);
    border-color: var(--gray-300);
    color: var(--gray-700);
}

body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus {
    background-color: var(--gray-100);
    border-color: var(--app-primary);
}

body.dark-mode .input-group-text {
    background-color: var(--gray-200);
    border-color: var(--gray-300);
    color: var(--gray-600);
}

body.dark-mode .alert-success {
    background-color: rgba(39, 174, 96, 0.2);
    color: #2ecc71;
    border: 1px solid rgba(39, 174, 96, 0.3);
}

body.dark-mode .alert-danger {
    background-color: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

body.dark-mode .alert-warning {
    background-color: rgba(243, 156, 18, 0.2);
    color: #f1c40f;
    border: 1px solid rgba(243, 156, 18, 0.3);
}

body.dark-mode .alert-info {
    background-color: rgba(23, 162, 184, 0.2);
    color: #3498db;
    border: 1px solid rgba(23, 162, 184, 0.3);
}

body.dark-mode .dropdown-menu {
    background-color: var(--white);
    border-color: var(--gray-200);
}

body.dark-mode .dropdown-item {
    color: var(--gray-700);
}

body.dark-mode .dropdown-item:hover {
    background-color: var(--gray-100);
}

body.dark-mode .text-muted {
    color: var(--gray-500) !important;
}

/* ============================================ */
/* 3. SIDEBAR STYLE VARIATIONS                */
/* ============================================ */

/* Light Sidebar */
body.sidebar-light .sidebar {
    background: var(--white);
    color: var(--gray-800);
    border-right: 1px solid var(--gray-200);
}

body.sidebar-light .sidebar-brand {
    color: var(--app-primary);
}

body.sidebar-light .sidebar-menu li a {
    color: var(--gray-600);
}

body.sidebar-light .sidebar-menu li a:hover {
    color: var(--app-primary);
    background: var(--gray-100);
}

body.sidebar-light .sidebar-menu li.active > a {
    color: var(--app-primary);
    background: rgba(44, 62, 80, 0.1);
    border-left-color: var(--app-primary);
}

body.sidebar-light .sidebar-divider {
    background: var(--gray-200);
}

body.sidebar-light .sidebar-footer {
    border-top-color: var(--gray-200);
}

/* Mini Sidebar */
body.sidebar-mini .sidebar {
    width: 70px;
}

body.sidebar-mini .sidebar .sidebar-brand span,
body.sidebar-mini .sidebar .sidebar-menu li a span,
body.sidebar-mini .sidebar .sidebar-footer small {
    display: none;
}

body.sidebar-mini .sidebar .sidebar-menu li a i {
    margin-right: 0;
    font-size: 20px;
}

body.sidebar-mini .sidebar .sidebar-menu li a {
    justify-content: center;
    padding: 15px;
}

body.sidebar-mini .sidebar .dropdown-toggle::after {
    display: none;
}

body.sidebar-mini .main-content {
    margin-left: 70px;
    width: calc(100% - 70px);
}

/* Collapsed Sidebar (Start collapsed) */
body.sidebar-collapsed .sidebar {
    margin-left: calc(-1 * var(--sidebar-width));
}

body.sidebar-collapsed .main-content {
    margin-left: 0;
    width: 100%;
}

/* ============================================ */
/* 4. HEADER STYLE VARIATIONS                 */
/* ============================================ */

/* Dark Header */
body.header-dark .navbar {
    background: var(--dark);
    border-bottom-color: var(--gray-700);
}

body.header-dark .navbar .btn-light {
    background: var(--gray-700);
    color: var(--white);
    border-color: var(--gray-600);
}

body.header-dark .navbar .page-title {
    color: var(--white);
}

body.header-dark .navbar .dropdown-toggle {
    color: var(--white);
}

/* Primary Header */
body.header-primary .navbar {
    background: var(--app-primary);
    border-bottom-color: var(--app-primary-dark);
}

body.header-primary .navbar .btn-light {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.3);
}

body.header-primary .navbar .page-title {
    color: var(--white);
}

body.header-primary .navbar .dropdown-toggle {
    color: var(--white);
}

body.header-primary .navbar .btn-light:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Transparent Header */
body.header-transparent .navbar {
    background: transparent;
    border-bottom: none;
    box-shadow: none;
}

/* ============================================ */
/* 5. AUTHENTICATION - SPLIT SCREEN LAYOUT     */
/* ============================================ */

.auth-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.auth-left {
    flex: 1;
    background: linear-gradient(135deg, var(--app-primary-dark) 0%, var(--app-primary) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.auth-left::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../images/pattern.png') repeat;
    opacity: 0.1;
}

.auth-left-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 500px;
}

.auth-logo {
    margin-bottom: 30px;
}

.auth-logo i {
    font-size: 60px;
    margin-bottom: 20px;
}

.auth-logo h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 10px;
}

.auth-logo p {
    font-size: 16px;
    opacity: 0.9;
}

.auth-features {
    margin-top: 50px;
    list-style: none;
}

.auth-features li {
    margin-bottom: 15px;
    font-size: 16px;
}

.auth-features li i {
    margin-right: 10px;
    color: var(--success-color);
}

.auth-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    background-color: var(--white);
}

.auth-form-container {
    width: 100%;
    max-width: 400px;
}

.auth-form-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-form-header h2 {
    font-size: 28px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 10px;
}

.auth-form-header p {
    color: var(--gray-600);
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form label {
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.auth-form .form-control {
    height: 45px;
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-300);
    padding: 10px 15px;
    font-size: 14px;
    transition: var(--transition);
}

.auth-form .form-control:focus {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
}

.auth-form .input-group-text {
    background-color: transparent;
    border-right: none;
}

.auth-form .input-group .form-control {
    border-left: none;
}

.auth-form .btn-primary {
    width: 100%;
    height: 45px;
    background-color: var(--app-primary);
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 16px;
    transition: var(--transition);
}

.auth-form .btn-primary:hover {
    background-color: var(--app-primary-dark);
    transform: translateY(-1px);
}

.auth-links {
    text-align: center;
    margin-top: 20px;
}

.auth-links a {
    color: var(--gray-600);
    font-size: 14px;
}

.auth-links a:hover {
    color: var(--app-primary);
}

.role-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.role-option {
    flex: 1;
    text-align: center;
    padding: 15px;
    border: 2px solid var(--gray-300);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.role-option.active {
    border-color: var(--app-primary);
    background-color: rgba(44, 62, 80, 0.05);
}

.role-option i {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--gray-600);
}

.role-option.active i {
    color: var(--app-primary);
}

.role-option span {
    display: block;
    font-weight: 500;
}

/* Auth Responsive */
@media (max-width: 768px) {
    .auth-container {
        flex-direction: column;
    }
    
    .auth-left {
        padding: 30px 20px;
        min-height: auto;
    }
    
    .auth-logo h1 {
        font-size: 28px;
    }
    
    .auth-features {
        display: none;
    }
    
    .auth-right {
        padding: 30px 20px;
    }
}

/* ============================================ */
/* 6. LAYOUT - WRAPPER & SIDEBAR               */
/* ============================================ */

.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--app-primary-dark);
    color: var(--white);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
    color: var(--white);
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.sidebar-brand i {
    font-size: 28px;
    margin-right: 10px;
    color: var(--app-secondary);
}

.sidebar-brand:hover {
    color: var(--white);
    opacity: 0.9;
}

.sidebar-close {
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 20px;
    cursor: pointer;
    display: none;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
}

.sidebar-menu::-webkit-scrollbar {
    width: 5px;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.sidebar-menu ul {
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    list-style: none;
    margin-bottom: 2px;
}

.sidebar-menu li a {
    color: rgba(255, 255, 255, 0.7);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    transition: var(--transition);
    position: relative;
}

.sidebar-menu li a i {
    width: 24px;
    margin-right: 12px;
    font-size: 16px;
    text-align: center;
}

.sidebar-menu li a span {
    flex: 1;
}

.sidebar-menu li a .badge {
    margin-left: 8px;
}

.sidebar-menu li a:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-menu li.active > a {
    color: var(--white);
    background: var(--app-primary);
    border-left: 4px solid var(--app-secondary);
}

.sidebar-menu .dropdown-toggle::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: auto;
    transition: var(--transition);
}

.sidebar-menu .dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

.sidebar-menu ul ul {
    background: rgba(0, 0, 0, 0.2);
    padding: 0;
}

.sidebar-menu ul ul li a {
    padding-left: 56px;
    font-size: 13px;
}

.sidebar-menu ul ul li a i {
    font-size: 14px;
}

.sidebar-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 15px 20px;
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    background-color: var(--light-bg);
}

/* Navbar */
.navbar {
    height: var(--header-height);
    padding: 0 20px;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 999;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-800);
}

/* Footer */
.footer {
    margin-top: auto;
    padding: 15px 20px;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    font-size: 13px;
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

/* Mobile Sidebar */
@media (max-width: 991px) {
    .sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }
    
    .sidebar.active {
        margin-left: 0;
    }
    
    .sidebar-close {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
}

/* ============================================ */
/* 7. DASHBOARD COMPONENTS                     */
/* ============================================ */

/* Stat Cards */
.stat-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    border: 1px solid var(--gray-200);
}

.stat-card:hover {
    box-shadow: var(--box-shadow-lg);
    transform: translateY(-2px);
}

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 15px;
}

.stat-card .stat-icon.primary {
    background: rgba(44, 62, 80, 0.1);
    color: var(--app-primary);
}

.stat-card .stat-icon.success {
    background: rgba(39, 174, 96, 0.1);
    color: var(--success-color);
}

.stat-card .stat-icon.warning {
    background: rgba(243, 156, 18, 0.1);
    color: var(--warning-color);
}

.stat-card .stat-icon.danger {
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger-color);
}

.stat-card .stat-icon.info {
    background: rgba(23, 162, 184, 0.1);
    color: var(--info-color);
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 5px;
}

.stat-card .stat-label {
    color: var(--gray-600);
    font-size: 14px;
}

.stat-card .stat-change {
    margin-top: 10px;
    font-size: 13px;
}

.stat-change.positive {
    color: var(--success-color);
}

.stat-change.negative {
    color: var(--danger-color);
}

/* Chart Container */
.chart-container {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--box-shadow);
    border: 1px solid var(--gray-200);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
}

/* Recent Orders Table */
.recent-orders {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--box-shadow);
    border: 1px solid var(--gray-200);
}

/* ============================================ */
/* 8. POINT OF SALE (POS) STYLES              */
/* ============================================ */

.pos-container {
    display: flex;
    gap: 20px;
    height: calc(100vh - var(--header-height) - 100px);
}

.pos-products {
    flex: 2;
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--box-shadow);
    overflow-y: auto;
}

.pos-cart {
    flex: 1;
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
}

.product-card {
    background: var(--gray-100);
    border-radius: var(--border-radius);
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.product-card:hover {
    border-color: var(--app-primary);
    background: var(--white);
    box-shadow: var(--box-shadow);
}

.product-card img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    margin-bottom: 10px;
}

.product-card h6 {
    font-size: 14px;
    margin-bottom: 5px;
}

.product-card .price {
    font-weight: 600;
    color: var(--app-primary);
}

.product-card .stock {
    font-size: 12px;
    color: var(--gray-600);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-200);
}

.cart-item-info h6 {
    font-size: 14px;
    margin-bottom: 3px;
}

.cart-item-info .price {
    font-size: 13px;
    color: var(--gray-600);
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-item-actions .quantity {
    width: 50px;
    text-align: center;
}

.cart-totals {
    border-top: 2px solid var(--gray-300);
    padding-top: 15px;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.cart-total-row.total {
    font-size: 18px;
    font-weight: 700;
    color: var(--app-primary);
}

/* POS Responsive */
@media (max-width: 992px) {
    .pos-container {
        flex-direction: column;
        height: auto;
    }
}

/* ============================================ */
/* 9. PRODUCT MANAGEMENT STYLES               */
/* ============================================ */

.product-form-container {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--box-shadow);
    max-width: 900px;
    margin: 0 auto;
}

.product-image-upload {
    border: 2px dashed var(--gray-300);
    border-radius: var(--border-radius);
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.product-image-upload:hover {
    border-color: var(--app-primary);
    background: var(--gray-100);
}

.product-image-upload i {
    font-size: 48px;
    color: var(--gray-500);
    margin-bottom: 15px;
}

.product-image-preview {
    margin-top: 15px;
}

.product-image-preview img {
    max-width: 200px;
    max-height: 200px;
    object-fit: cover;
    border-radius: var(--border-radius);
}

.barcode-preview {
    margin-top: 15px;
    padding: 20px;
    background: var(--white);
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
    text-align: center;
}

.barcode-preview svg {
    max-width: 100%;
}

/* Stock Transfer */
.transfer-panel {
    display: flex;
    gap: 20px;
}

.transfer-source,
.transfer-destination {
    flex: 1;
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--box-shadow);
}

.transfer-arrow {
    display: flex;
    align-items: center;
    font-size: 24px;
    color: var(--app-primary);
}

/* ============================================ */
/* 10. TABLES STYLES                          */
/* ============================================ */

.table-container {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--box-shadow);
}

.table {
    margin-bottom: 0;
}

.table th {
    background: var(--gray-100);
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-300);
    padding: 12px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 12px;
    vertical-align: middle;
    border-bottom: 1px solid var(--gray-200);
}

.table tbody tr:hover {
    background: var(--gray-100);
}

/* Status Badges */
.status-badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-confirmed {
    background: #cce5ff;
    color: #004085;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

.status-delivered {
    background: #d1e7dd;
    color: #0f5132;
}

.status-paid {
    background: #d4edda;
    color: #155724;
}

/* ============================================ */
/* 11. FORMS & INPUTS                         */
/* ============================================ */

.form-section {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--box-shadow);
}

.form-section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--gray-200);
}

.form-label {
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.form-label .required {
    color: var(--danger-color);
    margin-left: 3px;
}

.form-control,
.form-select {
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    padding: 10px 15px;
    font-size: 14px;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--danger-color);
}

.invalid-feedback {
    font-size: 12px;
    margin-top: 5px;
}

/* Input Groups */
.input-group-text {
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    color: var(--gray-600);
}

/* ============================================ */
/* 12. BUTTONS                                */
/* ============================================ */

.btn {
    padding: 10px 20px;
    border-radius: var(--border-radius);
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition);
    border: none;
}

.btn i {
    margin-right: 8px;
}

.btn-primary {
    background: var(--app-primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--app-primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--app-secondary);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--app-secondary-dark);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success-color);
    color: var(--white);
}

.btn-success:hover {
    background: #219a52;
}

.btn-danger {
    background: var(--danger-color);
    color: var(--white);
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-warning {
    background: var(--warning-color);
    color: var(--white);
}

.btn-warning:hover {
    background: #e08e0b;
}

.btn-info {
    background: var(--info-color);
    color: var(--white);
}

.btn-info:hover {
    background: #138496;
}

.btn-outline-primary {
    border: 1px solid var(--app-primary);
    color: var(--app-primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--app-primary);
    color: var(--white);
}

.btn-outline-secondary {
    border: 1px solid var(--app-secondary);
    color: var(--app-secondary);
    background: transparent;
}

.btn-outline-secondary:hover {
    background: var(--app-secondary);
    color: var(--white);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

/* Action Buttons Group */
.action-buttons {
    display: flex;
    gap: 5px;
}

.action-buttons .btn {
    padding: 5px 10px;
}

/* ============================================ */
/* 13. CARDS & WIDGETS                        */
/* ============================================ */

.card {
    background: var(--white);
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--gray-200);
    padding: 15px 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 20px;
}

.card-footer {
    background: var(--gray-100);
    border-top: 1px solid var(--gray-200);
    padding: 15px 20px;
}

/* Info Widget */
.info-widget {
    display: flex;
    align-items: center;
    padding: 15px;
    background: var(--white);
    border-radius: var(--border-radius);
    margin-bottom: 15px;
}

.info-widget-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 20px;
}

.info-widget-content h6 {
    font-size: 14px;
    color: var(--gray-600);
    margin-bottom: 5px;
}

.info-widget-content h4 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 0;
}

/* ============================================ */
/* 14. MODALS                                 */
/* ============================================ */

.modal-content {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--box-shadow-lg);
}

.modal-header {
    background: var(--gray-100);
    border-bottom: 1px solid var(--gray-200);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    padding: 15px 20px;
}

.modal-title {
    font-weight: 600;
    font-size: 18px;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    background: var(--gray-100);
    border-top: 1px solid var(--gray-200);
    padding: 15px 20px;
}

/* ============================================ */
/* 15. NOTIFICATIONS & ALERTS                 */
/* ============================================ */

.alert {
    border-radius: var(--border-radius);
    padding: 15px 20px;
    margin-bottom: 20px;
    border: none;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
}

.alert-info {
    background: #cce5ff;
    color: #004085;
}

/* Notification Dropdown */
.notification-menu {
    max-height: 500px;
}

.notification-item {
    cursor: pointer;
    transition: var(--transition);
}

.notification-item:hover {
    background: var(--gray-100);
}

.notification-item.unread {
    background: rgba(52, 152, 219, 0.05);
    border-left: 3px solid var(--app-secondary);
}

/* ============================================ */
/* 16. MARKETPLACE STYLES                     */
/* ============================================ */

.marketplace-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.marketplace-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    cursor: pointer;
}

.marketplace-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-lg);
}

.marketplace-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.marketplace-card-body {
    padding: 15px;
}

.marketplace-card-body h6 {
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 600;
}

.marketplace-card-body .price {
    font-size: 18px;
    font-weight: 700;
    color: var(--app-primary);
}

.marketplace-card-body .seller {
    font-size: 12px;
    color: var(--gray-600);
    margin-top: 5px;
}

/* ============================================ */
/* 17. REPORTS & ANALYTICS                    */
/* ============================================ */

.report-filters {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--box-shadow);
}

.report-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.report-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--box-shadow);
    text-align: center;
}

.report-card .label {
    color: var(--gray-600);
    font-size: 14px;
    margin-bottom: 10px;
}

.report-card .value {
    font-size: 28px;
    font-weight: 700;
    color: var(--app-primary);
}

/* ============================================ */
/* 18. UTILITIES                              */
/* ============================================ */

/* Spacing */
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }
.p-10 { padding: 10px; }
.p-20 { padding: 20px; }
.p-30 { padding: 30px; }

/* Text */
.text-primary { color: var(--app-primary) !important; }
.text-secondary { color: var(--app-secondary) !important; }
.text-success { color: var(--success-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-info { color: var(--info-color) !important; }
.text-muted { color: var(--gray-600) !important; }

/* Backgrounds */
.bg-primary { background: var(--app-primary) !important; }
.bg-secondary { background: var(--app-secondary) !important; }
.bg-success { background: var(--success-color) !important; }
.bg-danger { background: var(--danger-color) !important; }
.bg-warning { background: var(--warning-color) !important; }
.bg-info { background: var(--info-color) !important; }
.bg-light { background: var(--light-bg) !important; }

/* Borders */
.border-primary { border-color: var(--app-primary) !important; }
.border-secondary { border-color: var(--app-secondary) !important; }
.border-success { border-color: var(--success-color) !important; }
.border-danger { border-color: var(--danger-color) !important; }

/* Cursor */
.cursor-pointer { cursor: pointer; }

/* Display */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }

/* Flex Utilities */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

/* ============================================ */
/* 19. LOADING & SKELETON                     */
/* ============================================ */

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--gray-300);
    border-top-color: var(--app-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-300) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--border-radius);
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================ */
/* 20. PRINT STYLES (INVOICES)                */
/* ============================================ */

@media print {
    .sidebar,
    .navbar,
    .footer,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .invoice-print {
        padding: 20px;
    }
}

.invoice-container {
    background: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    max-width: 800px;
    margin: 0 auto;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--gray-300);
}

.invoice-logo h2 {
    font-weight: 700;
    color: var(--app-primary);
}

.invoice-details {
    text-align: right;
}

.invoice-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 20px;
}

.invoice-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}

.invoice-table {
    width: 100%;
    margin-bottom: 30px;
}

.invoice-table th {
    background: var(--gray-100);
    padding: 10px;
    border-bottom: 2px solid var(--gray-300);
}

.invoice-table td {
    padding: 10px;
    border-bottom: 1px solid var(--gray-200);
}

.invoice-totals {
    text-align: right;
    margin-top: 20px;
}

.invoice-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-300);
    text-align: center;
    color: var(--gray-600);
}

/* ============================================ */
/* 21. ROLE-SPECIFIC STYLES                   */
/* ============================================ */

.admin-only,
.seller-only,
.delivery-only,
.superadmin-only {
    display: none;
}

body[data-role="superadmin"] .superadmin-only { display: block; }
body[data-role="admin"] .admin-only { display: block; }
body[data-role="seller"] .seller-only { display: block; }
body[data-role="delivery"] .delivery-only { display: block; }

/* ============================================ */
/* 22. LIMIT WARNINGS                         */
/* ============================================ */

.limit-warning {
    background: #fff3cd;
    border-left: 4px solid var(--warning-color);
    padding: 15px;
    margin-bottom: 20px;
    border-radius: var(--border-radius);
}

.limit-warning i {
    color: var(--warning-color);
    margin-right: 10px;
}

.limit-exceeded {
    background: #f8d7da;
    border-left: 4px solid var(--danger-color);
    padding: 15px;
    margin-bottom: 20px;
    border-radius: var(--border-radius);
}

.limit-exceeded i {
    color: var(--danger-color);
    margin-right: 10px;
}

/* Progress Bar for Limits */
.limit-progress {
    margin-top: 10px;
}

.limit-progress .progress {
    height: 8px;
    border-radius: 4px;
}

.limit-progress .progress-bar {
    background: var(--app-primary);
}

.limit-progress .progress-bar.warning {
    background: var(--warning-color);
}

.limit-progress .progress-bar.danger {
    background: var(--danger-color);
}

.limit-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 5px;
}