/* ========================================
   ADMIN PANEL - MODERN DASHBOARD THEME
   ======================================== */

/* Root Variables */
:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --primary-bg: rgba(99, 102, 241, 0.1);
    --secondary: #0ea5e9;
    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --info: #06b6d4;
    --info-bg: rgba(6, 182, 212, 0.1);

    --bg-body: #0f172a;
    --bg-sidebar: #1e293b;
    --bg-card: #1e293b;
    --bg-card-hover: #263348;
    --bg-input: #0f172a;
    --bg-table-header: #263348;
    --bg-table-row-hover: rgba(99, 102, 241, 0.05);
    --bg-badge: rgba(99, 102, 241, 0.15);
    --bg-dropdown: #1e293b;

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-heading: #f8fafc;

    --border: #334155;
    --border-light: #1e293b;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -2px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.3), 0 4px 6px -4px rgba(0,0,0,0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.3), 0 8px 10px -6px rgba(0,0,0,0.3);

    --sidebar-width: 280px;
    --sidebar-collapsed: 80px;
    --header-height: 70px;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    border: none;
    outline: none;
    background: none;
}

/* ========================================
   SIDEBAR
   ======================================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    overflow: hidden;
}

.sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: var(--header-height);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    flex-shrink: 0;
}

.sidebar-logo-text {
    display: flex;
    flex-direction: column;
}

.sidebar-logo-text h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-heading);
    line-height: 1.2;
}

.sidebar-logo-text span {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.nav-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    padding: 16px 16px 8px;
    display: block;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
    position: relative;
    transition: var(--transition);
}

.nav-item:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary-bg);
    color: var(--primary-light);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}

.nav-item i {
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.nav-item .nav-badge {
    margin-left: auto;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.nav-badge.primary {
    background: var(--primary-bg);
    color: var(--primary-light);
}

.nav-badge.danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.nav-badge.success {
    background: var(--success-bg);
    color: var(--success);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: rgba(99, 102, 241, 0.05);
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
}

.sidebar-user-info h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.sidebar-user-info span {
    font-size: 11px;
    color: var(--text-muted);
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: var(--transition);
}

/* Top Header */
.top-header {
    position: sticky;
    top: 0;
    z-index: 900;
    height: var(--header-height);
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.sidebar-toggle:hover {
    background: var(--primary-bg);
    color: var(--primary-light);
}

.header-search {
    position: relative;
}

.header-search input {
    width: 320px;
    height: 42px;
    padding: 0 16px 0 44px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
}

.header-search input::placeholder {
    color: var(--text-muted);
}

.header-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.header-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

.header-search kbd {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    padding: 2px 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 11px;
    color: var(--text-muted);
    font-family: inherit;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-btn {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-secondary);
    position: relative;
    transition: var(--transition);
}

.header-btn:hover {
    background: var(--primary-bg);
    color: var(--primary-light);
}

.header-btn .badge-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg-body);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    border-radius: var(--radius-sm);
    margin-left: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.header-user:hover {
    background: var(--bg-card);
}

.header-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: white;
}

.header-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-user i {
    font-size: 12px;
    color: var(--text-muted);
}

/* Page Content */
.page-content {
    padding: 32px;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header-left h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 4px;
}

.page-header-left p {
    font-size: 14px;
    color: var(--text-muted);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.breadcrumb a {
    color: var(--text-secondary);
}

.breadcrumb a:hover {
    color: var(--primary-light);
}

.breadcrumb i {
    font-size: 10px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #16a34a);
    color: white;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xs);
    font-size: 14px;
}

/* ========================================
   STATS CARDS
   ======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.stat-card.primary::after { background: var(--primary); }
.stat-card.success::after { background: var(--success); }
.stat-card.warning::after { background: var(--warning); }
.stat-card.info::after { background: var(--info); }
.stat-card.danger::after { background: var(--danger); }

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-card.primary .stat-card-icon {
    background: var(--primary-bg);
    color: var(--primary-light);
}

.stat-card.success .stat-card-icon {
    background: var(--success-bg);
    color: var(--success);
}

.stat-card.warning .stat-card-icon {
    background: var(--warning-bg);
    color: var(--warning);
}

.stat-card.info .stat-card-icon {
    background: var(--info-bg);
    color: var(--info);
}

.stat-card.danger .stat-card-icon {
    background: var(--danger-bg);
    color: var(--danger);
}

.stat-card-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
}

.stat-card-trend.up {
    color: var(--success);
    background: var(--success-bg);
}

.stat-card-trend.down {
    color: var(--danger);
    background: var(--danger-bg);
}

.stat-card-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-heading);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ========================================
   CARDS / PANELS
   ======================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.card-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h3 i {
    color: var(--primary-light);
    font-size: 18px;
}

.card-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ========================================
   TABLES
   ======================================== */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead th {
    background: var(--bg-table-header);
    padding: 14px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    white-space: nowrap;
}

