:root {
    --bg: #0b0d0f;
    --panel: rgba(255,255,255,0.06);
    --card: rgba(255,255,255,0.08);
    --accent: #75c9ff;
    --text: #e6ecf2;
    --muted: #9ba4ae;
    --green: #3fd28b;
    --yellow: #f3b342;
    --orange: #ff8a4c;
    --red: #f76b6b;
}

* { box-sizing: border-box; }
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: radial-gradient(circle at 20% 20%, rgba(117,201,255,0.15), transparent 25%),
                radial-gradient(circle at 80% 0%, rgba(247,107,107,0.12), transparent 20%),
                var(--bg);
    color: var(--text);
    margin: 0;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 26px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand { font-weight: 700; letter-spacing: 0.5px; }
.top-actions { display: flex; gap: 12px; align-items: center; }
.top-nav { display: flex; gap: 8px; }
.top-nav a { color: var(--text); font-size: 0.9rem; padding: 8px 10px; border-radius: 10px; background: var(--panel); }
.user-chip { padding: 8px 12px; background: var(--panel); border-radius: 12px; color: var(--muted); }

.page { padding: 24px 28px 36px; max-width: 1680px; margin: 0 auto; }

.center-card { display: flex; justify-content: center; align-items: center; min-height: 70vh; }
.glass-card { background: var(--panel); padding: 32px; border-radius: 18px; box-shadow: 0 10px 40px rgba(0,0,0,0.45); width: 420px; }
.title { margin-top: 0; margin-bottom: 12px; }

.form { display: flex; flex-direction: column; gap: 10px; }
.form.inline { flex-direction: row; align-items: center; }
.form label { color: var(--muted); font-size: 0.9rem; }
.form input, .form select { padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.03); color: var(--text); }

