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

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    --text-dark: #1f2937;
    --text-medium: #4b5563;
    --text-light: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --border-color: #e5e7eb;
    --sidebar-bg: #1f2937;
    --sidebar-hover: #374151;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Dark Mode Variables */
body.dark-mode {
    --primary-color: #818cf8;
    --primary-dark: #6366f1;
    --secondary-color: #a78bfa;
    --success-color: #34d399;
    --warning-color: #fbbf24;
    --danger-color: #f87171;
    --info-color: #60a5fa;
    --text-dark: #f9fafb;
    --text-medium: #d1d5db;
    --text-light: #9ca3af;
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-tertiary: #374151;
    --border-color: #4b5563;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    color: var(--text-dark);
    background: var(--bg-secondary);
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.account-name {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: white;
}

.nav-item.active {
    background: var(--primary-color);
    color: white;
}

.nav-item .icon {
    margin-right: 12px;
    font-size: 20px;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
}

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

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

.user-info {
    flex: 1;
}

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

.user-email {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

/* Main Content */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 24px;
    min-height: 100vh;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
}

.page-subtitle {
    color: var(--text-light);
    font-size: 16px;
    margin-top: 4px;
}

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

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

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

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

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
}

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

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

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

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

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s;
    position: relative;
}

.btn-icon:hover {
    background: var(--bg-tertiary);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger-color);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
}

.btn-link:hover {
    text-decoration: underline;
}

.btn-link.danger {
    color: var(--danger-color);
}

/* Tab Content */
.tab-content {
    display: none;
}

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

/* Quick Actions Bar */
.quick-actions-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: var(--shadow);
    flex-wrap: wrap;
}

.quick-action-btn {
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-dark);
}

.quick-action-btn:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    position: relative;
    transition: all 0.2s;
}

.stat-card-clickable {
    cursor: pointer;
}

.stat-card-clickable:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--primary-color);
}

.stat-action-hint {
    font-size: 12px;
    color: var(--primary-color);
    margin-top: 12px;
    opacity: 0;
    transition: opacity 0.2s;
    font-weight: 600;
}

.stat-card-clickable:hover .stat-action-hint {
    opacity: 1;
}

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

.stat-label {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
}

.stat-period {
    font-size: 12px;
    color: var(--text-light);
}

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

