:root {
    --bg: #0a0d1a;
    --bg-secondary: #0f1424;
    --bg-tertiary: #151b2e;
    --sidebar: #0c1020;
    --panel: rgba(18, 22, 42, 0.95);
    --panel-border: rgba(99, 102, 241, 0.15);
    --text: #f1f5f9;
    --muted: #94a3b8;
    --accent: #6366f1;
    --accent-hover: #5558e3;
    --accent-glow: rgba(99, 102, 241, 0.3);
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.15);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.15);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.15);
    --border: rgba(148, 163, 184, 0.1);
    --sidebar-width: 260px;
    /* Glassmorphism Effects */
    --glass-bg: rgba(18, 22, 42, 0.8);
    --glass-border: rgba(99, 102, 241, 0.25);
    --glass-blur: blur(12px);
    --primary: #7c3aed;
    --primary-light: #a78bfa;
    --secondary: #06b6d4;
}

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

body {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    pointer-events: auto !important;
    overflow-x: hidden;
}

/* Ensure buttons are always clickable */
button,
.btn,
a.btn {
    pointer-events: auto !important;
    cursor: pointer !important;
    position: relative;
    z-index: 1;
}

button:disabled,
.btn:disabled {
    pointer-events: none;
    cursor: not-allowed;
}

/* Ensure modal content is above backdrop */
.modal-content {
    pointer-events: auto !important;
    position: relative;
    z-index: 10001 !important;
}

/* Modal Base Styles */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    pointer-events: auto;
}

.modal[style*="display: flex"],
.modal.active,
.modal.show {
    display: flex !important;
}

.modal > * {
    pointer-events: auto;
}

.modal-content {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 10001;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: var(--bg-tertiary);
    color: var(--muted);
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--danger);
    color: white;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-tertiary);
    border-radius: 0 0 16px 16px;
}

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

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

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

.sidebar-logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.sidebar-logo-text {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

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

.nav-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    padding: 8px 12px;
    opacity: 0.7;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    color: var(--muted);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--text);
}

.nav-item.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.nav-item-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.nav-item-badge {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background: radial-gradient(ellipse at top, #141833 0%, var(--bg) 50%);
    padding: 0;
    width: calc(100% - var(--sidebar-width));
    position: relative; /* Ensure proper stacking */
    z-index: 1; /* Ensure it's above body but below modals */
}

/* Page visibility management - ensures only one page visible at a time */
/* Using !important to override any inline styles set by JavaScript */
.page {
    display: none !important;
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    position: relative;
    z-index: 1;
}

#page-providers {
    max-width: 100%;
    padding: 24px;
}

/* ACTIVE page - only one should be active at a time */
/* Using !important to override inline styles and ensure visibility */
.page.active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.page-subtitle {
    color: var(--muted);
    font-size: 0.9rem;
}

/* Panels */
.panel {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
}

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

