/* ================================================================
   NexaBoard - Premium Admin Dashboard Template
   Version: 1.0.0
   Author: NexaBoard Team
   ================================================================ */

/* ================================================================
   1. CSS Variables & Theme
   ================================================================ */
:root {
    /* Primary Colors - Teal/Cyan */
    --primary-50: #f0fdfa;
    --primary-100: #ccfbf1;
    --primary-200: #99f6e4;
    --primary-300: #5eead4;
    --primary-400: #2dd4bf;
    --primary-500: #14b8a6;
    --primary-600: #0d9488;
    --primary-700: #0f766e;
    --primary-800: #115e59;
    --primary-900: #134e4a;

    /* Secondary Colors - Slate */
    --secondary-50: #f8fafc;
    --secondary-100: #f1f5f9;
    --secondary-200: #e2e8f0;
    --secondary-300: #cbd5e1;
    --secondary-400: #94a3b8;
    --secondary-500: #64748b;
    --secondary-600: #475569;
    --secondary-700: #334155;
    --secondary-800: #1e293b;
    --secondary-900: #0f172a;

    /* Accent Colors - Amber/Orange */
    --accent-50: #fffbeb;
    --accent-100: #fef3c7;
    --accent-200: #fde68a;
    --accent-300: #fcd34d;
    --accent-400: #fbbf24;
    --accent-500: #f59e0b;
    --accent-600: #d97706;
    --accent-700: #b45309;
    --accent-800: #92400e;
    --accent-900: #78350f;

    /* Success */
    --success-50: #f0fdf4;
    --success-100: #dcfce7;
    --success-500: #22c55e;
    --success-600: #16a34a;
    --success-700: #15803d;

    /* Warning */
    --warning-50: #fffbeb;
    --warning-100: #fef3c7;
    --warning-500: #f59e0b;
    --warning-600: #d97706;
    --warning-700: #b45309;

    /* Danger */
    --danger-50: #fef2f2;
    --danger-100: #fee2e2;
    --danger-500: #ef4444;
    --danger-600: #dc2626;
    --danger-700: #b91c1c;

    /* Info */
    --info-50: #eff6ff;
    --info-100: #dbeafe;
    --info-500: #3b82f6;
    --info-600: #2563eb;
    --info-700: #1d4ed8;

    /* Light Theme */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --border-color: #e2e8f0;
    --border-color-light: #f1f5f9;

    /* Sidebar */
    --sidebar-bg: #ffffff;
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 80px;

    /* Header */
    --header-height: 72px;
    --header-bg: rgba(255, 255, 255, 0.85);

    /* Shadows */
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px 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);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Typography */
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-tertiary: #64748b;
    --border-color: #334155;
    --border-color-light: #1e293b;
    --sidebar-bg: #1e293b;
    --header-bg: rgba(30, 41, 59, 0.85);
}

/* ================================================================
   2. Reset & Base Styles
   ================================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

ul, ol {
    list-style: none;
}

/* ================================================================
   3. Layout
   ================================================================ */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
}

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

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    z-index: 999;
    display: flex;
    flex-direction: column;
    transition: var(--transition-normal);
}

.sidebar-header {
    height: var(--header-height);
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.brand-icon svg {
    width: 100%;
    height: 100%;
}

.brand-text {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.sidebar-toggle-close {
    display: none;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.sidebar-toggle-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

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

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    display: block;
    padding: 0 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
}

.nav-menu {
    padding: 0 0.75rem;
}

.nav-item {
    margin-bottom: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.875rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition-fast);
    position: relative;
}

.nav-link i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.nav-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35);
}

.nav-badge {
    margin-left: auto;
    padding: 0.125rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    background: var(--primary-500);
    color: white;
    border-radius: var(--radius-full);
}

.nav-badge.badge-warning {
    background: var(--warning-500);
    color: var(--secondary-900);
}

/* Submenu */
.submenu-arrow {
    margin-left: auto;
    transition: var(--transition-fast);
}

.nav-item.has-submenu.open .submenu-arrow {
    transform: rotate(180deg);
}

.submenu {
    max-height: 0;
    overflow: hidden;
    transition: var(--transition-normal);
    padding-left: 2.5rem;
}

.nav-item.has-submenu.open .submenu {
    max-height: 500px;
    padding-top: 0.5rem;
}

.submenu li {
    margin-bottom: 2px;
}

