/* ============ THEME ============ */
@import url('./pricing.css');

:root {
    --bg: #070b15;
    --bg-2: #0a0f1e;
    --bg-3: #0f1526;
    --surface: #111827;
    --surface-2: #1a2133;
    --border: #1f2937;
    --border-2: #2a3547;
    --text: #e5e7eb;
    --text-2: #9ca3af;
    --text-3: #6b7280;
    --primary: #6366f1;
    --primary-2: #4f46e5;
    --accent: #a855f7;
    --success: #10b981;
    --warn: #f59e0b;
    --danger: #ef4444;
    --info: #60a5fa;
    --sidebar-w: 240px;
    --topbar-h: 60px;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 8px 24px rgba(0,0,0,0.4);
}
[data-theme="light"] {
    --bg: #f5f6fa;
    --bg-2: #ffffff;
    --bg-3: #eef0f5;
    --surface: #ffffff;
    --surface-2: #f9fafb;
    --border: #e5e7eb;
    --border-2: #d1d5db;
    --text: #111827;
    --text-2: #4b5563;
    --text-3: #6b7280;
}
[data-theme="neon"] {
    --bg: #050510;
    --surface: #0d0d1f;
    --border: #2d1b69;
    --text: #e0e7ff;
    --primary: #00ffd5;
    --accent: #ff00ff;
}
[data-theme="terminal"] {
    --bg: #000;
    --surface: #0a0a0a;
    --border: #1a1a1a;
    --text: #00ff00;
    --primary: #00ff00;
    --accent: #00aa00;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    overflow: hidden;
}

/* ============ LAYOUT ============ */
.app {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    height: 100vh;
}

/* ============ SIDEBAR ============ */
.sidebar {
    background: var(--bg-2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.brand {
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}
.brand-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 14px rgba(99,102,241,0.35);
}
.brand-name {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: linear-gradient(90deg, #93c5fd, #c4b5fd, #f0abfc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.brand-ver { font-size: 10px; color: var(--text-3); }

.nav {
    flex: 1;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
    user-select: none;
}
.nav-item:hover {
    background: var(--surface);
    color: var(--text);
}
.nav-item.active {
    background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(168,85,247,0.15));
    color: #c7d2fe;
    border-left: 3px solid var(--primary);
    padding-left: 9px;
}
.nav-icon { font-size: 16px; }
.nav-label { flex: 1; }

.sidebar-footer {
    border-top: 1px solid var(--border);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ai-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    font-size: 11px;
    color: var(--text-2);
}
.chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-3);
    flex-shrink: 0;
}
.ai-chip.ready .chip-dot {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse 2s infinite;
}
.ai-chip.running .chip-dot {
    background: var(--warn);
    animation: pulse 0.8s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.log-mini {
    background: #000;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 8px;
    height: 90px;
    overflow-y: auto;
    font-family: Consolas, monospace;
    font-size: 10px;
    color: #6ee7b7;
    line-height: 1.4;
}
.log-mini div { padding: 1px 0; }

/* ============ MAIN ============ */
.main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg);
}
.topbar {
    height: var(--topbar-h);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: var(--bg-2);
    flex-shrink: 0;
}
.topbar-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.stat-chip {
    display: flex;
    align-items: baseline;
    gap: 6px;
    background: var(--surface);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.stat-num {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
}
.stat-lbl {
    font-size: 10px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.icon-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 15px;
    transition: all 0.15s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border-2); }

.view {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}
.view.active { display: block; }

