/* Dark Theme - Professional SaaS Design */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-tertiary: #1f1f1f;
    --text-primary: #ffffff;
    --text-secondary: #a3a3a3;
    --text-tertiary: #737373;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --border: #2a2a2a;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

main,
.container-fluid,
.row,
.col,
[class*="col-"],
.card,
.card-header,
.card-body,
.card-footer,
.table,
.table-responsive,
.progress,
.alert-item {
    color: var(--text-primary);
}

h1, h2, h3, h4, h5, h6,
p, span, div, label, small,
.card-title, .card-text, .card-footer, .card-header,
.list-group-item, .navbar-brand, .nav-link {
    color: inherit;
}

.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5,
.card-header h6,
.card-body h1,
.card-body h2,
.card-body h3,
.card-body h4,
.card-body h5,
.card-body h6 {
    color: var(--text-primary);
}

code {
    color: #c4b5fd;
    background: rgba(99, 102, 241, 0.12);
    padding: 2px 6px;
    border-radius: 6px;
}

.money {
    color: var(--success) !important;
    font-weight: 700;
}

/* Sidebar */
.sidebar {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 70px 0 0;
    width: 240px;
    transition: transform 0.3s ease;
}

.sidebar.hidden {
    transform: translateX(-240px);
}

.sidebar-sticky {
    position: relative;
    top: 0;
    height: calc(100vh - 70px);
    padding-top: 0.5rem;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar .nav-link {
    color: var(--text-secondary);
    border-radius: 8px;
    margin: 2px 12px;
    padding: 10px 12px;
    transition: all 0.2s ease;
    font-size: 0.9375rem;
}

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

.sidebar .nav-link.active {
    background: var(--accent);
    color: white;
}

.sidebar .nav-link i {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    stroke-width: 2;
}

/* Sidebar Toggle Buttons */
.sidebar-toggle-inside {
    position: absolute;
    top: 16px;
    right: 12px;
    z-index: 10;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.sidebar-toggle-inside:hover {
    background: var(--accent);
    color: white;
}

.sidebar-toggle-inside i {
    width: 18px;
    height: 18px;
}

.sidebar.hidden .sidebar-toggle-inside {
    display: none;
}

.sidebar-toggle-show {
    position: fixed;
    top: 85px;
    left: 16px;
    z-index: 1002;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.sidebar.hidden ~ .sidebar-toggle-show {
    display: flex;
}

.sidebar-toggle-show:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Navbar */
.navbar {
    background: var(--bg-secondary) !important;
    border-bottom: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    z-index: 101;
    height: 70px;
    transition: width 0.3s ease;
}

.navbar.sidebar-hidden {
    width: 100%;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
}

.navbar-brand a {
    color: var(--text-primary);
}

/* Main content */
main {
    margin-left: 240px;
    padding-top: 90px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

main.sidebar-hidden {
    margin-left: 0;
}

/* Cards */
.card {
    background: #111111;
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.2s ease;
}

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

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
}

.card-body {
    padding: 20px;
}

/* Dashboard Cards - Clean Design */
.dashboard-card {
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s ease;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    background: var(--bg-secondary);
    cursor: pointer;
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
}

.dashboard-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

a:has(.dashboard-card) {
    text-decoration: none;
    color: inherit;
}

a:has(.dashboard-card):hover {
    text-decoration: none;
}

.dashboard-card .card-icon {
    width: 48px;
    height: 48px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dashboard-card .card-icon i {
    width: 24px;
    height: 24px;
    color: var(--accent);
    stroke-width: 2;
}

.dashboard-card .card-content {
    flex: 1;
}

.dashboard-card .card-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 500;
}

.dashboard-card .card-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

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

.dashboard-card .badge-success,
.dashboard-card .badge-info {
    background: transparent;
    color: var(--text-secondary);
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.dashboard-card .badge-success i {
    color: var(--success);
    width: 14px;
    height: 14px;
}

.dashboard-card .badge-info i {
    color: var(--accent);
    width: 14px;
    height: 14px;
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
}

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

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

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

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

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

.btn-danger {
    background: var(--error);
    color: white;
}

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

/* Tables */
.table-responsive {
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
}

.table {
    color: var(--text-primary);
    margin-bottom: 0;
    --bs-table-color: #ffffff;
    --bs-table-bg: var(--bg-secondary);
    --bs-table-border-color: var(--border);
    --bs-table-striped-bg: #181818;
    --bs-table-striped-color: #ffffff;
    --bs-table-hover-bg: var(--bg-tertiary);
    --bs-table-hover-color: #ffffff;
}

.table > :not(caption) > * > * {
    background: var(--bg-secondary);
    color: #ffffff !important;
    border-bottom-color: var(--border);
    box-shadow: none;
}

.table thead th {
    border-bottom: 1px solid var(--border);
    color: #f5f5f5 !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 12px;
    background: #171717;
}

.table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: all 0.2s ease;
}

.table tbody tr:hover,
.table-hover > tbody > tr:hover > * {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary);
}

.table tbody td {
    padding: 12px;
    vertical-align: middle;
    color: #ffffff !important;
}

.table strong,
.table td strong,
.table td small,
.table td span,
.table td div,
.table td a,
.table td code,
.table td .text-dark,
.table td .text-muted,
.table td .text-secondary {
    color: inherit !important;
}

.table .badge.text-dark {
    color: #111111 !important;
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
}

.badge.bg-success {
    background: var(--success) !important;
}

.badge.bg-danger {
    background: var(--error) !important;
}

.badge.bg-warning {
    background: var(--warning) !important;
}

.badge.bg-primary {
    background: var(--accent) !important;
}

/* Forms */
.form-control, .form-select,
input.form-control, select.form-select, textarea.form-control,
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
textarea, select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff;
    caret-color: #ffffff;
    border-radius: 8px;
    padding: 10px 14px;
}

.form-control::placeholder,
textarea::placeholder,
input::placeholder {
    color: #a3a3a3 !important;
    -webkit-text-fill-color: #a3a3a3;
    opacity: 1;
}

.form-control:focus, .form-select:focus,
input:focus, textarea:focus, select:focus {
    background: var(--bg-tertiary);
    border-color: var(--accent);
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-control:disabled, .form-control[readonly],
.form-select:disabled,
input:disabled, textarea:disabled, select:disabled {
    color: #f5f5f5 !important;
    -webkit-text-fill-color: #f5f5f5;
    opacity: 1;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
    -webkit-text-fill-color: #ffffff;
    -webkit-box-shadow: 0 0 0px 1000px var(--bg-tertiary) inset;
    transition: background-color 9999s ease-in-out 0s;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(1) opacity(0.85);
}

.form-label {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 6px;
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: 1px solid;
    padding: 12px 16px;
}

.alert-info {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(129, 140, 248, 0.5);
    color: #c7d2fe;
}

.alert-info strong,
.alert-info i,
.alert-info small,
.alert-info span {
    color: inherit;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
    color: var(--success);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning);
    color: var(--warning);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
    color: var(--error);
}

/* Progress bars */
.progress {
    background: var(--bg-tertiary);
    border-radius: 8px;
    overflow: hidden;
}

.progress-bar {
    background: var(--accent);
    transition: width 0.6s ease;
}

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

.progress-bar.bg-danger {
    background: var(--error);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* Text colors */
.text-muted {
    color: #c4c4c4 !important;
}

h5,
.card-header h5,
.card-body h5,
.card-body .h4,
.card-body .h5,
.dashboard-card .card-label,
.dashboard-card .card-value,
.dashboard-card .card-footer,
.welcome-header h1,
.welcome-header p,
.card .text-dark,
.card .text-black,
.card table,
.card table th,
.card table td,
.card table small,
.card table strong,
.card table a,
.card table span,
.card table div,
.card .table,
.card .table th,
.card .table td {
    color: #ffffff !important;
}

.card .table,
.card .table-responsive,
.card table {
    background: var(--bg-secondary) !important;
}

.card .table thead th {
    background: #171717 !important;
    color: #ffffff !important;
}

.card .table tbody td,
.card .table tbody tr,
.card table tbody td,
.card table tbody tr {
    background: var(--bg-secondary) !important;
    color: #ffffff !important;
}

.card .table-hover > tbody > tr:hover > *,
.card table tbody tr:hover > * {
    background: var(--bg-tertiary) !important;
    color: #ffffff !important;
}

/* Theme Switcher */
.theme-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 6px;
    display: flex;
    gap: 4px;
}

.theme-switcher button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.theme-switcher button:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.theme-switcher button.active {
    background: var(--accent);
    color: white;
}

/* Welcome Header */
.welcome-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease;
}

