:root {
    --bg-dark: #080a10;
    --bg-panel: #121620;
    --bg-panel-hover: #161b2b;
    --primary: #3b82f6;
    --primary-neon: #0ea5e9;
    --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #0ea5e9 100%);
    --accent: #10b981;
    --accent-hover: #059669;
    --accent-danger: #ef4444;
    --accent-danger-hover: #dc2626;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --border-color: rgba(255, 255, 255, 0.05);
    --border-color-hover: rgba(255, 255, 255, 0.1);
    --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
    --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body.theme-excel {
    --neon-color: #10b981;
    --neon-color-hover: #059669;
    --neon-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

body.theme-word {
    --neon-color: #0ea5e9;
    --neon-color-hover: #3b82f6;
    --neon-gradient: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-stack);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

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

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

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Utility */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    border: 0;
    padding: 0;
    white-space: nowrap;
    clip-path: inset(100%);
    clip: rect(0 0 0 0);
    overflow: hidden;
}

/* --- Dashboard Layout --- */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* --- Sidebar --- */
.sidebar {
    position: sticky;
    left: 0;
    top: 0;
    height: 100vh;
    width: 280px;
    flex-shrink: 0;
    background: rgba(13, 17, 23, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px;
    z-index: 100;
    transition: all 0.3s ease;
}

.sidebar-top {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.sidebar-bottom {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

.sidebar-brand .logo-icon {
    font-size: 24px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 8px rgba(14, 165, 233, 0.4));
}

.sidebar-brand .logo-text {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #fff;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.nav-item i {
    font-size: 16px;
}

.nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
}

body.theme-excel .nav-item.active {
    color: #fff;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

body.theme-word .nav-item.active {
    color: #fff;
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.2);
}

/* --- Format Switcher --- */
.format-switcher-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.switcher-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.format-switcher {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 4px;
    gap: 4px;
}

.switcher-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.switcher-btn:hover {
    color: #fff;
}

body.theme-excel .switcher-btn.active {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

body.theme-word .switcher-btn.active {
    background: rgba(14, 165, 233, 0.1);
    color: #0ea5e9;
    border: 1px solid rgba(14, 165, 233, 0.2);
}

/* Sidebar Profile Card */
.sidebar-profile {
    margin-top: 24px;
    margin-bottom: 24px;
}

.profile-card-compact {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.profile-card-compact:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(59, 130, 246, 0.3);
}

.profile-avatar {
    font-size: 24px;
    color: var(--primary-neon);
}

.profile-details {
    flex: 1;
    min-width: 0;
}

.profile-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-sub-tier {
    font-size: 10px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-balance-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-neon);
    font-family: 'JetBrains Mono', monospace;
}

.logout-btn-mini {
    color: var(--text-muted);
    font-size: 14px;
    transition: color 0.2s;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-btn-mini:hover {
    color: var(--accent-danger);
}

/* Guest Card */
.guest-card-compact {
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    text-align: center;
}

.guest-prompt {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.4;
}

.guest-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.guest-actions .action-btn {
    width: 100%;
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 8px;
}

/* Sidebar Footer */
.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-seller-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 10px;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--primary-neon);
}

.payment-icons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.payment-icons i {
    font-size: 20px;
    color: var(--text-muted);
}

.payment-icons .fa-cc-visa {
    color: #fff;
}

.payment-icons .fa-cc-mastercard {
    color: #ff5f00;
}

.mir-icon {
    height: 20px;
    width: auto;
    background: #fff;
    padding: 2px 4px;
    border-radius: 2px;
}

.copyright {
    font-size: 10px;
    color: var(--text-muted);
}

/* --- Mobile Topbar (Hidden on Desktop) --- */
.mobile-topbar {
    display: none;
}

/* --- Main Content Area --- */
.main-content {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    align-items: center;
    width: 100%;
}

.content-header,
.dashboard-grid,
.banners-container {
    width: 100%;
    max-width: 1440px;
}

.content-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dashboard-title {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}

.dashboard-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    max-width: 800px;
}

/* --- Dashboard Grid --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
    align-items: start;
}

.widget {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.widget-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.widget-header h3 i {
    color: var(--primary-neon);
}

/* Widget Specific Spans */
.widget-dropzone {
    grid-column: span 7;
    height: 340px;
    display: flex;
    flex-direction: column;
    padding: 0; /* Let drop-zone fill the widget */
    overflow: hidden;
}