.submenu a {
    display: block;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.submenu a:hover {
    color: var(--primary-500);
    background: var(--bg-tertiary);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    object-fit: cover;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    display: block;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.sidebar-user-menu {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.sidebar-user-menu:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition-normal);
}

/* Header */
.header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    padding: 0 1.5rem;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.sidebar-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar-toggle i {
    font-size: 1.5rem;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 1rem;
    color: var(--text-tertiary);
    font-size: 1.125rem;
}

.search-input {
    width: 320px;
    height: 44px;
    padding: 0 3.5rem 0 2.75rem;
    background: var(--bg-tertiary);
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-500);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

.search-shortcut {
    position: absolute;
    right: 1rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-tertiary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

/* Header Right */
.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-btn {
    position: relative;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.header-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.header-btn i {
    font-size: 1.375rem;
}

.flag-icon {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.625rem;
    font-weight: 600;
    color: white;
    background: var(--danger-500);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Header Dropdown */
.header-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 280px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition-fast);
    z-index: 1000;
}

.header-dropdown:hover .dropdown-menu,
.header-dropdown:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

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

.dropdown-header h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.dropdown-header a {
    font-size: 0.8125rem;
    color: var(--primary-500);
}

.dropdown-header a:hover {
    text-decoration: underline;
}

.notification-list {
    max-height: 320px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    transition: var(--transition-fast);
}

.notification-item:hover {
    background: var(--bg-tertiary);
}

.notification-item.unread {
    background: rgba(20, 184, 166, 0.05);
}

.notification-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.notification-icon i {
    font-size: 1.125rem;
    color: white;
}

.notification-content p {
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.notification-content span {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.dropdown-footer {
    display: block;
    padding: 1rem 1.25rem;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary-500);
    border-top: 1px solid var(--border-color);
}

.dropdown-footer:hover {
    background: var(--bg-tertiary);
}

/* User Dropdown */
.header-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.375rem;
    padding-right: 0.75rem;
    border-radius: var(--radius-lg);
    transition: var(--transition-fast);
}

.header-user:hover {
    background: var(--bg-tertiary);
}

.header-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    object-fit: cover;
}

.header-user-info {
    text-align: left;
}

.header-user-name {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.header-user-role {
    display: block;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.header-user i {
    color: var(--text-tertiary);
    margin-left: 0.25rem;
}

.user-menu {
    min-width: 220px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.dropdown-item i {
    font-size: 1.125rem;
    width: 20px;
}

.dropdown-item.text-danger {
    color: var(--danger-500);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

/* ================================================================
   4. Page Content
   ================================================================ */
.page-content {
    flex: 1;
    padding: 1.5rem;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.breadcrumb a {
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.breadcrumb a:hover {
    color: var(--primary-500);
}

.breadcrumb-separator {
    color: var(--border-color);
}

.page-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.date-range-picker {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.date-range-picker:hover {
    border-color: var(--primary-500);
}

/* ================================================================
   5. Buttons
   ================================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.4);
    transform: translateY(-1px);
}

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

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

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-sm {
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
}

.btn-icon {
    padding: 0.5rem;
    min-width: 36px;
}

/* ================================================================
   6. Cards
   ================================================================ */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color-light);
}

.card-header-left {
    flex: 1;
}

.card-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.card-title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
}

.card-subtitle {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.card-body {
    padding: 1.25rem 1.5rem;
}

.card-body.p-0 {
    padding: 0;
}

/* ================================================================
   7. Stats Cards
   ================================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    transition: var(--transition-fast);
}

.stat-card:hover {
    border-color: var(--primary-200);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.stat-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
}

.stat-icon i {
    font-size: 1.5rem;
}

.bg-primary-light {
    background: rgba(20, 184, 166, 0.12);
    color: var(--primary-600);
}

.bg-success-light {
    background: rgba(34, 197, 94, 0.12);
    color: var(--success-600);
}

.bg-warning-light {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning-600);
}

.bg-danger-light {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger-600);
}

.bg-info-light {
    background: rgba(59, 130, 246, 0.12);
    color: var(--info-600);
}

.bg-primary {
    background: var(--primary-500);
}

.bg-success {
    background: var(--success-500);
}

.bg-warning {
    background: var(--warning-500);
}

.bg-danger {
    background: var(--danger-500);
}

.bg-info {
    background: var(--info-500);
}

.bg-secondary {
    background: var(--secondary-400);
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.stat-trend.up {
    background: rgba(34, 197, 94, 0.12);
    color: var(--success-600);
}

.stat-trend.down {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger-600);
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.stat-card-footer {
    margin-top: 1rem;
    height: 50px;
}

.stat-chart {
    width: 100%;
    height: 100%;
}

/* ================================================================
   8. Chart Section
   ================================================================ */
.chart-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.chart-card-large,
.chart-card-small {
    min-height: 400px;
}

.chart-legend {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
}

#revenueChart {
    height: 300px;
}

#categoryChart {
    height: 200px;
}

/* Category List */
.category-list {
    margin-top: 1rem;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border-color-light);
}

.category-item:last-child {
    border-bottom: none;
}

.category-dot {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.category-name {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.category-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ================================================================
   9. Content Rows
   ================================================================ */
.content-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

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

/* ================================================================
   10. Tables
   ================================================================ */
.table-responsive {
    overflow-x: auto;
}

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

.table thead {
    background: var(--bg-tertiary);
}

.table th {
    padding: 0.875rem 1.25rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
}

.table td {
    padding: 1rem 1.25rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color-light);
}

.table tbody tr:hover {
    background: var(--bg-tertiary);
}

.order-id {
    font-family: var(--font-mono);
    font-weight: 500;
    color: var(--text-primary);
}

.customer-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.customer-cell img {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    object-fit: cover;
}

.customer-cell span {
    color: var(--text-primary);
    font-weight: 500;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.badge-success {
    background: rgba(34, 197, 94, 0.12);
    color: var(--success-600);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning-600);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger-600);
}

.badge-info {
    background: rgba(59, 130, 246, 0.12);
    color: var(--info-600);
}

/* ================================================================
   11. Product List
   ================================================================ */
.product-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.product-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    transition: var(--transition-fast);
}

.product-item:hover {
    background: var(--bg-primary);
    box-shadow: var(--shadow-md);
}

.product-image {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    flex: 1;
    min-width: 0;
}

.product-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-category {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.product-stats {
    text-align: right;
}

.product-sales {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-bottom: 0.125rem;
}

.product-revenue {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--primary-600);
}

/* ================================================================
   12. Activity Feed
   ================================================================ */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    position: relative;
}

.activity-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 19px;
    top: 44px;
    width: 2px;
    height: calc(100% + 0.5rem);
    background: var(--border-color);
}