.table tbody td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    vertical-align: middle;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background: var(--bg-table-row-hover);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Table User Cell */
.table-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.table-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: white;
    flex-shrink: 0;
}

.table-user-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.table-user-info span {
    font-size: 12px;
    color: var(--text-muted);
}

/* Table Actions */
.table-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.table-actions .btn-icon {
    color: var(--text-muted);
}

.table-actions .btn-icon:hover {
    background: var(--primary-bg);
    color: var(--primary-light);
}

.table-actions .btn-icon.danger:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge.primary {
    background: var(--primary-bg);
    color: var(--primary-light);
}

.badge.success {
    background: var(--success-bg);
    color: var(--success);
}

.badge.warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge.danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge.info {
    background: var(--info-bg);
    color: var(--info);
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.badge.success .badge-dot { background: var(--success); }
.badge.warning .badge-dot { background: var(--warning); }
.badge.danger .badge-dot { background: var(--danger); }
.badge.primary .badge-dot { background: var(--primary); }

/* ========================================
   GRID LAYOUTS
   ======================================== */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.grid-2-1 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.grid-1-1 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

/* ========================================
   CHART PLACEHOLDER
   ======================================== */
.chart-container {
    width: 100%;
    height: 300px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 20px 0;
}

.chart-bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.chart-bar {
    width: 100%;
    max-width: 40px;
    border-radius: 6px 6px 0 0;
    transition: var(--transition);
    position: relative;
    cursor: pointer;
}

.chart-bar:hover {
    opacity: 0.8;
    transform: scaleY(1.02);
    transform-origin: bottom;
}

.chart-bar.primary { background: linear-gradient(to top, var(--primary-dark), var(--primary-light)); }
.chart-bar.secondary { background: linear-gradient(to top, rgba(99,102,241,0.2), rgba(99,102,241,0.4)); }

.chart-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Mini chart line */
.mini-chart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 40px;
}

.mini-chart-bar {
    width: 4px;
    border-radius: 2px;
    background: var(--primary);
    opacity: 0.6;
    transition: var(--transition);
}

.mini-chart-bar:hover { opacity: 1; }

/* ========================================
   RECENT ACTIVITY
   ======================================== */
.activity-list {
    display: flex;
    flex-direction: column;
}

.activity-item {
    display: flex;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.activity-icon.primary {
    background: var(--primary-bg);
    color: var(--primary-light);
}

.activity-icon.success {
    background: var(--success-bg);
    color: var(--success);
}

.activity-icon.warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.activity-icon.danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.activity-content h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.activity-content p {
    font-size: 12px;
    color: var(--text-muted);
}

.activity-time {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    padding-top: 2px;
}

/* ========================================
   FORMS
   ======================================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 11px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ========================================
   PAGINATION
   ======================================== */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition);
}

.pagination-btn:hover {
    background: var(--primary-bg);
    color: var(--primary-light);
}

.pagination-btn.active {
    background: var(--primary);
    color: white;
}

.pagination-info {
    font-size: 13px;
    color: var(--text-muted);
}

/* ========================================
   PROGRESS BAR
   ======================================== */
.progress {
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 1s ease;
}

.progress-bar.primary { background: var(--primary); }
.progress-bar.success { background: var(--success); }
.progress-bar.warning { background: var(--warning); }
.progress-bar.danger { background: var(--danger); }

/* ========================================
   EMPTY STATE
   ======================================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: var(--primary-bg);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--primary-light);
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-muted);
    max-width: 400px;
    margin: 0 auto 24px;
}

/* ========================================
   TOP PRODUCTS
   ======================================== */
