@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #a5b4fc;
    --primary-glow: rgba(99,102,241,0.25);
    --accent: #f472b6;
    --accent2: #38bdf8;
    --success: #22c55e;
    --success-bg: rgba(34,197,94,0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239,68,68,0.1);
    --warning: #f59e0b;
    --sidebar-w: 260px;
    --bg: #f0f2f8;
    --card: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --text-muted: #94a3b8;
    --border: rgba(0,0,0,0.06);
    --radius: 16px;
    --shadow: 0 4px 24px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.08);
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== ANIMATED BACKGROUND ===== */
.app-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
}

.app-layout::before {
    content: '';
    position: fixed;
    top: -50%;
    right: -20%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
    animation: float1 20s ease-in-out infinite;
}

.app-layout::after {
    content: '';
    position: fixed;
    bottom: -30%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(244,114,182,0.06) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
    animation: float2 25s ease-in-out infinite;
}

@keyframes float1 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-60px, 60px); }
}

@keyframes float2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(40px, -40px); }
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, #1e1b4b 0%, #312e81 50%, #3730a3 100%);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 50;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 30px rgba(0,0,0,0.15);
    overflow: hidden;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.sidebar-brand {
    padding: 28px 24px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
}

.sidebar-logo {
    width: 46px;
    height: 46px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
}

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

.sidebar-subtitle {
    color: rgba(255,255,255,0.5);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sidebar-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    margin: 0 20px 8px;
}

.sidebar-section {
    padding: 8px 16px;
    position: relative;
}

.sidebar-section-title {
    font-size: 10px;
    font-weight: 700;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 12px 12px 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    text-decoration: none;
    color: rgba(255,255,255,0.6);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    margin-bottom: 2px;
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.sidebar-link.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-weight: 600;
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: var(--accent);
    border-radius: 0 4px 4px 0;
}

.sidebar-link .link-badge {
    margin-left: auto;
    background: rgba(244,114,182,0.2);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

.sidebar-footer {
    margin-top: auto;
    padding: 16px;
    position: relative;
}

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    text-decoration: none;
    color: rgba(255,255,255,0.5);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logout:hover {
    background: rgba(239,68,68,0.15);
    color: #fca5a5;
    border-color: rgba(239,68,68,0.2);
}

.sidebar-logout i { width: 20px; text-align: center; }

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 8px;
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
}

.sidebar-username {
    color: rgba(255,255,255,0.8);
    font-size: 13px;
    font-weight: 600;
}

.sidebar-role {
    color: rgba(255,255,255,0.35);
    font-size: 11px;
}

