/* ==========================================
   Animasyon Kütüphanesi - Modern Dark Theme
   ========================================== */

/* CSS Variables */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a25;
    --bg-hover: #252535;
    --bg-glass: rgba(26, 26, 37, 0.8);

    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #6b6b7b;

    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);

    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.3);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --bg-surface: #1e1e2e;

    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Reset & Base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Effects */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.3;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-secondary);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* ==========================================
   LAYOUT COMPONENTS
   ========================================== */

/* Container */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.header-content {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-icon {
    font-size: 2rem;
}

/* Search Bar */
.search-container {
    flex: 1;
    max-width: 400px;
    margin: 0 40px;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all var(--transition-normal);
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Profile Dropdown */
.profile-dropdown {
    position: relative;
}

.profile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.profile-btn:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}

.profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    overflow: hidden;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-name {
    font-weight: 500;
}

.profile-arrow {
    font-size: 0.8rem;
    transition: transform var(--transition-fast);
}

.profile-dropdown.active .profile-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-normal);
    z-index: 1001;
}

.profile-dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    transition: background var(--transition-fast);
    cursor: pointer;
}

.dropdown-item:first-child {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.dropdown-item:hover {
    background: var(--bg-hover);
}

.dropdown-item.danger {
    color: var(--danger);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

/* ==========================================
   MAIN CONTENT
   ========================================== */

.main-content {
    margin-top: 70px;
    padding: 32px 0;
    min-height: calc(100vh - 70px);
}

/* Tabs */
.tabs-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
}

.tab-btn {
    padding: 12px 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.tab-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
    box-shadow: var(--shadow-glow);
}

/* Tags Filter */
.tags-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
}

.tags-filter-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-right: 8px;
}

.tag-chip {
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
}

.tag-chip:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.tag-chip.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

/* Animation Grid */
.animations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    will-change: contents;
}

/* Animation Card */
.animation-card {
    width: 100%;
    height: 100%;
    min-height: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.animation-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.animation-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.animation-card.drag-over {
    border: 2px dashed var(--accent-primary);
    transform: scale(1.02);
}

.animation-card.linked {
    border-left: 3px solid var(--success);
}

.card-image {
    position: relative;
    width: 100%;
    /* Fixed height to ensure consistency across all cards */
    height: 480px;
    background: var(--bg-secondary);
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-image img {
    position: static;
    width: 100%;
    height: auto;
    object-fit: contain;
    /* Show full image */
    transition: transform var(--transition-normal);
    will-change: transform;
}

.animation-card:hover .card-image img {
    transform: scale(1.05);
}

.card-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-fast);
    pointer-events: none;
}

.card-image:hover .card-image-overlay {
    opacity: 0.5;
}

.copy-hint {
    color: white;
    font-size: 0.9rem;
    padding: 8px 16px;
    background: var(--accent-primary);
    border-radius: var(--radius-sm);
}

.card-content {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 140px;
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 8px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-tag {
    padding: 4px 10px;
    background: var(--bg-hover);
    border-radius: 12px;
    font-size: 0.75rem;
    color: var(--accent-primary);
}

.card-command {
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-top: 12px;
    word-break: break-all;
}

.card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
}

.card-author {
    font-size: 0.85rem;
    color: var(--text-muted);
    flex: 1;
}

.card-actions {
    display: flex;
    gap: 6px;
}

.card-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.card-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.card-btn.share-btn:hover {
    color: var(--info);
}

.card-btn.edit-btn:hover {
    color: var(--warning);
}

.card-btn.delete-btn:hover {
    color: var(--danger);
}

.card-btn.shared {
    color: var(--success);
    border-color: var(--success);
}

/* Linked Badge */
.linked-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid var(--success);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--success);
    margin-top: 8px;
}

/* User Profile Cards (for shared animations) */
.user-profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.user-profile-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.user-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-letter {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.user-stats {
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.user-arrow {
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: transform var(--transition-fast);
}

.user-profile-card:hover .user-arrow {
    transform: translateX(4px);
    color: var(--accent-primary);
}

/* Add Animation FAB */
.fab-add {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 60px;
    height: 60px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    transition: all var(--transition-normal);
    z-index: 100;
}

.fab-add:hover {
    transform: scale(1.1) rotate(90deg);
}

/* ==========================================
   MODALS
   ========================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    z-index: 2000;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-normal);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

/* ==========================================
   FORMS
   ========================================== */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--transition-normal);
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

/* Image Upload */
.image-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.image-upload-area:hover,
.image-upload-area.dragover {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.05);
}

.image-upload-area.has-image {
    padding: 0;
    border-style: solid;
}