.product-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.product-item:last-child {
    border-bottom: none;
}

.product-img {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.product-info {
    flex: 1;
    min-width: 0;
}

.product-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-info span {
    font-size: 12px;
    color: var(--text-muted);
}

.product-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-heading);
    white-space: nowrap;
}

/* ========================================
   NOTIFICATION DROPDOWN
   ======================================== */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    background: var(--bg-dropdown);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 1000;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dropdown-header h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-heading);
}

.dropdown-body {
    max-height: 320px;
    overflow-y: auto;
}

.dropdown-item {
    display: flex;
    gap: 12px;
    padding: 14px 20px;
    transition: var(--transition);
    cursor: pointer;
}

.dropdown-item:hover {
    background: var(--bg-table-row-hover);
}

.dropdown-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.dropdown-footer a {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-light);
}

/* ========================================
   LOGIN PAGE
   ======================================== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99,102,241,0.15), transparent 70%);
    top: -200px;
    right: -200px;
    border-radius: 50%;
}

.login-wrapper::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(168,85,247,0.1), transparent 70%);
    bottom: -100px;
    left: -100px;
    border-radius: 50%;
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    position: relative;
    z-index: 1;
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    margin-bottom: 16px;
}

.login-logo h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 4px;
}

.login-logo p {
    font-size: 14px;
    color: var(--text-muted);
}

.login-form .form-group {
    position: relative;
}

.login-form .form-group .input-icon {
    position: absolute;
    left: 14px;
    top: 40px;
    color: var(--text-muted);
    font-size: 14px;
}

.login-form .form-control {
    padding-left: 42px;
}

.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.login-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

.login-options a {
    font-size: 13px;
    color: var(--primary-light);
    font-weight: 500;
}

.login-options a:hover {
    text-decoration: underline;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.login-btn:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.login-divider {
    text-align: center;
    margin: 24px 0;
    position: relative;
}

.login-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border);
}

.login-divider span {
    background: var(--bg-card);
    padding: 0 16px;
    font-size: 12px;
    color: var(--text-muted);
    position: relative;
}

.login-footer {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

.login-footer a {
    color: var(--primary-light);
    font-weight: 600;
}

/* ========================================
   SETTINGS PAGE
   ======================================== */
.settings-nav {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    margin-bottom: 32px;
    overflow-x: auto;
}

.settings-nav-btn {
    padding: 10px 20px;
    border-radius: var(--radius-xs);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    transition: var(--transition);
}

.settings-nav-btn:hover {
    color: var(--text-primary);
}

.settings-nav-btn.active {
    background: var(--bg-card);
    color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.settings-section {
    margin-bottom: 32px;
}

.settings-section h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 4px;
}

.settings-section p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.settings-row:last-child {
    border-bottom: none;
}

.settings-row-left h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.settings-row-left span {
    font-size: 12px;
    color: var(--text-muted);
}

/* Toggle Switch */
.toggle {
    width: 44px;
    height: 24px;
    background: var(--border);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.toggle.active {
    background: var(--primary);
}

.toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
}

.toggle.active::after {
    left: 23px;
}

/* ========================================
   MOBILE OVERLAY
   ======================================== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    opacity: 1;
}

/* ========================================
   MOBILE TOGGLE
   ======================================== */
