/* =============================================
   CRYPTOPORTFOLIO - THEME SYSTEM
   ============================================= */

/* CSS Variables - Dark Theme (Default) */
:root,
[data-theme="dark"] {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: #1e1e32;
    --bg-card-hover: #252540;
    --bg-input: #12121f;
    --border-color: #2a2a45;
    --border-light: #3a3a5a;

    --text-primary: #ffffff;
    --text-secondary: #a0a0b8;
    --text-muted: #6c6c8a;

    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-cyan: #06b6d4;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);

    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.15);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.15);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.15);
    --info: #06b6d4;
    --info-bg: rgba(6, 182, 212, 0.15);

    --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 20px rgba(99, 102, 241, 0.3);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;

    /* Sidebar - Dark */
    --sidebar-bg: #1a1a2e;
    --sidebar-bg-end: #12122a;
    --sidebar-border: #2a2a45;
    --sidebar-text: #ffffff;
    --sidebar-text-muted: #6c6c8a;
    --sidebar-hover: rgba(255, 255, 255, 0.05);
    --sidebar-active-bg: rgba(99, 102, 241, 0.15);
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #f5f7fa;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8f9fc;
    --bg-input: #f5f7fa;
    --border-color: #e2e8f0;
    --border-light: #cbd5e1;

    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    /* Accent colors for light theme */
    --accent-primary: #4f46e5;
    --accent-secondary: #7c3aed;
    --accent-cyan: #0891b2;
    --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);

    /* Status colors adjusted for light theme */
    --success: #059669;
    --success-bg: rgba(5, 150, 105, 0.12);
    --danger: #dc2626;
    --danger-bg: rgba(220, 38, 38, 0.12);
    --warning: #d97706;
    --warning-bg: rgba(217, 119, 6, 0.12);
    --info: #0891b2;
    --info-bg: rgba(8, 145, 178, 0.12);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.2);

    /* Sidebar - Light */
    --sidebar-bg: #ffffff;
    --sidebar-bg-end: #f8fafc;
    --sidebar-border: #e2e8f0;
    --sidebar-text: #1e293b;
    --sidebar-text-muted: #64748b;
    --sidebar-hover: rgba(99, 102, 241, 0.08);
    --sidebar-active-bg: rgba(99, 102, 241, 0.12);
}

/* Utility Classes for Accent Colors */
.text-accent {
    color: var(--accent-primary) !important;
}

.text-accent:hover {
    color: var(--accent-secondary) !important;
}

.link-accent {
    color: var(--accent-primary);
    text-decoration: none;
}

.link-accent:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

/* Light theme specific overrides */
[data-theme="light"] .card {
    box-shadow: var(--shadow-sm);
}

[data-theme="light"] .table {
    --bs-table-bg: var(--bg-card);
    --bs-table-color: var(--text-primary);
}

[data-theme="light"] .table thead th {
    background: var(--bg-input);
    color: var(--text-secondary);
}

[data-theme="light"] .table tbody tr:hover {
    background: var(--bg-card-hover);
}

[data-theme="light"] .badge.bg-secondary {
    background-color: #e2e8f0 !important;
    color: #475569 !important;
}

[data-theme="light"] .nav-tabs .nav-link {
    color: var(--text-secondary);
}

[data-theme="light"] .nav-tabs .nav-link.active {
    background: var(--bg-card);
    color: var(--accent-primary);
    border-color: var(--border-color);
}

[data-theme="light"] .list-group-item {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="light"] .breadcrumb-item a {
    color: var(--accent-primary);
}

[data-theme="light"] .breadcrumb-item.active {
    color: var(--text-muted);
}

/* Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Bootstrap Icons Fix */
.bi {
    display: inline-block;
    vertical-align: -0.125em;
    line-height: 1;
    font-style: normal;
}

/* Icon containers - ensure icons don't stretch */
.rounded-circle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0;
}

/* Stat card icon containers */
.rounded-circle.p-2,
.rounded-circle.p-3 {
    width: auto;
    height: auto;
    aspect-ratio: 1;
}

.rounded-circle .bi,
.rounded-3 .bi {
    line-height: 1;
    display: inline-block;
    width: auto;
    height: auto;
}