/* ============ CARDS ============ */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}
.card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 16px;
}
.card-full { grid-column: 1 / -1; }
.card-title {
    font-size: 13px;
    font-weight: 700;
    color: #93c5fd;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.card-desc {
    font-size: 12px;
    color: var(--text-2);
    line-height: 1.6;
    margin-bottom: 12px;
}
.card-hero {
    background: linear-gradient(135deg, #1e1b4b, #4c1d95);
    border-color: #6d28d9;
}
.card-hero-title {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 6px;
}
.card-hero-sub {
    font-size: 12px;
    color: #c7d2fe;
    margin-bottom: 16px;
}
.card-hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.card-ai {
    background: linear-gradient(135deg, #0f172a, #1e1b4b);
    border-color: #4338ca;
}

/* ============ FORMS ============ */
label {
    display: block;
    font-size: 11px;
    color: var(--text-2);
    margin: 12px 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
input[type="text"], input[type="number"], input[type="password"],
select, textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 13px;
    outline: none;
    transition: border 0.15s, background 0.15s;
    font-family: inherit;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    background: var(--bg-2);
}
select option { background: var(--bg-2); color: var(--text); }
textarea { resize: vertical; font-family: inherit; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}
.form-row { display: flex; flex-direction: column; }
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}
.form-footer {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ============ BUTTONS ============ */
.btn {
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
}
.btn-primary:hover:not(:disabled) {
    box-shadow: 0 4px 14px rgba(99,102,241,0.4);
}
.btn-ai {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: #fff;
}
.btn-ai:hover:not(:disabled) {
    box-shadow: 0 4px 18px rgba(168,85,247,0.5);
}
.btn-success { background: #065f46; color: #a7f3d0; }
.btn-success:hover:not(:disabled) { background: #047857; }
.btn-info { background: #1e3a8a; color: #bfdbfe; }
.btn-info:hover:not(:disabled) { background: #1d4ed8; }
.btn-danger { background: #7f1d1d; color: #fecaca; }
.btn-danger:hover:not(:disabled) { background: #991b1b; }
.btn-sm { padding: 7px 12px; font-size: 11px; }
.btn-lg { padding: 14px 24px; font-size: 14px; }

/* ============ TABS INLINE ============ */
.tabs-inline {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    background: var(--bg-2);
    padding: 6px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.tab-inline {
    padding: 8px 14px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-2);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.tab-inline:hover { color: var(--text); background: var(--surface); }
.tab-inline.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
}

.subview { display: none; }
.subview.active { display: block; }

/* ============ EXT GRID ============ */
.ext-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    margin-top: 6px;
}
.ext-grid label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text);
    cursor: pointer;
    margin: 0;
    font-weight: 500;
    transition: all 0.15s;
}
.ext-grid label:hover { border-color: var(--primary); }
.ext-grid input[type="checkbox"] {
    accent-color: var(--primary);
    width: 15px;
    height: 15px;
}

/* ============ SWITCH LIST ============ */
.switch-list {
    display: grid;
    gap: 8px;
    margin-top: 4px;
}
.switch {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 12px;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text);
    cursor: pointer;
    margin: 0;
    font-weight: 500;
    transition: border 0.15s;
}
.switch:hover { border-color: var(--primary); }
.switch input[type="checkbox"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}

/* ============ PROGRESS ============ */
.progress {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin: 16px 0;
}
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    width: 0%;
    transition: width 0.3s;
}

/* ============ KV LIST ============ */
.kv-list { display: grid; gap: 6px; }
.kv {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px dashed var(--border);
    font-size: 12px;
}
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--text-3); text-transform: uppercase; font-size: 10px; letter-spacing: 0.5px; }
.kv .v { color: var(--text); font-weight: 600; }

/* ============ QUICK ACTIONS ============ */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.qa-btn {
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
    font-family: inherit;
    font-weight: 500;
}
.qa-btn:hover {
    border-color: var(--primary);
    background: var(--surface-2);
}

/* ============ LOG ============ */
.log {
    background: #000;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    height: 240px;
    overflow-y: auto;
    font-family: Consolas, monospace;
    font-size: 11px;
    color: #6ee7b7;
    line-height: 1.55;
}
.log div { padding: 1px 0; }
.log .err { color: #fca5a5; }
.log .warn { color: #fcd34d; }
.log .info { color: #93c5fd; }

/* ============ AI PANEL ============ */
.ai-status {
    margin-top: 12px;
    padding: 10px 12px;
    background: var(--surface);
    border-left: 3px solid var(--text-3);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-2);
}
.ai-status.info { border-left-color: var(--info); color: #bfdbfe; }
.ai-status.ok { border-left-color: var(--success); color: #6ee7b7; }
.ai-status.warn { border-left-color: var(--warn); color: #fcd34d; }
.ai-status.err { border-left-color: var(--danger); color: #fca5a5; }
.ai-log {
    margin-top: 10px;
    background: #000;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 10px;
    max-height: 180px;
    overflow-y: auto;
    font-family: Consolas, monospace;
    font-size: 11px;
    color: #a5b4fc;
    line-height: 1.55;
}

.scan-progress {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 12px;
}
.scan-step {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--text-3);
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s;
}
.scan-step.active { background: rgba(99,102,241,0.15); color: #c7d2fe; }
.scan-step.done { color: #6ee7b7; }
.scan-step .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-2);
    flex-shrink: 0;
}
.scan-step.active .dot { background: var(--info); animation: pulse 1s infinite; }
.scan-step.done .dot { background: var(--success); }

/* ============ DEVICE ============ */
.device-search-wrap { position: relative; }
.device-dropdown {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--bg-2);
    border: 1px solid var(--border-2);
    border-radius: 8px;
    margin-top: 4px;
    max-height: 320px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: var(--shadow);
}
.device-dropdown.show { display: block; }
.dd-item {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
}
.dd-item:hover { background: var(--surface-2); }
.dd-name { font-size: 13px; color: var(--text); font-weight: 600; }
.dd-meta { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.dd-empty { padding: 14px; font-size: 12px; color: var(--text-3); text-align: center; }

.device-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    margin-top: 12px;
}
.dstat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
}
.dnum { display: block; font-size: 18px; font-weight: 700; color: var(--accent); }
.dlbl {
    display: block;
    font-size: 10px;
    color: var(--text-3);
    text-transform: uppercase;
    margin-top: 2px;
    letter-spacing: 0.5px;
}

.device-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
    margin-top: 10px;
    max-height: 400px;
    overflow-y: auto;
    padding: 4px;
}
.dev-chip {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 11px;
    color: var(--text);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    transition: border 0.15s;
}
.dev-chip:hover { border-color: var(--primary); }
.chip-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}
.chip-tier {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    flex-shrink: 0;
}
.tier-flagship { background: #4c1d95; color: #ddd6fe; }
.tier-gaming { background: #7c2d12; color: #fed7aa; }
.tier-mid { background: #1e3a8a; color: #bfdbfe; }
.tier-low { background: #374151; color: #d1d5db; }

/* ============ CRAWLER ============ */
.crawler-block {
    margin-top: 16px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}
.crawler-title {
    font-size: 13px;
    font-weight: 700;
    color: #93c5fd;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}
.crawler-empty {
    font-size: 12px;
    color: var(--text-3);
    padding: 14px;
    text-align: center;
}
.crawler-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
}
.crawler-stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 8px;
    text-align: center;
}
.crawler-stat span {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #a5b4fc;
}
.crawler-stat label {
    display: block;
    font-size: 9px;
    color: var(--text-3);
    text-transform: uppercase;
    margin-top: 3px;
    letter-spacing: 0.5px;
}
.crawler-sub {
    font-size: 11px;
    color: #93c5fd;
    margin: 12px 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.crawler-offsets, .crawler-sources {
    max-height: 160px;
    overflow-y: auto;
    border-radius: 6px;
    background: var(--surface);
}
.crawler-row {
    font-family: Consolas, monospace;
    font-size: 10px;
    color: var(--text-2);
    padding: 5px 10px;
    border-bottom: 1px solid var(--border);
    word-break: break-all;
}
.crawler-row b { color: #a5b4fc; }

/* ============ ANALYSIS ============ */
.analysis-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 14px;
}
.analysis-drop {
    border: 2px dashed var(--border-2);
    border-radius: var(--radius);
    padding: 32px 20px;
    text-align: center;
    font-size: 13px;
    color: var(--text-2);
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.7;
}
.analysis-drop:hover { border-color: var(--primary); color: #c7d2fe; background: rgba(99,102,241,0.05); }
.analysis-drop.dragover { border-color: var(--accent); background: rgba(168,85,247,0.08); }

.analysis-title {
    font-size: 11px;
    font-weight: 700;
    color: #93c5fd;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 12px 0 6px;
}
.analysis-row {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    padding: 5px 8px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}
.analysis-row .k { color: var(--text-3); }
.analysis-row .v { color: var(--text); font-family: Consolas, monospace; font-weight: 500; }

.entropy-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}
.entropy-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), var(--warn), var(--danger));
    transition: width 0.3s;
}
.hash-list { display: grid; gap: 5px; margin-top: 6px; }
.hash-row {
    display: grid;
    grid-template-columns: 70px 1fr 55px;
    gap: 8px;
    align-items: center;
    font-size: 11px;
    padding: 5px 8px;
    background: var(--surface);
    border-radius: 6px;
}
.hash-row .label { color: #93c5fd; font-weight: 700; }
.hash-row .value { font-family: Consolas, monospace; color: var(--text); word-break: break-all; font-size: 10px; }
.hash-row button {
    background: #1e3a8a;
    color: #bfdbfe;
    border: none;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 10px;
    cursor: pointer;
    font-family: inherit;
}
.hash-row button:hover { background: #1d4ed8; }

.strings-list {
    max-height: 220px;
    overflow: auto;
    font-family: Consolas, monospace;
    font-size: 10px;
    background: #000;
    border-radius: 6px;
    padding: 8px;
    margin-top: 6px;
}
.string-row { padding: 2px 4px; border-bottom: 1px solid #111827; color: var(--text-2); word-break: break-all; }
.string-row.url { color: #6ee7b7; }
.string-row.path { color: #fcd34d; }
.string-row.key { color: #fca5a5; }

/* ============ QA ============ */
.qa-list { display: grid; gap: 10px; margin-top: 10px; }
.qa-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
}
.qa-item.qa-pass { border-left: 3px solid var(--success); }
.qa-item.qa-fail { border-left: 3px solid var(--danger); }
.qa-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.qa-name { font-size: 13px; color: var(--text); font-weight: 700; word-break: break-all; }
.qa-badge {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 700;
    flex-shrink: 0;
}
.qa-badge.ok { background: #065f46; color: #a7f3d0; }
.qa-badge.fail { background: #7f1d1d; color: #fecaca; }
.qa-meta { font-size: 11px; color: var(--text-3); margin-top: 6px; }
.qa-details { font-size: 11px; color: var(--text-2); margin-top: 8px; line-height: 1.6; }
.qa-failures { font-size: 11px; color: #fca5a5; margin-top: 8px; }

.dup-summary {
    background: var(--surface);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 12px;
    color: #fcd34d;
    margin-bottom: 10px;
}
.dup-pre {
    background: #000;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    max-height: 320px;
    overflow: auto;
    font-size: 10px;
    font-family: Consolas, monospace;
    color: var(--text-2);
    line-height: 1.5;
}
.dup-line { background: #7f1d1d; color: #fecaca; display: block; }

/* ============ FINGERPRINT ============ */
.fp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 10px;
}
.fp-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px;
    text-align: center;
    transition: border 0.15s, transform 0.15s;
    cursor: pointer;
}
.fp-item:hover { border-color: var(--primary); transform: translateY(-2px); }
.fp-item canvas {
    width: 64px;
    height: 64px;
    image-rendering: pixelated;
    border-radius: 6px;
}
.fp-name {
    font-size: 10px;
    color: var(--text);
    margin-top: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}
.fp-hash {
    font-size: 9px;
    color: var(--text-3);
    font-family: Consolas, monospace;
    margin-top: 2px;
}

/* ============ CROSS VALIDATE ============ */
.cross-summary {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 14px;
}
.cross-summary.ok { background: #065f46; color: #a7f3d0; }
.cross-summary.fail { background: #7f1d1d; color: #fecaca; }
.cross-title { font-size: 13px; font-weight: 700; }
.cross-meta { font-size: 11px; margin-top: 4px; opacity: 0.9; }
.cross-section { margin-top: 14px; }
.cross-sub {
    font-size: 11px;
    color: #93c5fd;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.cross-list {
    display: grid;
    gap: 5px;
    max-height: 280px;
    overflow-y: auto;
}
.cross-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 6px 10px;
    background: var(--surface);
    border-radius: 6px;
    font-size: 11px;
    color: var(--text);
    border-left: 3px solid var(--border-2);
}
.cross-row.ok { border-left-color: var(--success); }
.cross-row.warn { border-left-color: var(--warn); color: #fcd34d; }
.cross-row.fail { border-left-color: var(--danger); color: #fecaca; }
.cross-badge {
    background: #1e3a8a;
    color: #bfdbfe;
    font-size: 9px;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: auto;
}
.cross-hash {
    font-family: Consolas, monospace;
    font-size: 10px;
    color: var(--text-3);
}

/* ============ EXPORT ============ */
.qr-canvas {
    background: #fff;
    border-radius: 10px;
    margin-top: 12px;
    display: block;
    padding: 10px;
}
.compare-result {
    text-align: center;
    padding: 10px;
    margin-top: 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    background: var(--surface);
    color: var(--text-3);
}
.compare-result.equal { background: #065f46; color: #a7f3d0; }
.compare-result.diff { background: #7f1d1d; color: #fecaca; }

/* ============ EXTENSIONS GROUP ============ */
.ext-group {
    margin-bottom: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
}
.ext-group-title {
    font-size: 11px;
    font-weight: 700;
    color: #93c5fd;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px dashed var(--border);
}
.ext-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 11px;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text);
    cursor: pointer;
    margin: 0;
    font-weight: 500;
    transition: all 0.15s;
    position: relative;
}
.ext-item:hover { border-color: var(--primary); }
.ext-item input[type="checkbox"] {
    position: absolute;
    top: 6px;
    right: 6px;
    accent-color: var(--primary);
    width: 13px;
    height: 13px;
}
.ext-label {
    font-weight: 700;
    color: var(--text);
    font-size: 12px;
}
.ext-desc {
    font-size: 9px;
    color: var(--text-3);
    text-transform: none;
    letter-spacing: 0;
}

/* ============ INSTALL GUIDE ============ */
.install-guide {
    background: #000;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    margin-top: 12px;
    max-height: 420px;
    overflow-y: auto;
    font-family: Consolas, monospace;
    font-size: 11px;
    color: #a7f3d0;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.6;
}

/* ============ SESSION ============ */
.session-info {
    font-size: 12px;
    color: var(--text-2);
    background: var(--surface);
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-family: Consolas, monospace;
    line-height: 1.7;
}
.session-info b { color: #c7d2fe; }

/* ============ TOAST ============ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 340px;
}
.toast {
    background: var(--bg-2);
    border: 1px solid var(--border-2);
    border-left: 4px solid var(--info);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 12px;
    color: var(--text);
    box-shadow: var(--shadow);
    animation: slideIn 0.2s ease-out;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.toast.ok { border-left-color: var(--success); }
.toast.warn { border-left-color: var(--warn); }
.toast.err { border-left-color: var(--danger); }
.toast-icon { font-size: 16px; flex-shrink: 0; }
.toast-body { flex: 1; }
.toast-title { font-weight: 700; margin-bottom: 2px; }
.toast-msg { color: var(--text-2); font-size: 11px; line-height: 1.5; }
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
    .app { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        left: -240px;
        top: 0;
        bottom: 0;
        width: 240px;
        z-index: 1000;
        transition: left 0.25s;
    }
    .sidebar.open { left: 0; }
    .analysis-cols { grid-template-columns: 1fr; }
    .topbar { padding: 0 14px; }
    .view { padding: 14px; }
}

/* Thêm vào cuối styles/main.css */

/* ============ MODAL BREVENT ============ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.15s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.modal-box {
    background: var(--bg-2);
    border: 1px solid var(--border-2);
    border-radius: 14px;
    max-width: 720px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    animation: slideUp 0.2s ease-out;
}
@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, #1e1b4b, #4c1d95);
}
.modal-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}
.modal-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    transition: background 0.15s;
}
.modal-close:hover { background: rgba(255,255,255,0.15); }
.modal-body {
    padding: 18px 20px;
    overflow-y: auto;
    flex: 1;
}
.modal-note {
    background: #1e3a8a;
    border-left: 3px solid #60a5fa;
    color: #bfdbfe;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 12px;
    margin-bottom: 16px;
    line-height: 1.55;
}
.modal-note b { color: #fff; }
.modal-section {
    margin-bottom: 16px;
    padding: 12px;
    background: var(--surface);
    border-radius: 10px;
    border: 1px solid var(--border);
}
.modal-section-title {
    font-size: 11px;
    font-weight: 700;
    color: #93c5fd;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.modal-desc {
    font-size: 11px;
    color: var(--text-2);
    margin-bottom: 8px;
    line-height: 1.55;
}
.modal-cmd {
    display: flex;
    gap: 8px;
    align-items: stretch;
    background: #000;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 10px;
}
.modal-cmd-multi {
    flex-direction: column;
    align-items: stretch;
}
.modal-cmd code,
.modal-cmd pre {
    flex: 1;
    font-family: Consolas, monospace;
    font-size: 11px;
    color: #6ee7b7;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.5;
}
.modal-copy {
    background: #1e3a8a;
    color: #bfdbfe;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
    transition: background 0.15s;
}
.modal-copy:hover { background: #1d4ed8; }
.modal-path {
    display: grid;
    gap: 4px;
}
.modal-path-item {
    background: #000;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 10px;
}
.modal-path-item code {
    font-family: Consolas, monospace;
    font-size: 11px;
    color: #fcd34d;
}
.modal-warning {
    background: #1f1b0a;
    border: 1px solid #78350f;
    border-left: 3px solid #f59e0b;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 11px;
    color: #fcd34d;
    line-height: 1.7;
}
.modal-foot {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}