.upload-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.upload-text {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.image-preview-container {
    position: relative;
    width: 100%;
}

.image-preview {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: var(--radius-md);
}

.image-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 8px;
}

/* Image Editor Modal */
.image-editor-area {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    width: 100%;
    /* Ensure it fits in modal but gives space */
    height: 60vh;
}

.cropper-container {
    width: 100%;
    height: 100%;
}

img#editorImage {
    max-width: 100%;
    display: block;
}

.editor-tools {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
}

/* ==========================================
   BUTTONS
   ========================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.btn-secondary {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-icon {
    padding: 10px;
}

/* ==========================================
   AUTH PAGES
   ========================================== */

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-box {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo h1 {
    font-size: 1.75rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-logo .logo-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.auth-title {
    text-align: center;
    margin-bottom: 8px;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form .btn {
    width: 100%;
    margin-top: 8px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--accent-primary);
    font-weight: 500;
}

/* Alert Box */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--warning);
    color: var(--warning);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid var(--info);
    color: var(--info);
}

/* ==========================================
   ADMIN PANEL
   ========================================== */

.admin-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: calc(100vh - 70px);
    margin-top: 70px;
}

.admin-sidebar {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 24px 0;
}

.admin-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.admin-menu-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.admin-menu-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
    border-left: 3px solid var(--accent-primary);
}

.admin-content {
    padding: 32px;
    overflow-y: auto;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.admin-title {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-md);
    font-size: 1.5rem;
    color: var(--accent-primary);
    margin-bottom: 16px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Data Table */
.data-table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: visible;
    /* Changed from hidden to visible */
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 20px;
    text-align: left;
}

.data-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tr:not(:last-child) td {
    border-bottom: 1px solid var(--border-color);
}

