/* ============================================================================
   KYNTHAR SHARED STYLES - Modern Blues Theme
   Professional B2B SaaS Design System
   ============================================================================ */

/* ============================================================================
   CSS CUSTOM PROPERTIES (Variables)
   Support for Light/Dark themes
   ============================================================================ */

:root {
    /* Colors - Modern Blues Palette */
    --color-navy: #1e3a8a;
    --color-blue-medium: #3b82f6;
    --color-blue-light: #60a5fa;
    --color-blue-pale: #dbeafe;

    /* Neutrals */
    --color-gray-900: #1f2937;
    --color-gray-700: #374151;
    --color-gray-600: #4b5563;
    --color-gray-500: #6b7280;
    --color-gray-400: #9ca3af;
    --color-gray-300: #d1d5db;
    --color-gray-200: #e5e7eb;
    --color-gray-100: #f3f4f6;
    --color-gray-50: #f9fafb;

    /* Semantic Colors - Light Mode */
    --bg-primary: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-elevated: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --border-color: #e5e7eb;
    --border-focus: #3b82f6;

    /* Brand Colors */
    --brand-primary: #1e3a8a;
    --brand-primary-hover: #1e40af;
    --brand-secondary: #3b82f6;

    /* Status Colors */
    --status-success-bg: #d1fae5;
    --status-success-text: #065f46;
    --status-warning-bg: #fef3c7;
    --status-warning-text: #92400e;
    --status-error-bg: #fee2e2;
    --status-error-text: #991b1b;
    --status-info-bg: #dbeafe;
    --status-info-text: #1e40af;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);

    /* Spacing Scale */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
}

/* Dark Mode Theme */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-surface: #1e293b;
    --bg-elevated: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --border-color: #334155;
    --border-focus: #60a5fa;

    --brand-primary: #3b82f6;
    --brand-primary-hover: #60a5fa;

    --status-success-bg: #064e3b;
    --status-success-text: #6ee7b7;
    --status-warning-bg: #78350f;
    --status-warning-text: #fcd34d;
    --status-error-bg: #7f1d1d;
    --status-error-text: #fca5a5;
    --status-info-bg: #1e3a8a;
    --status-info-text: #93c5fd;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.5);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.5);
}

/* ============================================================================
   RESET & BASE STYLES
   ============================================================================ */

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

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    transition: background-color var(--transition-base), color var(--transition-base);
}

/* ============================================================================
   TYPOGRAPHY SCALE
   ============================================================================ */