/* ===== MAIN AREA ===== */
.main-area {
    margin-left: var(--sidebar-w);
    flex: 1;
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

/* ===== TOP BAR ===== */
.top-bar {
    padding: 20px 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 30;
}

.top-bar-title h1 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-bar-title h1 i {
    color: var(--primary);
}

.top-bar-title p {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 2px;
}

.top-bar-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ===== CONTENT ===== */
.content {
    padding: 32px 36px;
}

/* ===== CARDS ===== */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 28px;
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-lg { padding: 36px; }
.card-flush { padding: 0; }

/* ===== TAB HEADER ===== */
.tab-header {
    display: flex;
    gap: 4px;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 28px;
}

.tab-header button {
    flex: 1;
    background: none;
    border: none;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.tab-header button.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

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

/* ===== UPLOAD AREA ===== */
.upload-area {
    border: 2px dashed #c7d2fe;
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #f5f3ff, #eef2ff);
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(99,102,241,0) 0%, rgba(99,102,241,0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.upload-area:hover::before { opacity: 1; }

.upload-area:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(99,102,241,0.12);
}

.upload-area.has-file {
    border-color: var(--success);
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
}

.upload-icon {
    font-size: 42px;
    color: var(--primary);
    display: block;
    margin-bottom: 12px;
}

.upload-text {
    font-weight: 700;
    font-size: 15px;
    color: var(--primary-dark);
    margin-bottom: 4px;
}

.upload-hint {
    font-size: 13px;
    color: var(--text-muted);
}

/* ===== FORM ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-light);
    letter-spacing: 0.01em;
}

.form-group label i {
    margin-right: 4px;
    color: var(--primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.25s ease;
    background: #fff;
    color: var(--text);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #cbd5e1;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
    opacity: 0;
    transition: opacity 0.25s;
}

.btn:hover::before { opacity: 1; }

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    box-shadow: 0 4px 15px rgba(99,102,241,0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99,102,241,0.45);
}

.btn-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    box-shadow: 0 4px 15px rgba(34,197,94,0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(34,197,94,0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    box-shadow: 0 4px 15px rgba(239,68,68,0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239,68,68,0.4);
}

.btn-secondary {
    background: #fff;
    color: var(--text);
    border: 2px solid #e2e8f0;
}

.btn-secondary:hover {
    border-color: var(--primary-light);
    background: #f8fafc;
}

.btn-ghost {
    background: transparent;
    color: var(--primary);
    padding: 8px 16px;
}

.btn-ghost:hover {
    background: rgba(99,102,241,0.06);
}

.btn-full { width: 100%; }
.btn-lg { padding: 16px 28px; font-size: 15px; border-radius: 14px; }
.btn-sm { padding: 8px 16px; font-size: 13px; border-radius: 10px; }

.btn:active { transform: translateY(0) scale(0.98); }

/* ===== CHECKBOX ===== */
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.checkbox-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
}

.checkbox-row label {
    font-size: 14px;
    color: var(--text-light);
    cursor: pointer;
    font-weight: 500;
}

/* ===== PREVIEW ===== */
.preview-section { margin: 20px 0; }

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

.preview-label {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 600;
}

.preview-label i { color: var(--primary); margin-right: 4px; }

.size-badge {
    background: linear-gradient(135deg, #ede9fe, #e0e7ff);
    color: var(--primary-dark);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
}

.preview-box {
    background: linear-gradient(135deg, #fefce8, #fef9c3);
    border: 1px solid #fde68a;
    border-radius: 12px;
    padding: 16px 18px;
    font-size: 13px;
    max-height: 200px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1.8;
    white-space: pre-wrap;
    color: #78716c;
}

/* ===== DATASET HEADER/CHECKLIST ===== */
.dataset-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.dataset-header label {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-light);
}

.select-all-link {
    color: var(--primary);
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: opacity 0.2s;
}

.select-all-link:hover { opacity: 0.7; }

.dataset-checklist {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 8px;
    max-height: 160px;
    overflow-y: auto;
    background: #fff;
}

.dataset-checklist label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.15s ease;
    font-weight: 500;
    color: var(--text);
}

.dataset-checklist label:hover { background: #f1f5f9; }

.badge {
    margin-left: auto;
    background: linear-gradient(135deg, #ede9fe, #e0e7ff);
    color: var(--primary);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

.badge-lg { padding: 5px 14px; font-size: 13px; }

.empty-inline {
    color: var(--text-muted);
    font-size: 13px;
    padding: 12px;
    text-align: center;
}

/* ===== RESULT SECTION ===== */
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
    margin: 28px 0;
}

.result-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-title i { color: var(--primary); }

.result-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stat-box {
    text-align: center;
    padding: 24px 16px;
    border-radius: 16px;
    transition: transform 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-box::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.5), transparent);
    pointer-events: none;
}

.stat-box:hover { transform: translateY(-4px); }

.stat-box.original {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    box-shadow: 0 4px 20px rgba(59,130,246,0.15);
}

.stat-box.clean {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    box-shadow: 0 4px 20px rgba(34,197,94,0.15);
}

.stat-box.scrubbed {
    background: linear-gradient(135deg, #fce7f3, #fbcfe8);
    box-shadow: 0 4px 20px rgba(236,72,153,0.15);
}

.stat-icon { font-size: 24px; margin-bottom: 8px; opacity: 0.5; }

.stat-number {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -1.5px;
    color: var(--text);
    position: relative;
}

.stat-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
    margin-top: 4px;
}

.download-actions {
    display: flex;
    gap: 12px;
}

/* ===== DATA TABLE ===== */
.table-wrapper {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

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

.data-table th {
    text-align: left;
    padding: 14px 18px;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

.data-table th i { margin-right: 4px; }

.data-table td {
    padding: 16px 18px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}

.data-table tbody tr {
    transition: all 0.2s ease;
}

.data-table tbody tr:hover {
    background: linear-gradient(135deg, #f8faff, #f5f3ff);
}

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

.date-col {
    color: var(--text-muted);
    font-size: 13px;
    white-space: nowrap;
}

/* ===== ICON BUTTON ===== */
.icon-btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-light);
    transition: all 0.2s ease;
    border-radius: 10px;
}

.icon-btn:hover {
    color: var(--primary);
    background: #ede9fe;
    transform: scale(1.05);
}

.icon-btn.delete:hover {
    color: var(--danger);
    background: #fef2f2;
}

/* ===== CAMPAIGN / STATUS BADGES ===== */
.campaign-badge {
    background: linear-gradient(135deg, #ede9fe, #e0e7ff);
    color: var(--primary-dark);
    padding: 5px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
}

.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.datasets-text { font-size: 12px; color: var(--text-muted); }

.download-col {
    display: flex;
    gap: 8px;
}

/* ===== HEADER ACTIONS ===== */
.header-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

/* ===== SETTINGS LIST ===== */
.settings-list {
    list-style: none;
}

.settings-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s ease;
    border-radius: 12px;
    margin-bottom: 4px;
}

.settings-list li:hover {
    background: #f8fafc;
}

.setting-info {
    display: flex;
    align-items: center;
    gap: 18px;
}

.setting-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.settings-list li:nth-child(1) .setting-icon { background: linear-gradient(135deg, #ede9fe, #e0e7ff); color: #6366f1; }
.settings-list li:nth-child(2) .setting-icon { background: linear-gradient(135deg, #fce7f3, #fbcfe8); color: #ec4899; }
.settings-list li:nth-child(3) .setting-icon { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #3b82f6; }
.settings-list li:nth-child(4) .setting-icon { background: linear-gradient(135deg, #dcfce7, #bbf7d0); color: #22c55e; }
.settings-list li:nth-child(5) .setting-icon { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #f59e0b; }

.setting-label {
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
}

.setting-value {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ===== SECURITY ACTION BADGES ===== */
.action-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
}

.action-login { background: #dbeafe; color: #1d4ed8; }
.action-logout { background: #fef3c7; color: #b45309; }
.action-scrub { background: #ede9fe; color: #6d28d9; }
.action-add { background: #dcfce7; color: #15803d; }
.action-delete { background: #fce7f3; color: #be185d; }
.action-update { background: #e0f2fe; color: #0284c7; }

.ip-code {
    background: #f1f5f9;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted);
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state .empty-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #ede9fe, #e0e7ff);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--primary);
    margin: 0 auto 20px;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

/* ===== MODAL ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.6);
    backdrop-filter: blur(8px);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

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

.modal {
    background: #fff;
    border-radius: 20px;
    padding: 36px;
    width: 480px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal h3 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal h3 i { color: var(--primary); }

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 28px;
}

/* ===== DIVIDER TEXT ===== */
.divider-text {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    margin: 20px 0;
    position: relative;
}

.divider-text::before,
.divider-text::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #e2e8f0;
}

.divider-text::before { left: 0; }
.divider-text::after { right: 0; }

/* ===== MANUAL TEXTAREA ===== */
.manual-textarea {
    width: 100%;
    min-height: 160px;
    padding: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    font-family: 'JetBrains Mono', monospace;
    resize: vertical;
    outline: none;
    transition: all 0.25s ease;
    line-height: 1.7;
}

.manual-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

/* ===== FORM EXTRAS ===== */
.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.file-input {
    padding: 12px !important;
    background: #f8fafc !important;
}

.form-row {
    display: flex;
    gap: 16px;
}

/* ===== FLASH ===== */
.flash {
    padding: 14px 20px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.flash.error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(239,68,68,0.15);
}

.flash.success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(34,197,94,0.15);
}

/* ===== LOGIN ===== */
.login-container {
    display: flex;
    min-height: 100vh;
}

.login-visual {
    flex: 1;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #4f46e5 80%, #6366f1 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    position: relative;
    overflow: hidden;
}

.login-visual::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 50%;
    top: -100px;
    right: -100px;
}

.login-visual::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 50%;
    bottom: -50px;
    left: -50px;
}

.login-visual-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.login-visual-icon {
    width: 90px;
    height: 90px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: #fff;
    margin: 0 auto 24px;
}

.login-visual h2 {
    color: #fff;
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.login-visual p {
    color: rgba(255,255,255,0.6);
    font-size: 16px;
    max-width: 320px;
    line-height: 1.6;
}

.login-form-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: #fff;
}

.login-box {
    width: 400px;
    max-width: 100%;
}

.login-box h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.login-box .subtitle {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 36px;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .sidebar { display: none; }
    .main-area { margin-left: 0; }
    .login-visual { display: none; }
}

@media (max-width: 768px) {
    .content { padding: 20px 16px; }
    .top-bar { padding: 16px 20px; }
    .result-stats { grid-template-columns: 1fr; }
    .download-actions { flex-direction: column; }
}

/* ===== DARK THEME ===== */
body.dark {
    --bg: #0f172a;
    --card: #1e293b;
    --text: #e2e8f0;
    --text-light: #94a3b8;
    --text-muted: #64748b;
    --border: rgba(255,255,255,0.06);
}

body.dark .top-bar {
    background: rgba(30,41,59,0.8);
}

body.dark .form-group input,
body.dark .form-group select,
body.dark .form-group textarea,
body.dark .manual-textarea,
body.dark .dataset-checklist {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

body.dark .form-group input:focus,
body.dark .form-group select:focus,
body.dark .manual-textarea:focus {
    border-color: var(--primary);
}

body.dark .tab-header { background: #0f172a; }
body.dark .tab-header button.active { background: #1e293b; }

body.dark .data-table th { background: #0f172a; border-color: #334155; }
body.dark .data-table td { border-color: #1e293b; }
body.dark .data-table tbody tr:hover { background: rgba(99,102,241,0.06); }

body.dark .table-wrapper { border-color: #334155; }

body.dark .settings-list li:hover { background: rgba(255,255,255,0.03); }
body.dark .settings-list li { border-color: #1e293b; }

body.dark .upload-area {
    background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(99,102,241,0.02));
    border-color: #334155;
}

body.dark .preview-box {
    background: linear-gradient(135deg, #1e293b, #1e1b4b);
    border-color: #334155;
    color: #94a3b8;
}

body.dark .checkbox-row {
    background: #0f172a;
    border-color: #334155;
}

body.dark .icon-btn { background: #0f172a; color: #94a3b8; }
body.dark .icon-btn:hover { background: #1e1b4b; }

body.dark .modal { background: #1e293b; }

body.dark .stat-box.original { background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(59,130,246,0.06)); }
body.dark .stat-box.clean { background: linear-gradient(135deg, rgba(34,197,94,0.12), rgba(34,197,94,0.06)); }
body.dark .stat-box.scrubbed { background: linear-gradient(135deg, rgba(236,72,153,0.12), rgba(236,72,153,0.06)); }

body.dark .dataset-checklist label:hover { background: rgba(255,255,255,0.04); }
body.dark .empty-state .empty-icon { background: rgba(99,102,241,0.15); }
body.dark .badge { background: rgba(99,102,241,0.15); }
body.dark .campaign-badge { background: rgba(99,102,241,0.15); }
body.dark .size-badge { background: rgba(99,102,241,0.15); }
body.dark .ip-code { background: #0f172a; }
body.dark .action-badge { opacity: 0.85; }