.data-table tr:hover td {
    background: var(--bg-hover);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

/* Log Item */
.log-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.log-item:last-child {
    border-bottom: none;
}

.log-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.log-content {
    flex: 1;
}

.log-action {
    font-weight: 500;
    margin-bottom: 4px;
}

.log-details {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.log-meta {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ==========================================
   EMPTY STATES
   ========================================== */

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.empty-title {
    font-size: 1.25rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-text {
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* ==========================================
   TOAST NOTIFICATIONS
   ========================================== */

.toast-container {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-success {
    border-color: var(--success);
}

.toast-error {
    border-color: var(--danger);
}

.toast-icon {
    font-size: 1.25rem;
}

.toast-success .toast-icon {
    color: var(--success);
}

.toast-error .toast-icon {
    color: var(--danger);
}

/* ==========================================
   UTILITIES
   ========================================== */

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.mt-2 {
    margin-top: 8px;
}

.mt-4 {
    margin-top: 16px;
}

.mb-2 {
    margin-bottom: 8px;
}

.mb-4 {
    margin-bottom: 16px;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 1024px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    /* Sidebar is now toggled via mobile menu - see ADMIN MOBILE SUPPORT section */
}

@media (max-width: 768px) {
    .header-content {
        padding: 0 16px;
    }

    .search-container {
        display: none;
    }

    .logo-text {
        display: none;
    }

    .container {
        padding: 0 16px;
    }

    .animations-grid {
        grid-template-columns: 1fr;
    }

    .tabs-container {
        flex-direction: column;
    }

    .tab-btn {
        width: 100%;
    }

    .modal {
        margin: 10px;
    }

    .auth-box {
        padding: 24px;
    }
}

/* Loader */
.loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.page-loader .loader {
    width: 40px;
    height: 40px;
}

/* Tag Input Component */
.tag-input-wrapper {
    position: relative;
    width: 100%;
}

.tag-input-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    min-height: 46px;
    cursor: text;
    transition: all 0.3s ease;
}

.tag-input-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.tag-chip .remove-tag {
    margin-left: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.tag-chip .remove-tag:hover {
    opacity: 1;
    color: var(--danger);
}

.tag-search-input {
    flex: 1;
    min-width: 120px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
}

.tag-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: var(--shadow-lg);
}

.tag-suggestions.active {
    display: block;
}

.tag-suggestion-item {
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.tag-suggestion-item:hover {
    background: var(--bg-secondary);
}

/* User Actions Menu (Example style for later) */
.user-actions-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 50;
    display: none;
    min-width: 160px;
}

.user-actions-dropdown.active {
    display: block;
}

.user-action-item {
    padding: 8px 12px;
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
}

.user-action-item:hover {
    background: var(--bg-secondary);
}

/* Card Tags */
.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.card-tag {
    font-size: 0.75rem;
    padding: 2px 8px;
}

/* Action Menu */
.action-cell {
    position: relative;
    text-align: right;
}

.action-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px 12px;
    font-size: 1.2rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.action-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.action-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 50;
    min-width: 180px;
    display: none;
    overflow: hidden;
}

.action-dropdown.active {
    display: block;
}

.action-item {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.action-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.action-item i {
    width: 16px;
    text-align: center;
}

.action-item.danger {
    color: var(--danger);
}

.action-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ==========================================
   MODAL STYLES (Ensuring Overlay)
   ========================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-xl);
    transform: translateY(20px);
    transition: all 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Tag Delete Zone */
.tag-delete-zone {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(150%);
    width: 300px;
    height: 120px;
    background: rgba(220, 38, 38, 0.15);
    border: 2px dashed rgba(220, 38, 38, 0.4);
    border-radius: 16px;
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--danger);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 90;
    pointer-events: none;
    opacity: 0;
}

.tag-delete-zone.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.tag-delete-zone.drag-over {
    background: rgba(220, 38, 38, 0.3);
    border-color: var(--danger);
    box-shadow: 0 0 30px rgba(220, 38, 38, 0.2);
    transform: translateX(-50%) scale(1.05);
}

.tag-delete-zone .delete-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
    transition: transform 0.2s;
}

.tag-delete-zone.drag-over .delete-icon {
    transform: scale(1.2) rotate(15deg);
}

.tag-delete-zone .delete-text {
    font-size: 0.9rem;
    font-weight: 500;
    pointer-events: none;
}

/* GIF Badge */
.card-image .gif-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 2;
    pointer-events: none;
    backdrop-filter: blur(2px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Tag Dragging Visual */
.tag-chip.dragging-tag {
    opacity: 0.8;
    border: 2px solid #f97316 !important;
    /* Orange-500 */
    transform: scale(1.05);
    background: rgba(249, 115, 22, 0.15);
}

/* ==========================================
   MODERN DASHBOARD STYLES
   ========================================== */

/* Section Title */
.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 24px 0 16px 0;
}

.section-title i {
    color: var(--accent-primary);
}

/* Stat Cards with Gradients */
/* Time Range Selector */
.header-actions-dash {
    display: flex;
    align-items: center;
    gap: 12px;
}

.time-range-selector {
    display: flex;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.time-range-btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    border-right: 1px solid var(--border-color);
}

.time-range-btn:last-child {
    border-right: none;
}

.time-range-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.time-range-btn.active {
    background: var(--accent-primary);
    color: white;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent-gradient);
}

.stat-card.gradient-purple::before {
    background: linear-gradient(90deg, #8b5cf6, #a855f7);
}

.stat-card.gradient-blue::before {
    background: linear-gradient(90deg, #3b82f6, #06b6d4);
}

.stat-card.gradient-green::before {
    background: linear-gradient(90deg, #22c55e, #10b981);
}

.stat-card.gradient-orange::before {
    background: linear-gradient(90deg, #f59e0b, #f97316);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.15);
    border-radius: var(--radius-md);
    font-size: 1.25rem;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.stat-card.gradient-purple .stat-icon {
    background: rgba(139, 92, 246, 0.15);
    color: #a855f7;
}

.stat-card.gradient-blue .stat-icon {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.stat-card.gradient-green .stat-icon {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.stat-card.gradient-orange .stat-icon {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.stat-card .stat-info {
    flex: 1;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.stat-card .stat-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 0.7rem;
    padding: 3px 8px;
    background: var(--bg-secondary);
    border-radius: 20px;
    color: var(--text-muted);
}

.stat-card .stat-badge.positive {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

/* Quick Stats Row */
.quick-stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
}

.quick-stat {
    flex: 1;
    min-width: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    text-align: center;
}

.quick-stat i {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.quick-stat .qs-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.quick-stat .qs-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.dashboard-card.wide {
    grid-column: span 3;
}

.card-header-dash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.card-header-dash h3 {
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header-dash h3 i {
    color: var(--accent-primary);
}

.card-header-dash .card-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Card Time Dropdown */
.card-time-dropdown {
    position: relative;
}

.card-time-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.card-time-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.card-time-btn i {
    font-size: 0.65rem;
    transition: transform var(--transition-fast);
}

.card-time-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 130px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition-fast);
}

.card-time-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.card-time-option {
    padding: 10px 14px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.card-time-option:first-child {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.card-time-option:last-child {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.card-time-option:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.card-time-option.active {
    background: var(--accent-primary);
    color: white;
}

.view-all-link {
    font-size: 0.8rem;
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.view-all-link:hover {
    color: var(--accent-secondary);
}

/* Hourly Chart */
.hourly-chart {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 160px;
    padding: 20px 16px;
    position: relative;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin: 16px;
}

.chart-bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    cursor: pointer;
    position: relative;
}

.chart-bar {
    width: 100%;
    max-width: 16px;
    background: linear-gradient(to top, var(--accent-primary), var(--accent-secondary));
    border-radius: 4px 4px 0 0;
    transition: all var(--transition-fast);
    min-height: 3px;
    margin-bottom: 20px;
}

.chart-bar:hover {
    opacity: 0.8;
    transform: scaleX(1.2);
}

.chart-bar.current {
    background: linear-gradient(to top, var(--success), #10b981);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

.chart-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    position: absolute;
    bottom: -18px;
    white-space: nowrap;
}

/* Bar Tooltip */
.bar-tooltip {
    display: none;
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    z-index: 10;
    box-shadow: var(--shadow-sm);
}

.chart-bar-wrapper:hover .bar-tooltip {
    display: block;
}

/* Clickable top item */
.top-item.clickable {
    cursor: pointer;
}

.top-item.clickable:hover {
    background: var(--bg-hover);
}

.top-item.clickable:hover .top-name code {
    color: var(--accent-primary);
}

.top-name code {
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    transition: color var(--transition-fast);
}

/* Top List */
.top-list {
    padding: 8px 0;
    max-height: 280px;
    overflow-y: auto;
}

.top-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    transition: background var(--transition-fast);
}

.top-item:hover {
    background: var(--bg-secondary);
}

.top-rank {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-primary);
    min-width: 28px;
}

.top-name {
    flex: 1;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: 12px;
}

/* Top Users Item */
.top-user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    transition: background var(--transition-fast);
}

.top-user-item:hover {
    background: var(--bg-secondary);
}

.top-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: white;
    overflow: hidden;
    flex-shrink: 0;
}

.top-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.top-user-name {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Action Breakdown */
.action-breakdown {
    padding: 12px 20px;
}

.action-item-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.action-item-stat:last-child {
    border-bottom: none;
}

.action-item-stat i {
    width: 20px;
    text-align: center;
}

.action-item-stat .action-name {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.action-item-stat .action-count {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Recent Logs List */
.recent-logs-list {
    padding: 8px 0;
    max-height: 300px;
    overflow-y: auto;
}

.recent-log-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    transition: background var(--transition-fast);
}

.recent-log-item:hover {
    background: var(--bg-secondary);
}

.log-icon-mini {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.log-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.log-user {
    font-size: 0.85rem;
    font-weight: 500;
}

.log-action-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.log-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Secondary Stats */
.secondary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.sec-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.sec-stat .sec-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
}

.sec-stat .sec-info {
    display: flex;
    flex-direction: column;
}

.sec-stat .sec-value {
    font-size: 1.1rem;
    font-weight: 700;
}

.sec-stat .sec-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Empty List */
.empty-list {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==========================================
   ADMIN MOBILE SUPPORT
   ========================================== */

.mobile-menu-btn {
    display: none;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.1rem;
    margin-right: 12px;
    transition: all var(--transition-fast);
}

.mobile-menu-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

@media (max-width: 1024px) {
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: fixed;
        left: -280px;
        top: 70px;
        height: calc(100vh - 70px);
        width: 260px;
        z-index: 1100;
        transition: left 0.3s ease;
        box-shadow: var(--shadow-lg);
    }

    .admin-sidebar.open {
        left: 0;
    }

    .mobile-overlay {
        z-index: 1050;
    }

    .admin-sidebar.open~.mobile-overlay {
        display: block;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-card.wide {
        grid-column: span 1;
    }

    .data-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -12px;
        padding: 0 12px;
    }

    .data-table {
        min-width: 600px;
    }

    .quick-stats-row {
        gap: 8px;
        padding: 12px;
        overflow-x: auto;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
    }

    .quick-stat {
        min-width: 100px;
        padding: 12px 8px;
        flex-shrink: 0;
    }

    .quick-stat .qs-value {
        font-size: 1.1rem;
    }

    .secondary-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .admin-content {
        padding: 12px;
    }

    .admin-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
    }

    .admin-title {
        font-size: 1.1rem;
    }

    .secondary-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .hourly-chart {
        padding: 8px;
        height: 120px;
        gap: 2px;
    }

    .chart-bar-wrapper {
        min-width: 10px;
    }

    .stat-card .stat-value {
        font-size: 1.4rem;
    }

    .quick-stats-row {
        flex-wrap: wrap;
        justify-content: center;
    }

    .quick-stat {
        flex: 1 1 100px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .secondary-stats {
        grid-template-columns: 1fr;
    }

    .logo-text {
        display: none;
    }

    .search-container {
        margin: 0 10px;
    }

    .header-actions {
        gap: 8px;
    }

    .profile-name {
        display: none;
    }

    .profile-btn {
        padding: 5px;
    }
}

/* ==========================================
   MESSAGING SYSTEM
   ========================================== */

/* Message FAB Button */
.fab-message {
    position: fixed;
    bottom: 104px;
    right: 32px;
    width: 52px;
    height: 52px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab-message:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    transform: scale(1.1);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

/* Unread Badge */
.unread-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--danger);
    border-radius: 10px;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.unread-badge.hidden {
    display: none;
}

/* Chat Panel */
.chat-panel {
    position: fixed;
    bottom: 170px;
    right: 32px;
    width: 380px;
    max-height: 500px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    z-index: 1500;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all var(--transition-normal);
}

.chat-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Chat Header */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.chat-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 1.1rem;
}

.chat-header-title i {
    color: var(--accent-primary);
}

.chat-header-actions {
    display: flex;
    gap: 8px;
}

.chat-header-btn {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.chat-header-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Chat Search */
.chat-search {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.chat-search-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.chat-search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.chat-search-input::placeholder {
    color: var(--text-muted);
}

/* Search Results */
.chat-search-results {
    max-height: 200px;
    overflow-y: auto;
    border-bottom: 1px solid var(--border-color);
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.search-result-item:hover {
    background: var(--bg-hover);
}

.search-result-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    overflow: hidden;
    flex-shrink: 0;
}

.search-result-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-name {
    font-weight: 500;
    color: var(--text-primary);
}

/* Conversation List */
.chat-conversations {
    flex: 1;
    overflow-y: auto;
    max-height: 300px;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background var(--transition-fast);
    border-bottom: 1px solid var(--border-color);
}

.conversation-item:last-child {
    border-bottom: none;
}

.conversation-item:hover {
    background: var(--bg-hover);
}

.conversation-item.active {
    background: rgba(99, 102, 241, 0.1);
    border-left: 3px solid var(--accent-primary);
}

.conversation-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    overflow: hidden;
    flex-shrink: 0;
}

.conversation-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.conversation-info {
    flex: 1;
    min-width: 0;
}

.conversation-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.conversation-preview {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.conversation-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.conversation-unread {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--accent-primary);
    border-radius: 9px;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Chat Messages View */
.chat-messages-view {
    display: none;
    flex-direction: column;
    height: 100%;
}

.chat-messages-view.active {
    display: flex;
}

.chat-user-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.chat-back-btn {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.chat-back-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.chat-user-info {
    flex: 1;
}

.chat-user-name {
    font-weight: 600;
    font-size: 0.95rem;
}

/* Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 280px;
    min-height: 200px;
}

.message-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.message-bubble.sent {
    align-self: flex-end;
    background: var(--accent-gradient);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-bubble.received {
    align-self: flex-start;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 4px;
    text-align: right;
}

.message-bubble.received .message-time {
    color: var(--text-muted);
}

/* Message Input */
.chat-input-area {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.chat-input {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 0.9rem;
    resize: none;
    transition: all var(--transition-fast);
}

.chat-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Empty State */
.chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.chat-empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.chat-empty-text {
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 480px) {
    .chat-panel {
        right: 12px;
        left: 12px;
        width: auto;
        bottom: 80px;
        height: calc(100vh - 100px);
        max-height: none;
        border-radius: var(--radius-lg);
    }

    .chat-messages {
        max-height: none;
        flex: 1;
    }

    .fab-message {
        right: 20px;
        bottom: 20px;
        width: 56px;
        height: 56px;
        z-index: 1600;
    }

    .fab-add {
        right: 20px;
        bottom: 90px;
        width: 56px;
        height: 56px;
    }
}

/* Online Status Indicator */
.online-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    position: absolute;
    bottom: 2px;
    right: 2px;
    border: 2px solid var(--bg-card);
}

.online-status.online {
    background: var(--success);
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}

.online-status.offline {
    background: var(--text-muted);
}

.conversation-avatar,
.search-result-avatar {
    position: relative;
}

/* Emoji Picker */
.emoji-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.emoji-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.emoji-picker {
    position: absolute;
    bottom: 60px;
    left: 16px;
    right: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 12px;
    display: none;
    z-index: 10;
}

.emoji-picker.active {
    display: block;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    max-height: 150px;
    overflow-y: auto;
}

.emoji-item {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.emoji-item:hover {
    background: var(--bg-hover);
}