.widget-filequeue {
    grid-column: span 5;
    height: 340px;
    display: flex;
    flex-direction: column;
}

.widget-controls {
    grid-column: span 12;
}

/* --- Drop-zone --- */
.drop-zone {
    border: 2px dashed rgba(59, 130, 246, 0.15);
    border-radius: 16px;
    background: rgba(18, 22, 32, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    width: 100%;
    position: relative;
    cursor: pointer;
}

.drop-zone::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.02) 0%, transparent 70%);
    pointer-events: none;
}

.drop-zone.drag-over {
    border-color: var(--neon-color);
    background: rgba(59, 130, 246, 0.05);
    box-shadow: 0 0 30px var(--neon-color), inset 0 0 20px var(--neon-color);
    transform: scale(1.01);
}

.drop-content {
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.upload-icon {
    font-size: 36px;
    color: var(--neon-color);
    margin-bottom: 16px;
    filter: drop-shadow(0 0 10px var(--neon-color));
}

.drop-zone h3 {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
}

.support-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.input-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
}

.select-btn {
    display: inline-block;
    background: var(--neon-gradient);
    color: #fff;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.select-btn:hover {
    box-shadow: 0 0 15px var(--neon-color);
    transform: translateY(-1px);
}

.camera-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    height: 38px;
    padding: 0 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
}

.camera-btn:hover {
    border-color: var(--primary-neon);
    color: #fff;
    background: rgba(14, 165, 233, 0.05);
}

/* --- File Queue --- */
.file-queue-container {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}

.file-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* File Card */
.file-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    position: relative;
    transition: all 0.2s ease;
    overflow: hidden;
}

.file-card:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(59, 130, 246, 0.2);
}

.card-status-strip {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: transparent;
    transition: background 0.3s;
}

.file-card.processing .card-status-strip {
    background: var(--primary-neon);
    animation: pulse-strip 1.5s ease-in-out infinite;
}

@keyframes pulse-strip {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

.file-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.file-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.file-meta {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.status-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

.progress-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.05);
}

.progress-bar {
    height: 100%;
    background: var(--primary-gradient);
    width: 0;
    transition: width 0.3s ease;
}

/* Card States */
.file-card.processing .status-badge {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.2);
}

.file-card.success {
    border-color: rgba(16, 185, 129, 0.2);
}

.file-card.success .card-status-strip {
    background: var(--accent);
}

.file-card.success .status-badge {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent);
    border-color: rgba(16, 185, 129, 0.2);
}

.file-card.error {
    border-color: rgba(239, 68, 68, 0.2);
}

.file-card.error .card-status-strip {
    background: var(--accent-danger);
}

.file-card.error .status-badge {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-danger);
    border-color: rgba(239, 68, 68, 0.2);
}

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

.download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    background: var(--accent);
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    transition: background 0.2s;
}

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

.remove-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.remove-btn:hover {
    color: var(--accent-danger);
    transform: scale(1.1);
}

/* --- Control Panel --- */
.control-panel-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.consent-block {
    flex: 1;
    min-width: 300px;
}

.consent-block .checkbox-container {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    padding: 16px 20px;
    border-radius: 12px;
    width: 100%;
}

.consent-block .option-label {
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-muted);
}

.consent-block .option-label a {
    color: var(--primary-neon);
    text-decoration: none;
}

.consent-block .option-label a:hover {
    text-decoration: underline;
}

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

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}

.main-action-btn {
    background: var(--neon-gradient);
    color: #fff;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 4px 20px var(--neon-color);
}

.main-action-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--neon-color);
    filter: brightness(1.1);
}

.main-action-btn:disabled, .disabled-btn {
    opacity: 0.4;
    cursor: not-allowed;
    background: #21262d !important;
    color: #484f58 !important;
    box-shadow: none !important;
    transform: none !important;
    border: 1px solid #30363d !important;
}

.download-all-btn {
    background: var(--accent);
    color: #fff;
}

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

.secondary-action-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.secondary-action-btn:hover {
    border-color: var(--text-main);
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
}