.button { padding: 10px 14px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.15); background: var(--card); color: var(--text); cursor: pointer; transition: transform 0.1s ease; }
.button.primary { background: linear-gradient(120deg, #7cd4ff, #4da1ff); color: #0b0d0f; font-weight: 700; }
.button.ghost { background: transparent; }
.button:hover { transform: translateY(-1px); }

.alert { background: rgba(247,107,107,0.15); border: 1px solid rgba(247,107,107,0.4); padding: 10px 12px; border-radius: 12px; color: #ffc2c2; }
.success { background: rgba(63,210,139,0.16); border: 1px solid rgba(63,210,139,0.4); padding: 10px 12px; border-radius: 12px; color: #d2ffe8; }
.helper { color: var(--muted); font-size: 0.9rem; }

.grid.two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.panel { background: var(--panel); padding: 18px; border-radius: 16px; box-shadow: inset 0 1px 0 rgba(255,255,255,0.06); }

.results { margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.result { padding: 12px; border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; display: flex; justify-content: space-between; gap: 12px; background: var(--card); }
.result form { width: 260px; }

.dossier-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.dossier-card { background: var(--card); padding: 14px; border-radius: 14px; border: 1px solid rgba(255,255,255,0.08); display: block; position: relative; }
.status { text-transform: uppercase; letter-spacing: 0.5px; font-size: 0.8rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(117,201,255,0.7); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(117,201,255,0.6); } 70% { box-shadow: 0 0 0 12px rgba(117,201,255,0); } 100% { box-shadow: 0 0 0 0 rgba(117,201,255,0); } }
.meta { color: var(--muted); font-size: 0.9rem; }
.score { color: var(--text); }

.breadcrumb { color: var(--muted); margin-bottom: 12px; display: inline-block; }
.header-row { display: flex; justify-content: space-between; align-items: center; }
.badge { padding: 8px 12px; border-radius: 12px; text-transform: uppercase; font-size: 0.85rem; }
.badge.pending, .badge.analyzing { background: rgba(117,201,255,0.2); color: #bde8ff; }
.badge.completed { background: rgba(63,210,139,0.2); color: #c6f5de; }
.badge.failed { background: rgba(247,107,107,0.2); color: #ffd1d1; }
.header-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.header-actions form { margin: 0; }
.button.danger { background: linear-gradient(120deg, #ff9a9e, #f76b6b); color: #0b0d0f; font-weight: 700; }
.score-large { font-size: 2rem; font-weight: 700; margin: 10px 0; }

.block { border-radius: 12px; padding: 12px; margin-bottom: 12px; border: 1px solid rgba(255,255,255,0.08); }
.block .block-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.block.clean { border-color: rgba(63,210,139,0.4); }
.block.yellow { border-color: rgba(243,179,66,0.6); background: rgba(243,179,66,0.08); }
.block.orange { border-color: rgba(255,138,76,0.6); background: rgba(255,138,76,0.08); }
.block.red { border-color: rgba(247,107,107,0.7); background: rgba(247,107,107,0.1); }
.block .notes { color: var(--muted); font-size: 0.9rem; }

.inline-block { display: flex; flex-direction: column; gap: 6px; border-bottom: 1px dashed rgba(255,255,255,0.12); padding: 8px 0; }
.inline-block:last-child { border-bottom: 0; }
.inline-block.clean .block-label { color: var(--green); }
.inline-block.yellow .block-label { color: var(--yellow); }
.inline-block.orange .block-label { color: var(--orange); }
.inline-block.red .block-label { color: var(--red); }

.truth-highlight { text-decoration: underline; text-decoration-thickness: 0.16em; text-decoration-style: solid; }
.truth-highlight.red { text-decoration-color: var(--red); }
.truth-highlight.orange { text-decoration-color: var(--orange); }
.truth-highlight.yellow { text-decoration-color: var(--yellow); }
.truth-highlight[data-reason] { position: relative; cursor: help; }
.truth-highlight[data-reason]::after {
    content: attr(data-reason);
    position: absolute;
    left: 0;
    bottom: 120%;
    width: max-content;
    max-width: 420px;
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 0.85rem;
    line-height: 1.3;
    box-shadow: 0 10px 24px rgba(0,0,0,0.35);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.12s ease, transform 0.12s ease;
    pointer-events: none;
    z-index: 2;
}
.truth-highlight[data-reason]:hover::after {
    opacity: 1;
    transform: translateY(0);
}

.timeline { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.timeline-date { color: var(--muted); font-size: 0.85rem; }
.timeline-body { background: var(--card); padding: 10px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.08); }

@media (max-width: 900px) {
    .grid.two { grid-template-columns: 1fr; }
    .form.inline { flex-direction: column; align-items: stretch; }
}


.workspace-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
.workspace-menu { position: sticky; top: 90px; }
.menu-eyebrow { text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); font-size: 0.78rem; margin: 0 0 4px; }
.menu-nav { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 18px; }
.menu-nav a { color: var(--text); background: var(--card); border: 1px solid rgba(255,255,255,0.08); border-radius: 10px; padding: 10px 12px; display: flex; gap: 8px; align-items: center; }
.menu-nav a:hover { border-color: rgba(117,201,255,0.6); }
.workspace-content { display: grid; gap: 18px; }
.section-panel { padding: 22px; }
.section-heading h2 { margin-top: 0; margin-bottom: 12px; }
.search-row input { flex: 1; }
.split-form { max-width: 720px; }
.admin-row input { min-width: 180px; }

.line-list { display: flex; flex-direction: column; gap: 8px; }
.line-item { display: grid; grid-template-columns: 120px minmax(0,1fr) 1fr auto; gap: 10px; padding: 10px 12px; border: 1px solid rgba(255,255,255,0.08); background: var(--card); border-radius: 10px; align-items: center; }
.line-title { font-weight: 700; color: var(--text); }

.captcha-image { width: 100%; border-radius: 10px; border: 1px solid rgba(255,255,255,0.12); }
.admin-user-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }

@media (max-width: 1150px) {
    .workspace-layout { grid-template-columns: 1fr; }
    .workspace-menu { position: static; }
}

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