/* ===== CSS Variables (Dark Pro Theme) ===== */
:root {
    /* Colors */
    --bg-primary: #0f0f12;
    --bg-secondary: #16161a;
    --bg-tertiary: #1c1c21;
    --bg-hover: #24242b;
    --bg-active: #2a2a33;

    --border-color: #2a2a33;
    --border-light: #35353f;

    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;

    --accent-primary: #6366f1;
    --accent-primary-hover: #4f46e5;
    --accent-secondary: #8b5cf6;

    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --error: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.1);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.1);

    /* Spacing */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --header-height: 64px;

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Monaco', monospace;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;

    /* Border radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

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

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scrollbar-width: none; /* Firefox */
}

html::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    -ms-overflow-style: none; /* IE */
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    z-index: 9999;
    transition: width 0.1s ease-out;
}

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

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

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

/* ===== Utilities ===== */
.hidden {
    display: none !important;
}

/* ===== Site Switch Overlay ===== */
.site-switch-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 15, 18, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.site-switch-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

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

/* ===== Login Page ===== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    position: relative;
    width: 100%;
    max-width: 420px;
}

.login-card {
    position: relative;
    z-index: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    margin-bottom: 16px;
}

.login-logo svg {
    width: 56px;
    height: 56px;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-secondary);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 14px 12px 44px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

.password-toggle {
    position: absolute;
    right: 12px;
    padding: 4px;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.password-toggle:hover {
    color: var(--text-secondary);
}

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
}

.checkbox-wrapper input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    width: 18px;
    height: 18px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

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

.checkbox-wrapper input:checked + .checkmark::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translateY(-1px);
}

.forgot-link {
    font-size: 13px;
    color: var(--accent-primary);
    transition: var(--transition-fast);
}

.forgot-link:hover {
    color: var(--accent-secondary);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    white-space: nowrap;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--accent-primary-hover);
}

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

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

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

.btn-block {
    width: 100%;
}

.btn-loader {
    animation: spin 1s linear infinite;
}

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

.login-footer {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.login-footer p {
    font-size: 12px;
    color: var(--text-muted);
}

.login-footer code {
    font-family: var(--font-mono);
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
}

/* Login Background */
.login-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.bg-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
}

.bg-shape-1 {
    width: 600px;
    height: 600px;
    background: var(--accent-primary);
    top: -200px;
    right: -100px;
}

.bg-shape-2 {
    width: 400px;
    height: 400px;
    background: var(--accent-secondary);
    bottom: -100px;
    left: -100px;
}

.bg-shape-3 {
    width: 300px;
    height: 300px;
    background: var(--success);
    bottom: 20%;
    right: 10%;
}

/* ===== Toast Notifications ===== */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    max-width: 400px;
    transform: translateX(120%);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    border-left: 3px solid var(--success);
}

.toast-error {
    border-left: 3px solid var(--error);
}

.toast-warning {
    border-left: 3px solid var(--warning);
}

.toast-info {
    border-left: 3px solid var(--info);
}

.toast-close {
    margin-left: auto;
    padding: 4px;
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1;
}

.toast-close:hover {
    color: var(--text-primary);
}

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

.app-container {
    display: flex;
    width: 100%;
}

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

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

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

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo svg {
    flex-shrink: 0;
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar.collapsed .logo-text {
    display: none;
}

.sidebar-toggle {
    padding: 8px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: var(--transition-fast);
}

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

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 16px 12px;
}

.sidebar.collapsed .sidebar-logo {
    cursor: pointer;
}

.sidebar.collapsed .sidebar-toggle {
    display: none;
}

/* Expand button for collapsed sidebar */
.sidebar-expand-btn {
    display: none;
    width: 100%;
    padding: 12px;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    transition: var(--transition-fast);
    justify-content: center;
}

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

.sidebar.collapsed .sidebar-expand-btn {
    display: flex;
}

.sidebar.collapsed .sidebar-footer {
    display: none;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

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

.nav-link.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
}

.nav-icon {
    flex-shrink: 0;
}

.sidebar.collapsed .nav-link span {
    display: none;
}

.nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 12px 0;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.storage-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.storage-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

.storage-bar {
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}

.storage-fill {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 2px;
}

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

.sidebar.collapsed ~ .main-content {
    margin-left: var(--sidebar-collapsed);
}

/* ===== Header ===== */
.header {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 24px;
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-menu-btn {
    display: none;
    padding: 8px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
}

.breadcrumb {
    font-size: 15px;
    font-weight: 500;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.site-selector {
    position: relative;
}

.site-selector-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.site-selector-btn:hover {
    border-color: var(--border-light);
}

.site-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--accent-primary);
    border-radius: var(--radius-sm);
    color: white;
}

.site-icon svg {
    width: 16px;
    height: 16px;
}

.site-selector-btn .chevron {
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.site-selector.open .chevron {
    transform: rotate(180deg);
}

.site-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 200px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
}

.site-selector.open .site-dropdown {
    opacity: 1;
    visibility: visible;
}