/* Bootstrap compatibility overrides for dark theme */
.bg-light,
.table-light,
.card .bg-light,
.alert-item.bg-light {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

.text-dark,
.text-black,
.card .text-dark,
.card .text-black,
.bg-light .text-dark,
.bg-light .text-black,
.table .text-dark,
.table .text-black {
    color: var(--text-primary) !important;
}

.text-primary,
.card .text-primary,
.table .text-primary,
h6.text-primary,
h2.text-primary,
h4.text-primary {
    color: #cbd5ff !important;
}

.bg-warning.text-dark,
.badge.bg-warning.text-dark,
.card-header.bg-warning,
.funnel-box.bg-warning.text-dark {
    color: #111111 !important;
}

.card-header.bg-warning h1,
.card-header.bg-warning h2,
.card-header.bg-warning h3,
.card-header.bg-warning h4,
.card-header.bg-warning h5,
.card-header.bg-warning h6,
.card-header.bg-warning span,
.card-header.bg-warning div,
.bg-warning.text-dark h1,
.bg-warning.text-dark h2,
.bg-warning.text-dark h3,
.bg-warning.text-dark h4,
.bg-warning.text-dark h5,
.bg-warning.text-dark h6,
.bg-warning.text-dark small,
.bg-warning.text-dark span,
.bg-warning.text-dark div {
    color: #111111 !important;
}

.card-header.bg-warning,
.funnel-box.bg-warning {
    background: #facc15 !important;
}

.table a,
.card a:not(.btn),
.list-group-item a {
    color: #c4b5fd;
}

.table a:hover,
.card a:not(.btn):hover,
.list-group-item a:hover {
    color: #ddd6fe;
}

/* Lucide SVG icons default sizing */
svg[data-lucide] {
    width: 1em;
    height: 1em;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Achievement Cards */
.achievement-card {
    background: linear-gradient(145deg, #141414 0%, #1a1a1a 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.achievement-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), #a855f7, var(--accent));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.achievement-card:hover::before {
    opacity: 1;
}

.achievement-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.15);
}

.achievement-card .achievement-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.15) 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.achievement-card .achievement-icon i {
    width: 24px;
    height: 24px;
    color: var(--accent);
    stroke-width: 2;
}

