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

:root {
    --primary: #2874f0; /* Flipkart Blue */
    --primary-hover: #1c5cbd;
    --accent: #f39c12;
    --dark: #111827;
    --light-bg: #f4f5f8;
    --surface: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --sidebar-width: 260px;
}

body {
    background-color: var(--light-bg);
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    overflow-x: hidden;
}

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

/* Sidebar */
.app-sidebar {
    width: var(--sidebar-width);
    background-color: var(--surface);
    border-right: 1px solid var(--border);
    position: fixed;
    height: 100vh;
    z-index: 1040;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}
.sidebar-header {
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border);
}
.sidebar-brand {
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}
.sidebar-nav {
    flex-grow: 1;
    padding: 1.5rem 1rem;
    overflow-y: auto;
}
.nav-item {
    margin-bottom: 0.25rem;
}
.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}
.sidebar-link i {
    font-size: 1.25rem;
    margin-right: 12px;
}
.sidebar-link:hover {
    background-color: #f8fafc;
    color: var(--primary);
}
.sidebar-link.active {
    background-color: #eff6ff;
    color: var(--primary);
    font-weight: 600;
}

/* Main Content Area */
.app-main {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
}

/* Top Header */
.app-header {
    height: 70px;
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    color: var(--dark);
}
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}
.btn-logout {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}
.btn-logout:hover {
    color: #ef4444;
}
.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    background: none;
    border: none;
    color: var(--dark);
    padding: 0;
    cursor: pointer;
}

/* Content Area */
.app-content {
    padding: 2rem;
    flex-grow: 1;
}

/* Typography */
h1, h2, h3, h4, h5 {
    font-weight: 600;
    color: var(--dark);
    letter-spacing: -0.02em;
}
h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
    transition: all 0.2s ease;
}
.card-header {
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    color: var(--dark);
}
.card-body {
    padding: 1.5rem;
}

/* Buttons */
.btn {
    font-weight: 500;
    border-radius: 8px;
    padding: 0.6rem 1.25rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
}
.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline-primary:hover {
    background-color: var(--primary);
    color: white;
}

/* Forms */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #d1d5db;
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(40, 116, 240, 0.15);
}
.form-label {
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

/* Tables */
.table-responsive {
    border-radius: 8px;
    border: 1px solid var(--border);
    background: white;
}
.table {
    margin-bottom: 0;
}
.table th {
    background-color: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table td {
    padding: 1rem 1.5rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
}
.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* Badges */
.badge {
    padding: 0.4em 0.8em;
    border-radius: 6px;
    font-weight: 500;
}
.bg-success { background-color: #10b981 !important; }
.bg-warning { background-color: #f59e0b !important; }
.bg-danger { background-color: #ef4444 !important; }

/* Dashboard Stat Cards */
.stat-card {
    border: 1px solid var(--border);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}
.bg-indigo-light { background-color: #eff6ff; color: var(--primary); }
.bg-emerald-light { background-color: #ecfdf5; color: #10b981; }
.bg-rose-light { background-color: #fff1f2; color: #f43f5e; }

/* Upload Dropzone Styling */
.upload-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    background-color: #f8fafc;
    transition: all 0.2s ease;
}
.upload-zone:hover {
    border-color: var(--primary);
    background-color: #eff6ff;
}

/* Responsive */
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
        box-shadow: 4px 0 10px rgba(0,0,0,0.1);
    }
    .app-sidebar.show {
        transform: translateX(0);
    }
    .app-main {
        margin-left: 0;
        width: 100%;
    }
    .mobile-toggle {
        display: block;
    }
    .app-header {
        padding: 0 1.25rem;
    }
    .app-content {
        padding: 1.25rem;
    }
    
    /* Overlay for mobile */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1035;
    }
    .sidebar-overlay.show {
        display: block;
    }
}

/* Print Overrides */
@media print {
    .app-sidebar, .app-header, .mobile-toggle, .btn {
        display: none !important;
    }
    .app-main {
        margin-left: 0 !important;
        width: 100% !important;
    }
    .app-content {
        padding: 0 !important;
    }
    .card {
        border: none !important;
        box-shadow: none !important;
    }
    .table-responsive {
        border: none !important;
    }
}