.site-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.site-dropdown-item:first-child {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.site-dropdown-item:last-child {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.site-dropdown-item:hover {
    background: var(--bg-hover);
}

.site-dropdown-item.active {
    background: rgba(99, 102, 241, 0.1);
}

.site-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.site-dropdown-item .check-icon {
    margin-left: auto;
    opacity: 0;
    color: var(--accent-primary);
}

.site-dropdown-item.active .check-icon {
    opacity: 1;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 200px;
    padding: 8px 12px 8px 40px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    width: 280px;
}

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

.header-search kbd {
    position: absolute;
    right: 10px;
    padding: 2px 6px;
    background: var(--bg-hover);
    border-radius: 4px;
    font-family: var(--font-sans);
    font-size: 11px;
    color: var(--text-muted);
}

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

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

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--error);
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.user-menu-btn:hover {
    background: var(--bg-hover);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.3;
}

.user-name {
    font-weight: 500;
    font-size: 13px;
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

.user-menu-btn .chevron {
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.user-menu.open .chevron {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
}

.user-menu.open .user-dropdown {
    opacity: 1;
    visibility: visible;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

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

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

.dropdown-item.danger:hover {
    background: var(--error-bg);
}

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

/* ===== Page Content ===== */
.page-content {
    flex: 1;
    padding: 24px;
}

.page {
    display: block;
}

.page.hidden {
    display: none;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
}

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

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

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

.stat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.stat-change {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
}

.stat-change.positive {
    background: var(--success-bg);
    color: var(--success);
}

.stat-change.negative {
    background: var(--error-bg);
    color: var(--error);
}

.stat-change.neutral {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

/* ===== Dashboard Grid ===== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

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

.card-header h3 {
    font-size: 15px;
    font-weight: 600;
}

.card-link {
    font-size: 13px;
    color: var(--accent-primary);
    transition: var(--transition-fast);
}

.card-link:hover {
    color: var(--accent-secondary);
}

/* ===== Activity List ===== */
.activity-list {
    padding: 8px 0;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 20px;
    transition: var(--transition-fast);
}

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

.activity-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-content p {
    font-size: 13px;
    line-height: 1.4;
}

.activity-content strong {
    font-weight: 500;
}

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

/* ===== Quick Actions ===== */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 20px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.action-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.action-btn span {
    font-size: 13px;
    font-weight: 500;
}

/* ===== Tables ===== */
.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

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

.table-search svg {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    pointer-events: none;
}

.table-search input {
    width: 280px;
    padding: 8px 12px 8px 40px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.table-search input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

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

.table-filters {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-select {
    padding: 8px 32px 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

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

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

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr {
    transition: var(--transition-fast);
}

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

.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-cell-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: white;
}

.user-cell-info {
    display: flex;
    flex-direction: column;
}

.user-cell-name {
    font-weight: 500;
}

.user-cell-sub {
    font-size: 12px;
    color: var(--text-muted);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
}

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

.status-badge.inactive {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

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

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

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

.plan-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
}

.plan-badge.free {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.plan-badge.basic {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
}

.plan-badge.premium {
    background: var(--warning-bg);
    color: var(--warning);
}

.action-buttons {
    display: flex;
    align-items: center;
    gap: 4px;
}

.action-btn-sm {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.action-btn-sm:hover {
    background: var(--bg-active);
    color: var(--text-primary);
}

.action-btn-sm.danger:hover {
    background: var(--error-bg);
    color: var(--error);
}

.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.table-info {
    font-size: 13px;
    color: var(--text-muted);
}

.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.pagination-btn:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.pagination-btn.active {
    background: var(--accent-primary);
    color: white;
}

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

.pagination-dots {
    padding: 0 4px;
    color: var(--text-muted);
}

/* ===== Subscription Stats ===== */
.subscription-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.sub-stat-card {
    padding: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

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

.sub-plan {
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
}

.sub-plan.free {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.sub-plan.basic {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
}

.sub-plan.premium {
    background: var(--warning-bg);
    color: var(--warning);
}

.sub-count {
    font-size: 20px;
    font-weight: 600;
}

.sub-stat-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.sub-stat-fill {
    height: 100%;
    border-radius: 3px;
}

/* ===== Roles Grid ===== */
.roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.role-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

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

.role-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.role-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.role-card-title h4 {
    font-size: 15px;
    font-weight: 600;
}

.role-card-title span {
    font-size: 12px;
    color: var(--text-muted);
}

.role-card-body {
    padding: 16px 20px;
}

.role-permissions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.permission-tag {
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border-radius: 100px;
    font-size: 12px;
    color: var(--text-secondary);
}

.permission-tag.granted {
    background: var(--success-bg);
    color: var(--success);
}

/* ===== Settings ===== */
.settings-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
}

.settings-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-align: left;
    transition: var(--transition-fast);
}

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

.settings-nav-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
}

.settings-content {
    min-width: 0;
}

.settings-tab {
    display: none;
}

.settings-tab.active {
    display: block;
}

.settings-form {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.form-input::placeholder {
    color: var(--text-muted);
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 8px;
}

.input-addon {
    display: flex;
    align-items: stretch;
}

.addon-text {
    display: flex;
    align-items: center;
    padding: 0 14px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-right: none;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    color: var(--text-muted);
    font-size: 13px;
}

.input-addon .form-input {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.file-upload {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-tertiary);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
}

.file-upload-preview {
    width: 72px;
    height: 72px;
    background: var(--bg-hover);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.file-upload-info p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.file-upload-info button {
    color: var(--accent-primary);
    font-weight: 500;
}

.file-upload-info span {
    font-size: 12px;
    color: var(--text-muted);
}

.color-picker {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-input {
    width: 44px;
    height: 44px;
    padding: 4px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
}

.color-picker .form-input {
    width: 120px;
    font-family: var(--font-mono);
}

/* ===== Integrations ===== */
.integrations-list {
    padding: 8px 0;
}

.integration-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

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

.integration-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.integration-info {
    flex: 1;
}

.integration-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.integration-info p {
    font-size: 13px;
    color: var(--text-muted);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-tertiary);
    border-radius: 24px;
    transition: var(--transition-fast);
}

.toggle-slider::before {
    position: absolute;
    content: '';
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--accent-primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* ===== Modals ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
}

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

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

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

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: var(--transition-fast);
}

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

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

/* ===== Permissions Grid ===== */
.permissions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.permission-group h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.permission-group .checkbox-wrapper {
    margin-bottom: 8px;
}

/* ===== Orders Page ===== */
.orders-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.order-stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

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

.order-stat-icon.pending {
    background: var(--warning-bg);
    color: var(--warning);
}

.order-stat-icon.processing {
    background: var(--info-bg);
    color: var(--info);
}

.order-stat-icon.shipped {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.order-stat-icon.completed {
    background: var(--success-bg);
    color: var(--success);
}

.order-stat-info {
    display: flex;
    flex-direction: column;
}

.order-stat-value {
    font-size: 22px;
    font-weight: 600;
}

.order-stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

.order-number {
    font-weight: 600;
    color: var(--accent-primary);
}

.order-items-preview {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-secondary);
    font-size: 13px;
}

.order-amount {
    font-weight: 600;
}

/* Order Status Badges */
.status-badge.pending {
    background: var(--warning-bg);
    color: var(--warning);
}

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

.status-badge.shipped {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

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

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

/* ===== Order Modal ===== */
.modal.modal-lg {
    max-width: 800px;
}

.order-detail-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 24px;
}

.order-section {
    margin-bottom: 24px;
}

.order-section:last-child {
    margin-bottom: 0;
}

.order-section h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* Order Items */
.order-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.order-item-image {
    width: 56px;
    height: 56px;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    overflow: hidden;
}

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

.order-item-info {
    flex: 1;
}

.order-item-name {
    font-weight: 500;
    margin-bottom: 2px;
}

.order-item-variant {
    font-size: 12px;
    color: var(--text-muted);
}

.order-item-qty {
    font-size: 13px;
    color: var(--text-secondary);
    margin-right: 16px;
}

.order-item-price {
    font-weight: 600;
    min-width: 70px;
    text-align: right;
}

/* Order Totals */
.order-totals {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.order-total-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.order-total-row.total {
    padding-top: 12px;
    margin-top: 8px;
    border-top: 1px solid var(--border-color);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Order Timeline */
.order-timeline {
    position: relative;
    padding-left: 24px;
}

.order-timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-bottom: 16px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-light);
}

.timeline-item.active::before {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.timeline-item-title {
    font-weight: 500;
    margin-bottom: 2px;
}

.timeline-item-date {
    font-size: 12px;
    color: var(--text-muted);
}

/* Order Customer */
.order-customer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.customer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: white;
}

.customer-info {
    display: flex;
    flex-direction: column;
}

.customer-name {
    font-weight: 500;
}

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

.customer-contacts {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.contact-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.contact-row svg {
    color: var(--text-muted);
}

/* Shipping Address */
.shipping-address {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.shipping-address p {
    margin-bottom: 4px;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ===== Catalog ===== */
.catalog-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.catalog-stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.catalog-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.catalog-stat-icon.total {
    background: rgba(99, 102, 241, 0.15);
    color: #6366f1;
}

.catalog-stat-icon.active {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.catalog-stat-icon.out {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.catalog-stat-icon.value {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.catalog-stat-info {
    display: flex;
    flex-direction: column;
}

.catalog-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.catalog-stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

/* Product Cell */
.product-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.product-image {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    flex-shrink: 0;
}

.product-info {
    display: flex;
    flex-direction: column;
}

.product-name {
    font-weight: 500;
    color: var(--text-primary);
}

.product-sku {
    font-size: 12px;
    color: var(--text-muted);
    font-family: monospace;
}

/* Category Badge */
.category-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Price Cell */
.price-cell {
    font-weight: 600;
    color: var(--text-primary);
}

/* Stock Badge */
.stock-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}

.stock-badge.ok {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.stock-badge.low {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.stock-badge.out_of_stock {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Image Upload Area */
.image-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
}

.image-upload-area:hover {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.05);
}

.image-upload-area svg {
    opacity: 0.5;
}

.image-upload-area span {
    font-size: 13px;
}

/* ===== Messages / Live Chat ===== */
.messages-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
}

.messages-stat {
    display: flex;
    align-items: center;
    gap: 8px;
}

.messages-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.messages-stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

.messages-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    height: calc(100vh - 260px);
    min-height: 500px;
}

/* Conversations Panel */
.conversations-panel {
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.conversations-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
}

.conversations-search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
}

.conversations-search input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 13px;
}

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

.conversations-search svg {
    color: var(--text-muted);
}

.filter-select-sm {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    color: var(--text-primary);
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
}

/* Conversation Item */
.conversation-item {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.15s ease;
}

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

.conversation-item.active {
    background: rgba(99, 102, 241, 0.1);
    border-left: 3px solid var(--accent-primary);
}

.conversation-item.unread {
    background: rgba(99, 102, 241, 0.05);
}

.conversation-item.unread .conversation-name,
.conversation-item.unread .conversation-subject {
    font-weight: 600;
}

.conversation-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    color: white;
    flex-shrink: 0;
}

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

.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.conversation-name {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
}

.conversation-time {
    font-size: 11px;
    color: var(--text-muted);
}

.conversation-subject {
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-preview {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
}

.conversation-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.conversation-channel {
    color: var(--text-muted);
    display: flex;
}

.conversation-status {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.conversation-status.open {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.conversation-status.pending {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.conversation-status.resolved {
    background: rgba(107, 114, 128, 0.15);
    color: #6b7280;
}

.conversation-unread {
    background: var(--accent-primary);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Chat Panel */
.chat-panel {
    display: none;
    flex-direction: column;
    background: var(--bg-primary);
}

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

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.chat-customer {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-customer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    color: white;
}

.chat-customer-info {
    display: flex;
    flex-direction: column;
}

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

.chat-customer-email {
    font-size: 12px;
    color: var(--text-muted);
}

.chat-customer {
    position: relative;
}

.chat-customer-info {
    cursor: pointer;
    padding: 4px 8px;
    margin: -4px -8px;
    border-radius: 6px;
    transition: background 0.15s;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-right: 20px;
}

.chat-customer-info:hover {
    background: var(--bg-tertiary);
}

.chat-customer-chevron {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
    transition: transform 0.2s, opacity 0.2s;
}

.chat-customer-info:hover .chat-customer-chevron {
    opacity: 1;
}

.chat-customer.open .chat-customer-chevron {
    transform: translateY(-50%) rotate(180deg);
}

.customer-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s;
    z-index: 100;
}

.chat-customer.open .customer-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.customer-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 13px;
    transition: background 0.15s;
}

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

.customer-dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.customer-dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

.customer-dropdown-item svg {
    opacity: 0.6;
}

.chat-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-subject {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-secondary);
}

.chat-subject svg {
    color: var(--text-muted);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Chat Message */
.chat-message {
    display: flex;
    gap: 12px;
    max-width: 80%;
}

.chat-message.customer {
    align-self: flex-start;
}

.chat-message.agent {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 11px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.chat-message.customer .message-avatar {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
}

.chat-message.agent .message-avatar {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.message-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.message-sender {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.message-time {
    font-size: 11px;
    color: var(--text-muted);
}

.message-text {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
}

.chat-message.agent .message-text {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.2);
}

/* Chat Input */
.chat-input-area {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.chat-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text-primary);
    resize: none;
    min-height: 42px;
    max-height: 120px;
}

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

.chat-input::placeholder {
    color: var(--text-muted);
}

.chat-input-actions {
    display: flex;
    gap: 8px;
}

.chat-attach-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s ease;
}

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

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

/* Chat Empty State */
.chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
    text-align: center;
}

.chat-empty svg {
    margin-bottom: 16px;
    opacity: 0.3;
}

.chat-empty h3 {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.chat-empty p {
    font-size: 14px;
}

/* Nav Badge */
.nav-badge {
    background: var(--accent-primary);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    margin-left: auto;
}

/* ===== Reviews ===== */
.reviews-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.reviews-stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.reviews-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reviews-stat-icon.rating {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.reviews-stat-icon.total {
    background: rgba(99, 102, 241, 0.15);
    color: #6366f1;
}

.reviews-stat-icon.pending {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.reviews-stat-icon.five-star {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.reviews-stat-info {
    display: flex;
    flex-direction: column;
}

.reviews-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.reviews-stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

.reviews-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.reviews-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Review Card */
.review-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.review-customer {
    display: flex;
    align-items: center;
    gap: 12px;
}

.review-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    color: white;
}

.review-customer-info {
    display: flex;
    flex-direction: column;
}

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

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

.review-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.review-status {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.review-status.published {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.review-status.pending {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.review-rating {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.stars {
    display: flex;
    gap: 2px;
}

.star {
    color: var(--text-muted);
}

.star.filled {
    color: #f59e0b;
}

.review-helpful {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

.review-content {
    margin-bottom: 16px;
}

.review-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.review-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.review-reply {
    background: var(--bg-tertiary);
    border-left: 3px solid var(--accent-primary);
    border-radius: 0 8px 8px 0;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.review-reply-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 6px;
}

.review-reply p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.review-actions {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

/* ===== User Profile Modal ===== */
.modal-xl {
    max-width: 900px;
    width: 95%;
}

.profile-header-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.profile-avatar-lg {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: white;
}

.profile-header-text {
    display: flex;
    flex-direction: column;
}

.profile-header-text h2 {
    margin: 0;
    font-size: 18px;
}

.profile-header-text span {
    font-size: 13px;
    color: var(--text-muted);
}

.profile-status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.profile-status-badge.active {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.profile-status-badge.inactive {
    background: rgba(107, 114, 128, 0.15);
    color: #6b7280;
}

.profile-status-badge.banned {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Profile Tabs */
.profile-tabs {
    display: flex;
    gap: 4px;
    padding: 0 24px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.profile-tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.profile-tab-btn:hover {
    color: var(--text-primary);
}

.profile-tab-btn.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.profile-tab-btn svg {
    width: 16px;
    height: 16px;
}

.profile-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.profile-tab-panel {
    display: none;
}

.profile-tab-panel.active {
    display: block;
}

/* Profile Grid */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.profile-section {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

.profile-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.profile-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.info-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.info-value.highlight {
    color: var(--accent-primary);
    font-weight: 600;
}

.profile-address {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.profile-notes {
    width: 100%;
    min-height: 80px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    font-size: 13px;
    color: var(--text-primary);
    resize: vertical;
}

.profile-notes:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Profile Devices */
.profile-devices-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-device-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
}

.profile-device-card.online {
    border-left: 3px solid #10b981;
}

.profile-device-card.offline {
    border-left: 3px solid var(--text-muted);
    opacity: 0.7;
}

.device-icon-wrap {
    width: 44px;
    height: 44px;
    background: var(--bg-secondary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.device-icon-wrap svg {
    width: 24px;
    height: 24px;
    stroke: var(--text-secondary);
    fill: none;
    stroke-width: 1.5;
}

.device-details {
    flex: 1;
}

.device-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

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

.device-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.device-status-dot.online {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.device-status-dot.offline {
    background: var(--text-muted);
}

.device-meta-row {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.device-meta-row code {
    background: var(--bg-secondary);
    padding: 1px 4px;
    border-radius: 3px;
}

.device-activity {
    font-size: 11px;
    color: var(--text-muted);
}

.btn-disconnect {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.btn-disconnect:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

.btn-disconnect svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

/* Profile Tables */
.profile-table {
    width: 100%;
    border-collapse: collapse;
}

.profile-table th,
.profile-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.profile-table th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
}

.profile-table td {
    font-size: 13px;
    color: var(--text-primary);
}

.profile-table code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

/* Profile Cards */
.profile-cards-section,
.profile-payments-section {
    margin-bottom: 24px;
}

.profile-cards-section h4,
.profile-payments-section h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.profile-card-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 8px;
}

.card-brand-icon {
    width: 40px;
    height: 26px;
    background: var(--bg-secondary);
    border-radius: 4px;
}

.card-brand-icon.visa {
    background: linear-gradient(135deg, #1a1f71, #2563eb);
}

.card-brand-icon.mastercard {
    background: linear-gradient(135deg, #eb001b, #f79e1b);
}

.card-brand-icon.amex {
    background: linear-gradient(135deg, #006fcf, #00aeef);
}

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

.card-default {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: auto;
}

.payment-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.payment-badge.paid {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

/* Profile Tickets */
.profile-ticket-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 8px;
}

.ticket-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ticket-id {
    font-size: 11px;
    color: var(--text-muted);
    font-family: monospace;
}

.ticket-subject {
    font-weight: 500;
    color: var(--text-primary);
}

.ticket-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.ticket-status {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.ticket-status.open {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.ticket-status.resolved {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.empty-icon {
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-icon svg {
    width: 48px;
    height: 48px;
    stroke: currentColor;
}

/* Users Table Enhancements */
.user-cell-email {
    font-size: 12px;
    color: var(--text-muted);
}

.devices-indicator {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.devices-count {
    font-weight: 600;
    color: var(--text-primary);
}

.devices-label {
    font-size: 11px;
    color: var(--text-muted);
}

.last-login-cell {
    font-size: 12px;
    color: var(--text-muted);
}

.action-btn-sm.primary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
}

.action-btn-sm.primary:hover {
    background: rgba(99, 102, 241, 0.2);
}

/* ===== User Profile Page ===== */
.user-profile-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Back Button */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 8px 0;
    transition: color 0.2s ease;
}

.btn-back:hover {
    color: var(--text-primary);
}

/* Profile Hero */
.profile-page-header {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.profile-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    gap: 24px;
}

.profile-hero-left {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.profile-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.profile-avatar-large.blocked {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
}

.profile-hero-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-hero-name {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.status-badge {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 500;
}

.status-badge.success {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.status-badge.danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.status-badge.warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.flag-badge {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
}

.flag-badge.danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Priority dots */
.priority-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.priority-dot.high {
    background: #ef4444;
}

.priority-dot.medium {
    background: #f59e0b;
}

/* Source icons */
.source-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.source-icon.direct { background: rgba(99, 102, 241, 0.15); color: #6366f1; }
.source-icon.organic { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.source-icon.social { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.source-icon.referral { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.source-icon.paid { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }

/* Content type icons */
.content-type-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.content-type-icon.live { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.content-type-icon.movie { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.content-type-icon.series { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.content-type-icon.sports { background: rgba(16, 185, 129, 0.15); color: #10b981; }

/* Platform icons */
.platform-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.platform-icon.android { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.platform-icon.web { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }

/* Entity icons */
.entity-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.entity-icon.ticket { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.entity-icon.subscription { background: rgba(99, 102, 241, 0.15); color: #6366f1; }
.entity-icon.payment { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.entity-icon.security { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

/* Log icons */
.log-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 20px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.log-icon.login { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.log-icon.logout { background: rgba(156, 163, 175, 0.15); color: #9ca3af; }
.log-icon.watch { background: rgba(99, 102, 241, 0.15); color: #6366f1; }
.log-icon.settings { background: rgba(107, 114, 128, 0.15); color: #6b7280; }
.log-icon.payment { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.log-icon.subscription { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.log-icon.device { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.log-icon.security { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.log-icon.support { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.log-icon.error { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

/* Warning mark */
.warning-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.profile-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    color: var(--text-muted);
    font-size: 14px;
}

.profile-hero-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.profile-hero-meta svg {
    opacity: 0.6;
}

.profile-hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.plan-badge {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.plan-badge.premium {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.plan-badge.basic {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
}

.plan-badge.free {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.verify-badge {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.profile-hero-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 16px;
}

.profile-quick-stats {
    display: flex;
    gap: 24px;
}

.quick-stat {
    text-align: center;
}

.quick-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.quick-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-actions {
    display: flex;
    gap: 8px;
}

/* Profile Layout */
.profile-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
}

/* Profile Sidebar */
.profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px;
}

.profile-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: none;
    background: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

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

.profile-nav-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
}

.profile-nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-counter {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--accent-primary);
    color: white;
}

.nav-counter.danger {
    background: #ef4444;
}

.profile-sidebar-footer {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
}

.last-activity {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.last-activity .label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.last-activity .value {
    font-size: 13px;
    color: var(--text-primary);
}

/* Profile Main Content */
.profile-main {
    min-width: 0;
}

.profile-section-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.section-subtitle {
    font-size: 14px;
    color: var(--text-muted);
}

.section-actions {
    display: flex;
    gap: 8px;
}

/* Profile Cards */
.profile-overview-grid,
.activity-grid,
.payments-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.profile-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.profile-card.full-width {
    grid-column: 1 / -1;
}

.profile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.profile-card-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.profile-card-body {
    padding: 20px;
}

/* Subscription Info */
.subscription-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.subscription-plan {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.plan-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.plan-price {
    font-size: 14px;
    color: var(--text-muted);
}

.subscription-dates {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.date-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.date-row span:first-child {
    color: var(--text-muted);
}

.date-row span:last-child {
    color: var(--text-primary);
}

/* Info List */
.info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.info-label {
    color: var(--text-muted);
}

.info-value {
    color: var(--text-primary);
}

/* Code Item */
.code-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-bottom: 8px;
}

.code-item:last-child {
    margin-bottom: 0;
}

.code-item code {
    font-size: 13px;
    color: var(--accent-primary);
}

.code-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Admin Notes */
.admin-notes {
    width: 100%;
    min-height: 100px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    color: var(--text-primary);
    resize: vertical;
    font-family: inherit;
}

.admin-notes:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Devices Grid */
.devices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.device-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.device-card.online {
    border-color: rgba(16, 185, 129, 0.3);
}

.device-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-tertiary);
}

.device-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-secondary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.device-icon svg {
    width: 28px;
    height: 28px;
    stroke: var(--text-secondary);
}

.device-icon.smart_tv svg { stroke: #f59e0b; }
.device-icon.mobile svg { stroke: #6366f1; }
.device-icon.tablet svg { stroke: #10b981; }

.device-status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.device-status-indicator.online {
    background: #10b981;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
}

.device-status-indicator.offline {
    background: var(--text-muted);
}

.device-card-body {
    padding: 16px;
}

.device-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.device-model {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.device-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.detail-label {
    color: var(--text-muted);
}

.detail-value {
    color: var(--text-primary);
}

.detail-value code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.device-ua {
    background: var(--bg-tertiary);
    padding: 8px 10px;
    border-radius: 6px;
}

.device-ua code {
    font-size: 11px;
    color: var(--text-muted);
    word-break: break-all;
}

.device-card-footer {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

/* Sessions Table */
.sessions-table-wrapper {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

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

.sessions-table th,
.sessions-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.sessions-table th {
    background: var(--bg-tertiary);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.sessions-table td {
    font-size: 13px;
    color: var(--text-primary);
}

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

.sessions-table tr.flagged {
    background: rgba(239, 68, 68, 0.05);
}

.ip-address {
    font-size: 12px;
    background: var(--bg-tertiary);
    padding: 3px 8px;
    border-radius: 4px;
}

.ip-flag {
    font-size: 9px;
    padding: 2px 5px;
    border-radius: 3px;
    margin-left: 6px;
    font-weight: 600;
}

.ip-flag.danger {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.ip-flag.warning {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.browser-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.browser-info .browser {
    font-weight: 500;
}

.browser-info .os {
    font-size: 11px;
    color: var(--text-muted);
}

.device-type-badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--bg-tertiary);
}

.high-pages {
    color: #f59e0b;
    font-weight: 600;
}

.session-status {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.session-status.active {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.session-status.expired {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.session-status.terminated {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.session-status.blocked {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.action-buttons {
    display: flex;
    gap: 4px;
}

.action-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s ease;
}

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

/* Activity Stats */
.activity-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.activity-stat {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.activity-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.activity-stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Pages List */
.pages-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.page-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: 6px;
}

.page-path {
    font-family: monospace;
    font-size: 13px;
    color: var(--accent-primary);
}

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

/* Activity Chart */
.activity-chart {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 100px;
    gap: 8px;
}

.chart-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.chart-bar .bar {
    width: 100%;
    background: linear-gradient(180deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 4px 4px 0 0;
    min-height: 4px;
}

.chart-bar .bar-label {
    font-size: 11px;
    color: var(--text-muted);
}

/* Watch History */
.watch-history {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.watch-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.watch-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.watch-title {
    font-weight: 500;
    color: var(--text-primary);
}

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

.watch-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.watch-duration {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Payment Cards */
.payment-card-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-bottom: 8px;
}

.payment-card-item:last-child {
    margin-bottom: 0;
}

.card-brand {
    width: 48px;
    height: 32px;
    border-radius: 6px;
}

.card-brand.visa {
    background: linear-gradient(135deg, #1a1f71, #2563eb);
}

.card-brand.mastercard {
    background: linear-gradient(135deg, #eb001b, #f79e1b);
}

.card-brand.mir {
    background: linear-gradient(135deg, #00a650, #00a650);
}

.card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.card-number {
    font-weight: 500;
    color: var(--text-primary);
}

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

/* Tickets */
.tickets-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ticket-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.ticket-card.open {
    border-left: 3px solid #f59e0b;
}

.ticket-card.resolved {
    border-left: 3px solid #10b981;
}

.ticket-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
}

.ticket-id {
    font-family: monospace;
    font-size: 12px;
    color: var(--text-muted);
}

.ticket-priority {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.ticket-priority.low {
    background: var(--bg-secondary);
    color: var(--text-muted);
}

.ticket-priority.medium {
    background: rgba(99, 102, 241, 0.15);
    color: #6366f1;
}

.ticket-priority.high {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.ticket-priority.critical {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.ticket-card-body {
    padding: 16px;
}

.ticket-subject {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.ticket-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
}

.ticket-card-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

/* Security */
.security-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.flag-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.flag-item.verified {
    border-color: rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.flag-item.danger {
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.flag-icon {
    font-size: 16px;
}

/* Blocks List */
.blocks-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.block-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.block-item.permanent {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.05);
}

.block-type {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.block-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.block-reason {
    font-weight: 500;
    color: var(--text-primary);
}

.block-details {
    font-size: 13px;
    color: var(--text-secondary);
}

.block-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.permanent-badge {
    color: #ef4444;
    font-weight: 600;
}

.block-actions {
    display: flex;
    align-items: flex-start;
}

/* Total Spent */
.total-spent {
    font-size: 14px;
    color: var(--text-muted);
}

.total-spent strong {
    color: var(--text-primary);
    font-size: 18px;
}

/* Empty State Small */
.empty-state.small {
    padding: 20px;
}

.empty-state.small p {
    margin: 0;
}

/* Text Muted */
.text-muted {
    color: var(--text-muted);
    font-size: 14px;
}

/* Generic Badge */
.badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.badge.success {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.badge.warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.badge.danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.badge.muted {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

/* ===== Referrals Section ===== */
.referral-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.referral-stats-grid .stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
}

.referral-stats-grid .stat-card .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.referral-stats-grid .stat-card .stat-label {
    font-size: 12px;
    color: var(--text-muted);
}

.referral-stats-grid .stat-card.accent .stat-value {
    color: var(--accent);
}

.referral-stats-grid .stat-card.success .stat-value {
    color: var(--success);
}

.referral-code-card .referral-info-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 16px;
}

.referral-code-card .ref-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.referral-code-card .ref-item label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.referral-code-card .ref-value {
    display: flex;
    align-items: center;
    gap: 8px;
}

.referral-code-card .ref-value code {
    background: var(--bg-tertiary);
    padding: 8px 12px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 14px;
    color: var(--text-primary);
}

.referral-code-card .ref-value code.ref-link {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.referral-code-card .btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.referral-code-card .btn-icon:hover {
    opacity: 1;
}

/* Data table in referrals */
.data-table .user-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.data-table .user-cell .user-name {
    font-weight: 500;
    color: var(--text-primary);
}

.data-table .user-cell .user-email {
    font-size: 12px;
    color: var(--text-muted);
}

.data-table .amount {
    font-weight: 600;
    color: var(--success);
}

.data-table .status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.data-table .status-badge.active {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.data-table .status-badge.inactive {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

/* ===== Logs Section ===== */
.log-filters {
    display: flex;
    gap: 12px;
}

.log-filters .form-control-sm {
    padding: 6px 12px;
    font-size: 13px;
    min-width: 150px;
}

.logs-timeline {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    overflow: hidden;
}

.log-entry {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 14px 16px;
    background: var(--bg-secondary);
    transition: background 0.2s;
}

.log-entry:hover {
    background: var(--bg-hover);
}

.log-entry.log-auth {
    border-left: 3px solid var(--accent);
}

.log-entry.log-payment {
    border-left: 3px solid var(--success);
}

.log-entry.log-error {
    border-left: 3px solid var(--danger);
}

.log-entry.log-security {
    border-left: 3px solid var(--warning);
}

.log-icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}

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

.log-description {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.log-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.log-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.log-device {
    color: var(--text-secondary);
}

.log-ip {
    font-family: monospace;
}

.logs-pagination {
    display: flex;
    justify-content: center;
    padding-top: 16px;
}

/* Empty state small variant */
.empty-state.small {
    padding: 32px 20px;
}

.empty-state.small h3 {
    font-size: 14px;
}

.empty-state.small p {
    font-size: 13px;
}

/* ===== DatePicker Component ===== */
.datepicker {
    position: relative;
    display: inline-block;
}

.datepicker-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 14px;
    transition: border-color 0.15s;
    min-width: 240px;
}

.datepicker-trigger:hover {
    border-color: var(--accent-primary);
}

.datepicker-trigger svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.datepicker-trigger .datepicker-text {
    flex: 1;
}

.datepicker-arrow {
    color: var(--text-muted);
}

.datepicker-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1000;
    display: none;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.datepicker-dropdown.open {
    display: block;
}

.datepicker-body {
    display: flex;
}

/* Presets */
.datepicker-presets {
    display: flex;
    flex-direction: column;
    padding: 12px;
    background: var(--bg-tertiary);
    border-right: 1px solid var(--border-color);
    min-width: 150px;
}

.preset-btn {
    padding: 10px 14px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
    white-space: nowrap;
}

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

.preset-btn.active {
    background: var(--accent-primary);
    color: white;
}

/* Calendar */
.datepicker-calendar {
    padding: 16px;
    min-width: 300px;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    transition: all var(--transition-fast);
}

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

.calendar-title {
    display: flex;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 8px;
}

.weekday {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-day {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    border-radius: 6px;
}

.calendar-day:hover:not(.disabled):not(.other-month) {
    background: var(--bg-hover);
}

.calendar-day.other-month {
    color: var(--text-muted);
    opacity: 0.4;
}

.calendar-day.today {
    color: var(--accent-primary);
    font-weight: 700;
}

.calendar-day.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.calendar-day.selected {
    background: var(--accent-primary);
    color: white;
    font-weight: 600;
}

.calendar-day.in-range {
    background: rgba(99, 102, 241, 0.2);
}

/* Footer */
.datepicker-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

.datepicker-actions {
    display: flex;
    gap: 8px;
}

.datepicker-actions .btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
}

/* Responsive DatePicker */
@media (max-width: 768px) {
    .datepicker-body {
        flex-direction: column;
    }

    .datepicker-presets {
        flex-direction: row;
        flex-wrap: wrap;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        min-width: 0;
    }

    .preset-btn {
        flex: 0 0 auto;
        padding: 8px 12px;
    }

    .datepicker-calendar {
        min-width: 0;
    }
}

/* ===== Analytics Section ===== */
.analytics-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.analytics-period .form-control-sm {
    min-width: 160px;
}

.analytics-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.analytics-stat {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.analytics-stat .stat-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 10px;
    color: var(--accent);
}

.analytics-stat .stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

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

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.analytics-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
}

.analytics-card.full-width {
    grid-column: 1 / -1;
}

.analytics-card h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.analytics-card h4 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 16px 0 10px 0;
}

/* Traffic Sources */
.traffic-sources-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.traffic-source-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.source-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 100px;
}

.source-icon {
    font-size: 16px;
}

.source-name {
    font-size: 13px;
    color: var(--text-primary);
}

.source-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    margin-left: 20px;
}

.source-visits {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 30px;
}

.source-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.source-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s;
}

.source-percent {
    font-size: 12px;
    color: var(--text-muted);
    min-width: 40px;
    text-align: right;
}

.traffic-attribution {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.attr-item {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 6px;
}

.attr-label {
    color: var(--text-muted);
}

.attr-value {
    color: var(--text-primary);
}

/* Top Pages */
.top-pages-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.top-page-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: 6px;
}

.page-rank {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.page-info {
    flex: 1;
}

.page-title {
    display: block;
    font-size: 13px;
    color: var(--text-primary);
}

.page-path {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
}

.page-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.page-views {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.page-time {
    font-size: 11px;
    color: var(--text-muted);
}

/* Referrers */
.referrers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.referrer-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 10px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    font-size: 13px;
}

.referrer-domain {
    color: var(--text-primary);
}

.referrer-visits {
    color: var(--text-muted);
}

/* Campaigns */
.campaigns-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.campaign-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: 6px;
}

.campaign-name {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.campaign-source {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
}

.campaign-stats {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Devices breakdown */
.devices-breakdown {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.device-type-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.device-name {
    min-width: 100px;
    font-size: 13px;
    color: var(--text-primary);
}

.device-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.device-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #8b5cf6);
    border-radius: 4px;
}

.device-percent {
    min-width: 40px;
    text-align: right;
    font-size: 12px;
    color: var(--text-muted);
}

.browsers-breakdown {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.browser-item {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    padding: 4px 0;
    color: var(--text-secondary);
}

/* Locations */
.locations-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.location-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--bg-tertiary);
    border-radius: 6px;
}

.location-flag {
    font-size: 18px;
}

.location-city {
    flex: 1;
    font-size: 13px;
    color: var(--text-primary);
}

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

/* Events */
.events-breakdown {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.event-type-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 10px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    font-size: 12px;
}

.event-label {
    color: var(--text-secondary);
}

.event-count {
    font-weight: 600;
    color: var(--text-primary);
}

/* Performance */
.performance-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.perf-metric {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: 6px;
}

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

.perf-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.perf-value.perf-good { color: var(--success); }
.perf-value.perf-medium { color: var(--warning); }
.perf-value.perf-bad { color: var(--danger); }

/* Sessions Journey */
.sessions-journey {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.journey-session {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.journey-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-tertiary);
}

.journey-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
}

.journey-date {
    color: var(--text-primary);
    font-weight: 500;
}

.journey-duration,
.journey-device,
.journey-source {
    color: var(--text-muted);
}

.journey-pages {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s;
}

.journey-pages.expanded {
    max-height: 500px;
}

.journey-page {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
}

.journey-page:last-child {
    border-bottom: none;
}

.journey-page .page-num {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 600;
}

.journey-page .page-path {
    font-family: monospace;
    font-size: 12px;
    color: var(--text-muted);
    min-width: 120px;
}

.journey-page .page-title {
    flex: 1;
    font-size: 13px;
    color: var(--text-primary);
}

.journey-page .page-duration {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== Content Section ===== */
.content-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.content-stat {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.content-stat .stat-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(139, 92, 246, 0.15);
    border-radius: 10px;
    color: #8b5cf6;
}

.content-stat .stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

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

.content-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.content-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
}

.content-card.full-width {
    grid-column: 1 / -1;
}

.content-card h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

/* Favorite Channels */
.favorite-channels-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.channel-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.channel-rank {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 600;
}

.channel-logo {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 6px;
    font-size: 20px;
}

.channel-info {
    flex: 1;
}

.channel-name {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.channel-sessions {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
}

.channel-time {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
}

/* Categories */
.categories-breakdown {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-info {
    min-width: 100px;
}

.category-name {
    display: block;
    font-size: 13px;
    color: var(--text-primary);
}

.category-time {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
}

.category-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.category-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #ec4899);
    border-radius: 4px;
}

.category-percent {
    min-width: 40px;
    text-align: right;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Watch Time by Hour */
.watch-time-hours {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 120px;
    padding: 10px 0;
}

.hour-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.hour-label {
    font-size: 10px;
    color: var(--text-muted);
}

.hour-bar {
    width: 24px;
    height: 80px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.hour-bar-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, #8b5cf6, #6366f1);
    border-radius: 4px;
    transition: height 0.3s;
}

.hour-percent {
    font-size: 10px;
    color: var(--text-muted);
}

/* Quality Stats */
.quality-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.quality-metric {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: 6px;
}

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

.quality-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.quality-value.quality-bad {
    color: var(--danger);
}

/* Platforms Breakdown */
.platforms-breakdown {
    margin-bottom: 24px;
}

.platforms-breakdown h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px 0;
}

.platforms-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.platform-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: border-color 0.2s;
}

.platform-card:hover {
    border-color: var(--border-light);
}

.platform-card.android {
    border-left: 4px solid #3ddc84;
}

.platform-card.web {
    border-left: 4px solid var(--accent);
}

.platform-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.platform-icon {
    font-size: 24px;
}

.platform-name {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.platform-percent {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
}

.platform-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.platform-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.platform-stat .stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.platform-stat .stat-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.platform-stat .stat-value.stat-warning {
    color: var(--warning);
}

.platform-devices {
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
}

.platform-devices .devices-label {
    color: var(--text-muted);
}

.platform-devices .devices-list {
    color: var(--text-secondary);
}

/* Channel Platform Badge */
.channel-platform {
    font-size: 16px;
    margin-left: auto;
    margin-right: 8px;
}

/* History Platform Badge */
.history-platform {
    flex-shrink: 0;
}

.platform-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 16px;
    background: var(--bg-tertiary);
}

.platform-badge.android {
    background: rgba(61, 220, 132, 0.15);
}

.platform-badge.web {
    background: rgba(59, 130, 246, 0.15);
}

/* Watch History */
.watch-history-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.watch-history-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-tertiary);
}

.history-icon {
    font-size: 24px;
}

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

.history-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

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

.history-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    font-size: 11px;
    color: var(--text-muted);
}

.history-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 100px;
}

.history-progress .progress-bar {
    flex: 1;
    height: 4px;
    background: var(--bg-secondary);
    border-radius: 2px;
    overflow: hidden;
}

.history-progress .progress-fill {
    height: 100%;
    background: var(--success);
    border-radius: 2px;
}

.history-progress .progress-text {
    font-size: 11px;
    color: var(--text-muted);
    min-width: 35px;
}

.history-duration {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    min-width: 60px;
    text-align: right;
}

/* ===== Tasks Section ===== */
.tasks-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.task-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    min-width: 100px;
}

.task-stat .stat-count {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.task-stat .stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.task-stat.todo {
    border-left: 3px solid var(--text-muted);
}

.task-stat.progress {
    border-left: 3px solid var(--accent);
}

.task-stat.completed {
    border-left: 3px solid var(--success);
}

.tasks-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tasks-filters .form-control-sm {
    min-width: 150px;
}

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.task-card:hover {
    border-color: var(--border-light);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.task-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.task-priority-indicator {
    width: 4px;
    height: 24px;
    border-radius: 2px;
    background: var(--text-muted);
}

.task-priority-indicator.priority-low {
    background: var(--text-muted);
}

.task-priority-indicator.priority-medium {
    background: var(--accent);
}

.task-priority-indicator.priority-high {
    background: var(--warning);
}

.task-priority-indicator.priority-urgent {
    background: var(--danger);
    animation: pulse-urgent 1.5s infinite;
}

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

.task-status {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.task-status.status-todo {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.task-status.status-progress {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent);
}

.task-status.status-completed {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.task-status.status-cancelled {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.task-department {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    margin-left: auto;
}

.task-department.dept-support {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

.task-department.dept-technical {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent);
}

.task-department.dept-billing {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.task-department.dept-sales {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
}

.task-linked {
    font-size: 16px;
    cursor: help;
}

.task-card-body {
    padding: 16px;
}

.task-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.task-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.task-card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
    font-size: 13px;
}

.task-assignee {
    display: flex;
    align-items: center;
    gap: 8px;
}

.assignee-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
}

.assignee-name {
    color: var(--text-primary);
}

.assignee-unassigned {
    color: var(--text-muted);
    font-style: italic;
}

.task-due {
    color: var(--text-secondary);
}

.task-due.overdue {
    color: var(--danger);
    font-weight: 500;
}

.task-comments {
    color: var(--text-muted);
}

.task-card-actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
}

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

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

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

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

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

    .orders-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .catalog-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .reviews-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .order-detail-grid {
        grid-template-columns: 1fr;
    }

    .order-detail-sidebar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    /* User Profile Modal */
    .modal.modal-xl {
        max-width: 95%;
    }

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

    /* User Profile Page */
    .profile-overview-grid,
    .activity-grid,
    .payments-grid {
        grid-template-columns: 1fr;
    }

    .activity-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .profile-quick-stats {
        gap: 16px;
    }
}

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

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

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

    .mobile-menu-btn {
        display: flex;
    }

    .header-search {
        display: none;
    }

    .user-info {
        display: none;
    }

    .messages-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .conversations-panel {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        max-height: 300px;
    }

    .chat-panel {
        min-height: 400px;
    }

    .chat-empty {
        display: none;
    }

    .settings-layout {
        grid-template-columns: 1fr;
    }

    .settings-nav {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 8px;
    }

    .settings-nav-item {
        white-space: nowrap;
    }

    /* User Profile */
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .profile-header-info {
        align-items: center;
    }

    .profile-header-stats {
        justify-content: center;
    }

    .profile-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
        gap: 4px;
    }

    .profile-tab-btn {
        white-space: nowrap;
        padding: 8px 12px;
        font-size: 12px;
    }

    .profile-device-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .device-meta-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .btn-disconnect {
        align-self: flex-end;
    }

    .profile-table {
        display: block;
        overflow-x: auto;
    }

    /* User Profile Page */
    .profile-layout {
        grid-template-columns: 1fr;
    }

    .profile-sidebar {
        order: 2;
    }

    .profile-main {
        order: 1;
    }

    .profile-nav {
        flex-direction: row;
        overflow-x: auto;
        padding: 8px;
    }

    .profile-nav-item {
        flex-direction: column;
        gap: 4px;
        padding: 10px 14px;
        font-size: 11px;
    }

    .profile-nav-item span:not(.nav-counter) {
        display: none;
    }

    .profile-hero {
        flex-direction: column;
    }

    .profile-hero-right {
        align-items: stretch;
        width: 100%;
    }

    .profile-actions {
        flex-wrap: wrap;
    }

    .profile-actions .btn {
        flex: 1;
        min-width: 120px;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

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

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

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

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

    .reviews-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .review-header {
        flex-direction: column;
        gap: 12px;
    }

    .review-actions {
        flex-wrap: wrap;
    }

    .order-detail-sidebar {
        grid-template-columns: 1fr;
    }

    .modal.modal-lg {
        max-width: 95%;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .page-header .btn {
        width: 100%;
    }

    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .table-search input {
        width: 100%;
    }

    .table-filters {
        flex-wrap: wrap;
    }

    .table-footer {
        flex-direction: column;
        gap: 16px;
    }

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

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

    .site-selector {
        display: none;
    }

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

    /* User Profile Mobile */
    .profile-body {
        padding: 16px;
    }

    .profile-section {
        padding: 14px;
    }

    .profile-section-header {
        font-size: 12px;
    }

    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .profile-ticket-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .ticket-meta {
        width: 100%;
        justify-content: space-between;
    }

    .profile-card-item {
        flex-wrap: wrap;
    }

    .card-default {
        margin-left: 0;
    }

    /* User Profile Page 768px */
    .activity-stats-grid {
        grid-template-columns: 1fr;
    }

    .profile-hero-left {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-hero-meta {
        justify-content: center;
    }

    .profile-hero-badges {
        justify-content: center;
    }

    .profile-quick-stats {
        justify-content: center;
        flex-wrap: wrap;
    }

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

    .sessions-table {
        font-size: 12px;
    }

    .sessions-table th,
    .sessions-table td {
        padding: 8px 10px;
    }

    .block-item {
        flex-direction: column;
    }

    /* Analytics responsive */
    .analytics-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .content-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

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

    .watch-history-item {
        flex-wrap: wrap;
    }

    .history-meta {
        order: 3;
        width: 100%;
        flex-direction: row;
        gap: 12px;
        margin-top: 8px;
    }

    .journey-meta {
        flex-wrap: wrap;
    }
}

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

    .header {
        padding: 0 16px;
    }

    .modal {
        width: 95%;
        max-height: 95vh;
    }

    .modal-body {
        padding: 16px;
    }

    /* User Profile Smallest */
    .profile-header-avatar {
        width: 60px;
        height: 60px;
        font-size: 20px;
    }

    .profile-header-name {
        font-size: 18px;
    }

    .profile-header-stats {
        flex-wrap: wrap;
        gap: 12px;
    }

    .profile-stat-value {
        font-size: 16px;
    }

    .profile-tab-btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    .profile-section-title {
        font-size: 13px;
    }

    .device-icon-wrap {
        width: 36px;
        height: 36px;
    }

    .device-icon-wrap svg {
        width: 18px;
        height: 18px;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }

    /* User Profile Page 480px */
    .profile-hero {
        padding: 16px;
    }

    .profile-avatar-large {
        width: 64px;
        height: 64px;
        font-size: 22px;
    }

    .profile-hero-name {
        font-size: 18px;
        flex-wrap: wrap;
    }

    .profile-hero-meta {
        font-size: 12px;
        gap: 10px;
    }

    .quick-stat-value {
        font-size: 16px;
    }

    .quick-stat-label {
        font-size: 10px;
    }

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

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .device-card-body {
        padding: 12px;
    }

    .device-name {
        font-size: 14px;
    }

    .detail-row {
        font-size: 12px;
    }

    /* Analytics 480px */
    .analytics-summary-grid {
        grid-template-columns: 1fr;
    }

    .analytics-stat {
        padding: 12px;
    }

    .analytics-stat .stat-value {
        font-size: 18px;
    }

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

    .source-stats {
        flex-wrap: wrap;
    }

    .performance-metrics {
        grid-template-columns: 1fr;
    }

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

    .events-breakdown {
        grid-template-columns: 1fr;
    }
}

/* ===== User Profile Page - Additional Styles ===== */

/* Profile Modal Overlay */
.profile-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    z-index: 1000;
}

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

.profile-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: auto;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    z-index: 1001;
}

.profile-modal.modal-lg {
    max-width: 700px;
}

.profile-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* Subscription Actions Grid */
.subscription-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.sub-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sub-action-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

.sub-action-btn svg {
    stroke: var(--accent-primary);
}

.sub-action-btn.warning:hover {
    border-color: var(--warning);
}

.sub-action-btn.warning svg {
    stroke: var(--warning);
}

.sub-action-btn.danger:hover {
    border-color: var(--error);
}

.sub-action-btn.danger svg {
    stroke: var(--error);
}

.sub-action-btn span {
    font-size: 13px;
}

/* Profile Card Header Right */
.profile-card-header .header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Subscription Status */
.sub-status {
    font-weight: 500;
}

.sub-status.active {
    color: var(--success);
}

.sub-status.paused {
    color: var(--warning);
}

.sub-status.cancelled,
.sub-status.expired {
    color: var(--error);
}

/* Flags Grid */
.flags-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

/* Form Section */
.form-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.form-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

/* Badge muted */
.badge.muted {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

/* Address Block */
.address-block {
    line-height: 1.6;
}

.address-line {
    color: var(--text-primary);
}

.address-line.country {
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ===== Submenu Navigation ===== */
.nav-item.has-submenu {
    position: relative;
}

.nav-item.has-submenu > .nav-link {
    position: relative;
}

.nav-chevron {
    margin-left: auto;
    transition: transform var(--transition-fast);
    color: var(--text-muted);
    flex-shrink: 0;
}

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

.nav-submenu {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    padding-left: 32px;
}

.nav-item.has-submenu.open .nav-submenu {
    max-height: 200px;
    opacity: 1;
}

.nav-submenu li {
    margin: 2px 0;
}

.nav-submenu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    transition: var(--transition-fast);
}

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

.nav-submenu-link.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
}

.sidebar.collapsed .nav-submenu {
    display: none;
}

.sidebar.collapsed .nav-chevron {
    display: none;
}

/* Live Badge */
.live-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 600;
    border-radius: 10px;
    animation: pulse-live 2s infinite;
}

@keyframes pulse-live {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* ===== Users Tabs ===== */
.users-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.users-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.users-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.users-tab.active {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.users-tab .tab-count {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    background: var(--bg-tertiary);
    border-radius: 10px;
}

.users-tab.active .tab-count {
    background: var(--accent-primary);
    color: white;
}

/* ===== Visitors Grid ===== */
.visitors-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.visitors-live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: var(--radius-md);
    color: #10b981;
    font-size: 13px;
    font-weight: 500;
}

.visitors-live-indicator .live-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse-live 2s infinite;
}

.visitors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.visitor-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    transition: var(--transition-fast);
}

.visitor-card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-md);
}

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

.visitor-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.visitor-avatar {
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.visitor-details h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.visitor-details span {
    font-size: 12px;
    color: var(--text-muted);
}

.visitor-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
}

.visitor-status.online {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.visitor-status.online::before {
    content: '';
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
    animation: pulse-live 2s infinite;
}

.visitor-card-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.visitor-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.visitor-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.visitor-meta-item svg {
    width: 14px;
    height: 14px;
    opacity: 0.6;
}

.visitor-current-page {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.visitor-current-page .page-label {
    color: var(--text-muted);
}

.visitor-current-page .page-path {
    color: var(--accent-primary);
    font-family: var(--font-mono);
}

.visitor-card-footer {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.visitor-card-footer .btn {
    flex: 1;
    padding: 8px;
    font-size: 12px;
}

/* ===== Contacts Section ===== */
.contacts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.contact-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.contact-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    font-size: 11px;
    color: var(--text-secondary);
}

.contact-tag.vip {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.contact-tag.new {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.contact-tag.hot {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.contact-tag.cold {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.contact-notes {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== Visitor Profile Modal ===== */
.visitor-profile-header {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    margin-bottom: 20px;
}

.visitor-profile-avatar {
    width: 64px;
    height: 64px;
    background: var(--bg-secondary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.visitor-profile-info {
    flex: 1;
}

.visitor-profile-info h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.visitor-profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.visitor-profile-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.visitor-stat-card {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.visitor-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.visitor-stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.visitor-page-history {
    background: var(--bg-tertiary);
    border-radius: 8px;
    overflow: hidden;
}

.visitor-page-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.visitor-page-history-header h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.visitor-page-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

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

.visitor-page-number {
    width: 24px;
    height: 24px;
    background: var(--accent-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
}

.visitor-page-info {
    flex: 1;
}

.visitor-page-path {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-primary);
}

.visitor-page-title {
    font-size: 12px;
    color: var(--text-muted);
}

.visitor-page-time {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== Block IP Modal ===== */
.block-ip-warning {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    margin-bottom: 20px;
}

.block-ip-warning svg {
    color: #f59e0b;
    flex-shrink: 0;
}

.block-ip-warning p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

/* ===== Empty States ===== */
.empty-state-visitors {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.empty-state-visitors svg {
    width: 64px;
    height: 64px;
    color: var(--text-muted);
    opacity: 0.5;
    margin-bottom: 16px;
}

.empty-state-visitors h3 {
    font-size: 18px;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.empty-state-visitors p {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

/* ===== Header Stats ===== */
.header-stats {
    display: flex;
    gap: 24px;
}

.header-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.header-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

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

/* ===== User Cell (Table) ===== */
.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    color: white;
    flex-shrink: 0;
}

.user-info-cell {
    display: flex;
    flex-direction: column;
}

.user-info-cell .user-name {
    font-weight: 500;
    color: var(--text-primary);
}

.user-info-cell .user-email {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== Action Buttons ===== */
.action-buttons {
    display: flex;
    gap: 4px;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: var(--transition-fast);
}

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

.action-btn.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* ===== Form Row ===== */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* ===== Invoices Page ===== */
.invoices-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.invoice-stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.invoice-stat-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.invoice-stat-icon.draft {
    background: rgba(107, 114, 128, 0.15);
    color: #6b7280;
}

.invoice-stat-icon.sent {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.invoice-stat-icon.paid {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.invoice-stat-icon.overdue {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.invoice-stat-info {
    display: flex;
    flex-direction: column;
}

.invoice-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

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

/* Invoice Status Badges */
.invoice-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.invoice-status.draft {
    background: rgba(107, 114, 128, 0.15);
    color: #6b7280;
}

.invoice-status.sent {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.invoice-status.paid {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.invoice-status.overdue {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.invoice-status.cancelled {
    background: rgba(107, 114, 128, 0.15);
    color: #6b7280;
    text-decoration: line-through;
}

/* Invoice Items Editor */
.invoice-items-editor {
    margin: 20px 0;
}

.invoice-items-editor > label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.invoice-items-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.invoice-item-row {
    display: grid;
    grid-template-columns: 1fr 80px 100px 100px 40px;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.invoice-item-row input {
    width: 100%;
    padding: 8px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
}

.invoice-item-row input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.invoice-item-row .item-total {
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}

.invoice-item-row .btn-remove-item {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.invoice-item-row .btn-remove-item:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Invoice Totals */
.invoice-totals {
    margin: 20px 0;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.invoice-total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.invoice-total-row.total {
    padding-top: 12px;
    margin-top: 8px;
    border-top: 1px solid var(--border-color);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Recurring Options */
.recurring-options {
    margin-top: 10px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.recurring-options.hidden {
    display: none;
}

/* Recurring Section */
.recurring-section {
    margin-top: 32px;
}

.recurring-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.recurring-section .section-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.recurring-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.recurring-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: var(--transition-fast);
}

.recurring-card:hover {
    border-color: var(--accent-primary);
}

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

.recurring-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.recurring-card-customer {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.recurring-toggle {
    position: relative;
}

.recurring-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recurring-card-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.recurring-card-row .label {
    color: var(--text-muted);
}

.recurring-card-row .value {
    color: var(--text-primary);
    font-weight: 500;
}

.recurring-card-footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Invoice View Modal */
.invoice-view-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 24px;
}

.invoice-preview {
    background: white;
    border-radius: var(--radius-md);
    padding: 24px;
    color: #1f2937;
}

.invoice-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e5e7eb;
}

.invoice-company h3 {
    font-size: 24px;
    font-weight: 700;
    color: #6366f1;
    margin: 0;
}

.invoice-company p {
    font-size: 12px;
    color: #6b7280;
    margin: 4px 0 0 0;
}

.invoice-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.invoice-badge.draft {
    background: #f3f4f6;
    color: #6b7280;
}

.invoice-badge.sent {
    background: #dbeafe;
    color: #2563eb;
}

.invoice-badge.paid {
    background: #d1fae5;
    color: #059669;
}

.invoice-badge.overdue {
    background: #fee2e2;
    color: #dc2626;
}

.invoice-badge.cancelled {
    background: #f3f4f6;
    color: #6b7280;
}

.invoice-preview-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
}

.invoice-to label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    margin-bottom: 6px;
}

.invoice-to p {
    margin: 2px 0;
    font-size: 13px;
    color: #1f2937;
}

.invoice-details {
    text-align: right;
}

.invoice-detail-row {
    margin-bottom: 4px;
    font-size: 13px;
}

.invoice-detail-row span {
    color: #6b7280;
}

.invoice-detail-row strong {
    color: #1f2937;
    margin-left: 8px;
}

.invoice-preview-items {
    margin-bottom: 20px;
}

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

.invoice-preview-items th,
.invoice-preview-items td {
    padding: 10px 12px;
    text-align: left;
    font-size: 13px;
}

.invoice-preview-items th {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.invoice-preview-items td {
    border-bottom: 1px solid #f3f4f6;
    color: #1f2937;
}

.invoice-preview-items th:last-child,
.invoice-preview-items td:last-child {
    text-align: right;
}

.invoice-preview-totals {
    margin-left: auto;
    width: 200px;
}

.invoice-preview-total-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    color: #6b7280;
}

.invoice-preview-total-row.total {
    padding-top: 10px;
    margin-top: 6px;
    border-top: 2px solid #e5e7eb;
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
}

.invoice-preview-notes {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.invoice-preview-notes label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    margin-bottom: 6px;
}

.invoice-preview-notes p {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

.invoice-payment-placeholder {
    margin-top: 20px;
    padding: 16px;
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #9ca3af;
}

.invoice-payment-placeholder svg {
    color: #d1d5db;
}

/* Invoice View Sidebar */
.invoice-view-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.invoice-view-section h4 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.invoice-timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 200px;
    overflow-y: auto;
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
}

.timeline-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-color);
    margin-top: 4px;
    flex-shrink: 0;
}

.timeline-dot.created { background: #6b7280; }
.timeline-dot.sent { background: #3b82f6; }
.timeline-dot.paid { background: #10b981; }
.timeline-dot.reminder { background: #f59e0b; }
.timeline-dot.overdue { background: #ef4444; }
.timeline-dot.cancelled { background: #6b7280; }

.timeline-content {
    flex: 1;
}

.timeline-action {
    color: var(--text-primary);
    font-weight: 500;
}

.timeline-date {
    color: var(--text-muted);
    font-size: 11px;
}

.timeline-user {
    color: var(--text-muted);
    font-size: 11px;
}

.invoice-view-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
}

/* Overdue Indicator */
.overdue-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #ef4444;
    font-size: 11px;
    font-weight: 600;
}

.overdue-indicator::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #ef4444;
    border-radius: 50%;
    animation: pulse-live 1s infinite;
}

/* Button small */
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Invoice responsive */
@media (max-width: 1024px) {
    .invoices-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .invoice-view-grid {
        grid-template-columns: 1fr;
    }

    .invoice-view-sidebar {
        order: -1;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .invoice-view-section {
        flex: 1;
        min-width: 200px;
    }

    .invoice-view-actions {
        flex-direction: row;
        width: 100%;
    }

    .invoice-view-actions .btn {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .invoices-stats {
        grid-template-columns: 1fr;
    }

    .recurring-cards {
        grid-template-columns: 1fr;
    }

    .invoice-item-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .invoice-item-row .item-total {
        text-align: left;
    }
}

/* ===== Profile Payments Section Styles ===== */
.section-header-actions {
    display: flex;
    gap: 10px;
}

.payment-stat-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.payment-stat-item .stat-label {
    color: var(--text-muted);
    font-size: 13px;
}

.payment-stat-item .stat-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
}

/* Invoice link in table */
.invoice-link {
    color: var(--accent-primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.invoice-link:hover {
    color: var(--accent-primary-hover);
    text-decoration: underline;
}

/* Toggle switch (for recurring) */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    transition: var(--transition-fast);
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-muted);
    transition: var(--transition-fast);
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
    background-color: white;
}

/* Recurring card inactive state */
.recurring-card.inactive {
    opacity: 0.6;
}

.recurring-card.inactive .recurring-card-title {
    text-decoration: line-through;
}
