/* Maktaba - Modern POS System Styles */
:root {
    /* New Modern Color Palette */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --accent: #f59e0b;
    --accent-light: #fef3c7;
    --success: #10b981;
    --success-light: #d1fae5;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;

    /* Neutral Colors */
    --bg-main: #f8f7f4;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;

    --gray-50: #fafaf9;
    --gray-100: #f5f5f4;
    --gray-200: #e7e5e4;
    --gray-300: #d6d3d1;
    --gray-400: #a8a29e;
    --gray-500: #78716c;
    --gray-600: #57534e;
    --gray-700: #44403c;
    --gray-800: #292524;
    --gray-900: #1c1917;

    /* Gradient Colors */
    --gradient-blue: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    --gradient-green: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-orange: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --gradient-purple: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    --gradient-red: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);

    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.05);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
    background: var(--bg-main);
    color: var(--gray-900);
    -webkit-font-smoothing: antialiased;
    overscroll-behavior: none;
    margin: 0;
    padding: 0;
}

input, select, textarea { direction: rtl; }

*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ===== LAYOUT ===== */
.app-container {
    display: flex;
    min-height: 100dvh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    border-left: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

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

@media (min-width: 1024px) {
    .sidebar {
        position: relative;
        transform: translateX(0);
    }
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 40;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--gray-100);
}

.sidebar-logo {
    font-size: 1.75rem;
    font-weight: 800;
    background: var(--gradient-blue);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-subtitle {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 4px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

.sidebar-section {
    padding: 20px 16px 10px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    color: var(--gray-600);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 4px;
    text-decoration: none;
    position: relative;
}

.sidebar-link:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.sidebar-link.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    right: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: var(--primary);
    border-radius: 3px 0 0 3px;
}

.sidebar-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
}

.sidebar-user {
    padding: 8px 12px;
    font-size: 0.85rem;
    color: var(--gray-600);
    font-weight: 500;
}

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--danger);
    font-size: 0.85rem;
    font-weight: 500;
    width: 100%;
    transition: all 0.2s ease;
    text-decoration: none;
}

.sidebar-logout:hover { background: var(--danger-light); }
.sidebar-logout svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    padding-bottom: calc(70px + var(--safe-area-bottom));
}

@media (min-width: 1024px) {
    .main-content { padding-bottom: 0; }
}

/* Top Header (Mobile) */
.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 30;
}

@media (min-width: 1024px) { .top-header { display: none; } }

.menu-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    color: var(--gray-600);
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.menu-btn:hover { background: var(--gray-100); }

.header-logo {
    font-size: 1.25rem;
    font-weight: 800;
    background: var(--gradient-blue);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Bottom Navigation (Mobile) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-around;
    padding: 8px 16px;
    padding-bottom: calc(8px + var(--safe-area-bottom));
    z-index: 30;
}

@media (min-width: 1024px) { .bottom-nav { display: none; } }

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border-radius: var(--radius);
    color: var(--gray-500);
    font-size: 0.7rem;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 60px;
    text-decoration: none;
}

.bottom-nav-item svg { width: 24px; height: 24px; }
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item.active svg { stroke-width: 2.5; }

/* Page Content */
.page-content {
    flex: 1;
    padding: 16px;
}

@media (min-width: 768px) { .page-content { padding: 24px; } }

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

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

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
}

.card-body { padding: 20px; }