/* Fix icons in input groups */
.input-group-text {
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-group-text .bi {
    line-height: 1;
}

/* Fix icons in buttons */
.btn .bi {
    line-height: 1;
    vertical-align: -0.125em;
}

/* Fix icons in alerts */
.alert .bi {
    line-height: 1;
    flex-shrink: 0;
}

/* Fix icons in badges */
.badge .bi {
    line-height: 1;
    vertical-align: -0.1em;
}

/* Fix icons in nav links */
.nav-link .bi {
    line-height: 1;
    flex-shrink: 0;
}

/* Fix icons in list items */
.list-group-item .bi {
    line-height: 1;
}

/* Fix icons in card headers */
.card-header .bi {
    line-height: 1;
    vertical-align: -0.125em;
}

/* Fix icons with fs-* classes */
.bi.fs-1, .bi.fs-2, .bi.fs-3, .bi.fs-4, .bi.fs-5, .bi.fs-6 {
    line-height: 1;
    vertical-align: middle;
}

html {
    font-size: 14px;
    height: 100%;
    scroll-behavior: smooth;
}

@media (min-width: 768px) {
    html {
        font-size: 15px;
    }
}

body {
    min-height: 100vh;
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Selection */
::selection {
    background: var(--accent-primary);
    color: white;
}

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar {
    width: 280px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-end) 100%);
    border-right: 1px solid var(--sidebar-border);
    z-index: 1000;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header a {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 12px;
}

.logo-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
    box-shadow: var(--shadow-glow);
    flex-shrink: 0;
}

.logo-icon .bi {
    line-height: 1;
    display: inline-block;
}

.sidebar-header span {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--sidebar-text);
    letter-spacing: -0.5px;
}

/* Notification bell in sidebar header */
.notification-bell-btn {
    background: transparent;
    border: none;
    color: var(--sidebar-text-muted);
    font-size: 1.25rem;
    padding: 6px;
    border-radius: 50%;
    transition: var(--transition-fast);
    position: relative;
    line-height: 1;
}

.notification-bell-btn:hover {
    color: var(--sidebar-text);
    background: var(--sidebar-hover);
}

.notification-badge {
    position: absolute;
    top: 0;
    right: -2px;
    min-width: 18px;
    height: 18px;
    font-size: 0.65rem;
    font-weight: 700;
    background: var(--danger);
    color: #fff;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.notification-bell-btn.has-unread i {
    animation: bellShake 2s ease-in-out infinite;
}

@keyframes bellShake {
    0%, 80%, 100% { transform: rotate(0); }
    85% { transform: rotate(15deg); }
    90% { transform: rotate(-12deg); }
    95% { transform: rotate(8deg); }
}

.notification-dropdown {
    width: 340px;
    max-height: 400px;
    overflow-y: auto;
}

.sidebar nav {
    flex: 1;
    padding: 8px 12px;
    overflow-y: auto;
    min-height: 0;
    flex-wrap: nowrap;
}

.sidebar .nav-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--sidebar-text-muted);
    padding: 16px 16px 6px;
    margin: 0;
}

.sidebar .nav-section-label:first-child {
    padding-top: 8px;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    margin-bottom: 2px;
    border-radius: var(--radius-md);
    color: var(--sidebar-text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-normal);
    border: 1px solid transparent;
    font-size: 0.875rem;
}

.sidebar .nav-link i {
    font-size: 1.05rem;
    width: 22px;
    text-align: center;
    line-height: 1;
    flex-shrink: 0;
}

.sidebar .nav-link:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text);
    border-color: rgba(99, 102, 241, 0.2);
}

.sidebar .nav-link.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--shadow-glow);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--sidebar-border);
    background: var(--sidebar-hover);
    flex-shrink: 0;
}

.user-avatar {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.sidebar-user-name {
    color: var(--sidebar-text);
}

.sidebar-user-email {
    color: var(--sidebar-text-muted);
}

.sidebar-chevron {
    color: var(--sidebar-text-muted);
}

.sidebar-logout-btn {
    margin-top: 12px;
    background: transparent;
    border: 1px solid var(--sidebar-border);
    color: var(--sidebar-text-muted);
    transition: var(--transition-normal);
}

.sidebar-logout-btn:hover {
    background: var(--danger-bg);
    border-color: var(--danger);
    color: var(--danger);
}

.sidebar-footer .profile-link {
    padding: 8px;
    margin: -8px;
    border-radius: var(--radius-sm);
    transition: var(--transition-normal);
}

.sidebar-footer .profile-link:hover {
    background: var(--sidebar-hover);
}

.sidebar-footer .profile-link:hover .sidebar-chevron {
    color: var(--accent-primary) !important;
    transform: translateX(3px);
    transition: var(--transition-normal);
}

/* Theme Toggle Button */
.theme-toggle-wrapper {
    flex-shrink: 0;
}

.theme-toggle-btn {
    background: var(--sidebar-hover);
    border: 1px solid var(--sidebar-border);
    color: var(--sidebar-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    transition: var(--transition-normal);
}

.theme-toggle-btn:hover {
    background: var(--sidebar-active-bg);
    border-color: var(--accent-primary);
    color: var(--sidebar-text);
}

.theme-toggle-btn .theme-icon-light,
.theme-toggle-btn .theme-icon-dark {
    font-size: 1rem;
    transition: var(--transition-normal);
}

/* Show/hide icons based on theme */
[data-theme="dark"] .theme-icon-dark {
    display: none;
}

[data-theme="dark"] .theme-icon-light {
    display: inline-block;
    color: #f59e0b;
}

[data-theme="light"] .theme-icon-light {
    display: none;
}

[data-theme="light"] .theme-icon-dark {
    display: inline-block;
    color: #6366f1;
}

/* =============================================
   MAIN CONTENT
   ============================================= */
.main-content {
    margin-left: 280px;
    min-height: 100vh;
    background: var(--bg-primary);
}

.main-content main {
    padding: 32px;
    max-width: 1600px;
}

/* =============================================
   TYPOGRAPHY
   ============================================= */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--text-primary) !important;
    font-weight: 600;
    letter-spacing: -0.5px;
}