.panel-title {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-subtitle {
    color: var(--muted);
    font-size: 0.8rem;
    margin-top: 4px;
}

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

.stat-card {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 20px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-label {
    color: var(--muted);
    font-size: 0.85rem;
}

/* Buttons */
.btn {
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 15px var(--accent-glow);
}

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

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

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

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

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--muted);
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    color: var(--text);
    font-size: 0.9rem;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

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

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

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

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

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

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    margin: 0;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Smaller toggles for provider cards */
.provider-card .toggle {
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    position: relative;
    display: inline-block;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.provider-card .toggle:hover {
    transform: scale(1.05);
}

.provider-card .toggle:active {
    transform: scale(0.98);
}

.provider-card label.toggle {
    position: relative;
    display: inline-block;
    cursor: pointer;
    user-select: none;
    width: 44px;
    height: 24px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-tertiary);
    border-radius: 24px;
    transition: 0.3s;
    border: 1.5px solid var(--border);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.provider-card .toggle-slider {
    border-radius: 24px;
    border: 1.5px solid var(--border);
}

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

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.provider-card .toggle-slider:before {
    height: 18px;
    width: 18px;
    left: 2px;
}

.toggle input:checked+.toggle-slider {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 6px var(--accent-glow);
}

.provider-card .toggle input:checked+.toggle-slider {
    box-shadow: 0 0 5px var(--accent-glow);
}

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

.provider-card .toggle input:checked+.toggle-slider:before {
    transform: translateY(-50%) translateX(20px);
}

.toggle input:focus+.toggle-slider {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Grid Layouts */
.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.three-column {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@media (max-width: 1200px) {

    .two-column,
    .three-column {
        grid-template-columns: 1fr;
    }
}

/* Tables */
.table-container {
    overflow-x: auto;
}

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

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

th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    background: var(--bg-tertiary);
}

tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: 10px;
}

.tab {
    padding: 10px 20px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

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

.tab.active {
    background: var(--accent);
    color: white;
}

/* File List */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 500px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.file-item-icon {
    font-size: 24px;
}

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

.file-item-name {
    font-weight: 500;
    margin-bottom: 4px;
}

.file-item-meta {
    font-size: 0.8rem;
    color: var(--muted);
}

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

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 0.3s;
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
}

.toast {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px) scale(0.95);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.activity-fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

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

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

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

/* Loading */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

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

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Queue Item */
.queue-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
}

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

.queue-item-title {
    font-weight: 500;
    margin-bottom: 4px;
}

.queue-item-meta {
    font-size: 0.8rem;
    color: var(--muted);
}

/* Account Card */
.account-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

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

.account-card-title {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.account-card-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.status-dot.online {
    background: var(--success);
}

.status-dot.offline {
    background: var(--danger);
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

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

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

/* Pricing Rate Control Panel */
.pricing-rate-control {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    padding: 12px 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.pricing-rate-control .rate-label {
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pricing-rate-control .rate-input {
    width: 90px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.pricing-rate-control .rate-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.pricing-rate-control .rate-unit {
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
}

/* Modern Pricing Table */
.pricing-table-container {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    overflow: hidden;
}

.pricing-table-header {
    display: grid;
    grid-template-columns: 180px 140px 1fr 1fr 80px;
    gap: 16px;
    padding: 14px 20px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted);
}

.pricing-table-row {
    display: grid;
    grid-template-columns: 180px 140px 1fr 1fr 80px;
    gap: 16px;
    padding: 16px 20px;
    align-items: center;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

.pricing-table-row:last-child {
    border-bottom: none;
}

.pricing-table-row:hover {
    background: var(--bg-tertiary);
}

.provider-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.provider-cell .provider-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}

.provider-cell .provider-key {
    font-size: 11px;
    color: var(--muted);
}

.neh-rate-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.neh-rate-cell .usd-rate {
    font-weight: 700;
    font-size: 14px;
    color: var(--accent);
}

.neh-rate-cell .points-rate {
    font-size: 12px;
    color: var(--success);
}

.margin-cell {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.margin-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.margin-input {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

.margin-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.margin-symbol {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}

.final-price {
    padding: 4px 8px;
    background: var(--success-bg);
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
    color: var(--success);
    text-align: center;
}

.final-price.special {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent);
}

.action-cell {
    display: flex;
    justify-content: center;
}

.action-cell .btn-save {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--accent);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}

.action-cell .btn-save:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

.action-cell .btn-save:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Pricing Summary Card */
.pricing-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.pricing-summary-card {
    background: linear-gradient(135deg, var(--panel) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.pricing-summary-icon {
    width: 48px;
    height: 48px;
    background: var(--bg);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.pricing-summary-content {
    flex: 1;
}

.pricing-summary-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.pricing-summary-label {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

@media (max-width: 1200px) {

    .pricing-table-header,
    .pricing-table-row {
        grid-template-columns: 150px 120px 1fr 1fr 70px;
        gap: 12px;
        padding: 12px 16px;
    }
}

.account-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    max-width: 1200px;
}

@media (max-width: 968px) {
    .account-settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .pricing-rate-control {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ===== Modern Provider Card Styles ===== */
.provider-cards-container {
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.02) 100%);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid rgba(99, 102, 241, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    box-sizing: border-box;
}

.provider-cards-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid rgba(99, 102, 241, 0.1);
}

.provider-cards-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.provider-cards-title h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text) 0%, var(--accent) 50%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.provider-cards-title .icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent) 0%, #8b5cf6 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
    transition: transform 0.3s ease;
}

.provider-cards-title .icon:hover {
    transform: scale(1.05) rotate(5deg);
}

.provider-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
    width: 100%;
    padding: 4px; /* Prevent box-shadow clipping */
}

.provider-card {
    background: linear-gradient(135deg, rgba(18, 22, 42, 0.98) 0%, rgba(15, 20, 36, 0.95) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 20px;
    padding: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.1);
    width: 100%;
    height: auto;
    min-height: auto;
    display: flex;
    flex-direction: column;
    max-width: 100%;
}

.provider-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent) 0%, #8b5cf6 50%, var(--secondary) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.provider-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.provider-card:hover {
    transform: translateY(-10px) scale(1.015);
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 24px 72px rgba(99, 102, 241, 0.3),
        0 12px 32px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(99, 102, 241, 0.1);
}

.provider-card:active {
    transform: translateY(-6px) scale(1.01);
}

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

.provider-card:hover::after {
    opacity: 1;
}

.provider-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 22px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.06) 100%);
    border-bottom: 1px solid rgba(99, 102, 241, 0.15);
    position: relative;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.provider-card:hover .provider-card-header {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.18) 0%, rgba(139, 92, 246, 0.1) 100%);
}


.provider-card-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.3), transparent);
}

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

.provider-card-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    border: 1px solid var(--border);
}

.provider-card-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 2px;
}

.provider-card-key {
    font-size: 0.75rem;
    color: var(--muted);
    font-family: 'Monaco', 'Consolas', monospace;
    opacity: 0.8;
}

.provider-card-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.provider-card-badge.image {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.provider-card-badge.video {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.provider-card-badge.music {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
}

.provider-card-badge.design {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.provider-card-badge.other {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

.provider-card-body {
    padding: 16px 18px;
    background: linear-gradient(180deg, transparent 0%, rgba(99, 102, 241, 0.02) 100%);
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: auto;
    max-height: none;
    transition: all 0.3s ease;
}

.provider-card:hover .provider-card-body {
    background: linear-gradient(180deg, transparent 0%, rgba(99, 102, 241, 0.04) 100%);
}


.provider-card-body::-webkit-scrollbar {
    width: 4px;
}

.provider-card-body::-webkit-scrollbar-track {
    background: transparent;
}

.provider-card-body::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 2px;
}

.provider-card-body::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}

.provider-control-section {
    margin-bottom: 12px;
}

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

.control-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--muted);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.control-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border), transparent);
}

.control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(21, 27, 46, 0.6);
    border-radius: 10px;
    margin-bottom: 6px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.control-row:last-child {
    margin-bottom: 0;
}

.control-row:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.15);
}

.control-row.active {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.2);
}