/* ===== STAT CARDS (Gradient Style) ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (min-width: 768px) {
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.stat-card.gradient {
    color: white;
}

.stat-card.gradient.blue { background: var(--gradient-blue); }
.stat-card.gradient.green { background: var(--gradient-green); }
.stat-card.gradient.orange { background: var(--gradient-orange); }
.stat-card.gradient.purple { background: var(--gradient-purple); }

.stat-card .stat-icon {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card .stat-icon svg {
    width: 20px;
    height: 20px;
    color: white;
}

.stat-label {
    font-size: 0.8rem;
    opacity: 0.9;
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.stat-subtitle {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 8px;
}

.stat-card.primary .stat-value { color: var(--primary); }
.stat-card.success .stat-value { color: var(--success); }
.stat-card.danger .stat-value { color: var(--danger); }
.stat-card.warning .stat-value { color: var(--warning); }

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

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

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

.btn-accent {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.btn-accent:hover {
    background: #d97706;
    transform: translateY(-1px);
}

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

.btn-danger:hover { background: #dc2626; }

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover { background: var(--gray-200); }

.btn-outline {
    background: transparent;
    border: 2px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    border-color: var(--gray-400);
    background: var(--gray-50);
}

.btn-sm { padding: 8px 14px; font-size: 0.8rem; min-height: 36px; }
.btn-lg { padding: 16px 28px; font-size: 1rem; min-height: 52px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }

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

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all 0.2s ease;
    background: var(--bg-card);
    min-height: 48px;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    outline: none;
}

.form-input::placeholder { color: var(--gray-400); }
.form-error { font-size: 0.75rem; color: var(--danger); margin-top: 6px; }

/* ===== TABLES ===== */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table th {
    text-align: right;
    padding: 14px 16px;
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-600);
    white-space: nowrap;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-100);
}

.data-table tbody tr:hover { background: var(--gray-50); }
.data-table .highlight-low { background: var(--warning-light); }
.data-table .highlight-negative { background: var(--danger-light); }

/* Mobile Cards */
.mobile-cards { display: block; }
@media (min-width: 768px) { .mobile-cards { display: none; } }

.desktop-table { display: none; }
@media (min-width: 768px) { .desktop-table { display: block; } }

.mobile-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

.mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 12px;
}

.mobile-card-title { font-weight: 600; color: var(--gray-900); }

.mobile-card-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--gray-100);
}

.mobile-card-row:last-of-type { border-bottom: none; }
.mobile-card-label { color: var(--gray-500); }
.mobile-card-value { font-weight: 500; }

.mobile-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-100);
}