.activity-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.activity-icon i {
    font-size: 1.125rem;
}

.activity-content p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.activity-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* ================================================================
   13. Task List
   ================================================================ */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.task-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.task-item:hover {
    background: var(--bg-primary);
}

.task-item.completed {
    opacity: 0.6;
}

.task-item.completed .task-text {
    text-decoration: line-through;
}

.task-checkbox {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.task-checkbox input {
    opacity: 0;
    position: absolute;
    width: 0;
    height: 0;
}

.task-checkbox .checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.task-checkbox input:checked + .checkmark {
    background: var(--primary-500);
    border-color: var(--primary-500);
}

.task-checkbox input:checked + .checkmark::after {
    content: '\eb7b';
    font-family: 'remixicon';
    font-size: 0.75rem;
    color: white;
}

.task-content {
    flex: 1;
    min-width: 0;
}

.task-text {
    display: block;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.task-due {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.task-priority {
    padding: 0.25rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.priority-high {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger-600);
}

.priority-medium {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning-600);
}

.priority-low {
    background: rgba(34, 197, 94, 0.12);
    color: var(--success-600);
}

/* ================================================================
   14. Country List
   ================================================================ */
.country-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.country-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.country-flag {
    width: 32px;
    height: 24px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: var(--shadow-xs);
}

.country-flag img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.country-info {
    flex: 1;
    min-width: 0;
}

.country-name {
    display: block;
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0.375rem;
}

.country-progress {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-400), var(--primary-600));
    border-radius: var(--radius-full);
    transition: var(--transition-slow);
}

.country-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 70px;
    text-align: right;
}

/* ================================================================
   15. Footer
   ================================================================ */
.footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.footer-left p {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.footer-right a {
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.footer-right a:hover {
    color: var(--primary-500);
}

/* ================================================================
   16. Responsive Styles
   ================================================================ */
@media (max-width: 1280px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .chart-row {
        grid-template-columns: 1fr;
    }

    .content-row {
        grid-template-columns: 1fr;
    }

    .content-row.three-cols {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .sidebar-toggle-close {
        display: flex;
    }

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

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: flex;
    }

    .search-input {
        width: 240px;
    }

    .header-user-info {
        display: none;
    }
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header-right {
        width: 100%;
        flex-wrap: wrap;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .search-box {
        display: none;
    }

    .date-range-picker span {
        display: none;
    }

    .table th,
    .table td {
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .page-content {
        padding: 1rem;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .card-header,
    .card-body {
        padding: 1rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .header-right .header-btn:not(.theme-toggle):not(:last-child) {
        display: none;
    }
}

/* ================================================================
   17. Animations
   ================================================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

.animate-slide-up {
    animation: slideInUp 0.4s ease-out;
}

/* Stagger animation for cards */
.stats-grid > .stat-card:nth-child(1) { animation: slideInUp 0.4s ease-out 0.1s both; }
.stats-grid > .stat-card:nth-child(2) { animation: slideInUp 0.4s ease-out 0.2s both; }
.stats-grid > .stat-card:nth-child(3) { animation: slideInUp 0.4s ease-out 0.3s both; }
.stats-grid > .stat-card:nth-child(4) { animation: slideInUp 0.4s ease-out 0.4s both; }

/* ================================================================
   18. Utilities
   ================================================================ */
.text-primary { color: var(--primary-500); }
.text-success { color: var(--success-500); }
.text-warning { color: var(--warning-500); }
.text-danger { color: var(--danger-500); }
.text-info { color: var(--info-500); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