/* Override for text-muted headings */
h1.text-muted, h2.text-muted, h3.text-muted,
h4.text-muted, h5.text-muted, h6.text-muted {
    color: var(--text-muted) !important;
}

p {
    color: var(--text-secondary);
}

/* Ensure all text is visible in dark theme */
.card h1, .card h2, .card h3, .card h4, .card h5, .card h6,
.card .h1, .card .h2, .card .h3, .card .h4, .card .h5, .card .h6 {
    color: var(--text-primary) !important;
}

.card p, .card span, .card div, .card label {
    color: inherit;
}

/* Small text */
small, .small {
    color: var(--text-secondary);
}

.text-muted, .text-muted * {
    color: var(--text-muted) !important;
}

/* Fix text-body for dark theme */
.text-body {
    color: var(--text-primary) !important;
}

.text-body-secondary {
    color: var(--text-secondary) !important;
}

.text-primary {
    color: var(--accent-primary) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

.text-success {
    color: var(--success) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-info {
    color: var(--info) !important;
}

.text-white {
    color: #ffffff !important;
}

.text-light {
    color: var(--text-secondary) !important;
}

/* Fix Bootstrap's default text color */
.text-dark {
    color: var(--text-primary) !important;
}

/* Stat card specific text colors */
.card-body h4, .card-body h5, .card-body h6 {
    color: var(--text-primary) !important;
}

.card-body .mb-0, .card-body .mb-1 {
    color: var(--text-primary);
}

/* Fix fw-bold and fw-medium text visibility */
.fw-bold, .fw-semibold, .fw-medium {
    color: inherit;
}

/* Ensure numbers and values are visible */
.fs-1, .fs-2, .fs-3, .fs-4, .fs-5, .fs-6 {
    color: inherit;
}

/* =============================================
   CARDS
   ============================================= */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.card:hover {
    border-color: var(--border-light);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 20px 24px;
    font-weight: 600;
}

.card-body {
    padding: 24px;
}

.card-footer {
    background: rgba(0, 0, 0, 0.1);
    border-top: 1px solid var(--border-color);
    padding: 16px 24px;
}

/* Stat Cards */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 4px 0 0 4px;
}

.stat-card.success::before {
    background: var(--success);
}

.stat-card.danger::before {
    background: var(--danger);
}

.stat-card.warning::before {
    background: var(--warning);
}

.stat-card.info::before {
    background: var(--info);
}

/* Card Hover Effect */
.card-hover {
    cursor: pointer;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-primary);
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
    font-weight: 500;
    border-radius: var(--radius-md);
    padding: 10px 20px;
    transition: var(--transition-normal);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white !important;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
    background: linear-gradient(135deg, #5558e8 0%, #7c4ddb 100%);
    color: white !important;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #0ea572;
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: #000;
}

.btn-outline-primary {
    background: transparent;
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
}

.btn-outline-primary:hover {
    background: var(--accent-primary);
    color: white;
}

.btn-outline-secondary {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
}

.btn-outline-secondary:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.btn-outline-success {
    background: transparent;
    border: 1px solid var(--success);
    color: var(--success);
}

.btn-outline-success:hover {
    background: var(--success);
    color: white;
}

.btn-outline-danger {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}

.btn-outline-danger:hover {
    background: var(--danger);
    color: white;
}

.btn-outline-warning {
    background: transparent;
    border: 1px solid var(--warning);
    color: var(--warning);
}

.btn-outline-warning:hover {
    background: var(--warning);
    color: #000;
}

.btn-outline-info {
    background: transparent;
    border: 1px solid var(--info);
    color: var(--info);
}

.btn-outline-info:hover {
    background: var(--info);
    color: white;
}

.btn-outline-light {
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    background: transparent;
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1.1rem;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.btn-group .btn:last-child {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.btn-group .btn.active {
    background: var(--accent-gradient);
    color: white;
    border-color: var(--accent-primary);
}

/* =============================================
   FORMS
   ============================================= */
.form-control, .form-select {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 12px 16px;
    transition: var(--transition-normal);
}

.form-control:focus, .form-select:focus {
    background: var(--bg-input);
    border-color: var(--accent-primary);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 8px;
}

.form-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.input-group-text {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.form-control-sm, .form-select-sm {
    padding: 8px 12px;
    font-size: 0.875rem;
}

.form-check-input {
    background-color: var(--bg-input);
    border-color: var(--border-light);
}

.form-check-input:checked {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* Disabled form controls */
.form-control:disabled,
.form-control[disabled],
.form-control[readonly] {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-secondary);
    opacity: 1;
    cursor: not-allowed;
}

/* SweetAlert2 Dark Theme Overrides */
.swal2-popup {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

.swal2-title {
    color: var(--text-primary) !important;
}

.swal2-html-container,
.swal2-content {
    color: var(--text-secondary) !important;
}

/* =============================================
   TABLES
   ============================================= */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
    color: var(--text-primary);
}

.table thead th {
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.table tbody td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.table tbody tr {
    transition: var(--transition-fast);
}

.table-hover tbody tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

.table-light {
    --bs-table-bg: rgba(0, 0, 0, 0.2);
}

.table-responsive {
    border-radius: var(--radius-md);
}

/* Sortable columns */
.sortable {
    cursor: pointer;
    user-select: none;
    transition: var(--transition-fast);
}

.sortable:hover {
    color: var(--accent-primary);
}

.sortable i {
    font-size: 0.7rem;
    margin-left: 4px;
    opacity: 0.5;
    transition: var(--transition-fast);
}

.sortable:hover i {
    opacity: 1;
}

.sortable i.text-primary {
    opacity: 1;
    color: var(--accent-primary) !important;
}

/* Action Buttons in Tables */
.table .btn-group {
    display: inline-flex;
    gap: 0;
}

.table .btn-group .btn {
    padding: 6px 10px;
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.table .btn-group .btn:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.table .btn-group .btn:last-child,
.table .btn-group .btn:last-of-type {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.table .btn-group .btn-outline-primary {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: transparent;
}

.table .btn-group .btn-outline-primary:hover {
    background: var(--accent-primary);
    color: white;
}

.table .btn-group .btn-outline-danger {
    border-color: var(--danger);
    color: var(--danger);
    background: transparent;
}

.table .btn-group .btn-outline-danger:hover {
    background: var(--danger);
    color: white;
}

.table .btn-group .btn .bi {
    font-size: 0.85rem;
    line-height: 1;
}

/* Filter Section */
.card .row.g-3 .form-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card .row.g-3 .btn-group .btn {
    font-size: 0.8rem;
}

.card .row.g-3 .btn-group .btn.active {
    background: var(--accent-gradient);
    color: white;
    border-color: var(--accent-primary);
}

.card .row.g-3 .btn-outline-primary {
    border-color: var(--border-light);
    color: var(--text-secondary);
}

.card .row.g-3 .btn-outline-primary:hover,
.card .row.g-3 .btn-outline-primary:focus {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: transparent;
}

.card .row.g-3 .btn-outline-secondary {
    border-color: var(--border-light);
    color: var(--text-secondary);
}

.card .row.g-3 .btn-outline-secondary:hover {
    border-color: var(--text-muted);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* =============================================
   BADGES
   ============================================= */
.badge {
    font-weight: 500;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
}

/* Badge with solid backgrounds for visibility */
.badge.bg-primary {
    background: var(--accent-primary) !important;
    color: #ffffff !important;
}

.badge.bg-secondary {
    background: #4a4a6a !important;
    color: #ffffff !important;
}

.badge.bg-success {
    background: var(--success) !important;
    color: #ffffff !important;
}

.badge.bg-danger {
    background: var(--danger) !important;
    color: #ffffff !important;
}

.badge.bg-warning {
    background: var(--warning) !important;
    color: #000000 !important;
}

.badge.bg-warning.text-dark {
    color: #000000 !important;
}

.badge.bg-info {
    background: var(--info) !important;
    color: #ffffff !important;
}

/* Non-badge bg classes keep their original behavior */
div.bg-success:not(.badge), span.bg-success:not(.badge) {
    background: var(--success-bg) !important;
}

div.bg-danger:not(.badge), span.bg-danger:not(.badge) {
    background: var(--danger-bg) !important;
}

div.bg-warning:not(.badge), span.bg-warning:not(.badge) {
    background: var(--warning-bg) !important;
}

div.bg-info:not(.badge), span.bg-info:not(.badge) {
    background: var(--info-bg) !important;
}

/* text-dark for badge context */
.badge .text-dark, .badge.text-dark {
    color: #000000 !important;
}

/* =============================================
   ALERTS
   ============================================= */
.alert {
    border-radius: var(--radius-md);
    border: none;
    padding: 16px 20px;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border-left: 4px solid var(--success);
}

.alert-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border-left: 4px solid var(--danger);
}

.alert-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border-left: 4px solid var(--warning);
}

.alert-info {
    background: var(--info-bg);
    color: var(--info);
    border-left: 4px solid var(--info);
}

.alert-dismissible .btn-close {
    filter: invert(1);
}

/* =============================================
   BREADCRUMB
   ============================================= */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 8px;
}

.breadcrumb-item {
    color: var(--text-muted);
}

.breadcrumb-item a {
    color: var(--accent-primary);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--accent-secondary);
}

.breadcrumb-item.active {
    color: var(--text-secondary);
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--text-muted);
}

/* =============================================
   LIST GROUPS
   ============================================= */
.list-group-item {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-primary);
    padding: 16px 20px;
}

.list-group-flush > .list-group-item:last-child {
    border-bottom: none;
}

/* =============================================
   DROPDOWNS
   ============================================= */
.dropdown-menu {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 8px;
}

.dropdown-item {
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    transition: var(--transition-fast);
}

.dropdown-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-primary);
}