/* ===== ALERTS ===== */
.alert {
    padding: 14px 16px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert svg { width: 20px; height: 20px; flex-shrink: 0; }
.alert-success { background: var(--success-light); color: #065f46; }
.alert-danger, .alert-error { background: var(--danger-light); color: #991b1b; }
.alert-warning { background: var(--warning-light); color: #92400e; }
.alert-info { background: var(--primary-light); color: #1e40af; }

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

@media (min-width: 640px) {
    .page-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.page-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gray-900);
    margin: 0;
}

@media (min-width: 768px) { .page-title { font-size: 1.75rem; } }

.page-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Search Box */
.search-box {
    position: relative;
    flex: 1;
}

.search-box input {
    width: 100%;
    padding: 12px 16px;
    padding-right: 44px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    background: var(--bg-card);
    transition: all 0.2s ease;
}

.search-box input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.search-box svg {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--gray-400);
}

/* ===== BADGE ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: var(--success-light); color: #065f46; }
.badge-danger { background: var(--danger-light); color: #991b1b; }
.badge-warning { background: var(--warning-light); color: #92400e; }
.badge-primary { background: var(--primary-light); color: #1e40af; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* ===== CATEGORY TABS ===== */
.category-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.category-tab {
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 500;
    background: var(--bg-card);
    color: var(--gray-600);
    border: 1px solid var(--gray-200);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.category-tab:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
}

.category-tab.active {
    background: var(--gray-900);
    color: white;
    border-color: var(--gray-900);
}

.category-tab .count {
    background: rgba(0,0,0,0.1);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
}

.category-tab.active .count {
    background: rgba(255,255,255,0.2);
}

/* ===== PRODUCT GRID ===== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (min-width: 640px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
    .product-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1400px) {
    .product-grid { grid-template-columns: repeat(5, 1fr); }
}

.product-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.product-card:active {
    transform: scale(0.98);
}

.product-card.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.product-card-image {
    aspect-ratio: 1;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
}

.product-card-image svg {
    width: 48px;
    height: 48px;
    color: var(--gray-300);
}

.product-card-image .expand-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,0.9);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.product-card:hover .expand-btn { opacity: 1; }

.product-card-body {
    padding: 14px;
}

.product-card-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gray-900);
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.product-card-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
}

.product-card-add {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.product-card-add:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.product-card-add svg {
    width: 18px;
    height: 18px;
}

.product-card-stock {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 4px;
}

.product-card-stock.low { color: var(--warning); }
.product-card-stock.out { color: var(--danger); }

/* ===== ORDER PANEL ===== */
.order-panel {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

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

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

.order-panel-title svg {
    width: 20px;
    height: 20px;
}

.order-panel-actions {
    display: flex;
    gap: 8px;
}

.order-panel-reset {
    padding: 8px 14px;
    background: var(--gray-100);
    color: var(--gray-600);
    border: none;
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.order-panel-reset:hover { background: var(--gray-200); }

.order-items {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
}

.order-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 10px;
}

.order-item-image {
    width: 56px;
    height: 56px;
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.order-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

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

.order-item-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.order-item-meta {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.order-item-price {
    font-weight: 600;
    color: var(--gray-900);
    margin-top: 4px;
}

.order-item-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-item-qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--gray-300);
    background: var(--bg-card);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.order-item-qty-btn:hover { background: var(--gray-100); }

.order-item-qty {
    width: 32px;
    text-align: center;
    font-weight: 600;
}

.order-item-delete {
    width: 32px;
    height: 32px;
    background: var(--danger-light);
    color: var(--danger);
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.order-item-delete:hover {
    background: var(--danger);
    color: white;
}

.order-summary {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
}

.order-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.9rem;
}

.order-summary-row.total {
    font-size: 1.1rem;
    font-weight: 700;
    padding-top: 12px;
    margin-top: 8px;
    border-top: 2px solid var(--gray-200);
}

.order-actions {
    padding: 16px 20px;
    display: flex;
    gap: 12px;
}

.order-actions .btn { flex: 1; }

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-400);
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    opacity: 0.4;
}

.empty-state-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 8px;
}

/* ===== LOGIN PAGE ===== */
.login-container {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-main);
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-blue);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.login-subtitle {
    color: var(--gray-500);
    font-size: 0.9rem;
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 16px;
}

@media (min-width: 768px) {
    .grid-2 { grid-template-columns: repeat(2, 1fr); }
}

/* Print Styles */
@media print {
    .sidebar, .bottom-nav, .top-header, .fab, .no-print {
        display: none !important;
    }
    .main-content { margin: 0 !important; padding: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd; }
}

/* ===== UTILITIES ===== */
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--gray-500); }

.bg-success-light { background: var(--success-light); }
.bg-danger-light { background: var(--danger-light); }
.bg-warning-light { background: var(--warning-light); }

.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

.p-3 { padding: 12px; }
.p-4 { padding: 16px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.w-full { width: 100%; }
.flex-1 { flex: 1; }
.hidden { display: none !important; }

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }

.text-center { text-align: center; }
.text-right { text-align: right; }

.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }

.shadow { box-shadow: var(--shadow); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.overflow-x-auto { overflow-x: auto; }
.whitespace-nowrap { white-space: nowrap; }

.link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.link:hover { text-decoration: underline; }
.link-danger { color: var(--danger); }

/* FAB */
.fab {
    position: fixed;
    bottom: calc(90px + var(--safe-area-bottom));
    left: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gradient-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    z-index: 20;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.fab:hover { transform: scale(1.05); }
.fab svg { width: 24px; height: 24px; }

@media (min-width: 1024px) { .fab { bottom: 24px; } }

/* ===== MODERN LIST STYLES ===== */
.list-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 16px;
}

.list-page-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 4px 0;
}

.list-page-title p {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0;
}

.list-page-actions {
    display: flex;
    gap: 12px;
}

.btn-export {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.btn-export:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.btn-export svg { width: 18px; height: 18px; }

.btn-add-new {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.25);
}

.btn-add-new:hover {
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35);
    transform: translateY(-1px);
}

.btn-add-new svg { width: 18px; height: 18px; }

/* List Tabs */
.list-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 0;
}

.list-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    transition: color 0.15s;
    text-decoration: none;
}