.achievement-card .card-title {
    font-weight: 700;
    font-size: 1.1rem;
}

.achievement-meta {
    display: grid;
    gap: 6px;
}

.meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.meta-label {
    color: var(--text-secondary);
}

.meta-value {
    font-weight: 600;
    color: var(--text-primary);
}

.meta-value.bonus {
    color: var(--success);
    font-weight: 700;
}

/* Achievement Panel */
.achievement-panel {
    position: fixed;
    top: 70px;
    right: 0;
    width: 280px;
    height: calc(100vh - 70px);
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    z-index: 99;
    transform: translateX(0);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.achievement-panel.collapsed {
    transform: translateX(280px);
}

.achievement-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9375rem;
}

.achievement-panel-close {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.achievement-panel-close:hover {
    background: var(--accent);
    color: white;
}

.achievement-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.achievement-section {
    margin-bottom: 20px;
}

.achievement-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}

.achievement-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.achievement-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    transition: all 0.2s ease;
}

.achievement-item:hover {
    border-color: var(--accent);
}

.achievement-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.achievement-item-icon {
    width: 32px;
    height: 32px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.achievement-item-icon i {
    width: 16px;
    height: 16px;
    color: var(--accent);
}

.achievement-item-title {
    font-weight: 600;
    font-size: 0.875rem;
    flex: 1;
}

.achievement-item-bonus {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--success);
}

.achievement-progress {
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.achievement-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #a855f7);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.achievement-progress-text {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-align: right;
}

.achievement-empty {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    text-align: center;
    padding: 16px;
    opacity: 0.7;
}

.achievement-panel-show {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 98;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: linear-gradient(135deg, var(--accent), #a855f7);
    color: white;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
    transition: all 0.2s ease;
}

.achievement-panel.collapsed .achievement-panel-show {
    display: flex;
}

.achievement-panel-show:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.4);
}

.achievement-panel-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: var(--error);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