.mobile-toggle {
    display: none;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1400px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1200px) {
    .grid-2-1 {
        grid-template-columns: 1fr;
    }
    
    .grid-2, .grid-3, .grid-1-1 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-toggle {
        display: flex;
    }

    .header-search input {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .page-content {
        padding: 20px 16px;
    }

    .top-header {
        padding: 0 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .header-search {
        display: none;
    }

    .header-user-name {
        display: none;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .table thead th,
    .table tbody td {
        padding: 12px;
        font-size: 13px;
    }

    .stat-card-value {
        font-size: 26px;
    }

    .login-card {
        margin: 20px;
        padding: 28px;
    }
}

@media (max-width: 480px) {
    .page-content {
        padding: 16px 12px;
    }
    
    .card-header {
        padding: 16px;
    }
    
    .card-body {
        padding: 16px;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.animate-in {
    animation: fadeIn 0.5s ease forwards;
}

.stat-card { animation: fadeIn 0.5s ease forwards; }
.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.2s; }

/* ========================================
   CUSTOM SCROLLBAR
   ======================================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ========================================
   DONUT CHART
   ======================================== */
.donut-chart {
    width: 200px;
    height: 200px;
    margin: 0 auto 20px;
    position: relative;
}

.donut-chart svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.donut-chart circle {
    fill: none;
    stroke-width: 20;
    stroke-linecap: round;
}

.donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.donut-center h3 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-heading);
}

.donut-center span {
    font-size: 12px;
    color: var(--text-muted);
}

.donut-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}

.donut-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.donut-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

/* ========================================
   ORDERS TABLE STATUS
   ======================================== */
.order-id {
    font-weight: 700;
    color: var(--primary-light);
    font-size: 13px;
}

.order-amount {
    font-weight: 700;
    color: var(--text-heading);
}

/* ========================================
   PRODUCT IMAGE IN TABLE
   ======================================== */
.table-product {
    display: flex;
    align-items: center;
    gap: 12px;
}

.table-product-img {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.table-product-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.table-product-info span {
    font-size: 12px;
    color: var(--text-muted);
}

/* Stock indicator */
.stock-bar {
    width: 80px;
    height: 4px;
    background: var(--bg-input);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 4px;
}

.stock-fill {
    height: 100%;
    border-radius: 2px;
}

/* Welcome banner */
.welcome-banner {
    background: linear-gradient(135deg, var(--primary-dark), #7c3aed);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

.welcome-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.welcome-banner::after {
    content: '';
    position: absolute;
    bottom: -30%;
    right: 10%;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.03);
    border-radius: 50%;
}

.welcome-banner h2 {
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.welcome-banner p {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    max-width: 500px;
    position: relative;
    z-index: 1;
}

.welcome-banner .btn {
    margin-top: 16px;
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    position: relative;
    z-index: 1;
}

.welcome-banner .btn:hover {
    background: rgba(255,255,255,0.25);
}

/* ========================================
   PRODUCT WITH VARIATIONS
   ======================================== */

/* Product Card Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 24px;
}

/* Product Card */
.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}

.product-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

/* Product Main Header */
.product-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 0;
}

.product-card-header .badge {
    font-size: 11px;
}

.product-card-main {
    display: flex;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.product-main-img {
    width: 90px;
    height: 90px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.product-main-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-main-info {
    flex: 1;
    min-width: 0;
}

.product-main-info h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-main-info .product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.product-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-muted);
}

.product-meta-item i {
    font-size: 11px;
}

.product-meta-item strong {
    color: var(--text-secondary);
    font-weight: 600;
}

.product-main-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Variations Section */
.product-variations {
    padding: 0 20px 20px;
}

.variations-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0 10px;
}

.variations-header h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.variations-header h4 i {
    color: var(--primary-light);
    font-size: 14px;
}

.variation-count {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--primary-bg);
    color: var(--primary-light);
}

.variations-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Single Variation Row */
.variation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.variation-item:hover {
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(99, 102, 241, 0.03);
}

.variation-img {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-xs);
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border);
    position: relative;
}

.variation-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.variation-img .img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 18px;
}

/* Variation Info */
.variation-info {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr 0.6fr 0.6fr;
    gap: 8px;
    align-items: center;
}

.variation-detail {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.variation-detail-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.variation-detail-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.variation-detail-value.price {
    color: var(--success);
    font-weight: 700;
}

.variation-detail-value.sku {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.variation-detail-value.stock-ok {
    color: var(--success);
}

.variation-detail-value.stock-low {
    color: var(--warning);
}

.variation-detail-value.stock-out {
    color: var(--danger);
}

/* Variation Tags (Color/Size) */
.variation-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.variation-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.variation-tag .color-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.2);
}

/* Variation Actions */
.variation-actions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

.variation-actions .btn-icon {
    width: 30px;
    height: 30px;
    font-size: 12px;
}

/* Product Card Footer */
.product-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: rgba(0,0,0,0.1);
}

.product-card-footer .product-total-stock {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.product-card-footer .product-total-stock strong {
    color: var(--text-primary);
    font-weight: 700;
}

.product-card-actions {
    display: flex;
    gap: 6px;
}

/* Add Variation Button */
.add-variation-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-xs);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    background: transparent;
    margin-top: 4px;
}