/* =============================================
   MODALS
   ============================================= */
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.modal-header {
    border-bottom-color: var(--border-color);
}

.modal-footer {
    border-top-color: var(--border-color);
}

.btn-close {
    filter: invert(1);
}

/* =============================================
   AUTH PAGES
   ============================================= */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.auth-container::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    top: -200px;
    right: -200px;
}

.auth-container::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
}

.auth-card .card {
    backdrop-filter: blur(10px);
    background: rgba(30, 30, 50, 0.8);
}

/* Auth pages mobile optimizations */
@media (max-width: 768px) {
    .auth-container {
        padding: 16px;
    }

    .auth-card {
        max-width: 100%;
    }

    .auth-card .card {
        border-radius: var(--radius-md);
    }

    .auth-card .card-body {
        padding: 24px 20px !important;
    }

    /* Reduce decorative elements on mobile */
    .auth-container::before,
    .auth-container::after {
        width: 300px;
        height: 300px;
        opacity: 0.5;
    }

    /* Hide crypto float icons on very small screens */
    .crypto-float {
        display: none;
    }

    .particle {
        display: none;
    }

    /* Login page specific */
    .login-content {
        padding: 20px 12px !important;
    }

    .login-card {
        max-width: 100%;
    }

    /* Logo sizing on mobile */
    .logo-icon {
        width: 56px !important;
        height: 56px !important;
        min-width: 56px !important;
        min-height: 56px !important;
        font-size: 1.3rem !important;
    }
}