.control-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
}

.control-label .icon {
    font-size: 16px;
    opacity: 0.8;
}

.control-label .sublabel {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 400;
}

.provider-card-footer {
    padding: 20px 24px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.25) 100%);
    border-top: 1px solid rgba(99, 102, 241, 0.1);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.profit-margin-display {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profit-margin-label {
    font-size: 0.7rem;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.profit-margin-value {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--success);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.15) 100%);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: 0 1px 6px rgba(16, 185, 129, 0.15);
    transition: all 0.3s ease;
    letter-spacing: 0.1px;
}

.profit-margin-value:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.naming-display {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.7rem;
    color: var(--muted);
    border: 1px solid rgba(99, 102, 241, 0.2);
    transition: all 0.3s ease;
}

.naming-display:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-color: rgba(99, 102, 241, 0.3);
}

.naming-display select {
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex: 1;
}

.naming-display select:hover {
    background: rgba(99, 102, 241, 0.1);
}

.naming-display select:focus {
    outline: none;
    background: rgba(99, 102, 241, 0.15);
}

/* Provider card empty state */
.provider-cards-empty {
    text-align: center;
    padding: 60px 40px;
    color: var(--muted);
}

.provider-cards-empty .icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.provider-cards-empty h4 {
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 8px;
}

/* Responsive adjustments for provider cards */
@media (max-width: 1400px) {
    .provider-card-grid {
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
        gap: 18px;
    }
    
    .provider-card {
        min-height: 460px;
    }
}

@media (max-width: 1024px) {
    .provider-card-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 16px;
    }
    
    .provider-card {
        min-height: 440px;
    }

    .provider-cards-container {
        padding: 16px;
    }
}

@media (max-width: 768px) {
    .provider-card-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    
    .provider-card {
        min-height: 420px;
    }

    .provider-cards-container {
        padding: 16px;
        border-radius: 16px;
    }

    .provider-card-header {
        padding: 16px 18px;
    }

    .provider-card-body {
        padding: 16px 18px;
    }

    .provider-card-footer {
        padding: 14px 18px;
    }
}

@media (max-width: 599px) {
    .provider-card-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .provider-card {
        width: 100%;
        min-height: auto;
        max-width: 100%;
    }

    .provider-cards-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .provider-cards-container {
        padding: 12px;
        border-radius: 16px;
    }

    .provider-icon {
        width: 48px;
        height: 48px;
        font-size: 22px;
    }

    .provider-name {
        font-size: 0.95rem;
    }
    
    .provider-card-header {
        padding: 16px;
    }
    
    .provider-card-body {
        padding: 16px;
    }
    
    .provider-card-footer {
        padding: 14px 16px;
    }
    
    .control-group {
        padding: 12px 14px;
    }
    
    .control-header {
        margin-bottom: 8px;
    }
    
    .provider-card .toggle {
        width: 44px;
        height: 24px;
    }
}

@media (max-width: 480px) {
    .provider-card-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    
    .provider-cards-container {
        padding: 10px;
    }
    
    .provider-card-header {
        padding: 14px;
    }
    
    .provider-card-body {
        padding: 12px;
        gap: 8px;
    }
    
    .provider-card-footer {
        padding: 12px 14px;
    }
    
    /* Compact controls on mobile */
    .control-item {
        padding: 10px 12px;
    }
    
    .control-icon {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
    
    .control-name {
        font-size: 0.8rem;
    }
    
    .control-desc {
        font-size: 0.65rem;
    }
    
    .naming-select {
        padding: 10px 14px;
        font-size: 0.8rem;
    }
    
    .control-group {
        padding: 12px;
    }
    
    .control-title {
        font-size: 0.75rem;
    }
    
    .control-status {
        font-size: 0.65rem;
        padding: 3px 8px;
    }
}

/* Toggle animations enhancement */
.provider-card .toggle-slider {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.provider-card .toggle input:checked+.toggle-slider {
    box-shadow: 0 0 8px var(--accent-glow), 0 0 12px rgba(99, 102, 241, 0.25);
}

.provider-card .toggle:hover .toggle-slider {
    box-shadow: 0 0 4px rgba(99, 102, 241, 0.3);
}

.provider-card .toggle input:checked:hover+.toggle-slider {
    box-shadow: 0 0 10px var(--accent-glow), 0 0 15px rgba(99, 102, 241, 0.35);
}

/* Provider card header elements */
.provider-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    border: 1px solid rgba(99, 102, 241, 0.25);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.provider-icon img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    padding: 6px !important;
    display: block !important;
    border-radius: 10px;
}

.provider-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 14px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(139, 92, 246, 0.2));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.provider-card:hover .provider-icon {
    transform: scale(1.08) rotate(2deg);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border-color: rgba(99, 102, 241, 0.5);
}

.provider-card:hover .provider-icon::before {
    opacity: 1;
}

.provider-icon img {
    border-radius: 10px;
}

.provider-icon .logo-fallback {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: inherit;
}

.provider-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.provider-name {
    font-weight: 800;
    font-size: clamp(0.75rem, 2.5vw, 1rem);
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.3;
    letter-spacing: -0.2px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    max-width: 100%;
}

.provider-name span {
    flex-shrink: 0;
}

@media (max-width: 1400px) {
    .provider-name {
        font-size: clamp(0.7rem, 2vw, 0.95rem);
    }
}

@media (max-width: 1024px) {
    .provider-name {
        font-size: clamp(0.65rem, 1.8vw, 0.9rem);
    }
}