.stat-change {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.stat-change.negative {
    color: var(--danger-color);
}

.change-text {
    color: var(--text-light);
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.chart-card {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.chart-card.span-2 {
    grid-column: span 2;
}

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

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

.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.chart-filters {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: var(--bg-tertiary);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Data Table */
.data-table-card {
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 32px;
}

.data-table-card .card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

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

.data-table thead {
    background: var(--bg-secondary);
}

.data-table th {
    padding: 12px 24px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-medium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

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

.transaction-id {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: var(--primary-color);
}

.invoice-id {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: var(--text-dark);
}

/* Badges */
.badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-pending {
    background: #fef3c7;
    color: #92400e;
}

.badge-failed {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* Filters Bar */
.filters-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 250px;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
}

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

/* Billing */
.billing-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.billing-card {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.billing-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

.plan-name {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.plan-price {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.plan-price span {
    font-size: 16px;
    color: var(--text-light);
    font-weight: 400;
}

.plan-description {
    color: var(--text-light);
    margin-bottom: 20px;
}

.usage-progress {
    margin-bottom: 20px;
}

.usage-label {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 8px;
}

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s;
}

.card-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.card-icon {
    font-size: 32px;
}

.card-details {
    flex: 1;
}

.card-number {
    font-weight: 600;
    margin-bottom: 4px;
}

.card-expiry {
    font-size: 14px;
    color: var(--text-light);
}

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

.country-list {
    padding: 12px 0;
}

.country-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.country-name {
    font-size: 14px;
}

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

/* API Keys */
.api-keys-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.subtitle {
    color: var(--text-light);
    font-size: 16px;
    margin-top: 4px;
}

.api-keys-list {
    display: grid;
    gap: 24px;
    margin-bottom: 32px;
}

.api-key-card {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.api-key-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 16px;
}

.api-key-card h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.api-key-type {
    font-size: 14px;
    color: var(--text-light);
}

.api-key-value {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-secondary);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.api-key-value code {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: var(--text-dark);
}

.api-key-footer {
    display: flex;
    gap: 24px;
    font-size: 14px;
    color: var(--text-light);
}

.api-key-created,
.api-key-last-used {
    flex: 1;
}

.api-docs-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 32px;
    border-radius: 12px;
    text-align: center;
}

.api-docs-card h3 {
    font-size: 24px;
    margin-bottom: 12px;
}

.api-docs-card p {
    margin-bottom: 20px;
    opacity: 0.95;
}

/* Customers */
.customers-header {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

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

/* Settings */
.settings-container {
    max-width: 800px;
}

.settings-section {
    background: var(--bg-primary);
    padding: 32px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.settings-section h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 24px;
}

.setting-item {
    margin-bottom: 24px;
}

.setting-item label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 14px;
}

.input {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
}

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

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

.setting-toggle:last-child {
    border-bottom: none;
}

.setting-toggle h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.setting-toggle p {
    font-size: 14px;
    color: var(--text-light);
}

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

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

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

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: var(--bg-primary);
    transition: 0.3s;
    border-radius: 50%;
}

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

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

.security-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

.danger-zone {
    border: 2px solid var(--danger-color);
}

.danger-zone h3 {
    color: var(--danger-color);
}

.danger-zone .setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.danger-zone h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.danger-zone p {
    font-size: 14px;
    color: var(--text-light);
}

/* Responsive */
@media (max-width: 1200px) {
    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .chart-card.span-2 {
        grid-column: span 1;
    }
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.dark-mode-toggle:hover {
    background: var(--border-color);
}

.dark-mode-toggle span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-medium);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: var(--bg-primary);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
    border: 2px solid var(--border-color);
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

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

.modal-body {
    padding: 24px;
}

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

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-medium);
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--border-color);
    transform: rotate(90deg);
}

.modal-text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-medium);
    margin-bottom: 16px;
}

.modal-highlight {
    background: var(--bg-tertiary);
    padding: 16px;
    border-radius: 8px;
    margin: 16px 0;
    border-left: 4px solid var(--primary-color);
}

.modal-highlight strong {
    color: var(--primary-color);
    display: block;
    margin-bottom: 8px;
}

/* Risk Badge */
.risk-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.risk-low {
    background: #d1fae5;
    color: #065f46;
}

.risk-medium {
    background: #fef3c7;
    color: #92400e;
}

.risk-high {
    background: #fee2e2;
    color: #991b1b;
}

.risk-wtf {
    background: #fce7f3;
    color: #831843;
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    color: var(--text-light);
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.2s;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-separator {
    color: var(--text-light);
}

/* Sub Navigation Tabs */
.sub-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
    overflow-x: auto;
}

.sub-nav-item {
    padding: 12px 20px;
    background: none;
    border: none;
    color: var(--text-medium);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    transition: all 0.2s;
}

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

.sub-nav-item.active {
    color: var(--primary-color);
}

.sub-nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

/* Sub Tab Content */
.sub-tab-content {
    display: none;
}

.sub-tab-content.active {
    display: block;
}

/* Collapsible Sections */
.collapsible-section {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
}

.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.collapsible-header:hover {
    background: var(--bg-secondary);
}

.collapsible-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 12px;
}

.collapsible-icon {
    font-size: 20px;
    transition: transform 0.3s;
}