@media (max-width: 576px) {
    .auth-card .card-body {
        padding: 20px 16px !important;
    }

    .auth-card .card-header {
        padding: 16px !important;
    }

    /* Smaller text on very small screens */
    .auth-card h2 {
        font-size: 1.5rem !important;
    }

    .auth-card .logo-icon {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        min-height: 48px !important;
        font-size: 1.1rem !important;
    }
}

/* =============================================
   PROGRESS BARS
   ============================================= */
.progress {
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    height: 8px;
}

.progress-bar {
    background: var(--accent-gradient);
    border-radius: var(--radius-sm);
}

/* =============================================
   SCROLLBAR
   ============================================= */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* =============================================
   UTILITY CLASSES
   ============================================= */

/* Background colors with opacity for stat card icons */
.bg-primary.bg-opacity-10 {
    background: rgba(99, 102, 241, 0.15) !important;
}

.bg-primary.bg-opacity-25 {
    background: rgba(99, 102, 241, 0.25) !important;
}

.bg-secondary.bg-opacity-10 {
    background: rgba(108, 117, 125, 0.15) !important;
}

.bg-secondary.bg-opacity-25 {
    background: rgba(108, 117, 125, 0.25) !important;
}

.bg-success.bg-opacity-10 {
    background: rgba(16, 185, 129, 0.15) !important;
}

.bg-success.bg-opacity-25 {
    background: rgba(16, 185, 129, 0.25) !important;
}

.bg-danger.bg-opacity-10 {
    background: rgba(239, 68, 68, 0.15) !important;
}

.bg-danger.bg-opacity-25 {
    background: rgba(239, 68, 68, 0.25) !important;
}

.bg-warning.bg-opacity-10 {
    background: rgba(245, 158, 11, 0.15) !important;
}

.bg-warning.bg-opacity-25 {
    background: rgba(245, 158, 11, 0.25) !important;
}

.bg-info.bg-opacity-10 {
    background: rgba(6, 182, 212, 0.15) !important;
}

.bg-info.bg-opacity-25 {
    background: rgba(6, 182, 212, 0.25) !important;
}

/* Plain background colors */
.bg-primary:not(.bg-opacity-10):not(.bg-opacity-25) {
    background: var(--accent-primary) !important;
}

.bg-success:not(.bg-opacity-10):not(.bg-opacity-25) {
    background: var(--success) !important;
}

.bg-danger:not(.bg-opacity-10):not(.bg-opacity-25) {
    background: var(--danger) !important;
}