.add-variation-btn:hover {
    border-color: var(--primary);
    color: var(--primary-light);
    background: rgba(99, 102, 241, 0.05);
}

/* Variation Expand/Collapse */
.variations-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-light);
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px 10px;
    border-radius: var(--radius-xs);
    transition: var(--transition);
}

.variations-toggle:hover {
    background: var(--primary-bg);
}

.variations-toggle i {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.variations-toggle.expanded i {
    transform: rotate(180deg);
}

/* Collapsed variations */
.variations-list.collapsed .variation-item:nth-child(n+3) {
    display: none;
}

/* Product Price Range */
.price-range {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-heading);
}

.price-range .price-min {
    color: var(--success);
}

.price-range .price-sep {
    color: var(--text-muted);
    font-weight: 400;
    margin: 0 2px;
}

/* ========================================
   ADD/EDIT PRODUCT MODAL
   ======================================== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h3 i {
    color: var(--primary-light);
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--text-muted);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

/* Image Upload Area */
.img-upload-area {
    width: 100%;
    height: 120px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-muted);
}

.img-upload-area:hover {
    border-color: var(--primary);
    color: var(--primary-light);
    background: rgba(99, 102, 241, 0.03);
}

.img-upload-area i {
    font-size: 24px;
}

.img-upload-area span {
    font-size: 12px;
    font-weight: 500;
}

/* Variation Form Row */
.variation-form-row {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 16px;
    padding: 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    position: relative;
}

.variation-form-img {
    width: 80px;
    height: 80px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 20px;
    transition: var(--transition);
    overflow: hidden;
}

.variation-form-img:hover {
    border-color: var(--primary);
    color: var(--primary-light);
}

.variation-form-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.variation-form-fields {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.variation-form-fields .form-group {
    margin-bottom: 0;
}

.variation-form-fields .form-group label {
    font-size: 11px;
    margin-bottom: 4px;
}

.variation-form-fields .form-control {
    padding: 8px 12px;
    font-size: 13px;
}

.remove-variation-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--text-muted);
    transition: var(--transition);
}

.remove-variation-btn:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

/* View Mode Toggle */
.view-toggle {
    display: flex;
    gap: 2px;
    padding: 3px;
    background: var(--bg-input);
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
}

.view-toggle-btn {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.view-toggle-btn.active {
    background: var(--bg-card);
    color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

/* Product List View (Table with variations) */
.product-list-view .product-row {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
    overflow: hidden;
    transition: var(--transition);
}

.product-list-view .product-row:hover {
    border-color: var(--primary);
}

.product-row-main {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    cursor: pointer;
}

.product-row-img {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.product-row-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-row-info {
    flex: 1;
    min-width: 0;
}

.product-row-info h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 2px;
}

.product-row-info span {
    font-size: 12px;
    color: var(--text-muted);
}

.product-row-stats {
    display: flex;
    gap: 32px;
    align-items: center;
}

.product-row-stat {
    text-align: center;
}

.product-row-stat .label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.product-row-stat .value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-heading);
}

.product-row-expand {
    font-size: 14px;
    color: var(--text-muted);
    transition: transform 0.3s ease;
    padding: 8px;
}

.product-row-expand.expanded {
    transform: rotate(180deg);
}

/* Variation sub-table inside list view */
.product-row-variations {
    display: none;
    border-top: 1px solid var(--border);
}

.product-row-variations.show {
    display: block;
}

.product-row-variations .table thead th {
    background: rgba(99, 102, 241, 0.05);
    font-size: 11px;
    padding: 10px 16px;
}

.product-row-variations .table tbody td {
    padding: 12px 16px;
    font-size: 13px;
}

.variation-table-img {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.variation-table-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Responsive adjustments for variations */
@media (max-width: 1200px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .variation-info {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .product-row-stats {
        display: none;
    }

    .variation-form-fields {
        grid-template-columns: 1fr;
    }

    .product-card-main {
        flex-direction: column;
        align-items: flex-start;
    }

    .product-main-img {
        width: 100%;
        height: 160px;
    }
}

@media (max-width: 480px) {
    .variation-info {
        grid-template-columns: 1fr;
    }

    .variation-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .variation-img {
        width: 100%;
        height: 120px;
    }
}