/* KPI Cards */
.kpi-card {
    background: linear-gradient(145deg, #141414 0%, #1a1a1a 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    opacity: 0.8;
}

.kpi-card.purple::before { background: linear-gradient(90deg, #6366f1, #a855f7); }
.kpi-card.blue::before { background: linear-gradient(90deg, #3b82f6, #06b6d4); }
.kpi-card.pink::before { background: linear-gradient(90deg, #ec4899, #f43f5e); }
.kpi-card.orange::before { background: linear-gradient(90deg, #f59e0b, #f97316); }
.kpi-card.green::before { background: linear-gradient(90deg, #10b981, #34d399); }

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

.kpi-card .kpi-value {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 4px;
    background: linear-gradient(135deg, #fff 0%, #c4b5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.kpi-card .kpi-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.kpi-card .kpi-change {
    font-size: 0.8125rem;
    font-weight: 600;
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.kpi-card .kpi-change.positive { color: var(--success); }
.kpi-card .kpi-change.negative { color: var(--error); }

/* Funnel Box */
.funnel-box {
    background: linear-gradient(145deg, #141414 0%, #1a1a1a 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.funnel-box::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 12px solid var(--border);
}

.funnel-box:last-child::after {
    display: none;
}

.funnel-step {
    display: flex;
    align-items: center;
    gap: 16px;
}

.funnel-step-number {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: white;
    flex-shrink: 0;
}

.funnel-step-content {
    flex: 1;
}

.funnel-step-title {
    font-weight: 600;
    font-size: 0.9375rem;
    margin-bottom: 2px;
}

.funnel-step-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
}

/* Text Gradients */
.text-gradient-purple {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-blue {
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-green {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Card Gradients */
.card-gradient-purple {
    background: linear-gradient(145deg, rgba(99, 102, 241, 0.08) 0%, rgba(168, 85, 247, 0.05) 100%);
    border-color: rgba(99, 102, 241, 0.25);
}

.card-gradient-blue {
    background: linear-gradient(145deg, rgba(59, 130, 246, 0.08) 0%, rgba(6, 182, 212, 0.05) 100%);
    border-color: rgba(59, 130, 246, 0.25);
}

.card-gradient-green {
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.08) 0%, rgba(52, 211, 153, 0.05) 100%);
    border-color: rgba(16, 185, 129, 0.25);
}

/* Premium Animations */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.premium-shimmer {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
    background-size: 200% 100%;
    animation: shimmer 3s infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.2); }
    50% { box-shadow: 0 0 20px 4px rgba(99, 102, 241, 0.1); }
}

.pulse-glow {
    animation: pulse-glow 3s ease-in-out infinite;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        z-index: 1000;
    }

    main {
        margin-left: 0;
    }
}

.mobile-sidebar-toggle {
    width: 42px;
    height: 42px;
    margin-left: 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar-backdrop {
    display: none;
}

@media (max-width: 768px) {
    body.sidebar-mobile-open {
        overflow: hidden;
    }

    .theme-switcher {
        right: 12px;
        bottom: 12px;
        top: auto;
    }

    .navbar {
        width: 100%;
        padding-right: 8px !important;
    }

    .user-nav-dropdown .btn {
        padding-left: 8px;
        padding-right: 8px;
    }

    .sidebar {
        transform: translateX(-100%);
        width: min(86vw, 320px);
        box-shadow: 0 10px 35px rgba(0, 0, 0, 0.35);
    }

    .sidebar.hidden {
        transform: translateX(-100%);
    }

    .sidebar.mobile-open,
    .sidebar.mobile-open.collapse:not(.show) {
        display: block !important;
        transform: translateX(0);
    }

    .sidebar-toggle-inside,
    .sidebar-toggle-show {
        display: none !important;
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 70px 0 0 0;
        background: rgba(0, 0, 0, 0.55);
        z-index: 999;
    }

    body.sidebar-mobile-open .sidebar-backdrop {
        display: block;
    }

    main {
        margin-left: 0;
        padding-top: 82px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .container-fluid,
    .container-fluid > .row {
        padding-left: 0;
        padding-right: 0;
        margin-left: 0;
        margin-right: 0;
    }

    .dashboard-card {
        padding: 16px;
        align-items: flex-start;
    }

    .card-body,
    .card-header {
        padding: 14px;
    }

    .card-value {
        font-size: 1.5rem !important;
        line-height: 1.15;
        word-break: break-word;
    }

    .welcome-header {
        margin-bottom: 1rem !important;
    }

    .welcome-header .h2 {
        font-size: 1.4rem;
    }

    .mobile-card-table table,
    .mobile-card-table thead,
    .mobile-card-table tbody,
    .mobile-card-table th,
    .mobile-card-table td,
    .mobile-card-table tr {
        display: block;
        width: 100%;
    }

    .mobile-card-table thead {
        display: none;
    }

    .mobile-card-table tbody {
        display: grid;
        gap: 12px;
    }

    .mobile-card-table tr {
        background: var(--bg-tertiary);
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 12px;
    }

    .mobile-card-table td {
        border: none;
        padding: 6px 0;
    }

    .mobile-card-table td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.75rem;
        color: var(--text-secondary);
        margin-bottom: 2px;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .alert-item .btn {
        width: 100%;
    }
}