.bg-warning:not(.bg-opacity-10):not(.bg-opacity-25) {
    background: var(--warning) !important;
}

.bg-info:not(.bg-opacity-10):not(.bg-opacity-25) {
    background: var(--info) !important;
}

.bg-secondary:not(.bg-opacity-10):not(.bg-opacity-25) {
    background: var(--bg-card-hover) !important;
}

.bg-dark {
    background: var(--bg-secondary) !important;
}

.bg-light {
    background: var(--bg-card) !important;
}

/* Icon colors inside bg containers */
.bg-primary .bi, .bg-primary.bg-opacity-10 .bi, .bg-primary.bg-opacity-25 .bi {
    color: var(--accent-primary);
}

.bg-success .bi, .bg-success.bg-opacity-10 .bi, .bg-success.bg-opacity-25 .bi {
    color: var(--success);
}

.bg-danger .bi, .bg-danger.bg-opacity-10 .bi, .bg-danger.bg-opacity-25 .bi {
    color: var(--danger);
}

.bg-warning .bi, .bg-warning.bg-opacity-10 .bi, .bg-warning.bg-opacity-25 .bi {
    color: var(--warning);
}

.bg-info .bi, .bg-info.bg-opacity-10 .bi, .bg-info.bg-opacity-25 .bi {
    color: var(--info);
}

.bg-secondary .bi, .bg-secondary.bg-opacity-10 .bi, .bg-secondary.bg-opacity-25 .bi {
    color: var(--text-secondary);
}

/* Stat card icon containers - only apply flex to small icon containers */
.rounded-3.p-2,
.rounded-3.p-3 {
    display: flex;
    align-items: center;
    justify-content: center;
}

.rounded-3.p-3, .rounded-circle.p-3 {
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
}

.rounded-3.p-2, .rounded-circle.p-2 {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
}

/* Ensure fs-4 icons are visible */
.fs-4 {
    font-size: 1.5rem !important;
    line-height: 1;
}

/* Live Market coin cards */
.coin-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

.coin-card .card-title {
    color: var(--text-primary) !important;
}

.coin-card .card-body {
    color: var(--text-primary);
}

.coin-card .text-muted {
    color: var(--text-muted) !important;
}

.coin-card .small {
    color: var(--text-muted);
}

.coin-card .fw-medium,
.coin-card .fw-bold {
    color: var(--text-primary);
}

.coin-card .border-top {
    border-color: var(--border-color) !important;
}

/* Stat card value text */
.card .fs-4.fw-bold,
.card .fs-3.fw-bold,
.card .fs-2.fw-bold {
    color: var(--text-primary) !important;
}

/* Fix for labels in stat cards */
.card-body .small,
.card-body small {
    color: var(--text-muted);
}

.card-body .text-muted.small {
    color: var(--text-muted) !important;
}

/* Live indicator text */
.fw-medium {
    color: var(--text-primary);
}

/* Ensure all bold text in cards is visible */
.card .fw-bold {
    color: var(--text-primary) !important;
}

.card .fw-bold.text-success {
    color: var(--success) !important;
}

.card .fw-bold.text-danger {
    color: var(--danger) !important;
}

/* Specific fix for stat card values */
.card-body .fs-5,
.card-body .fs-4,
.card-body .fs-3 {
    color: var(--text-primary);
}

.card-body .fs-5.fw-bold,
.card-body .fs-4.fw-bold,
.card-body .fs-3.fw-bold {
    color: var(--text-primary) !important;
}

/* Fix text-success and text-danger on bold values */
.fs-5.text-success, .fs-4.text-success, .fs-3.text-success,
.fw-bold.text-success {
    color: var(--success) !important;
}

.fs-5.text-danger, .fs-4.text-danger, .fs-3.text-danger,
.fw-bold.text-danger {
    color: var(--danger) !important;
}

/* Icon in rounded containers */
.rounded-circle i,
.rounded-3 i {
    font-size: 1.25rem;
    line-height: 1;
}

.rounded-circle .fs-4,
.rounded-3 .fs-4 {
    font-size: 1.5rem !important;
}

/* Fix default Bootstrap text color inheritance */
.card, .card * {
    color: inherit;
}

.card {
    color: var(--text-primary);
}

/* Ensure divs inside card-body inherit color */
.card-body > div {
    color: var(--text-primary);
}

/* Performance metrics specific */
.card-body .text-muted + .fw-bold {
    color: var(--text-primary) !important;
}

.border-primary {
    border-color: var(--accent-primary) !important;
}

.border-success {
    border-color: var(--success) !important;
}

.border-danger {
    border-color: var(--danger) !important;
}

.border-warning {
    border-color: var(--warning) !important;
}

.border-info {
    border-color: var(--info) !important;
}

.border-secondary {
    border-color: var(--border-color) !important;
}

.border-0 {
    border: none !important;
}

.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