.provider-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--muted);
    display: inline-block;
    flex-shrink: 0;
    transition: all 0.3s ease;
    box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.2);
}

.provider-status-dot.active-neh {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3), 0 0 16px rgba(16, 185, 129, 0.6), 0 0 24px rgba(16, 185, 129, 0.3);
    animation: pulse-success 2s infinite;
}

.provider-status-dot.active-manual {
    background: var(--warning);
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.3), 0 0 16px rgba(251, 191, 36, 0.6), 0 0 24px rgba(251, 191, 36, 0.3);
    animation: pulse-warning 2s infinite;
}

.provider-card:hover .provider-status-dot.active-neh {
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.4), 0 0 20px rgba(16, 185, 129, 0.7), 0 0 32px rgba(16, 185, 129, 0.4);
}

.provider-card:hover .provider-status-dot.active-manual {
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.4), 0 0 20px rgba(251, 191, 36, 0.7), 0 0 32px rgba(251, 191, 36, 0.4);
}

@keyframes pulse-success {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes pulse-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.provider-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    margin-top: 2px;
    min-width: 0;
    overflow: hidden;
}

.provider-meta .provider-category {
    flex-shrink: 0;
}

.provider-id {
    font-size: clamp(0.6rem, 1.5vw, 0.7rem);
    color: var(--muted);
    font-family: 'Monaco', 'Consolas', monospace;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid rgba(99, 102, 241, 0.25);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

@media (max-width: 1024px) {
    .provider-id {
        font-size: clamp(0.55rem, 1.3vw, 0.65rem);
    }
}

.provider-card:hover .provider-id {
    border-color: rgba(99, 102, 241, 0.4);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.15) 100%);
}

.provider-category {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 4px 12px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.provider-card:hover .provider-category {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.provider-category.category-image {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(37, 99, 235, 0.1) 100%);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.provider-category.category-video {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(220, 38, 38, 0.1) 100%);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.provider-category.category-music {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2) 0%, rgba(147, 51, 234, 0.1) 100%);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.provider-category.category-design {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(22, 163, 74, 0.1) 100%);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.provider-category.category-other {
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.2) 0%, rgba(100, 116, 139, 0.1) 100%);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

/* Control group styles */
.control-group {
    margin-bottom: 0;
    padding: 12px 14px;
    background: linear-gradient(135deg, rgba(21, 27, 46, 0.6) 0%, rgba(15, 20, 36, 0.5) 100%);
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-group::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    transition: left 0.5s ease;
}

.control-group:hover::before {
    left: 100%;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-group:hover {
    background: linear-gradient(135deg, rgba(21, 27, 46, 0.75) 0%, rgba(15, 20, 36, 0.65) 100%);
    border-color: rgba(99, 102, 241, 0.35);
    transform: translateX(3px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.15), 0 2px 8px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.control-group:active {
    transform: translateX(1px);
}

.control-group .toggle {
    margin-top: 0;
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    align-self: flex-start;
    cursor: pointer;
}

.control-group label.toggle {
    display: inline-block;
    position: relative;
    cursor: pointer;
    user-select: none;
    width: 44px;
    height: 24px;
    margin: 0;
    padding: 0;
}

.control-group label.toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

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

.control-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: -0.1px;
    flex: 1;
    min-width: 0;
}

.control-status {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.2) 0%, rgba(100, 116, 139, 0.15) 100%);
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(148, 163, 184, 0.2);
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.control-status.status-active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.3) 0%, rgba(5, 150, 105, 0.2) 100%);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.3), 0 2px 6px rgba(16, 185, 129, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    text-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.control-status.status-active-warning {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.3) 0%, rgba(245, 158, 11, 0.2) 100%);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.4);
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.3), 0 2px 6px rgba(251, 191, 36, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

.control-status.status-active-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, rgba(37, 99, 235, 0.2) 100%);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.3), 0 2px 6px rgba(59, 130, 246, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    text-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

/* Profit display styles */
.profit-display {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(5, 150, 105, 0.08) 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 12px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    position: relative;
    overflow: hidden;
}

.profit-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.profit-display:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.12) 100%);
    border-color: rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.2);
}

.profit-display:hover::before {
    left: 100%;
}

/* Provider card footer improvements */
.provider-card-footer {
    padding: 16px 22px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.3) 100%);
    border-top: 1px solid rgba(99, 102, 241, 0.15);
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.provider-card:hover .provider-card-footer {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0.35) 100%);
    border-top-color: rgba(99, 102, 241, 0.25);
}

.footer-section {
    width: 100%;
}

.footer-section:last-child {
    margin-top: 2px;
}

.provider-card-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.3), transparent);
}

/* Empty state for provider cards */
.provider-card-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 40px;
    color: var(--muted);
}

/* ===== Enhanced Naming Section Styles ===== */
.naming-section {
    padding: 12px 0 !important;
    background: transparent !important;
    border: none !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100%;
}

.naming-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    width: 100%;
}

.naming-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.naming-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.naming-badge.badge-id {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.15) 100%);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.naming-badge.badge-original {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(217, 119, 6, 0.15) 100%);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.naming-select {
    width: 100% !important;
    padding: 12px 16px !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    border-radius: 12px !important;
    background: linear-gradient(135deg, rgba(21, 27, 46, 0.8) 0%, rgba(15, 20, 36, 0.7) 100%) !important;
    border: 1px solid rgba(99, 102, 241, 0.25) !important;
    color: var(--text) !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    padding-right: 40px !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 44px !important;
    box-sizing: border-box !important;
}