/* --- Info Metrics --- */
.widget-metrics-grid {
    grid-column: span 12;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.metric-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.metric-card:hover {
    transform: translateY(-4px);
    border-color: var(--neon-color);
    box-shadow: 0 15px 30px var(--neon-color);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.metric-value {
    font-size: 26px;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    background: var(--neon-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.metric-icon {
    font-size: 18px;
    color: var(--neon-color);
    background: rgba(255, 255, 255, 0.02);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.metric-card h3 {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.metric-card p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* --- Banners --- */
.banners-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.disclaimer-banner, .liability-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
}

.disclaimer-banner {
    background: rgba(14, 165, 233, 0.03);
    border: 1px solid rgba(14, 165, 233, 0.1);
    color: #38bdf8;
}

.disclaimer-banner i {
    color: #0ea5e9;
    font-size: 16px;
}

.liability-banner {
    background: rgba(239, 68, 68, 0.03);
    border: 1px solid rgba(239, 68, 68, 0.1);
    color: #fca5a5;
}

.liability-banner i {
    color: #ef4444;
    font-size: 16px;
}

/* --- FAQ Section --- */
.faq-section {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px;
}

.faq-title {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    text-align: center;
    margin-bottom: 32px;
}

.faq-item {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.faq-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.faq-item h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary-neon);
    margin-bottom: 8px;
}

.faq-item div[itemprop="text"] {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* --- Checkbox Styling --- */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.checkbox-container input {
    display: none;
}

.checkmark {
    position: relative;
    height: 18px;
    width: 18px;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--text-muted);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary-neon);
    border-color: var(--primary-neon);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

/* --- Modals & Glassmorphism --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

#termsModal, #privacyModal {
    z-index: 20000 !important;
}

#pricingModal {
    z-index: 10001 !important;
}

.modal-content {
    background: rgba(18, 22, 32, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 32px;
    width: 440px;
    max-width: 95vw;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-modal-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.close-modal-btn:hover {
    color: #fff;
}

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

/* Text Modal Specifics (Terms, Privacy) */
.text-modal-content {
    width: 800px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.text-modal-content .modal-body {
    overflow-y: auto;
    padding-right: 8px;
    line-height: 1.6;
}

.text-modal-content h4 {
    color: #fff;
    margin-top: 20px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.text-modal-content ul {
    padding-left: 20px;
    margin-bottom: 10px;
}

.text-modal-content li {
    margin-bottom: 5px;
}

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

/* Profile & Pricing Modal Specifics */
.profile-modal-content {
    width: 840px;
}

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

.profile-section h4 {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
}

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

.form-label {
    display: block;
    font-size: 12px;
    margin-bottom: 6px;
    color: var(--text-muted);
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-neon);
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.15);
}

.balance-display {
    display: flex;
    align-items: baseline;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.balance-amount {
    font-size: 36px;
    font-weight: 800;
    color: var(--primary-neon);
    font-family: 'JetBrains Mono', monospace;
}

.currency {
    color: var(--text-muted);
    font-size: 14px;
}

/* Credit Packages */
.credit-packages {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.credit-package-btn {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 140px;
}

.credit-package-btn:hover {
    border-color: var(--primary-neon);
    background: rgba(14, 165, 233, 0.03);
    transform: translateY(-2px);
}

.credit-package-btn.selected {
    border-color: var(--primary-neon);
    background: rgba(14, 165, 233, 0.08);
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.15);
}

.pkg-credits {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    font-family: 'JetBrains Mono', monospace;
}

.pkg-price {
    font-size: 14px;
    color: var(--text-muted);
}

.pkg-label {
    font-size: 9px;
    color: var(--primary-neon);
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 1px;
    margin-top: 12px;
    padding: 4px 8px;
    background: rgba(14, 165, 233, 0.08);
    border: 1px solid rgba(14, 165, 233, 0.15);
    border-radius: 4px;
}

.pkg-featured {
    border-color: rgba(16, 185, 129, 0.2);
}

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

.pkg-featured.selected {
    border-color: var(--accent);
    background: rgba(16, 185, 129, 0.08);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
}

.pkg-featured .pkg-label {
    color: #fff;
    background: var(--accent);
    border: none;
}

/* Custom Package */
.custom-pkg {
    min-width: 140px;
}

.custom-input-group {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    margin-bottom: 4px;
}

.custom-input-group input {
    width: 50px;
    background: transparent;
    border: none;
    color: #fff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    outline: none;
}

.input-suffix {
    color: var(--text-muted);
    font-size: 12px;
}

.custom-buy-btn {
    font-size: 11px !important;
    padding: 4px 8px !important;
}

.payment-agreement {
    margin: 20px 0;
}

.pay-action-btn {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 10px;
    background: var(--primary-gradient);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pay-action-btn:hover:not(:disabled) {
    filter: brightness(1.1);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.pay-action-btn:disabled {
    background: #21262d;
    color: #484f58;
    cursor: not-allowed;
    border: 1px solid #30363d;
}

/* --- Buttons --- */
.btn-primary {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

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

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    border-color: var(--text-muted);
    color: #fff;
}

/* --- Correction Studio --- */
.correction-studio-modal {
    width: 98vw;
    height: 95vh;
    max-width: none;
    background: #080a10;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

.studio-header {
    height: 64px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
}

.studio-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.studio-icon {
    font-size: 18px;
    color: var(--primary-neon);
}

.studio-info h3 {
    margin: 0;
    font-size: 15px;
    color: #fff;
    font-weight: 700;
}

.filename-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-muted);
}

.studio-actions {
    display: flex;
    gap: 10px;
}

.btn-export {
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    font-size: 12px;
}

.btn-export:hover:not(:disabled) {
    background: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-reset {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-reset:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
}

.btn-close-studio {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-close-studio:hover {
    background: var(--accent-danger);
    color: white;
}

.studio-body {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
    background: #05070b;
}

.studio-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.left-panel {
    width: 40%;
    border-right: 1px solid var(--border-color);
    background: #05070b;
}

.right-panel {
    flex: 1;
    background: #080a10;
}

.panel-header {
    height: 40px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    border-radius: 6px;
}

.zoom-controls button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 4px;
}

.zoom-controls button:hover {
    color: #fff;
}

#zoomLevel {
    min-width: 36px;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
}

.panel-content {
    flex: 1;
    overflow: auto;
    position: relative;
}

#sourceContainer {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    background-image:
        linear-gradient(45deg, #0d1117 25%, transparent 25%),
        linear-gradient(-45deg, #0d1117 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #0d1117 75%),
        linear-gradient(-45deg, transparent 75%, #0d1117 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}

#sourceImage {
    max-width: 100%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transform-origin: top left;
    transition: transform 0.1s ease-out;
    margin: 16px;
}

#tableEditor {
    padding: 16px;
    min-height: 100%;
}

.studio-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    background: #080a10;
}

.studio-table th {
    background: var(--bg-panel);
    position: sticky;
    top: 0;
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    text-align: left;
    color: var(--text-muted);
    font-weight: 600;
    z-index: 10;
}

.studio-table td {
    border: 1px solid var(--border-color);
    padding: 6px 10px;
    color: var(--text-main);
}

.studio-table td:focus-within {
    border-color: var(--primary-neon);
    background: rgba(14, 165, 233, 0.02);
}

.cell-input {
    width: 100%;
    background: transparent;
    border: none;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    outline: none;
    padding: 0;
    margin: 0;
}

.studio-table tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.01);
}

.studio-table tr:hover {
    background: rgba(14, 165, 233, 0.02);
}

.gutter {
    width: 6px;
    background: #080a10;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    cursor: col-resize;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gutter:hover {
    background: var(--primary-neon);
}

.table-tools button {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    cursor: pointer;
}

.table-tools button:hover {
    background: var(--primary-neon);
    color: #fff;
    border-color: var(--primary-neon);
}

/* --- Mobile Topbar --- */
.mobile-topbar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(13, 17, 23, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 99;
}

.mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-brand .logo-icon {
    font-size: 20px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.mobile-brand .logo-text {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
}

.hamburger-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Mobile Menu Overlay --- */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 10000;
    display: flex;
    justify-content: flex-end;
}

.mobile-menu-content {
    width: 300px;
    height: 100%;
    background: var(--bg-panel);
    border-left: 1px solid var(--border-color);
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s ease-out;
}

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

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.close-menu-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}

.mobile-menu-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.2s ease;
}

.mobile-nav-item.active {
    color: #fff;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.mobile-menu-profile {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mobile-logout-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 10px;
    color: var(--accent-danger);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.1);
    justify-content: center;
}

/* --- Responsive Media Queries --- */
@media (max-width: 1024px) {
    .dashboard-layout {
        flex-direction: column;
    }

    .sidebar {
        display: none; /* Hide sidebar on mobile/tablet */
    }

    .mobile-topbar {
        display: flex; /* Show mobile topbar */
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 24px;
        gap: 24px;
    }

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

    .widget-dropzone, .widget-filequeue, .widget-controls {
        grid-column: span 12;
    }

    .widget-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Modal Fixes for Mobile */
    .modal-content, .profile-modal-content, .text-modal-content {
        width: 90vw !important;
        max-height: 85vh !important;
        max-height: 85dvh !important;
        overflow-y: auto !important;
        border-radius: 16px !important;
        padding: 24px !important;
        padding-bottom: 32px !important; /* Extra padding at the bottom */
    }

    .modal-header {
        margin-bottom: 16px !important;
    }

    .close-modal-btn {
        font-size: 28px !important; /* Larger close button */
        padding: 8px !important;
    }
}

@media (max-width: 768px) {
    .widget-metrics-grid {
        grid-template-columns: 1fr;
    }

    .control-panel-layout {
        flex-direction: column;
        align-items: stretch;
    }

    .control-actions {
        flex-direction: column;
        width: 100%;
    }

    .control-actions button {
        width: 100%;
    }

    .studio-body {
        flex-direction: column;
    }

    .studio-panel.left-panel {
        width: 100%;
        height: 35%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .studio-panel.right-panel {
        width: 100%;
        height: 65%;
    }

    .gutter {
        display: none;
    }
}

@media (max-width: 480px) {
    .credit-packages {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   AUTH GLASSMORPHISM (Register/Login)
   ========================================= */
.auth-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--bg-dark);
    /* Optional: Subtle gradient background for depth */
    background: radial-gradient(circle at top right, #1a1f2e 0%, #0f1115 100%);
}

.auth-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-glass-card {
    width: 100%;
    max-width: 420px;
    background: rgba(22, 27, 34, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    text-align: center;
}

.auth-title-large {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 30px;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
    text-align: left;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
    pointer-events: none;
    transition: color 0.2s;
}

.auth-input {
    width: 100%;
    background: rgba(13, 17, 23, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 12px 16px 12px 42px; /* Space for icon */
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.2s ease;
}

.auth-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
    background: rgba(13, 17, 23, 1);
}

.auth-input:focus + .input-icon {
    color: var(--primary);
}

.auth-submit-btn {
    width: 100%;
    padding: 14px;
    margin-top: 10px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
    filter: brightness(1.1);
}

.auth-footer-link {
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-footer-link a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer-link a:hover {
    text-decoration: underline;
}

/* Alert Styling for Auth */
.auth-alert {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
}

.auth-alert.error {
    background: rgba(218, 54, 51, 0.15);
    border: 1px solid rgba(218, 54, 51, 0.3);
    color: #f85149;
}

.auth-alert.success {
    background: rgba(35, 134, 54, 0.15);
    border: 1px solid rgba(35, 134, 54, 0.3);
    color: #3fb950;
}

/* Auth Modals (Glassmorphism) */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.auth-modal-overlay.show {
    display: flex;
    opacity: 1;
}

.auth-modal-content {
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    background: rgba(22, 27, 34, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 30px;
    position: relative;
    overflow-y: auto;
    color: var(--text-main);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.auth-modal-overlay.show .auth-modal-content {
    transform: translateY(0);
}

.auth-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
}

.auth-modal-close:hover {
    color: #fff;
}

.auth-modal-body h2 {
    font-size: 18px;
    color: #fff;
    margin-top: 20px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 5px;
}

.auth-modal-body p, .auth-modal-body li {
    font-size: 14px;
    line-height: 1.6;
    color: #b0b8c3;
    margin-bottom: 10px;
}

.no-copy {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.no-copy [contenteditable="true"] {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}