h1 {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

h2 {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

h3 {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

p {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-secondary);
}

.text-small {
    font-size: 14px;
    color: var(--text-secondary);
}

.text-xs {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ============================================================================
   LAYOUT COMPONENTS
   ============================================================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

@media (min-width: 768px) {
    .container {
        padding: 0 var(--spacing-lg);
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 var(--spacing-xl);
    }
}

/* ============================================================================
   UNIFIED HEADER
   ============================================================================ */

.app-header {
    background-color: var(--brand-primary);
    color: white;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) 0;
    gap: var(--spacing-lg);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    white-space: nowrap;
}

.header-logo img {
    display: none;
}

.header-logo-text {
    font-size: 36px;
    font-weight: 700;
    color: white;
}

.header-nav {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.header-actions {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

/* Dark Mode Toggle */
.theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================================================
   RESPONSIVE MOBILE NAVIGATION
   ============================================================================ */

/* Mobile: Hide navigation, show it in a mobile-friendly way */
@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        padding: var(--spacing-sm) 0;
    }

    .header-logo {
        font-size: 20px;
    }

    .header-nav {
        order: 3;
        flex-basis: 100%;
        justify-content: flex-start;
        gap: var(--spacing-xs);
        margin-top: var(--spacing-sm);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-link {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 14px;
        white-space: nowrap;
    }

    .header-actions {
        gap: var(--spacing-xs);
    }

    .btn {
        padding: 8px 12px;
        font-size: 14px;
    }

    /* On very small screens, show icons only for Settings */
    .btn-secondary:first-of-type {
        min-width: 38px;
    }
}

@media (max-width: 480px) {
    .header-actions .btn-secondary:first-of-type::before {
        content: "⚙️";
        margin-right: 0;
    }

    .header-actions .btn-secondary:first-of-type {
        font-size: 0;
        padding: 8px;
        min-width: 38px;
    }

    .header-actions .btn-secondary:first-of-type::before {
        font-size: 18px;
    }

    .btn-secondary {
        padding: 6px 10px;
        font-size: 13px;
    }
}

/* Tablet and up: full navigation */
@media (min-width: 769px) {
    .header-nav {
        flex: 1;
        justify-content: center;
    }
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--brand-primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--brand-primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.2);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover:not(:disabled) {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

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

.btn-lg {
    padding: 14px 28px;
    font-size: 18px;
}

/* ============================================================================
   CARDS
   ============================================================================ */

.card {
    background-color: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-lg);
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-interactive {
    cursor: pointer;
}

.card-interactive:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ============================================================================
   FORMS
   ============================================================================ */

.form-group {
    margin-bottom: var(--spacing-lg);
}

label {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea,
select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 16px;
    font-family: inherit;
    background-color: var(--bg-surface);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-tertiary);
}

/* ============================================================================
   STATUS BADGES
   ============================================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background-color: var(--status-success-bg);
    color: var(--status-success-text);
}

.badge-warning {
    background-color: var(--status-warning-bg);
    color: var(--status-warning-text);
}

.badge-error {
    background-color: var(--status-error-bg);
    color: var(--status-error-text);
}

.badge-info {
    background-color: var(--status-info-bg);
    color: var(--status-info-text);
}

/* ============================================================================
   TABLES
   ============================================================================ */

table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--bg-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

thead {
    background-color: var(--bg-primary);
}

th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 12px 16px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background-color: var(--bg-primary);
}

/* ============================================================================
   MODAL
   ============================================================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: var(--spacing-md);
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--bg-surface);
    border-radius: var(--radius-xl);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

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

.modal-body {
    padding: var(--spacing-lg);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: var(--spacing-sm);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

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

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-xs { margin-top: var(--spacing-xs); }
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }

.mb-xs { margin-bottom: var(--spacing-xs); }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }

.w-full { width: 100%; }
.h-full { height: 100%; }

.hidden { display: none; }

/* ============================================================================
   RESPONSIVE GRID
   ============================================================================ */

.grid {
    display: grid;
    gap: var(--spacing-md);
}

@media (min-width: 640px) {
    .grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ============================================================================
   LOADING STATES
   ============================================================================ */

.loading-spinner {
    border: 3px solid var(--border-color);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-primary) 25%, var(--border-color) 50%, var(--bg-primary) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================================================
   FOCUS STYLES (Accessibility)
   ============================================================================ */

*:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

/* ============================================================================
   MOBILE-FIRST RESPONSIVE UTILITIES
   ============================================================================ */

/* Container sizing */
@media (max-width: 640px) {
    .container {
        padding: 0 var(--spacing-sm);
    }

    .main-content,
    .admin-container,
    .upload-container {
        margin: var(--spacing-lg) auto;
        padding: 0 var(--spacing-sm);
    }

    /* Typography adjustments */
    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 20px;
    }

    h3 {
        font-size: 18px;
    }

    /* Card stacking */
    .card {
        padding: var(--spacing-md);
    }

    /* Form inputs */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    textarea,
    select {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Tablet (641px - 1023px) */
@media (min-width: 641px) and (max-width: 1023px) {
    .container {
        padding: 0 var(--spacing-md);
    }

    h1 {
        font-size: 28px;
    }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    .container {
        padding: 0 var(--spacing-xl);
    }
}

/* Utility Classes */
.hide-mobile {
    display: none;
}

@media (min-width: 769px) {
    .hide-mobile {
        display: block;
    }

    .hide-desktop {
        display: none;
    }
}

/* Touch-friendly tap targets */
@media (hover: none) and (pointer: coarse) {
    button,
    .btn,
    a {
        min-height: 44px;
        min-width: 44px;
    }
}

/* ============================================================================
   DASHBOARD LAYOUT
   ============================================================================ */

.dashboard-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
    background: var(--bg-primary);
}

.dashboard-layout.sidebar-collapsed {
    grid-template-columns: 70px 1fr;
}

/* Sidebar */
.dashboard-sidebar {
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    transition: all var(--transition-base);
}

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

.sidebar-logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--brand-primary);
    text-decoration: none;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

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

.sidebar-nav {
    flex: 1;
    padding: var(--spacing-md) 0;
}

.sidebar-section {
    margin-bottom: var(--spacing-lg);
}

.sidebar-section-title {
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-lg);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
}

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

.sidebar-link.active {
    background: var(--color-blue-pale);
    color: var(--brand-primary);
    border-left-color: var(--brand-primary);
}

.sidebar-link-icon {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.sidebar-link-text {
    flex: 1;
}

/* Collapsed sidebar */
.sidebar-collapsed .sidebar-logo,
.sidebar-collapsed .sidebar-section-title,
.sidebar-collapsed .sidebar-link-text {
    display: none;
}

.sidebar-collapsed .sidebar-header {
    justify-content: center;
}

.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding: var(--spacing-sm);
}

/* Dashboard Main Area */
.dashboard-main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.dashboard-topbar {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: var(--spacing-md) var(--spacing-xl);
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    position: sticky;
    top: 0;
    z-index: 100;
}

.dashboard-search {
    flex: 1;
    max-width: 500px;
}

.dashboard-search input {
    width: 100%;
    padding: 10px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.dashboard-search input:focus {
    outline: none;
    border-color: var(--border-focus);
    background: var(--bg-surface);
}

.dashboard-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

/* Profile Dropdown */
.profile-dropdown {
    position: relative;
}

.profile-button {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 8px 12px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-primary);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.profile-button:hover {
    background: var(--bg-primary);
}

.profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--brand-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.profile-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    min-width: 200px;
    display: none;
    z-index: 1000;
}

.profile-menu.active {
    display: block;
}

.profile-menu-header {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.profile-menu-name {
    font-weight: 600;
    color: var(--text-primary);
}

.profile-menu-email {
    font-size: 12px;
    color: var(--text-secondary);
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.profile-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: var(--spacing-xs) 0;
}

/* Dashboard Content */
.dashboard-content {
    flex: 1;
    padding: var(--spacing-xl);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    background: var(--bg-surface);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.stat-change {
    font-size: 12px;
    color: var(--status-success-text);
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-change.negative {
    color: var(--status-error-text);
}

/* Data Table */
.data-table-container {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

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

.data-table thead {
    background: var(--bg-primary);
    border-bottom: 2px solid var(--border-color);
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    user-select: none;
    transition: all var(--transition-fast);
}

.data-table th:hover {
    background: var(--bg-surface);
}

.data-table th.sortable::after {
    content: ' ↕';
    opacity: 0.3;
}

.data-table th.sort-asc::after {
    content: ' ▲';
    opacity: 1;
}

.data-table th.sort-desc::after {
    content: ' ▼';
    opacity: 1;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition-fast);
    cursor: pointer;
}

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

.data-table tbody tr.expanded {
    background: var(--color-blue-pale);
}

.data-table td {
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 14px;
}

/* Accordion Details Row */
.accordion-details {
    display: none;
}

.accordion-details.active {
    display: table-row;
}

.accordion-details td {
    padding: 0;
    background: var(--bg-primary);
}

.accordion-content {
    padding: var(--spacing-xl);
    border-top: 2px solid var(--border-color);
}

.detail-sections {
    display: grid;
    gap: var(--spacing-lg);
}

/* Chat Widget */
.chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
}

.chat-toggle {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: var(--brand-primary);
    color: white;
    border: none;
    box-shadow: var(--shadow-xl);
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}

.chat-toggle:hover {
    background: var(--brand-primary-hover);
    transform: scale(1.1);
}

.chat-panel {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 350px;
    height: 500px;
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    display: none;
    flex-direction: column;
}

.chat-panel.active {
    display: flex;
}

.chat-header {
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 20px;
}

.chat-messages {
    flex: 1;
    padding: var(--spacing-md);
    overflow-y: auto;
}

.chat-input-container {
    padding: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

.chat-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.chat-input:focus {
    outline: none;
    border-color: var(--border-focus);
}

/* Mobile Responsive - Dashboard */
@media (max-width: 768px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .dashboard-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 250px;
        transform: translateX(-100%);
        z-index: 1000;
    }

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

    .mobile-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }

    .mobile-overlay.active {
        display: block;
    }

    .dashboard-topbar {
        padding: var(--spacing-md);
    }

    .dashboard-search {
        max-width: none;
    }

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

    .chat-panel {
        width: calc(100vw - 32px);
        height: 400px;
        right: 16px;
        bottom: 70px;
    }

    .data-table-container {
        overflow-x: auto;
    }

    .data-table {
        min-width: 600px;
    }
}