.naming-select:hover {
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15);
}

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

.naming-select option {
    background: #1a2332;
    color: var(--text);
    padding: 10px;
}

.naming-hint {
    margin-top: 10px;
    font-size: 0.72rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border-left: 3px solid var(--muted);
    opacity: 0.85;
    transition: all 0.3s ease;
}

/* ===== Enhanced Controls Grid Layout ===== */
.controls-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(135deg, rgba(21, 27, 46, 0.5) 0%, rgba(15, 20, 36, 0.4) 100%);
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.12);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.control-item:hover {
    background: linear-gradient(135deg, rgba(21, 27, 46, 0.7) 0%, rgba(15, 20, 36, 0.6) 100%);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateX(3px);
}

.control-item.control-active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0.08) 100%);
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.1);
}

.control-item.control-active.control-manual {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(245, 158, 11, 0.06) 100%);
    border-color: rgba(245, 158, 11, 0.3);
}

.control-item.control-active.control-store {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(16, 185, 129, 0.06) 100%);
    border-color: rgba(16, 185, 129, 0.3);
}

.control-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.control-icon {
    font-size: 1.1rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.control-item.control-active .control-icon {
    background: rgba(99, 102, 241, 0.2);
    transform: scale(1.05);
}

.control-item.control-manual.control-active .control-icon {
    background: rgba(245, 158, 11, 0.2);
}

.control-item.control-store.control-active .control-icon {
    background: rgba(16, 185, 129, 0.2);
}

.control-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.control-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.control-desc {
    font-size: 0.7rem;
    color: var(--muted);
    opacity: 0.8;
}

.control-item .toggle {
    flex-shrink: 0;
}

/* Enhanced responsive design - Optimized for readability and usability */
/* Provider cards should be large enough to read without internal scrolling */

/* Very large screens (>2560px) */
@media (min-width: 2561px) {
    .provider-card-grid {
        grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
        gap: 24px;
    }
}

/* Large screens (1920-2560px) */
@media (min-width: 1920px) and (max-width: 2560px) {
    .provider-card-grid {
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
        gap: 22px;
    }
}

/* Medium screens (1200-1920px) */
@media (min-width: 1200px) and (max-width: 1919px) {
    .provider-card-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 20px;
    }
    
    .provider-card-v2 {
        min-width: 320px;
    }
}

/* Tablets (768-1200px) */
@media (min-width: 768px) and (max-width: 1199px) {
    .provider-card-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 18px;
    }
    
    .provider-card-v2 {
        min-width: 300px;
    }
}

/* Small tablets (600-768px) */
@media (min-width: 600px) and (max-width: 767px) {
    .provider-card-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 16px;
    }
    
    .provider-card-v2 {
        min-width: 280px;
    }
}

/* Mobile (<600px) - Full width cards for better readability */
@media (max-width: 599px) {
    .provider-card-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        justify-content: stretch;
    }
    
    .provider-card-v2 {
        width: 100%;
        min-width: 100%;
    }

    .provider-cards-container {
        padding: 16px;
    }

    .provider-cards-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .provider-cards-header > div:last-child {
        width: 100%;
    }

    #providerSearchInput {
        width: 100% !important;
    }

    .provider-card-header {
        padding: 16px 18px;
    }

    .provider-card-body {
        padding: 16px 18px;
    }

    .provider-card-footer {
        padding: 16px 18px;
    }

    .provider-icon {
        width: 48px;
        height: 48px;
        font-size: 24px;
    }

    .provider-name {
        font-size: 1rem;
    }

    .control-group {
        padding: 12px;
    }

    .provider-cards-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .provider-cards-title .icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .provider-cards-container {
        padding: 12px;
    }

    .provider-card {
        border-radius: 12px;
    }

    .provider-card-header {
        padding: 12px;
    }

    .provider-card-body {
        padding: 12px;
    }

    .provider-card-footer {
        padding: 12px;
    }

    .control-group {
        padding: 8px;
        margin-bottom: 12px;
    }

    .control-header {
        margin-bottom: 8px;
    }

    .provider-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

/* Stats cards responsive */
@media (max-width: 768px) {
    .page-header[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}

/* Tabs responsive */
@media (max-width: 768px) {
    .tabs {
        flex-wrap: wrap;
        gap: 8px;
    }

    .tabs .tab {
        flex: 1 1 auto;
        min-width: calc(50% - 4px);
    }
}

/* ===================================================================
   COMPREHENSIVE RESPONSIVE DESIGN - Mobile First Approach
   =================================================================== */

/* Mobile Hamburger Menu Button */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1000;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    border: none;
    cursor: pointer;
    padding: 12px;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.5);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
    position: relative;
}

.mobile-menu-toggle span::before,
.mobile-menu-toggle span::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle span::before {
    top: -8px;
}

.mobile-menu-toggle span::after {
    top: 8px;
}

/* Hamburger to X animation when sidebar is open */
.mobile-menu-toggle.active span {
    background: transparent;
}

.mobile-menu-toggle.active span::before {
    top: 0;
    transform: rotate(45deg);
}

.mobile-menu-toggle.active span::after {
    top: 0;
    transform: rotate(-45deg);
}

/* Mobile Overlay for sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
}

/* ===== RESPONSIVE SIDEBAR ===== */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 240px;
    }
}