.shadow {
    box-shadow: var(--shadow-md) !important;
}

.shadow-lg {
    box-shadow: var(--shadow-lg) !important;
}

.rounded-circle {
    border-radius: 50% !important;
}

.rounded-3 {
    border-radius: var(--radius-md) !important;
}

/* Glow Effects */
.glow-primary {
    box-shadow: var(--shadow-glow);
}

.glow-success {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.glow-danger {
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

/* Section Dividers */
.section-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
}

.section-divider::before,
.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.section-divider span {
    padding: 0 16px;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Icon Containers */
.icon-container {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.icon-container.primary {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary);
}

.icon-container.success {
    background: var(--success-bg);
    color: var(--success);
}

.icon-container.danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.icon-container.warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.icon-container.info {
    background: var(--info-bg);
    color: var(--info);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 4rem;
    opacity: 0.2;
    color: var(--text-muted);
}

/* Charts */
.chart-container {
    position: relative;
    height: 300px;
}

/* =============================================
   LIVE MARKET SPECIFIC
   ============================================= */
.live-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--danger);
    display: inline-block;
    animation: pulse 2s infinite;
}

.live-indicator.active {
    background-color: var(--success);
}

.live-indicator.paused {
    background-color: var(--warning);
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.1); }
}

.coin-card {
    transition: var(--transition-normal);
    border-left: 4px solid var(--border-color);
}

.coin-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.coin-card.price-up {
    border-left-color: var(--success);
}

.coin-card.price-down {
    border-left-color: var(--danger);
}

.price-flash {
    animation: priceFlash 0.3s ease;
}

