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

:root {
    --bg-primary: #0f0f14;
    --bg-secondary: #1a1a24;
    --bg-tertiary: #24243a;
    --bg-card: #1e1e2e;
    --text-primary: #e8e8f0;
    --text-secondary: #8888a8;
    --text-muted: #5a5a7a;
    --accent: #7c5cfc;
    --accent-hover: #9b7dff;
    --accent-glow: rgba(124, 92, 252, 0.3);
    --success: #4cce8a;
    --error: #ff5566;
    --warning: #ffaa33;
    --border: #2a2a40;
    --border-hover: #3a3a5a;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

html, body {
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
}

/* Header */
header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 16px 32px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

header h1 .icon {
    color: var(--accent);
    margin-right: 8px;
}

/* Main */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 32px;
}

/* Sections */
section {
    margin-bottom: 32px;
}

section h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* Pipeline */
.pipeline-stages {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.stage {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    min-width: 240px;
    flex: 1;
}

.stage-main {
    flex: 2;
}

.stage-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.stage-number {
    width: 28px;
    height: 28px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.stage-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.optional {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.8rem;
}

.video-count {
    margin-left: auto;
    background: var(--bg-tertiary);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.stage-arrow {
    color: var(--text-muted);
    font-size: 1.5rem;
    padding-top: 60px;
    flex-shrink: 0;
}

/* Drop Zones */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 24px;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--accent);
    background: rgba(124, 92, 252, 0.05);
}

.drop-zone.drag-over {
    background: rgba(124, 92, 252, 0.1);
    box-shadow: 0 0 20px var(--accent-glow);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.drop-icon {
    font-size: 2rem;
    opacity: 0.6;
}

.drop-zone p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.drop-zone-large {
    min-height: 100px;
}

/* Upload Progress Overlay */
.upload-progress-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 15, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    z-index: 10;
}

.upload-progress-ring {
    position: relative;
    width: 70px;
    height: 70px;
}

.upload-progress-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.upload-progress-ring .ring-bg {
    fill: none;
    stroke: var(--bg-tertiary);
    stroke-width: 4;
}

.upload-progress-ring .ring-fill {
    fill: none;
    stroke: var(--accent);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 163.36;
    stroke-dashoffset: 163.36;
    transition: stroke-dashoffset 0.15s ease;
    filter: drop-shadow(0 0 4px var(--accent-glow));
}

.upload-progress-pct {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Video Preview */
.video-preview {
    width: 100%;
}

.video-preview video {
    width: 100%;
    border-radius: var(--radius-sm);
    max-height: 160px;
    object-fit: cover;
    background: #000;
}

.video-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.video-name {
    font-size: 0.8rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 8px;
}

/* Video List (Main Videos) */
.video-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.video-list-item {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 10px;
    position: relative;
}

.video-list-item video {
    width: 100%;
    border-radius: 6px;
    max-height: 100px;
    object-fit: cover;
    background: #000;
}

.video-list-item .video-name {
    display: block;
    margin-top: 6px;
    font-size: 0.75rem;
}

.video-list-item .btn-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0,0,0,0.6);
    width: 22px;
    height: 22px;
    font-size: 0.7rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

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

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

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

.btn-secondary:hover:not(:disabled) {
    background: var(--border);
}

.btn-accent {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 12px var(--accent-glow);
}

.btn-accent:hover:not(:disabled) {
    background: var(--accent-hover);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-danger {
    background: transparent;
    color: var(--error);
    border: 1px solid var(--error);
}

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

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

.btn-lg {
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: 600;
}

.btn-icon {
    width: 26px;
    height: 26px;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
    flex-shrink: 0;
}

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

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

.btn-icon-left {
    font-size: 0.9em;
}

.btn-reprocess {
    background: var(--bg-tertiary);
    color: var(--warning);
    border: 1px solid var(--warning);
    padding: 4px 10px;
    font-size: 0.75rem;
}

.btn-reprocess:hover {
    background: var(--warning);
    color: #000;
}

/* Settings */
.settings-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.settings-grid {
    display: flex;
    gap: 32px;
    align-items: center;
}

.setting-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.setting-group label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    white-space: nowrap;
}

.setting-group select {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 0.85rem;
    cursor: pointer;
}

.setting-group select:focus {
    outline: none;
    border-color: var(--accent);
}

.range-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.range-input input[type="range"] {
    -webkit-appearance: none;
    width: 150px;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    outline: none;
}

.range-input input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
}