@media (max-width: 768px) {
    /* Show hamburger menu */
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Show overlay when sidebar is open */
    .sidebar-overlay.active {
        display: block;
    }
    
    /* Sidebar becomes off-canvas */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 200;
        width: 280px;
        box-shadow: none;
    }
    
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 10px 0 40px rgba(0, 0, 0, 0.4);
    }
    
    /* Main content takes full width on mobile */
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding-top: 70px; /* Space for hamburger menu */
    }
    
    /* Page padding adjustments */
    .page.active {
        padding: 16px !important;
    }
    
    /* Page title adjustments */
    .page-title {
        font-size: 1.5rem;
        padding-left: 50px; /* Space for hamburger on page titles */
    }
    
    .page-subtitle {
        font-size: 0.85rem;
        padding-left: 50px;
    }
}

/* ===== RESPONSIVE MODALS ===== */
/* Base modal styles are defined above - these are responsive overrides */

@media (max-width: 768px) {
    .modal {
        padding: 8px;
        align-items: flex-start !important;
        padding-top: 40px;
    }
    
    .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 85vh;
        border-radius: 16px !important;
        margin: 0 !important;
    }
    
    .modal-header {
        padding: 16px;
        position: sticky;
        top: 0;
        background: inherit;
        z-index: 10;
        border-bottom: 1px solid var(--border);
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .modal-footer {
        padding: 16px;
        position: sticky;
        bottom: 0;
        background: inherit;
        border-top: 1px solid var(--border);
        flex-wrap: wrap;
        gap: 8px !important;
    }
    
    .modal-footer .btn {
        flex: 1 1 auto;
        min-width: 120px;
        justify-content: center;
    }
    
    .modal-title {
        font-size: 1.1rem;
    }
    
    .modal-close {
        width: 36px;
        height: 36px;
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .modal-content {
        border-radius: 12px 12px 0 0 !important;
        max-height: 90vh;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
        animation: slideUpModal 0.3s ease;
    }
    
    @keyframes slideUpModal {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
}

/* ===== RESPONSIVE BUTTONS ===== */
.btn {
    white-space: nowrap;
    min-height: 40px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

@media (max-width: 768px) {
    .btn {
        padding: 12px 16px;
        font-size: 0.9rem;
        min-height: 44px; /* Touch-friendly size */
    }
    
    .btn-sm {
        padding: 10px 14px;
        font-size: 0.85rem;
        min-height: 40px;
    }
    
    /* Stack buttons on mobile */
    .panel-header {
        flex-direction: column;
        align-items: stretch !important;
        gap: 12px;
    }
    
    .panel-header > div:last-child,
    .panel-header > .btn {
        width: 100%;
    }
    
    /* Button groups stack on mobile */
    [style*="display: flex"][style*="gap"] > .btn {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 14px 16px;
        font-size: 0.95rem;
        width: 100%;
        justify-content: center;
    }
    
    /* Exception for inline small buttons */
    .btn-sm {
        width: auto;
        padding: 8px 12px;
    }
}

/* ===== RESPONSIVE FORMS ===== */
@media (max-width: 768px) {
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-input,
    .form-select,
    select.form-input {
        padding: 14px 16px;
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 48px;
    }
    
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }
    
    /* Two column forms become single column */
    .two-column,
    .three-column,
    .account-settings-grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }
    
    /* Form inline layouts stack */
    [style*="display: grid"][style*="grid-template-columns"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
    }
}

/* ===== RESPONSIVE TABLES ===== */
@media (max-width: 1024px) {
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -16px;
        padding: 0 16px;
    }
    
    table {
        min-width: 700px;
    }
}

@media (max-width: 768px) {
    /* Card-based table layout for mobile */
    .table-container.mobile-cards table,
    .table-container.mobile-cards thead,
    .table-container.mobile-cards tbody,
    .table-container.mobile-cards th,
    .table-container.mobile-cards td,
    .table-container.mobile-cards tr {
        display: block;
    }
    
    .table-container.mobile-cards thead {
        display: none;
    }
    
    .table-container.mobile-cards tr {
        margin-bottom: 16px;
        background: var(--panel);
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 16px;
    }
    
    .table-container.mobile-cards td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid var(--border);
    }
    
    .table-container.mobile-cards td:last-child {
        border-bottom: none;
    }
    
    .table-container.mobile-cards td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--muted);
        font-size: 0.8rem;
        text-transform: uppercase;
    }
    
    th, td {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
}

/* ===== RESPONSIVE PANELS ===== */
@media (max-width: 768px) {
    .panel {
        padding: 16px;
        border-radius: 12px;
        margin-bottom: 16px;
    }
    
    .panel-header {
        margin-bottom: 16px;
    }
    
    .panel-title {
        font-size: 1rem;
    }
}

/* ===== RESPONSIVE STATS GRID ===== */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
        border-radius: 10px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 16px;
    }
    
    .stat-value {
        font-size: 1.75rem;
        margin-bottom: 0;
    }
}

/* ===== RESPONSIVE PRICING TABLE ===== */
@media (max-width: 1200px) {
    .pricing-table-header,
    .pricing-table-row {
        grid-template-columns: 1fr 1fr 1fr 1fr auto;
        gap: 12px;
        padding: 12px 16px;
    }
}