.collapsible-section.expanded .collapsible-icon {
    transform: rotate(90deg);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.collapsible-section.expanded .collapsible-content {
    max-height: 2000px;
}

.collapsible-body {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

/* Action Cards */
.action-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.action-card {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
}

.action-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.action-card-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.action-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.action-card-description {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.4;
}

/* Locked Feature Badge */
.locked-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
}

/* Step Indicator */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
    gap: 16px;
}

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

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    color: var(--text-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.step.active .step-number {
    background: var(--primary-color);
    color: white;
}

.step.completed .step-number {
    background: var(--success-color);
    color: white;
}

.step-label {
    font-size: 14px;
    color: var(--text-medium);
    font-weight: 500;
}

.step.active .step-label {
    color: var(--text-dark);
    font-weight: 600;
}

.step-connector {
    width: 40px;
    height: 2px;
    background: var(--border-color);
}

.step.completed ~ .step-connector {
    background: var(--success-color);
}

/* Tree Navigation */
.tree-nav {
    list-style: none;
    padding-left: 0;
}

.tree-nav li {
    margin: 4px 0;
}

.tree-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

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

.tree-item.active {
    background: var(--primary-color);
    color: white;
}

.tree-toggle {
    width: 20px;
    text-align: center;
    cursor: pointer;
}

.tree-children {
    padding-left: 24px;
    display: none;
}

.tree-children.expanded {
    display: block;
}

/* Complex Modal Components */
.modal-section {
    margin-bottom: 24px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.detail-item {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.detail-label {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 8px;
    font-weight: 600;
}

.detail-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.detail-percent {
    display: block;
    font-size: 14px;
    color: var(--text-medium);
}

.payment-method-list,
.health-bars,
.comparison-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.payment-method-row,
.health-row,
.comparison-row {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
}

.payment-method-row span:first-child,
.health-row span:first-child,
.comparison-row span:first-child {
    min-width: 150px;
    font-weight: 500;
}

.payment-method-row span:last-child,
.health-row span:last-child,
.comparison-row span:last-child {
    min-width: 50px;
    text-align: right;
    font-weight: 600;
}

.progress-bar-mini {
    flex: 1;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill-mini {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s;
}

.timeline-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.timeline-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    border-left: 3px solid var(--success-color);
}

.failure-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.failure-reason-item {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    border-left: 3px solid var(--danger-color);
}

.segment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.segment-card {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid var(--border-color);
    transition: all 0.2s;
    cursor: pointer;
}

.segment-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.segment-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.segment-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.segment-count {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 4px;
}

.segment-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
}

.risk-factors-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.risk-factor-item {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid var(--warning-color);
}

.risk-factor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.risk-factor-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-dark);
}

.risk-factor-desc {
    font-size: 13px;
    color: var(--text-light);
}

.action-checklist {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.action-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

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

.action-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.action-item span {
    flex: 1;
    font-size: 14px;
    color: var(--text-dark);
}

.converter-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.currency-pair {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    gap: 12px;
}

.currency-from,
.currency-to {
    font-weight: 600;
    font-size: 16px;
}

.currency-arrow {
    color: var(--primary-color);
    font-size: 20px;
}

.currency-change {
    font-size: 13px;
    font-weight: 600;
}

.currency-change.positive {
    color: var(--success-color);
}

.currency-change.negative {
    color: var(--danger-color);
}

.portal-log {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.portal-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 6px;
    gap: 16px;
}

.portal-time {
    font-size: 13px;
    color: var(--text-light);
    min-width: 100px;
}

.portal-route {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 14px;
}

.portal-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.portal-stat {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.portal-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.portal-stat-label {
    font-size: 12px;
    color: var(--text-light);
}

.margin-waterfall {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.waterfall-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 6px;
    border-left: 4px solid var(--success-color);
}

.waterfall-item.negative {
    border-left-color: var(--danger-color);
}

.waterfall-item.positive {
    border-left-color: var(--success-color);
    background: rgba(16, 185, 129, 0.1);
}

.waterfall-label {
    font-size: 14px;
    font-weight: 500;
}

.waterfall-value {
    font-size: 16px;
    font-weight: 700;
}

.waterfall-percent {
    font-size: 13px;
    color: var(--text-light);
    min-width: 70px;
    text-align: right;
}

@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }

    .sidebar-header,
    .sidebar-footer {
        padding: 20px 10px;
    }

    .account-name,
    .user-info,
    .nav-item span:not(.icon) {
        display: none;
    }

    .main-content {
        margin-left: 70px;
        padding: 16px;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

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

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

    .modal {
        max-width: 95%;
    }

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

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

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