.range-input span {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.85rem;
    min-width: 35px;
}

/* Process Section */
.process-section {
    text-align: center;
    padding: 20px;
}

.process-controls {
    margin-bottom: 20px;
}

.progress-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.85rem;
}

#progressText {
    color: var(--accent);
    font-weight: 500;
}

#progressCount {
    color: var(--text-secondary);
}

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.current-video {
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Results */
.results-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

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

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

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.result-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    transition: border-color 0.2s;
}

.result-card.selected {
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

.result-video-container {
    width: 100%;
    border-radius: 6px;
    background: #000;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-card video {
    width: 100%;
    height: 100%;
    border-radius: 6px;
    object-fit: contain;
    background: #000;
    display: block;
}

.result-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.result-card-header input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

.result-card-name {
    font-size: 0.8rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.result-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.result-status {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.status-done {
    background: rgba(76, 206, 138, 0.15);
    color: var(--success);
}

.status-error {
    background: rgba(255, 85, 102, 0.15);
    color: var(--error);
}

.status-processing {
    background: rgba(124, 92, 252, 0.15);
    color: var(--accent);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Per-video processing progress in result cards */
.result-video-progress {
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.result-video-progress .video-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.result-video-progress .video-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #9b7cfc);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

.result-video-progress .video-progress-text {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 600;
}

@keyframes progress-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.result-video-progress .video-progress-fill.active {
    background: linear-gradient(90deg, var(--accent), #9b7cfc, var(--accent));
    background-size: 200% 100%;
    animation: progress-shimmer 2s linear infinite;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 450px;
    max-width: 90%;
    box-shadow: var(--shadow);
}

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

.modal-header h3 {
    font-size: 1rem;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    width: auto;
    height: auto;
}

.modal-body {
    padding: 20px;
}

.modal-body label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.modal-body input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.modal-body input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
}

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

.folder-picker input[type="text"] {
    flex: 1;
}

.hint {
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-top: 6px;
}

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

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 0.85rem;
    box-shadow: var(--shadow);
    animation: slideIn 0.3s ease;
    max-width: 350px;
}

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

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

.toast.info {
    border-left: 3px solid var(--accent);
}

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

/* Responsive */
@media (max-width: 900px) {
    .pipeline-stages {
        flex-direction: column;
    }

    .stage-arrow {
        padding-top: 0;
        text-align: center;
        transform: rotate(90deg);
    }

    .stage {
        min-width: auto;
    }

    .settings-grid {
        flex-direction: column;
        align-items: flex-start;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Header Nav */
.header-logo {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
}

.header-logo-img {
    height: 70px;
    width: auto;
}

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

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

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

/* User Menu */
.user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.user-menu-btn:hover {
    border-color: var(--accent);
}

.user-avatar {
    width: 28px;
    height: 28px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 500;
}

.plan-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.plan-free { background: var(--bg-tertiary); color: var(--text-secondary); }
.plan-pro { background: rgba(124, 92, 252, 0.2); color: var(--accent); }
.plan-premium { background: rgba(255, 170, 51, 0.2); color: var(--warning); }

.plan-badge-lg {
    font-size: 0.8rem;
    padding: 4px 12px;
}

.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    min-width: 220px;
    box-shadow: var(--shadow);
    z-index: 200;
    overflow: hidden;
}

.user-dropdown.show {
    display: block;
}

.dropdown-user-info {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dropdown-user-info strong {
    font-size: 0.9rem;
}

.dropdown-user-info span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s;
}

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

.dropdown-logout {
    color: var(--error);
}

/* Flash Messages */
.flash-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 32px 0;
}

.flash-message {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flash-success {
    background: rgba(76, 206, 138, 0.15);
    color: var(--success);
    border: 1px solid rgba(76, 206, 138, 0.3);
}

.flash-error {
    background: rgba(255, 85, 102, 0.15);
    color: var(--error);
    border: 1px solid rgba(255, 85, 102, 0.3);
}

.flash-info {
    background: rgba(124, 92, 252, 0.15);
    color: var(--accent);
    border: 1px solid rgba(124, 92, 252, 0.3);
}

.flash-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 0.9rem;
    opacity: 0.6;
}

.flash-close:hover {
    opacity: 1;
}

/* Auth Pages */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 80px);
    padding: 32px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow);
    box-sizing: border-box;
}

.auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-icon {
    font-size: 2rem;
    color: var(--accent);
}

.auth-header h2 {
    font-size: 1.3rem;
    margin: 8px 0 4px;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group input,
.form-group select {
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: border-color 0.2s;
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn-full {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 0.95rem;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

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

/* Password requirements */
.password-requirements {
    list-style: none;
    padding: 0;
    margin: -8px 0 12px 0;
    font-size: 0.78rem;
    color: var(--text-muted, #888);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 16px;
}

.password-requirements li {
    position: relative;
    padding-left: 18px;
}

.password-requirements li::before {
    content: '○';
    position: absolute;
    left: 0;
    font-size: 0.7rem;
    top: 1px;
}

.password-requirements li.valid {
    color: #4ade80;
}

.password-requirements li.valid::before {
    content: '✓';
}

.password-requirements li.invalid {
    color: #f87171;
}

.password-requirements li.invalid::before {
    content: '✗';
}

/* Profile Page */
.profile-card {
    max-width: 500px;
}

.profile-avatar-large {
    width: 64px;
    height: 64px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: white;
    margin: 0 auto 12px;
}

.profile-plan-info {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    margin-top: 8px;
}

.profile-plan-detail {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.profile-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.profile-section h3 {
    font-size: 0.95rem;
    margin-bottom: 12px;
}

.profile-subscription {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.text-muted {
    color: var(--text-muted);
}

/* Pricing Page */
.pricing-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 32px;
}

.pricing-header {
    text-align: center;
    margin-bottom: 40px;
}

.pricing-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.pricing-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.billing-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
}

.billing-option {
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: color 0.2s;
    cursor: pointer;
}

.billing-option.active {
    color: var(--text-primary);
    font-weight: 600;
}

.discount-badge {
    background: rgba(76, 206, 138, 0.15);
    color: var(--success);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

.discount-percent-badge {
    display: inline-block;
    background: rgba(76, 206, 138, 0.2);
    color: var(--success);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 6px;
}

.yearly-computed-price {
    font-size: 0.8rem;
    margin-top: 4px;
    font-weight: 600;
    min-height: 1.2em;
}

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

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: 0.3s;
}

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

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

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

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

@media (max-width: 1024px) {
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .pricing-grid {
        grid-template-columns: 1fr;
    }
}

.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    position: relative;
    transition: all 0.2s;
}

.pricing-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.pricing-popular {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.pricing-current {
    border-color: var(--success);
}

.popular-label {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 10px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.current-plan-label {
    position: absolute;
    top: -10px;
    right: 16px;
    background: var(--success);
    color: #000;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 10px;
    letter-spacing: 0.5px;
}

.pricing-card-header {
    text-align: center;
    margin-bottom: 24px;
}

.pricing-card-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.pricing-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
}

.price-amount {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
}

.price-period {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.price-yearly-note {
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

.pricing-features {
    list-style: none;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pricing-features li {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.pricing-features li strong {
    color: var(--text-primary);
}

.pricing-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.pricing-footer .btn {
    margin-top: 12px;
}

/* Plan Limit Notice */
.plan-limit-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    margin-top: 10px;
    background: rgba(255, 170, 51, 0.1);
    border: 1px solid rgba(255, 170, 51, 0.3);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--warning);
}

.plan-limit-notice a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.plan-limit-notice a:hover {
    text-decoration: underline;
}

/* Disabled drop zone */
.drop-zone-disabled {
    opacity: 0.4;
    pointer-events: none;
}

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

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

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

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

/* Responsive - Pricing */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .header-nav {
        gap: 6px;
    }

    .user-name {
        display: none;
    }

    .lang-selector {
        order: -1;
    }

    header {
        padding: 12px 16px;
    }

    .header-logo-img {
        height: 50px;
    }

    main {
        padding: 16px;
    }

    .flash-container {
        padding: 12px 16px 0;
    }

    .nav-link {
        padding: 6px 8px;
        font-size: 0.8rem;
    }

    .btn-accent, .btn-outline {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 10px 12px;
    }

    .header-logo-img {
        height: 40px;
    }

    .header-nav {
        gap: 4px;
    }

    .nav-link {
        padding: 5px 6px;
        font-size: 0.75rem;
    }

    .lang-btn {
        padding: 4px 8px;
        font-size: 0.8rem;
    }

    .user-menu-btn {
        padding: 4px 8px;
        font-size: 0.8rem;
    }

    main {
        padding: 12px;
    }

    .flash-container {
        padding: 8px 12px 0;
    }

    .hero-title {
        font-size: 1.7rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .btn-lg {
        padding: 12px 20px;
        font-size: 0.95rem;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .step-card {
        padding: 28px 20px;
    }

    .landing-section {
        padding: 40px 0;
    }

    .auth-container {
        padding: 16px 12px;
    }

    .auth-card {
        padding: 20px 16px;
    }
}

/* Language Selector */
.lang-selector {
    position: relative;
}

.lang-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.lang-btn:hover {
    border-color: var(--border-hover);
    background: var(--bg-card);
}

.lang-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    min-width: 150px;
    z-index: 1001;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.lang-dropdown.show {
    display: block;
}

.lang-option {
    display: block;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s;
}

.lang-option:hover {
    background: var(--bg-tertiary);
}

/* ========================================
   LANDING PAGE
   ======================================== */

.landing-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
}

.landing-container-sm {
    max-width: 800px;
}

/* Hero */
.landing-hero {
    padding: 80px 0 100px;
    background: linear-gradient(165deg, var(--bg-primary) 0%, #15152a 40%, #1a1035 100%);
    position: relative;
    overflow: hidden;
}

.landing-hero::before {
    content: '';
    position: absolute;
    top: -200px;
    right: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
}

.landing-hero .landing-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-badge {
    display: inline-block;
    background: rgba(124, 92, 252, 0.15);
    color: var(--accent);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 20px;
    border: 1px solid rgba(124, 92, 252, 0.3);
}

.hero-title {
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
}

.hero-accent {
    background: linear-gradient(135deg, var(--accent), #b388ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 32px;
    max-width: 520px;
}

.hero-ctas {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-note {
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Hero Mockup */
.hero-mockup {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px var(--accent-glow);
}

.mockup-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.mockup-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-hover);
}

.mockup-dot:nth-child(1) { background: #ff5f57; }
.mockup-dot:nth-child(2) { background: #ffbd2e; }
.mockup-dot:nth-child(3) { background: #28c840; }

.mockup-title {
    margin-left: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.mockup-body {
    padding: 32px 24px;
}

.mockup-pipeline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.mockup-stage {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    text-align: center;
    min-width: 90px;
}

.mockup-stage span {
    font-size: 1.8rem;
    display: block;
    margin-bottom: 4px;
}

.mockup-stage small {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.mockup-stage-intro { border-color: var(--accent); }
.mockup-stage-main { border-color: var(--success); }
.mockup-stage-outro { border-color: var(--warning); }

.mockup-arrow {
    color: var(--text-muted);
    font-size: 1.2rem;
}

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

.mockup-progress-bar {
    height: 100%;
    width: 75%;
    background: linear-gradient(90deg, var(--accent), var(--success));
    border-radius: 3px;
    animation: mockupProgress 3s ease-in-out infinite;
}

@keyframes mockupProgress {
    0%, 100% { width: 30%; }
    50% { width: 90%; }
}

.mockup-output {
    text-align: center;
    color: var(--success);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Buttons */
.btn-lg {
    padding: 14px 32px;
    font-size: 1.05rem;
    border-radius: 10px;
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-hover);
    padding: 14px 32px;
    font-size: 1.05rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(124, 92, 252, 0.08);
}

.btn-full {
    width: 100%;
}

/* Sections */
.landing-section {
    padding: 80px 0;
}

.landing-section-alt {
    background: var(--bg-secondary);
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-header h2 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto;
}

/* Steps */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.step-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px 28px;
    text-align: center;
    position: relative;
    transition: border-color 0.3s, transform 0.3s;
}

.step-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

.step-number {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 32px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
}

.step-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.step-card h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.step-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 24px;
    transition: border-color 0.3s, transform 0.3s;
}

.feature-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 14px;
}

.feature-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Use Cases */
.usecases-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.usecase-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 20px;
    text-align: center;
    transition: border-color 0.3s, transform 0.3s;
}

.usecase-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

.usecase-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.usecase-card h3 {
    font-size: 1.05rem;
    margin-bottom: 8px;
}

.usecase-card p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.6;
}

/* Pricing Preview */
.pricing-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.pricing-preview-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 24px;
    text-align: center;
    position: relative;
    transition: border-color 0.3s, transform 0.3s;
}

.pricing-preview-card:hover {
    transform: translateY(-4px);
}

.pricing-preview-popular {
    border-color: var(--plan-color, var(--accent));
    box-shadow: 0 0 30px rgba(124, 92, 252, 0.15);
}

.pricing-preview-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--plan-color, var(--accent));
    color: #fff;
    padding: 4px 16px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 700;
}

.pricing-preview-card h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.pricing-preview-price {
    margin-bottom: 12px;
}

.preview-amount {
    font-size: 2.2rem;
    font-weight: 800;
}

.preview-period {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.pricing-preview-highlight {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* FAQ */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.3s;
}

.faq-item[open] {
    border-color: var(--accent);
}

.faq-item summary {
    padding: 18px 24px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

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

.faq-item summary::after {
    content: '+';
    font-size: 1.3rem;
    color: var(--text-muted);
    font-weight: 300;
    transition: transform 0.3s;
}

.faq-item[open] summary::after {
    content: '\2212';
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item p {
    padding: 0 24px 18px;
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
}

/* Contact Form */
.contact-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
}

.contact-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.contact-form .form-group {
    margin-bottom: 20px;
}

.contact-form label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.contact-form input,
.contact-form select,
.contact-form textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px;
    gap: 12px;
}

.success-icon {
    width: 64px;
    height: 64px;
    background: var(--success);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 700;
}

.contact-success h3 {
    font-size: 1.4rem;
}

.contact-success p {
    color: var(--text-secondary);
}

/* Final CTA */
.landing-cta {
    padding: 80px 0;
    background: linear-gradient(165deg, #1a1035 0%, var(--bg-primary) 100%);
}

.landing-cta h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.landing-cta p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Footer */
.landing-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 60px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo {
    height: 40px;
    width: auto;
    margin-bottom: 14px;
}

.footer-brand p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    max-width: 300px;
}

.footer-col h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.footer-col a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 10px;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: var(--accent);
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 24px;
    text-align: center;
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Landing Responsive */
@media (max-width: 1024px) {
    .landing-hero .landing-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-subtitle {
        max-width: 100%;
    }

    .hero-ctas {
        justify-content: center;
    }

    .hero-visual {
        display: none;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .features-grid,
    .steps-grid,
    .pricing-preview-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
}

@media (max-width: 600px) {
    .landing-hero {
        padding: 50px 0 60px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .section-header h2 {
        font-size: 1.7rem;
    }

    .landing-section {
        padding: 50px 0;
    }

    .features-grid,
    .steps-grid,
    .pricing-preview-grid,
    .usecases-grid {
        grid-template-columns: 1fr;
    }

    .contact-form .form-row {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .contact-card {
        padding: 24px;
    }

    .landing-container {
        padding: 0 16px;
    }
}

.lang-option.active {
    background: var(--accent);
    color: white;
    font-weight: 500;
}

/* ===== Admin Panel ===== */
.admin-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 20px;
}

.admin-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.admin-section h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.admin-csv-tools {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.csv-status {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.admin-search {
    width: 100%;
    padding: 10px 16px;
    font-size: 0.95rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
}

.admin-search:focus {
    border-color: var(--accent);
}

.admin-search::placeholder {
    color: var(--text-muted);
}

.admin-bulk-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px 12px 0 0;
    border-bottom: none;
}

.admin-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.admin-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.admin-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-left: auto;
}

.admin-table-wrapper {
    overflow-x: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0 0 12px 12px;
}

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

.admin-table th {
    padding: 10px 14px;
    text-align: left;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    background: var(--bg-tertiary);
}

.admin-table td {
    padding: 12px 14px;
    font-size: 0.9rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover td {
    background: rgba(124, 92, 252, 0.05);
}

.admin-table .col-check {
    width: 40px;
    text-align: center;
}

.admin-table .col-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.admin-actions {
    display: flex;
    gap: 6px;
}

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

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

.btn-danger:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── Admin Nav Active ── */
.nav-link-active {
    color: var(--accent) !important;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 2px;
}

/* ══════════════════════════════════════════
   MONITORING DASHBOARD
   ══════════════════════════════════════════ */

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

.monitor-header h2 {
    margin: 0;
    font-size: 1.3rem;
    color: var(--text-primary);
}

.monitor-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.monitor-refresh-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.monitor-pulse {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
    display: inline-block;
}

.monitor-pulse.pulsing {
    animation: pulse-glow 0.5s ease;
}

@keyframes pulse-glow {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
    100% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
}

/* Cards grid */
.monitor-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .monitor-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

.monitor-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

.monitor-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.monitor-card-icon {
    font-size: 1.2rem;
}

.monitor-card-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.monitor-card-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-variant-numeric: tabular-nums;
}

.monitor-card-detail {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 8px;
}

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

.monitor-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease, background 0.3s ease;
    min-width: 0;
}

.bar-ok { background: var(--success); }
.bar-warn { background: #f59e0b; }
.bar-danger { background: var(--error); }
.bar-accent { background: var(--accent); }
.bar-storage { background: var(--accent); opacity: 0.7; }

.bar-inline {
    flex: 1;
    height: 6px;
}

/* Sections */
.monitor-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.monitor-section h3 {
    margin: 0 0 16px 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.monitor-empty {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    padding: 16px 0;
    margin: 0;
}

/* Storage summary */
.monitor-storage-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.monitor-storage-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.storage-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.storage-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.storage-total {
    color: var(--accent);
}

/* Plan breakdown */
.monitor-plan-grid {
    display: flex;
    gap: 16px;
}

.monitor-plan-card {
    flex: 1;
    text-align: center;
    padding: 16px;
    border-radius: 10px;
    background: var(--bg-tertiary);
}

.monitor-plan-card .plan-count {
    font-size: 2rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.monitor-plan-card .plan-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
    margin-top: 4px;
}

.monitor-plan-card.plan-free .plan-count { color: var(--text-secondary); }
.monitor-plan-card.plan-pro .plan-count { color: var(--accent); }
.monitor-plan-card.plan-premium .plan-count { color: #f59e0b; }

.monitor-plan-card.plan-free .plan-label { color: var(--text-muted); }
.monitor-plan-card.plan-pro .plan-label { color: var(--accent); }
.monitor-plan-card.plan-premium .plan-label { color: #f59e0b; }

/* Processing jobs */
.monitor-job {
    padding: 14px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-bottom: 8px;
}

.monitor-job-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.monitor-job-user {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
}

.monitor-job-progress {
    margin-left: auto;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.monitor-job-detail {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Badges */
.monitor-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.badge-active {
    background: rgba(124, 92, 252, 0.15);
    color: var(--accent);
}

.badge-cpu {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

/* Storage per user rows */
.monitor-user-storage-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.monitor-user-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
}

.user-row-id {
    font-size: 0.8rem;
    color: var(--text-secondary);
    min-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-row-size {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 70px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.user-row-files {
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 60px;
}

/* Monitor table (FFmpeg) */
.monitor-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.monitor-table th {
    text-align: left;
    padding: 8px 12px;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
}

.monitor-table td {
    padding: 8px 12px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
}

.monitor-table tr:last-child td {
    border-bottom: none;
}

.cmd-cell {
    font-family: monospace;
    font-size: 0.72rem;
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-muted) !important;
}

/* Session chips */
.monitor-sessions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.monitor-session-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
}

.chip-user {
    background: rgba(124, 92, 252, 0.1);
    border: 1px solid rgba(124, 92, 252, 0.3);
}

.chip-guest {
    background: rgba(156, 163, 175, 0.1);
    border: 1px solid rgba(156, 163, 175, 0.3);
}

.chip-type {
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
}

.chip-user .chip-type { color: var(--accent); }
.chip-guest .chip-type { color: var(--text-muted); }

.chip-id {
    color: var(--text-secondary);
    font-family: monospace;
    font-size: 0.75rem;
}

/* ═══════════════════════════════════════════════════ */
/* Plan Configuration Admin Page                      */
/* ═══════════════════════════════════════════════════ */

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

.plans-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

@media (max-width: 900px) {
    .plans-grid { grid-template-columns: 1fr; }
}

.plan-config-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.plan-config-title {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 8px 0;
    border-radius: var(--radius-sm);
}

.plan-badge-free {
    background: rgba(124, 92, 252, 0.1);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.plan-badge-pro {
    background: rgba(124, 92, 252, 0.15);
    color: var(--accent);
    border: 1px solid var(--accent);
}

.plan-badge-premium {
    background: linear-gradient(135deg, rgba(255, 170, 51, 0.15), rgba(255, 85, 102, 0.15));
    color: var(--warning);
    border: 1px solid var(--warning);
}

.plan-config-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.plan-config-field > label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.field-hint {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.plan-input {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    width: 100%;
    transition: border-color 0.2s;
}

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

.input-with-badge {
    position: relative;
}

.input-badge {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: var(--text-muted);
    pointer-events: none;
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 4px;
}

/* CRF Slider */
.crf-slider-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.crf-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    outline: none;
    background: var(--bg-tertiary);
    transition: background 0.2s;
}

.crf-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--bg-card);
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
    transition: transform 0.15s, background 0.2s;
}

.crf-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

/* Slider color classes */
.crf-slider.crf-green {
    background: linear-gradient(90deg, #2dd4bf, #4cce8a);
}
.crf-slider.crf-green::-webkit-slider-thumb {
    background: #4cce8a;
}

.crf-slider.crf-yellow {
    background: linear-gradient(90deg, #4cce8a, #ffaa33);
}
.crf-slider.crf-yellow::-webkit-slider-thumb {
    background: #ffaa33;
}

.crf-slider.crf-red {
    background: linear-gradient(90deg, #ffaa33, #ff5566);
}
.crf-slider.crf-red::-webkit-slider-thumb {
    background: #ff5566;
}

.crf-marks {
    display: flex;
    justify-content: space-between;
    padding: 0 2px;
}

.crf-mark {
    font-size: 0.65rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: color 0.2s, background 0.2s;
}

.crf-mark:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.crf-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
}

.crf-value {
    font-weight: 700;
    font-family: monospace;
}

.crf-desc {
    color: var(--text-muted);
    font-style: italic;
}

.crf-label.crf-green .crf-value { color: #4cce8a; }
.crf-label.crf-yellow .crf-value { color: #ffaa33; }
.crf-label.crf-red .crf-value { color: #ff5566; }

.crf-label.crf-green .crf-desc { color: #4cce8a; }
.crf-label.crf-yellow .crf-desc { color: #ffaa33; }
.crf-label.crf-red .crf-desc { color: #ff5566; }

/* Plan Modal (Add Plan) */
.plan-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 200;
    justify-content: center;
    align-items: center;
}

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

.plan-modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.plan-modal-content h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.plan-modal-content .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.plan-modal-content .form-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.plan-modal-content .form-group input {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.plan-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 8px;
}

/* Plan delete button */
.plan-delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.plan-delete-btn:hover {
    color: var(--error);
    background: rgba(255, 85, 102, 0.1);
}

/* Add plan card */
.plan-add-card {
    background: var(--bg-card);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    cursor: pointer;
    transition: all 0.2s;
}

.plan-add-card:hover {
    border-color: var(--accent);
    background: rgba(124, 92, 252, 0.05);
}

.plan-add-card span {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 600;
}