@media (max-width: 900px) {
    .pricing-table-header {
        display: none;
    }
    
    .pricing-table-row {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 16px;
        margin-bottom: 12px;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: var(--panel);
    }
    
    .pricing-table-row > div {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .pricing-table-row > div::before {
        content: attr(data-label);
        font-size: 0.75rem;
        color: var(--muted);
        font-weight: 600;
        text-transform: uppercase;
    }
    
    .pricing-rate-control {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 16px;
    }
    
    .pricing-rate-control > div:first-child {
        width: 100%;
    }
    
    .pricing-rate-control .btn {
        width: 100%;
    }
    
    .pricing-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .pricing-summary {
        grid-template-columns: 1fr;
    }
    
    .pricing-summary-card {
        padding: 14px 16px;
    }
    
    .pricing-summary-value {
        font-size: 1.25rem;
    }
}

/* ===== RESPONSIVE QUEUE/ACTIVITY ITEMS ===== */
@media (max-width: 768px) {
    .queue-item,
    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .queue-item-info,
    .file-item-info {
        width: 100%;
    }
    
    .queue-item .btn,
    .file-item .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===== RESPONSIVE TOAST NOTIFICATIONS ===== */
@media (max-width: 768px) {
    .toast-container {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }
    
    .toast {
        width: 100%;
        border-radius: 12px;
    }
}

/* ===== RESPONSIVE TABS ===== */
@media (max-width: 600px) {
    .tabs {
        flex-direction: column;
        gap: 4px;
    }
    
    .tab {
        width: 100%;
        text-align: center;
        padding: 12px 16px;
    }
    
    #providerTabs {
        display: flex;
        flex-direction: column;
    }
    
    #providerTabs .tab {
        width: 100%;
    }
}

/* ===== RESPONSIVE TOGGLE SWITCHES ===== */
@media (max-width: 768px) {
    .toggle {
        width: 50px;
        height: 28px;
    }
    
    .toggle-slider:before {
        height: 22px;
        width: 22px;
    }
    
    .toggle input:checked + .toggle-slider:before {
        transform: translateY(-50%) translateX(22px);
    }
}

/* ===== RESPONSIVE EMPTY STATES ===== */
@media (max-width: 768px) {
    .empty-state {
        padding: 40px 20px;
    }
    
    .empty-state-icon {
        font-size: 40px;
    }
}

/* ===== UTILITY CLASSES FOR RESPONSIVENESS ===== */
.hide-mobile {
    display: block;
}

.show-mobile {
    display: none !important;
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
    
    .show-mobile {
        display: block !important;
    }
    
    .text-center-mobile {
        text-align: center !important;
    }
    
    .full-width-mobile {
        width: 100% !important;
    }
    
    .stack-mobile {
        flex-direction: column !important;
    }
    
    .gap-sm-mobile {
        gap: 8px !important;
    }
}

/* ===== FIX FOR SCROLLING ON MOBILE ===== */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }
    
    .main-content {
        overflow-x: hidden;
    }
    
    /* Prevent horizontal scroll */
    .page.active {
        max-width: 100vw;
        overflow-x: hidden;
    }
}

/* ===== BACKGROUND TASK INDICATOR RESPONSIVE ===== */
@media (max-width: 768px) {
    #globalTaskIndicator {
        left: 16px !important;
        right: 16px !important;
        bottom: 80px !important;
        min-width: auto !important;
        max-width: none !important;
    }
}

/* ===== SEARCH INPUT RESPONSIVE ===== */
@media (max-width: 768px) {
    #searchInput,
    #providerSearchInput,
    [type="search"],
    [type="text"][placeholder*="Search"] {
        width: 100% !important;
        font-size: 16px !important; /* Prevent zoom on iOS */
    }
}

/* ===== ACTIVITY LIST RESPONSIVE ===== */
@media (max-width: 768px) {
    #recentActivity,
    #downloadActivityList {
        max-height: 300px;
    }
    
    .activity-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* ===== SPECIFIC PAGE FIXES ===== */

/* Dashboard page */
@media (max-width: 768px) {
    #page-dashboard .two-column {
        grid-template-columns: 1fr !important;
    }
    
    #page-dashboard .quick-actions {
        grid-template-columns: 1fr !important;
    }
}

/* Server Control page */
@media (max-width: 768px) {
    #page-server-control .panel {
        margin-bottom: 16px;
    }
    
    #page-server-control .btn {
        width: 100%;
        margin-bottom: 8px;
    }
}

/* Users page table */
@media (max-width: 900px) {
    #page-users table {
        min-width: auto;
    }
    
    #page-users thead {
        display: none;
    }
    
    #page-users tbody tr {
        display: block;
        margin-bottom: 16px;
        padding: 16px;
        background: var(--panel);
        border: 1px solid var(--border);
        border-radius: 12px;
    }
    
    #page-users tbody td {
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
        border-bottom: 1px solid var(--border);
    }
    
    #page-users tbody td:last-child {
        border-bottom: none;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    #page-users tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--muted);
        font-size: 0.8rem;
    }
}

/* =============================================================================
   PROVIDER CARDS V2 - Redesigned for better UX and responsiveness
   ============================================================================= */

.provider-card-v2 {
    background: linear-gradient(135deg, rgba(18, 22, 42, 0.98) 0%, rgba(15, 20, 36, 0.95) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    padding: 0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.provider-card-v2::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--border);
    transition: background 0.3s ease;
}