.list-tab:hover { color: #374151; }

.list-tab.active { color: #8b5cf6; }

.list-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: #8b5cf6;
    border-radius: 2px 2px 0 0;
}

.list-tab-count {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: #f3f4f6;
    color: #6b7280;
}

.list-tab.active .list-tab-count {
    background: #ede9fe;
    color: #8b5cf6;
}

/* List Filters */
.list-filters {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.list-search {
    position: relative;
    width: 300px;
    max-width: 100%;
}

.list-search input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    background: white;
    color: #374151;
    transition: all 0.15s;
}

.list-search input::placeholder { color: #9ca3af; }

.list-search input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.list-search svg {
    position: absolute;
    right: auto;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #9ca3af;
}

.list-filter-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-filter:hover { background: #f9fafb; }
.btn-filter svg { width: 18px; height: 18px; }

/* Modern Table */
.list-table-wrapper {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

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

.list-table th {
    text-align: right;
    padding: 14px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.list-table td {
    padding: 16px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.875rem;
    color: #374151;
    vertical-align: middle;
}

.list-table tbody tr:last-child td { border-bottom: none; }
.list-table tbody tr:hover { background: #fafafb; }

/* Cell with avatar */
.cell-with-avatar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cell-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.cell-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cell-avatar svg {
    width: 20px;
    height: 20px;
    color: #9ca3af;
}

.cell-avatar.user {
    border-radius: 50%;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

.cell-avatar.user svg { color: #3b82f6; }

.cell-info h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 2px 0;
}

.cell-info span {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Tags */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.tag-purple { background: #ede9fe; color: #7c3aed; }
.tag-blue { background: #dbeafe; color: #2563eb; }
.tag-green { background: #d1fae5; color: #059669; }
.tag-yellow { background: #fef3c7; color: #d97706; }
.tag-red { background: #fee2e2; color: #dc2626; }
.tag-gray { background: #f3f4f6; color: #6b7280; }

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-badge.success { background: #d1fae5; color: #059669; }
.status-badge.warning { background: #fef3c7; color: #d97706; }
.status-badge.danger { background: #fee2e2; color: #dc2626; }
.status-badge.info { background: #dbeafe; color: #2563eb; }

/* Price cell */
.cell-price {
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
}

/* Action icons */
.cell-actions {
    display: flex;
    gap: 6px;
}

.action-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.15s;
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
}

.action-icon:hover { background: #f3f4f6; color: #374151; }
.action-icon.view:hover { background: #dbeafe; color: #2563eb; }
.action-icon.edit:hover { background: #ede9fe; color: #7c3aed; }
.action-icon.delete:hover { background: #fee2e2; color: #dc2626; }
.action-icon.print:hover { background: #d1fae5; color: #059669; }
.action-icon svg { width: 18px; height: 18px; }

/* Pagination */
.list-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
}

.pagination-info {
    font-size: 0.875rem;
    color: #6b7280;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: white;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    gap: 6px;
    padding: 0 12px;
}

.page-btn:hover { background: #f9fafb; border-color: #d1d5db; }
.page-btn.active { background: #8b5cf6; border-color: #8b5cf6; color: white; }
.page-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.page-btn svg { width: 16px; height: 16px; }

/* Empty state */
.list-empty {
    text-align: center;
    padding: 60px 20px;
}

.list-empty svg {
    width: 64px;
    height: 64px;
    color: #d1d5db;
    margin-bottom: 16px;
}

.list-empty h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 8px 0;
}

.list-empty p {
    color: #6b7280;
    margin: 0 0 20px 0;
}

/* Date filters inline */
.date-filters {
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-filter-group label {
    font-size: 0.8rem;
    color: #6b7280;
}

.date-filter-group input {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.85rem;
}

.date-filter-group input:focus {
    outline: none;
    border-color: #8b5cf6;
}

/* Responsive */
@media (max-width: 768px) {
    .list-page-header { flex-direction: column; align-items: flex-start; }
    .list-page-actions { width: 100%; }
    .btn-export { display: none; }
    .btn-add-new { flex: 1; justify-content: center; }
    .list-filters { flex-direction: column; align-items: stretch; }
    .list-search { width: 100%; }
    .list-filter-actions { width: 100%; }
    .list-table-wrapper { overflow-x: auto; }
    .list-table { min-width: 600px; }
}

/* ===== MODERN FORM STYLES ===== */
.form-page {
    max-width: 640px;
    margin: 0 auto;
}

.form-page.wide {
    max-width: 900px;
}

.form-page-header {
    margin-bottom: 24px;
}

.form-page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 4px 0;
}

.form-page-header p {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

.form-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
}

.form-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f3f4f6;
    background: #fafafa;
}

.form-card-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-card-header h2 svg {
    width: 20px;
    height: 20px;
    color: #8b5cf6;
}

.form-card-body {
    padding: 24px;
}

.form-section {
    margin-bottom: 24px;
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f3f4f6;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-row.two-cols {
    grid-template-columns: repeat(2, 1fr);
}

.form-row.three-cols {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 640px) {
    .form-row.two-cols,
    .form-row.three-cols {
        grid-template-columns: 1fr;
    }
}

.form-field {
    margin-bottom: 20px;
}

.form-field:last-child {
    margin-bottom: 0;
}

.form-field-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.form-field-label .required {
    color: #ef4444;
    margin-right: 2px;
}

.form-field-hint {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 6px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.9375rem;
    color: #1f2937;
    background: #fafafa;
    transition: all 0.2s ease;
}

.form-control:hover {
    border-color: #d1d5db;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: #8b5cf6;
    background: white;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

.form-control::placeholder {
    color: #9ca3af;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3e%3c/path%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 12px center;
    background-size: 20px;
    padding-left: 40px;
}

.form-control.error {
    border-color: #ef4444;
    background: #fef2f2;
}

.form-control.error:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.form-field-error {
    font-size: 0.75rem;
    color: #ef4444;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-field-error svg {
    width: 14px;
    height: 14px;
}

/* Input with icon */
.form-input-icon {
    position: relative;
}

.form-input-icon .form-control {
    padding-right: 44px;
}

.form-input-icon svg {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #9ca3af;
    pointer-events: none;
}

/* Input with button */
.form-input-group {
    display: flex;
    gap: 10px;
}

.form-input-group .form-control {
    flex: 1;
}

.form-input-group .btn {
    flex-shrink: 0;
}

/* Checkbox / Toggle */
.form-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 12px 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    background: #fafafa;
    transition: all 0.2s;
}

.form-checkbox:hover {
    border-color: #d1d5db;
    background: white;
}

.form-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    accent-color: #8b5cf6;
}

.form-checkbox-label {
    font-size: 0.9375rem;
    color: #374151;
    font-weight: 500;
}

/* Image upload */
.form-image-upload {
    border: 2px dashed #e5e7eb;
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafafa;
}

.form-image-upload:hover {
    border-color: #8b5cf6;
    background: #faf5ff;
}

.form-image-upload svg {
    width: 48px;
    height: 48px;
    color: #c4b5fd;
    margin-bottom: 12px;
}

.form-image-upload-text {
    font-size: 0.9375rem;
    color: #374151;
    font-weight: 500;
    margin-bottom: 4px;
}

.form-image-upload-hint {
    font-size: 0.75rem;
    color: #9ca3af;
}

.form-image-preview {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-top: 16px;
}

.form-image-preview img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid #e5e7eb;
}

.form-image-preview-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Form card footer / actions */
.form-card-footer {
    padding: 20px 24px;
    border-top: 1px solid #f3f4f6;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.btn-form-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: white;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    color: #6b7280;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-form-cancel:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
}

.btn-form-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.25);
}

.btn-form-submit:hover {
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
    transform: translateY(-1px);
}

.btn-form-submit:active {
    transform: translateY(0);
}

.btn-form-submit svg {
    width: 18px;
    height: 18px;
}

/* Formset rows for purchase invoices etc */
.formset-row-modern {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 12px;
    align-items: end;
    padding: 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 12px;
}

.formset-row-modern:hover {
    background: #f3f4f6;
}

.formset-row-modern .form-field {
    margin-bottom: 0;
}

.formset-row-modern .form-field-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 6px;
}

.formset-row-modern .form-control {
    padding: 10px 12px;
    font-size: 0.875rem;
}

.formset-delete-btn {
    padding: 10px 12px;
    background: #fee2e2;
    border: none;
    border-radius: 8px;
    color: #dc2626;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.formset-delete-btn:hover {
    background: #fecaca;
}

@media (max-width: 640px) {
    .formset-row-modern {
        grid-template-columns: 1fr;
    }
}

/* Alert inside form */
.form-alert {
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.875rem;
}

.form-alert svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.form-alert.info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.form-alert.warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.form-alert.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* ===== CUSTOM SELECT DROPDOWN ===== */
select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-color: #fff !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: left 12px center !important;
    background-size: 18px !important;
    padding: 10px 12px 10px 40px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    font-size: 0.9rem !important;
    color: #374151 !important;
    cursor: pointer !important;
    width: 100%;
    transition: border-color 0.15s, box-shadow 0.15s;
}

select:hover {
    border-color: #9ca3af !important;
}

select:focus {
    outline: none !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

select:disabled {
    background-color: #f3f4f6 !important;
    cursor: not-allowed !important;
    opacity: 0.7 !important;
}

/* Fix for Firefox */
select:-moz-focusring {
    color: transparent;
    text-shadow: 0 0 0 #374151;
}

/* Style the options */
select option {
    padding: 10px;
    background: white;
    color: #374151;
}

/* Custom dropdown wrapper for enhanced dropdowns */
.custom-select-wrapper {
    position: relative;
}

.custom-select {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.custom-select-trigger:hover {
    border-color: #9ca3af;
}

.custom-select.open .custom-select-trigger {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.custom-select-trigger span {
    flex: 1;
    text-align: right;
    color: #374151;
}

.custom-select-trigger span.placeholder {
    color: #9ca3af;
}

.custom-select-trigger svg {
    width: 18px;
    height: 18px;
    color: #6b7280;
    transition: transform 0.2s;
}

.custom-select.open .custom-select-trigger svg {
    transform: rotate(180deg);
}

.custom-select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.custom-select.open .custom-select-options {
    display: block;
    animation: dropdownFade 0.15s ease;
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.custom-select-search {
    padding: 8px 12px;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    background: white;
}

.custom-select-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.875rem;
}

.custom-select-search input:focus {
    outline: none;
    border-color: #3b82f6;
}

.custom-select-option {
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.1s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-select-option:hover {
    background: #f3f4f6;
}

.custom-select-option.selected {
    background: #eff6ff;
    color: #1d4ed8;
}

.custom-select-option img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
}

.custom-select-option-text {
    flex: 1;
}

.custom-select-option-text .main {
    font-weight: 500;
    color: #1f2937;
}

.custom-select-option-text .sub {
    font-size: 0.75rem;
    color: #6b7280;
}

.custom-select-empty {
    padding: 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 0.875rem;
}

/* ===== CUSTOM DROPDOWN (JavaScript-based) ===== */
.custom-dropdown {
    position: relative;
    width: 100%;
}

.custom-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    min-height: 42px;
}

.custom-dropdown-trigger:hover {
    border-color: #9ca3af;
}

.custom-dropdown.open .custom-dropdown-trigger {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.custom-dropdown-text {
    flex: 1;
    color: #374151;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-dropdown-arrow {
    color: #6b7280;
    display: flex;
    align-items: center;
    margin-right: 8px;
    transition: transform 0.2s;
}

.custom-dropdown.open .custom-dropdown-arrow {
    transform: rotate(180deg);
}

.custom-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.custom-dropdown.open .custom-dropdown-menu {
    display: block;
}

.custom-dropdown-item {
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 0.9rem;
    color: #374151;
}

.custom-dropdown-item:hover {
    background: #f3f4f6;
}

.custom-dropdown-item.selected {
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 500;
}

.custom-dropdown-item.placeholder {
    color: #9ca3af;
}
