/* Quantek Control Panel Styles */
/* Import Tajawal font for Arabic and Inter for English */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* CSS Variables for theme management */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --bg-color: #f8fafc;
    --bg-secondary: #ffffff;
    --text-color: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.2s ease-in-out;
}

/* Dark theme variables */
[data-theme="dark"] {
    --bg-color: #0f172a;
    --bg-secondary: #1e293b;
    --text-color: #f1f5f9;
    --text-secondary: #cbd5e1;
    --border-color: #334155;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.3), 0 1px 2px -1px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
}

/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: var(--transition);
}

/* Arabic font for RTL content */
[dir="rtl"] body,
.arabic {
    font-family: 'Tajawal', sans-serif;
}

/* Login Page Styles */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
}

.login-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 20px;
}

.language-switcher {
    position: absolute;
    top: -60px;
    right: 0;
    display: flex;
    gap: 10px;
}

[dir="rtl"] .language-switcher {
    right: auto;
    left: 0;
}

.language-switcher a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.1);
    transition: var(--transition);
    font-size: 14px;
}

.language-switcher a:hover,
.language-switcher a.active {
    background: rgba(255, 255, 255, 0.2);
}

.login-form {
    background: var(--bg-secondary);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.login-header h1 {
    color: var(--text-color);
    font-size: 24px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 16px;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-btn:hover {
    background: var(--primary-hover);
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
    padding: 12px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.demo-credentials {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-secondary);
}

/* Activity Logs Styling */
.activity-list {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border-radius: 50%;
    font-size: 14px;
}

.activity-description {
    font-size: 14px;
    color: var(--text-color);
    line-height: 1.4;
}

.activity-item small {
    font-size: 12px;
    color: #6c757d;
}

/* Dashboard Enhancements */
.dashboard {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: var(--transition);
    z-index: 1000;
}

[dir="rtl"] .sidebar {
    border-right: none;
    border-left: 1px solid var(--border-color);
    right: 0;
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.sidebar-header h1 {
    color: var(--text-color);
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

[dir="rtl"] .sidebar-nav a {
    border-left: none;
    border-right: 3px solid transparent;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

[dir="rtl"] .sidebar-nav a:hover,
[dir="rtl"] .sidebar-nav a.active {
    border-right-color: var(--primary-color);
}

.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 20px;
    transition: var(--transition);
}

[dir="rtl"] .main-content {
    margin-left: 0;
    margin-right: 280px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.header h1 {
    color: var(--text-color);
    font-size: 28px;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.theme-toggle,
.language-toggle {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 8px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-toggle:hover,
.language-toggle:hover {
    background: var(--primary-color);
    color: white;
}

.user-menu {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 8px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.user-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* Card Styles */
.card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: between;
    align-items: center;
}

.card-title {
    color: var(--text-color);
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.card-body {
    padding: 20px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.stat-icon.profit { background: var(--success-color); }
.stat-icon.sales { background: var(--primary-color); }
.stat-icon.expenses { background: var(--error-color); }
.stat-icon.orders { background: var(--warning-color); }
.stat-icon.capital { background: #6366f1; }
.stat-icon.liquidity { background: #06b6d4; }

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px;
    text-transform: uppercase;
}

.badge-primary {
    background: var(--primary-color);
    color: white;
}

.badge-danger {
    background: var(--error-color);
    color: white;
}

.badge-info {
    background: #06b6d4;
    color: white;
}

.badge-success {
    background: var(--success-color);
    color: white;
}

/* Table Styles */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
}

.table tr:hover {
    background: var(--bg-color);
}

.table .btn {
    padding: 4px 8px;
    font-size: 0.875rem;
    margin: 0 2px;
}

.stat-info h3 {
    color: var(--text-color);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

/* Form Styles */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 16px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.5;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-danger {
    background: var(--error-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

/* Table Styles */
.table-container {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

[dir="rtl"] .table th,
[dir="rtl"] .table td {
    text-align: right;
}

.table th {
    background: var(--bg-color);
    color: var(--text-color);
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    color: var(--text-color);
}

.table tbody tr:hover {
    background: rgba(37, 99, 235, 0.05);
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

.badge-info {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

/* Mobile Responsive */
.mobile-menu-btn {
    display: none;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 10px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 18px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        transform: translateX(-100%);
        position: fixed;
        z-index: 1001;
    }
    
    [dir="rtl"] .sidebar {
        transform: translateX(100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        margin-right: 0;
        padding: 15px;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .header-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .table {
        min-width: 600px;
    }
    
    .login-form {
        padding: 30px 20px;
    }
    
    .login-header h1 {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .login-container {
        margin: 10px;
    }
    
    .login-form {
        padding: 20px 15px;
    }
    
    .header {
        padding: 15px;
    }
    
    .main-content {
        padding: 10px;
    }
    
    .stat-card {
        padding: 20px;
        flex-direction: column;
        text-align: center;
    }
    
    .btn {
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.mb-0 { margin-bottom: 0; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }
.mt-0 { margin-top: 0; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-10 { gap: 10px; }
.gap-15 { gap: 15px; }
.gap-20 { gap: 20px; }

/* Chart Container */
.chart-container {
    position: relative;
    height: 300px;
    margin: 20px 0;
}

/* Loading Spinner */
.loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Print Styles */
@media print {
    .sidebar,
    .header-actions,
    .btn {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .card {
        break-inside: avoid;
    }
}

/* Supplier management styles */
.supplier-info-display {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 15px;
    font-size: 14px;
    min-height: 60px;
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.supplier-info-display i {
    margin-right: 8px;
    color: var(--primary-color);
    width: 16px;
}

.stat-icon.suppliers {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.stat-icon.active {
    background: linear-gradient(135deg, #d299c2 0%, #fef9d7 100%);
}

.stat-icon.inactive {
    background: linear-gradient(135deg, #89f7fe 0%, #66a6ff 100%);
}

/* VAT Summary Styles */
.items-summary {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 20px;
}

.summary-row {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.summary-row:last-child,
.total-row {
    border-bottom: none;
    border-top: 2px solid var(--primary-color);
    padding-top: 12px;
    margin-top: 8px;
    font-weight: bold;
}

.summary-row .d-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-row {
    background: var(--light-bg);
    margin: 0 -20px -20px -20px;
    padding: 15px 20px;
    border-radius: 0 0 var(--radius) var(--radius);
}

/* Company Settings Styles */
.company-preview {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 30px;
    background: var(--bg-color);
    margin-top: 20px;
}

.preview-header {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.preview-logo {
    flex-shrink: 0;
}

.company-logo-placeholder {
    width: 80px;
    height: 80px;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    line-height: 1.2;
}

.preview-info h3 {
    color: var(--text-color);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.preview-info p {
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.5;
}

.preview-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 15px 0;
}

.preview-contact span {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.preview-contact i {
    color: var(--primary-color);
    width: 16px;
}

.preview-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.preview-numbers small {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Form Row Styles for Settings */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* Error and Success Messages */
.success-message {
    background: #d1fae5;
    color: #065f46;
    padding: 12px 16px;
    border-radius: var(--radius);
    border-left: 4px solid var(--success-color);
    margin: 20px 0;
}

.error-message {
    background: #fef2f2;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: var(--radius);
    border-left: 4px solid var(--error-color);
    margin: 20px 0;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .preview-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .preview-contact,
    .preview-numbers {
        flex-direction: column;
        gap: 10px;
    }
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: var(--card-bg);
    margin: 5% auto;
    padding: 0;
    border: none;
    border-radius: 8px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-color);
}

.modal-body {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.modal-body pre {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    font-size: 13px;
    border: 1px solid #e9ecef;
}

.modal-body h4 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: var(--text-color);
}

.modal-body h4:first-child {
    margin-top: 0;
}

/* Pagination Styles */
.pagination-wrapper {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    gap: 5px;
}

/* Form Inline Styles */
.form-inline .form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: end;
}

.form-inline .form-group {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

.form-inline .form-group label {
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-color);
}

/* Table Code Styles */
table code {
    background-color: #f1f3f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    color: #d73a49;
}

/* Badge Color Variations */
.badge-success {
    background-color: var(--success-color);
    color: white;
}

.badge-warning {
    background-color: var(--warning-color);
    color: white;
}

.badge-info {
    background-color: var(--info-color);
    color: white;
}

/* PC Builder Styles */
.pc-builder-table {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.pc-components-table {
    margin: 0;
    border: none;
}

.pc-components-table th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    text-align: center;
    padding: 15px 10px;
    border: none;
    position: sticky;
    top: 0;
    z-index: 10;
}

.pc-components-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.component-col { width: 20%; min-width: 150px; }
.sku-col { width: 12%; min-width: 100px; }
.name-col { width: 25%; min-width: 180px; }
.price-col { width: 15%; min-width: 110px; }
.qty-col { width: 8%; min-width: 60px; }
.total-col { width: 15%; min-width: 110px; }
.actions-col { width: 5%; min-width: 80px; }

.component-info {
    text-align: left;
}

.component-category .badge {
    font-size: 0.75rem;
    margin-bottom: 5px;
}

.component-brand {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.sku-cell {
    text-align: center;
}

.sku-code {
    background: var(--bg-color);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
    border: 1px solid var(--border-color);
}

.name-cell {
    text-align: left;
}

.component-name {
    font-size: 0.95rem;
    line-height: 1.3;
    display: block;
    color: var(--text-color);
}

.price-cell, .total-cell {
    text-align: right;
    font-family: 'Inter', monospace;
}

.unit-price, .total-price {
    font-weight: 600;
    color: var(--text-color);
}

.qty-cell {
    text-align: center;
}

.quantity-badge {
    background: var(--primary-color);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.85rem;
}

.actions-cell {
    text-align: center;
}

.btn-remove {
    padding: 6px 8px;
    font-size: 0.8rem;
}

.btn-remove:hover {
    transform: scale(1.05);
}

.total-row th {
    background: var(--success-color) !important;
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
}

.total-label {
    text-align: right;
}

.total-amount {
    text-align: right;
    font-family: 'Inter', monospace;
}

.empty-row td {
    padding: 40px 20px;
}

.empty-state {
    text-align: center;
}

.empty-icon {
    font-size: 3rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0;
}

/* Component Selector */
.component-selector {
    background: var(--bg-color);
    padding: 20px;
    border-radius: var(--radius);
    border: 2px dashed var(--border-color);
    margin-bottom: 20px;
}

.component-selector h4 {
    margin-bottom: 15px;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.component-selector-grid {
    display: grid;
    grid-template-columns: 150px 2fr 1fr 120px 100px 120px 100px;
    gap: 15px;
    align-items: end;
}

.component-input, .price-input {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 10px 12px;
    font-size: 0.9rem;
    transition: var(--transition);
    width: 100%;
}

.component-input:focus, .price-input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.price-input {
    text-align: right;
    font-family: 'Inter', monospace;
    font-weight: 600;
}

/* Component Type Badges */
.component-type-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.component-type-badge[data-type="cpu"] { background: #ef4444; }
.component-type-badge[data-type="mb"] { background: #f97316; }
.component-type-badge[data-type="ram"] { background: #eab308; }
.component-type-badge[data-type="gpu"] { background: #22c55e; }
.component-type-badge[data-type="ssd"] { background: #06b6d4; }
.component-type-badge[data-type="hdd"] { background: #0ea5e9; }
.component-type-badge[data-type="psu"] { background: #8b5cf6; }
.component-type-badge[data-type="case"] { background: #6b7280; }
.component-type-badge[data-type="cooler"] { background: #14b8a6; }
.component-type-badge[data-type="fan"] { background: #84cc16; }
.component-type-badge[data-type="optical"] { background: #f59e0b; }
.component-type-badge[data-type="network"] { background: #3b82f6; }
.component-type-badge[data-type="sound"] { background: #ec4899; }
.component-type-badge[data-type="cable"] { background: #64748b; }
.component-type-badge[data-type="other"] { background: #374151; }

.component-select {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 10px 12px;
    font-size: 0.9rem;
    transition: var(--transition);
}

.component-select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.quantity-input {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 10px 12px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.price-display, .total-display {
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 10px 12px;
    text-align: right;
    font-weight: 600;
    font-family: 'Inter', monospace;
    color: var(--text-secondary);
}

.btn-add-component {
    padding: 10px 15px;
    font-weight: 600;
    border-radius: var(--radius);
    transition: var(--transition);
}

.btn-add-component:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-add-component:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.build-total {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
}

.build-total .total-amount {
    color: var(--success-color);
    font-size: 1.3rem;
    font-weight: 700;
}

/* Responsive Design for PC Builder */
@media (max-width: 768px) {
    .component-selector-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .pc-components-table th,
    .pc-components-table td {
        padding: 8px 5px;
        font-size: 0.85rem;
    }
    
    .component-col, .name-col {
        min-width: 120px;
    }
    
    .sku-col, .price-col, .total-col {
        min-width: 80px;
    }
    
    .component-brand {
        font-size: 0.75rem;
    }
    
    .component-name {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .pc-builder-table {
        font-size: 0.8rem;
    }
    
    .component-selector {
        padding: 15px;
    }
    
    .component-selector-grid {
        gap: 8px;
    }
}

/* PC Builder Profit and PDF Styles */
.build-total {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: right;
    min-width: 250px;
}

.cost-info, .profit-info, .selling-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.cost-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.profit-info {
    color: var(--success-color);
    font-weight: 500;
}

.selling-info {
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 600;
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
    margin-top: 4px;
}

.actions-info {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    justify-content: flex-end;
}

.form-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* PDF Button Styles */
.btn-pdf {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: var(--radius);
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition);
}

.btn-pdf:hover {
    background: #c82333;
    color: white;
    text-decoration: none;
}

.btn-pdf.admin {
    background: #17a2b8;
}

.btn-pdf.admin:hover {
    background: #138496;
}

/* Responsive build total */
@media (max-width: 768px) {
    .build-total {
        min-width: auto;
        width: 100%;
        margin-top: 15px;
    }
    
    .card-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .actions-info {
        justify-content: center;
    }
}

/* Print-specific styles for PDF */
@media print {
    .sidebar, .header, .no-print {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .pdf-container {
        max-width: none;
        margin: 0;
        padding: 0;
    }
}