.provider-card-v2.status-neh::before {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.provider-card-v2.status-manual::before {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.provider-card-v2:hover {
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}

/* Main section: Logo + Info + Status */
.pcard-main {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

.pcard-logo {
    width: 56px;
    height: 56px;
    min-width: 56px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.pcard-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.pcard-logo-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.pcard-logo-upload {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg);
    color: white;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 10;
}

.pcard-logo:hover .pcard-logo-upload {
    opacity: 1;
}

.pcard-logo-upload:hover {
    transform: scale(1.1);
    background: var(--accent-hover);
}

.pcard-info {
    flex: 1;
    min-width: 0;
}

.pcard-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pcard-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pcard-key {
    font-size: 0.75rem;
    color: var(--muted);
    font-family: 'Monaco', 'Consolas', monospace;
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
}

.pcard-category {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 12px;
}

.pcard-category-select {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: rgba(99, 102, 241, 0.1);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cpath fill='%2394a3b8' d='M0 2l4 4 4-4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    padding-right: 20px;
}

.pcard-category-select:hover {
    border-color: var(--accent);
    background-color: rgba(99, 102, 241, 0.2);
}

.pcard-category-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.pcard-category-select.cat-image { background-color: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.pcard-category-select.cat-video { background-color: rgba(239, 68, 68, 0.2); color: #f87171; }
.pcard-category-select.cat-music { background-color: rgba(168, 85, 247, 0.2); color: #c084fc; }
.pcard-category-select.cat-design { background-color: rgba(34, 197, 94, 0.2); color: #4ade80; }
.pcard-category-select.cat-3d { background-color: rgba(6, 182, 212, 0.2); color: #22d3ee; }
.pcard-category-select.cat-font { background-color: rgba(249, 115, 22, 0.2); color: #fb923c; }
.pcard-category-select.cat-template { background-color: rgba(236, 72, 153, 0.2); color: #f472b6; }
.pcard-category-select.cat-other { background-color: rgba(148, 163, 184, 0.2); color: #94a3b8; }

.pcard-category.cat-image { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.pcard-category.cat-video { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.pcard-category.cat-music { background: rgba(168, 85, 247, 0.2); color: #c084fc; }
.pcard-category.cat-design { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.pcard-category.cat-3d { background: rgba(6, 182, 212, 0.2); color: #22d3ee; }
.pcard-category.cat-font { background: rgba(249, 115, 22, 0.2); color: #fb923c; }
.pcard-category.cat-template { background: rgba(236, 72, 153, 0.2); color: #f472b6; }
.pcard-category.cat-other { background: rgba(148, 163, 184, 0.2); color: #94a3b8; }

.pcard-status-badge {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 6px 12px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.pcard-status-badge.status-inactive {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

.pcard-status-badge.status-neh {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.pcard-status-badge.status-manual {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
}

/* Controls section: Toggles + Naming */
.pcard-controls {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.pcard-toggle-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.pcard-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(21, 27, 46, 0.6);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 100px;
}

.pcard-toggle:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
}

.pcard-toggle.active {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.4);
}

.pcard-toggle.active.manual {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.4);
}

.pcard-toggle.active.store {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.4);
}

.pcard-toggle-icon {
    font-size: 1rem;
}

.pcard-toggle-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    flex: 1;
}

.pcard-toggle input {
    display: none;
}

.pcard-toggle-switch {
    width: 36px;
    height: 20px;
    background: rgba(148, 163, 184, 0.3);
    border-radius: 10px;
    position: relative;
    transition: all 0.2s ease;
}

.pcard-toggle-switch::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.pcard-toggle input:checked + .pcard-toggle-switch {
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
}

.pcard-toggle.active input:checked + .pcard-toggle-switch {
    background: linear-gradient(135deg, #10b981, #34d399);
}

.pcard-toggle.active.manual input:checked + .pcard-toggle-switch {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

.pcard-toggle.active.store input:checked + .pcard-toggle-switch {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
}

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

/* Naming section */
.pcard-naming {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(21, 27, 46, 0.4);
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-radius: 10px;
}

.pcard-naming-icon {
    font-size: 1rem;
}

.pcard-naming-select {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.pcard-naming-select:hover {
    background: rgba(99, 102, 241, 0.1);
}

.pcard-naming-select:focus {
    outline: none;
    background: rgba(99, 102, 241, 0.15);
}

.pcard-naming-select option {
    background: var(--bg-secondary);
    color: var(--text);
    padding: 8px;
}

/* Grid for provider cards v2 */
#providerCardsGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 20px;
    width: 100%;
}

/* Responsive adjustments for provider cards v2 */
@media (max-width: 1200px) {
    #providerCardsGrid {
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 768px) {
    #providerCardsGrid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    
    .pcard-main {
        padding: 14px 16px;
        gap: 12px;
    }
    
    .pcard-logo {
        width: 48px;
        height: 48px;
        min-width: 48px;
    }
    
    .pcard-name {
        font-size: 0.95rem;
    }
    
    .pcard-status-badge {
        font-size: 0.65rem;
        padding: 4px 10px;
    }
    
    .pcard-controls {
        padding: 12px 16px;
        gap: 12px;
    }
    
    .pcard-toggle-group {
        gap: 8px;
    }
    
    .pcard-toggle {
        padding: 8px 12px;
        min-width: 90px;
    }
    
    .pcard-toggle-label {
        font-size: 0.75rem;
    }
    
    .pcard-toggle-switch {
        width: 32px;
        height: 18px;
    }
    
    .pcard-toggle-switch::before {
        width: 14px;
        height: 14px;
    }
    
    .pcard-toggle input:checked + .pcard-toggle-switch::before {
        transform: translateX(14px);
    }
}

@media (max-width: 480px) {
    .pcard-main {
        flex-wrap: wrap;
    }
    
    .pcard-status-badge {
        width: 100%;
        text-align: center;
        margin-top: 8px;
    }
    
    .pcard-toggle-group {
        flex-direction: column;
    }
    
    .pcard-toggle {
        width: 100%;
    }
}
