/* ==============================================================================
   NEW M.S TYRE TRADERS — ULTRA-CLEAN MODERN ERP DESIGN SYSTEM
   ============================================================================== */

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

:root {
    --bg-main: #0B0F17;
    --bg-surface: #111827;
    --bg-card: #162032;
    --bg-card-hover: #1E293B;
    --bg-elevated: #1E293B;
    --border-color: #26334D;
    --border-subtle: #1E293B;
    --border-focus: #3B82F6;
    
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    
    /* Brand Accent Colors */
    --brand-orange: #FF6600;
    --brand-orange-hover: #EA580C;
    --brand-orange-glow: rgba(255, 102, 0, 0.25);
    --maxxis-orange: #FF6600;
    --ceat-blue: #0056B3;
    --ceat-accent: #0284C7;
    
    --primary: #3B82F6;
    --primary-hover: #2563EB;
    --primary-glow: rgba(59, 130, 246, 0.2);
    --primary-bg: rgba(59, 130, 246, 0.1);
    
    --success: #10B981;
    --success-hover: #059669;
    --success-bg: rgba(16, 185, 129, 0.12);
    
    --warning: #F59E0B;
    --warning-bg: rgba(245, 158, 11, 0.12);
    
    --danger: #EF4444;
    --danger-bg: rgba(239, 68, 68, 0.12);
    
    --purple: #8B5CF6;
    --purple-bg: rgba(139, 92, 246, 0.12);
    
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 25px rgba(59, 130, 246, 0.15);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 270px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}

.brand-header {
    padding: 22px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo-badge {
    background: linear-gradient(135deg, var(--brand-orange), #EA580C);
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 16px;
    color: #fff;
    box-shadow: 0 4px 15px var(--brand-orange-glow);
    letter-spacing: -0.5px;
}

.brand-title {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.4px;
    color: #fff;
}

.brand-subtitle {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sidebar-nav::-webkit-scrollbar {
    width: 5px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}

.nav-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.8px;
    padding: 14px 12px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid transparent;
}

.nav-item i {
    font-size: 15px;
    width: 20px;
    text-align: center;
    color: var(--text-muted);
    transition: var(--transition);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.nav-item:hover i {
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary-bg);
    color: #fff;
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: inset 3px 0 0 var(--primary);
}

.nav-item.active i {
    color: var(--primary);
}

.nav-badge {
    margin-left: auto;
    background: var(--brand-orange);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: var(--radius-full);
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: rgba(11, 15, 23, 0.5);
}

/* Main Content Area */
.main-wrapper {
    flex: 1;
    margin-left: 270px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-nav {
    height: 64px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 90;
    backdrop-filter: blur(12px);
}

.nav-controls-left, .nav-controls-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.branch-select-wrapper select,
.form-select,
.form-input {
    background: #0B0F17;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    outline: none;
    transition: var(--transition);
}

.branch-select-wrapper select:focus,
.form-select:focus,
.form-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.user-profile-badge:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
}

.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 12px;
    color: #fff;
}

.content-area {
    flex: 1;
    padding: 28px;
    background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.03), transparent 40%), var(--bg-main);
}

/* Typography & Headers */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Grids & Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

/* Modern Metric Cards Grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: var(--shadow-card);
}

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

.stat-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.stat-val {
    font-size: 24px;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: -0.5px;
    color: #fff;
    margin-bottom: 4px;
}

.stat-meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* Cards & Panels */
.card, .panel-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 22px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.card-header, .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-subtle);
}

.card-title, .panel-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Progress Bars */
.progress-bar-bg {
    background: rgba(255, 255, 255, 0.06);
    height: 8px;
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-top: 6px;
}

.progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

/* Activity Feed List Items */
.activity-feed-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.activity-item:hover {
    background: var(--bg-card-hover);
    border-color: rgba(59, 130, 246, 0.3);
}

.activity-item-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.activity-item-content {
    flex: 1;
}

.activity-item-title {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 2px;
}

.activity-item-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Quick Action Strip */
.quick-actions-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    align-items: center;
}

.quick-actions-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-right: 6px;
}

/* Clean Empty State Component */
.empty-state-box {
    text-align: center;
    padding: 42px 24px;
    background: rgba(11, 15, 23, 0.5);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    margin: 12px 0;
}

.empty-state-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.08);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin: 0 auto 14px;
}

.empty-state-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.empty-state-desc {
    font-size: 13px;
    color: var(--text-secondary);
    max-width: 440px;
    margin: 0 auto 16px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-sm);
}

table, .custom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th {
    background: var(--bg-card);
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    vertical-align: middle;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-primary {
    background: var(--primary-bg);
    color: var(--primary);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-purple {
    background: var(--purple-bg);
    color: var(--purple);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    transition: var(--transition);
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #fff;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), #1D4ED8);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: var(--success-hover);
}

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: var(--danger);
    color: #fff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-title {
    font-size: 17px;
    font-weight: 800;
    color: #fff;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: #fff;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: rgba(11, 15, 23, 0.5);
}

/* Monospace text */
.mono-font {
    font-family: 'JetBrains Mono', monospace;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 12px 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastSlide 0.3s ease;
}

@keyframes toastSlide {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 70px;
    }
    .brand-title, .brand-subtitle, .nav-item span, .nav-section-title, .sidebar-footer {
        display: none;
    }
    .main-wrapper {
        margin-left: 70px;
    }
}