@keyframes priceFlash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Live Market Mobile Optimizations */
@media (max-width: 768px) {
    /* Stack live market controls vertically */
    .card-body .row.align-items-center .d-flex.justify-content-end {
        justify-content: flex-start !important;
        width: 100%;
    }

    .card-body .row.align-items-center .d-flex.gap-3 {
        gap: 12px !important;
    }

    /* Full width search and select inputs on mobile */
    .input-group {
        width: 100% !important;
    }

    .form-select {
        width: 100% !important;
    }

    /* Coin cards - full width on mobile */
    .coin-card {
        margin-bottom: 12px;
    }

    /* Reduce animation intensity on mobile for performance */
    .coin-card:hover {
        transform: translateY(-2px);
    }
}

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.slide-in {
    animation: slideIn 0.3s ease forwards;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 991px) {
    .main-content main {
        padding: 24px;
    }

    /* Reduce font sizes slightly on tablets */
    html {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    /* Sidebar - slide in/out on mobile */
    .sidebar {
        transform: translateX(-100%);
        z-index: 1050;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .main-content main {
        padding: 16px;
    }

    /* Reduce padding on mobile */
    .card-body {
        padding: 16px;
    }

    .card-header {
        padding: 16px;
    }

    .card-footer {
        padding: 12px 16px;
    }

    /* Table cells - reduce padding */
    .table thead th,
    .table tbody td {
        padding: 12px 16px;
    }

    /* Page headers - stack vertically on mobile */
    .d-flex.justify-content-between.align-items-center {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 16px;
    }

    /* Button groups in headers */
    .d-flex.justify-content-between.align-items-center .d-flex.gap-2 {
        width: 100%;
        justify-content: flex-end;
    }

    /* Headings - slightly smaller on mobile */
    .h1, h1 {
        font-size: 1.75rem;
    }

    .h2, h2 {
        font-size: 1.5rem;
    }

    .h3, h3 {
        font-size: 1.25rem;
    }

    /* Buttons - ensure minimum touch target size */
    .btn {
        min-height: 44px;
        padding: 12px 20px;
    }

    .btn-sm {
        min-height: 38px;
        padding: 8px 14px;
    }

    .btn-lg {
        min-height: 52px;
        padding: 16px 28px;
    }

    /* Icon-only buttons need adequate touch targets */
    .btn:has(i.bi:only-child),
    .btn:has(i.bi):not(:has(span)):not(:has(div)) {
        min-width: 44px;
        min-height: 44px;
        padding: 10px;
    }

    /* Form controls - larger on mobile for better usability */
    .form-control,
    .form-select {
        min-height: 44px;
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    .form-control-sm,
    .form-select-sm {
        min-height: 38px;
        font-size: 14px;
    }

    /* Input groups */
    .input-group-text {
        min-height: 44px;
    }

    /* Modal adjustments */
    .modal-dialog {
        margin: 0.5rem;
    }

    .modal-body {
        padding: 1rem;
    }

    /* Table action buttons */
    .table .btn-action {
        width: 38px;
        height: 38px;
    }

    /* Stat cards - better spacing */
    .rounded-3.p-3,
    .rounded-circle.p-3 {
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
    }

    /* Filter sections - full width inputs on mobile */
    .card-body .row.g-3 > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Pagination - smaller on mobile */
    .pagination {
        font-size: 0.875rem;
    }

    .page-link {
        padding: 0.375rem 0.75rem;
    }

    /* Breadcrumbs - allow wrapping */
    .breadcrumb {
        flex-wrap: wrap;
    }

    /* Alert spacing */
    .alert {
        padding: 12px 16px;
    }

    /* Badge sizing */
    .badge {
        font-size: 0.75rem;
        padding: 4px 8px;
    }

    /* Dropdown menus - full width on mobile */
    .dropdown-menu {
        min-width: 100%;
    }
}

/* Small mobile devices (< 576px) */
@media (max-width: 576px) {
    html {
        font-size: 13px;
    }

    .main-content main {
        padding: 12px;
    }

    .card-body {
        padding: 12px;
    }

    /* Very compact table cells */
    .table thead th,
    .table tbody td {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    /* Hide less important table columns on very small screens */
    .table th:nth-child(n+6),
    .table td:nth-child(n+6) {
        display: none;
    }

    /* Stack stat cards even tighter */
    .col-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Smaller buttons on very small screens */
    .btn {
        font-size: 0.875rem;
        padding: 10px 16px;
    }

    .btn-sm {
        font-size: 0.75rem;
        padding: 6px 10px;
    }

    /* Compact modals */
    .modal-header,
    .modal-footer {
        padding: 0.75rem;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .main-content main {
        padding: 12px 16px;
    }

    /* Reduce vertical padding in landscape mode */
    .card-body {
        padding: 12px 16px;
    }

    .mb-4 {
        margin-bottom: 1rem !important;
    }
}

/* Utility class to force wrap long text on mobile */
@media (max-width: 768px) {
    .text-truncate {
        white-space: normal !important;
        word-break: break-word;
    }

    /* Ensure tables scroll horizontally if needed */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Better word wrapping for long content */
    .card-body p,
    .card-body div,
    .modal-body p,
    .modal-body div {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1100;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-md);
    width: 48px;
    height: 48px;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    transition: var(--transition-normal);
}

.mobile-menu-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.5);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Adjust main content to not overlap with mobile menu button */
    .main-content main {
        padding-top: 68px;
    }
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
}

.sidebar-overlay.show {
    display: block;
}

/* =============================================
   MOBILE-SPECIFIC UTILITIES
   ============================================= */

/* Hide on mobile */
.d-mobile-none {
    display: initial;
}

@media (max-width: 768px) {
    .d-mobile-none {
        display: none !important;
    }
}

/* Show only on mobile */
.d-mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .d-mobile-only {
        display: block !important;
    }
}

/* Text sizing for mobile */
@media (max-width: 768px) {
    .text-mobile-sm {
        font-size: 0.875rem !important;
    }

    .text-mobile-xs {
        font-size: 0.75rem !important;
    }
}

/* Better tap highlighting */
@media (max-width: 768px) {
    a, button, .btn, .nav-link, .dropdown-item {
        -webkit-tap-highlight-color: rgba(99, 102, 241, 0.2);
    }
}

/* Disable hover effects on touch devices */
@media (hover: none) and (pointer: coarse) {
    .card-hover:hover {
        transform: none;
        box-shadow: var(--shadow-sm);
    }

    .btn:hover {
        transform: none;
    }
}

/* Email preview mobile optimization */
@media (max-width: 768px) {
    .email-body-preview {
        font-size: 0.875rem;
        max-height: 250px !important;
    }

    .email-body-preview table {
        width: 100% !important;
        max-width: 100% !important;
    }

    .email-body-preview img {
        max-width: 100% !important;
        height: auto !important;
    }
}

/* Better scrollable areas on mobile */
@media (max-width: 768px) {
    .table-responsive {
        border-radius: var(--radius-md);
    }

    /* Improve scrollbar visibility on mobile */
    .table-responsive::-webkit-scrollbar {
        height: 6px;
    }

    .table-responsive::-webkit-scrollbar-track {
        background: var(--bg-input);
        border-radius: 3px;
    }

    .table-responsive::-webkit-scrollbar-thumb {
        background: var(--border-light);
        border-radius: 3px;
    }
}

/* Toast/Alert positioning on mobile */
@media (max-width: 768px) {
    .swal2-popup {
        width: calc(100% - 2rem) !important;
        max-width: 400px;
    }
}

/* Fixed positioning adjustments for mobile */
@media (max-width: 768px) {
    .position-fixed {
        position: absolute;
    }
}

/* =============================================
   PRINT STYLES
   ============================================= */
@media print {
    .sidebar,
    .mobile-menu-toggle,
    .sidebar-overlay {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    body {
        background: white;
        color: black;
    }

    .card {
        border: 1px solid #ddd;
        box-shadow: none;
    }

    .btn, .dropdown, .nav-link {
        display: none;
    }
}
