:root {
    --bg: #06080a;
    --panel: #101419;
    --panel-2: #151a20;
    --line: #272d34;
    --text: #f6f7f8;
    --muted: #8d959e;
    --yellow: #f4dc00;
    --yellow-2: #ffef2e;
    --green: #40d89b;
    --red: #ff6577;
    --orange: #ffb454;
    --radius: 18px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; min-height: 100vh; color: var(--text); background: radial-gradient(circle at 85% 5%, rgba(244,220,0,.08), transparent 26rem), linear-gradient(180deg, #0a0d10 0, var(--bg) 24rem); font: 15px/1.5 Inter, Arial, sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.shell { width: min(1420px, calc(100% - 48px)); margin: 0 auto; }
.topbar { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid rgba(255,255,255,.08); background: rgba(6,8,10,.92); backdrop-filter: blur(16px); }
.topbar-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 52px; height: 36px; border-radius: 9px; color: #06080a; background: var(--yellow); font-weight: 950; font-size: 20px; letter-spacing: -2px; }
.brand strong { display: block; letter-spacing: .06em; }
.brand small { display: block; color: var(--muted); font-size: 11px; }
.nav { display: flex; align-items: center; gap: 25px; color: #c4c8cd; }
.nav a:hover, .link-button:hover { color: var(--yellow); }
.nav form { margin: 0; }
.link-button { border: 0; padding: 0; color: inherit; background: none; cursor: pointer; }
.main-content { padding: 46px 0 72px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 30px; }
.page-head h1, .detail-main > h1 { margin: 7px 0 7px; font-size: clamp(30px, 4vw, 48px); line-height: 1.05; letter-spacing: -.035em; }
.page-head p { margin: 0; color: var(--muted); }
.eyebrow { color: var(--yellow); font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 0 18px; border: 1px solid transparent; border-radius: 11px; font-weight: 750; cursor: pointer; }
.button-primary { color: #090b0d; background: var(--yellow); }
.button-primary:hover { background: var(--yellow-2); }
.button-secondary { border-color: var(--line); background: var(--panel-2); }
.button-secondary:hover { border-color: #555e68; }
.button-small { min-height: 36px; padding: 0 13px; font-size: 13px; }
.button-wide { width: 100%; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { display: flex; align-items: flex-end; justify-content: space-between; padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: rgba(16,20,25,.82); }
.stat span { color: var(--muted); }
.stat strong { font-size: 28px; }
.stat-accent { border-color: rgba(244,220,0,.45); background: rgba(244,220,0,.08); }
.filters { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(4, minmax(145px, 1fr)) auto auto; align-items: end; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.filters label, .form-stack label { display: grid; gap: 7px; color: #bbc1c7; font-size: 12px; font-weight: 700; }
input, select, textarea, .field-control { width: 100%; min-height: 43px; padding: 10px 12px; border: 1px solid #313943; border-radius: 10px; outline: none; color: var(--text); background: #0b0e12; }
input:focus, select:focus, textarea:focus { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(244,220,0,.08); }
.reset-link { padding: 11px 5px; color: var(--muted); }
.scan-note { margin: 14px 3px 24px; color: var(--muted); font-size: 13px; }
.event-grid { display: grid; gap: 12px; }
.event-card { display: grid; grid-template-columns: 100px 1fr 160px; gap: 22px; align-items: center; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(135deg, rgba(22,27,33,.96), rgba(13,16,20,.96)); transition: transform .15s, border-color .15s; }
.event-card:hover { transform: translateY(-1px); border-color: #404954; }
.event-card-changed { border-color: rgba(255,180,84,.55); }
.event-date { min-height: 90px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-right: 1px solid var(--line); text-transform: uppercase; }
.event-date strong { color: var(--yellow); font-size: 35px; line-height: 1; }
.event-date span { margin-top: 5px; font-weight: 800; font-size: 12px; }
.event-date small { color: var(--muted); font-size: 10px; }
.event-body h2 { margin: 10px 0 7px; font-size: 21px; line-height: 1.25; }
.event-body h2 a:hover { color: var(--yellow); }
.event-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.status, .tag { display: inline-flex; min-height: 24px; align-items: center; padding: 0 9px; border: 1px solid #303841; border-radius: 99px; color: #b8c0c8; background: #14191f; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.status-new { color: #0a0c0d; border-color: var(--yellow); background: var(--yellow); }
.status-interesting, .status-planned { color: var(--green); border-color: rgba(64,216,155,.4); background: rgba(64,216,155,.08); }
.status-rejected, .status-cancelled { color: var(--red); border-color: rgba(255,101,119,.4); background: rgba(255,101,119,.08); }
.tag-warning { color: var(--orange); border-color: rgba(255,180,84,.45); }
.event-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: #a8afb7; font-size: 13px; }
.source-line { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; color: #747d87; font-size: 11px; }
.source-line span + span:before { content: '·'; margin-right: 7px; }
.event-actions { display: grid; justify-items: stretch; gap: 11px; text-align: center; }
.source-link { color: #afb6bd; font-size: 13px; }
.source-link:hover, .link-accent { color: var(--yellow); }
.pagination { display: flex; justify-content: center; gap: 25px; margin-top: 26px; color: var(--muted); }
.pagination a { color: var(--yellow); }
.back-link { display: inline-block; margin-bottom: 24px; color: var(--muted); }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.detail-main, .decision-card { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(16,20,25,.94); }
.detail-main { padding: clamp(24px, 4vw, 44px); }
.decision-card { position: sticky; top: 100px; padding: 24px; }
.decision-card h2, .detail-section h2, .change-box h2 { margin-top: 0; }
.decision-card > p { color: var(--muted); }
.detail-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 30px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--line); }
.detail-facts div { padding: 16px; background: #0d1115; }
.detail-facts small, .origin-row small { display: block; color: var(--muted); }
.detail-facts strong { display: block; margin-top: 4px; }
.event-preview { display: block; width: 100%; max-height: 460px; object-fit: contain; border-radius: 15px; background: #090b0d; }
.detail-section { margin-top: 34px; }
.detail-section p { color: #c0c5cb; }
.change-box { margin-top: 28px; padding: 20px; border: 1px solid rgba(255,180,84,.4); border-radius: 14px; color: #ffd19a; background: rgba(255,180,84,.07); }
.origins { display: grid; gap: 9px; }
.origin-row { display: flex; justify-content: space-between; gap: 20px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #0c1014; }
.origin-row a { color: var(--yellow); }
.form-stack { display: grid; gap: 16px; }
.check-row { grid-template-columns: auto 1fr !important; align-items: center; }
.check-row input { width: 17px; min-height: 17px; }
.seen-info { margin-top: 20px; color: var(--muted); font-size: 12px; }
.source-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.source-card { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.source-card-head, .source-card-head > div, .source-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.source-card h2 { display: inline; margin: 0; font-size: 19px; }
.source-state { width: 8px; height: 8px; border-radius: 50%; background: #5a6168; }
.source-state.source-on { background: var(--green); box-shadow: 0 0 0 5px rgba(64,216,155,.08); }
.source-card > p { color: var(--muted); }
.source-card dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.source-card dl div { padding: 12px; border-radius: 10px; background: #0b0f13; }
.source-card dt { color: var(--muted); font-size: 10px; }
.source-card dd { margin: 3px 0 0; font-weight: 750; }
.source-actions { margin-top: 16px; }
.source-actions > a { color: var(--yellow); }
.source-error { padding: 11px; border-radius: 9px; color: #ffacb6; background: rgba(255,101,119,.08); font-size: 12px; }
.run-log { margin-top: 34px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td { padding: 13px 15px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; }
td small { display: block; color: var(--red); }
.run-status { font-weight: 700; }
.run-success { color: var(--green); }
.run-failed { color: var(--red); }
.login-wrap { min-height: calc(100vh - 170px); display: grid; place-items: center; }
.login-card { width: min(460px, 100%); padding: 36px; border: 1px solid var(--line); border-radius: 22px; background: rgba(16,20,25,.96); box-shadow: 0 30px 100px rgba(0,0,0,.35); }
.login-card h1 { margin-bottom: 5px; }
.login-card > p { margin-top: 0; color: var(--muted); }
.empty-state { grid-column: 1 / -1; padding: 60px 25px; border: 1px dashed #303840; border-radius: var(--radius); text-align: center; color: var(--muted); }
.message { margin-bottom: 14px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); }
.message.success { border-color: rgba(64,216,155,.45); }
.message.warning { border-color: rgba(255,180,84,.45); }
.message.error { border-color: rgba(255,101,119,.45); }

@media (max-width: 1050px) {
    .filters { grid-template-columns: repeat(3, 1fr); }
    .filter-search { grid-column: span 2; }
    .event-card { grid-template-columns: 80px 1fr; }
    .event-actions { grid-column: 2; grid-template-columns: repeat(3, auto); align-items: center; justify-content: start; }
    .detail-layout { grid-template-columns: 1fr; }
    .decision-card { position: static; }
}
@media (max-width: 720px) {
    .shell { width: min(100% - 24px, 1420px); }
    .topbar-inner { min-height: 66px; }
    .nav a:nth-child(3) { display: none; }
    .brand small { display: none; }
    .page-head { align-items: flex-start; flex-direction: column; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .filters { grid-template-columns: 1fr 1fr; }
    .filter-search { grid-column: 1 / -1; }
    .event-card { grid-template-columns: 1fr; gap: 12px; }
    .event-date { min-height: auto; align-items: flex-start; border-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
    .event-date strong, .event-date span, .event-date small { display: inline; }
    .event-actions { grid-column: 1; grid-template-columns: 1fr; }
    .detail-facts { grid-template-columns: 1fr 1fr; }
    .source-grid { grid-template-columns: 1fr; }
    .source-card dl { grid-template-columns: 1fr; }
}
