:root {
  --bg: #07101d;
  --panel: #0d1928;
  --panel-2: #111f31;
  --line: #203047;
  --text: #edf5ff;
  --muted: #8fa2b9;
  --green: #35e0a1;
  --blue: #5aa9ff;
  --amber: #ffbd59;
  --red: #ff6577;
  --shadow: 0 20px 50px rgba(0, 0, 0, .24);
}

* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at 80% 0%, #102642 0, transparent 32%), var(--bg); color: var(--text); font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 245px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 18px; border-right: 1px solid var(--line); background: rgba(7, 16, 29, .88); backdrop-filter: blur(18px); display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 30px; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #052318; background: linear-gradient(135deg, var(--green), #8af5cf); font-weight: 900; font-size: 20px; box-shadow: 0 8px 24px rgba(53, 224, 161, .24); }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 16px; }
.brand span { color: var(--muted); font-size: 11px; }
.nav { display: grid; gap: 7px; }
.nav-item { width: 100%; border: 0; border-radius: 11px; padding: 12px 14px; color: var(--muted); background: transparent; text-align: left; transition: .2s ease; }
.nav-item span { display: inline-grid; width: 24px; font-weight: 800; }
.nav-item:hover, .nav-item.active { color: var(--text); background: #142438; }
.nav-item.active { box-shadow: inset 3px 0 var(--green); }
.connection-card { margin-top: auto; padding: 13px; border: 1px solid var(--line); border-radius: 12px; display: flex; align-items: center; gap: 11px; background: var(--panel); }
.connection-card strong, .connection-card small { display: block; }
.connection-card small { color: var(--muted); }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 5px rgba(255, 189, 89, .1); }
.pulse.online { background: var(--green); box-shadow: 0 0 0 5px rgba(53, 224, 161, .1); }
.pulse.offline { background: var(--red); box-shadow: 0 0 0 5px rgba(255, 101, 119, .1); }
.main { min-width: 0; padding: 0 34px 50px; }
.topbar { min-height: 108px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.topbar h1 { margin: 1px 0 0; font-size: 25px; letter-spacing: -.03em; }
.eyebrow { margin: 0; color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.top-actions { display: flex; gap: 12px; align-items: center; }
.reference-chip { padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); }
.reference-chip strong { color: var(--text); margin-left: 5px; }
.button { border: 1px solid transparent; border-radius: 10px; padding: 10px 15px; font-weight: 750; color: var(--text); background: #18283b; transition: transform .15s ease, background .15s ease, opacity .15s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .45; cursor: wait; transform: none; }
.button.primary { color: #042419; background: var(--green); }
.button.soft { border-color: var(--line); background: #132236; }
.button.danger { background: var(--red); color: #2b080e; }
.button.danger-soft { color: #ff9aa7; border-color: rgba(255, 101, 119, .25); background: rgba(255, 101, 119, .08); }
.card { background: linear-gradient(145deg, rgba(17, 31, 49, .96), rgba(11, 24, 39, .96)); border: 1px solid var(--line); border-radius: 17px; box-shadow: var(--shadow); }
.hero { min-height: 205px; padding: 31px 34px; display: flex; justify-content: space-between; align-items: center; overflow: hidden; position: relative; }
.hero-copy { min-width: 0; }
.hero::after { content: ""; position: absolute; inset: auto -70px -120px auto; width: 310px; height: 310px; border-radius: 50%; background: rgba(53, 224, 161, .08); filter: blur(2px); }
.status-line { display: flex; align-items: center; gap: 9px; text-transform: uppercase; color: var(--green); font-size: 11px; letter-spacing: .1em; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.hero h2 { max-width: 650px; margin: 16px 0 8px; font-size: clamp(23px, 3vw, 38px); line-height: 1.15; letter-spacing: -.035em; }
.hero p { color: var(--muted); margin: 0; }
.progress-orbit { width: 132px; height: 132px; position: relative; z-index: 1; border-radius: 50%; border: 9px solid rgba(53, 224, 161, .12); outline: 2px solid rgba(53, 224, 161, .28); display: grid; place-content: center; text-align: center; }
.progress-orbit strong { font-size: 27px; }
.progress-orbit span { color: var(--muted); font-size: 11px; }
.metrics-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin: 16px 0; }
.metric { padding: 20px; display: flex; gap: 15px; align-items: center; }
.metric-icon { width: 39px; height: 39px; border-radius: 11px; display: grid; place-items: center; font-weight: 900; }
.metric-icon.green { color: var(--green); background: rgba(53, 224, 161, .1); }.metric-icon.blue { color: var(--blue); background: rgba(90, 169, 255, .1); }.metric-icon.amber { color: var(--amber); background: rgba(255, 189, 89, .1); }.metric-icon.red { color: var(--red); background: rgba(255, 101, 119, .1); }
.metric small, .metric strong, .metric em { display: block; }.metric small { color: var(--muted); }.metric strong { font-size: 23px; letter-spacing: -.03em; }.metric em { color: #60758e; font-style: normal; font-size: 10px; }
.proxy-metric strong { font-size: clamp(15px, 1.4vw, 20px); overflow-wrap: anywhere; }
.proxy-refresh { margin-top: 7px; padding: 0; border: 0; color: var(--blue); background: transparent; font-size: 10px; font-weight: 800; }.proxy-refresh:disabled { opacity: .45; cursor: wait; }
.dashboard-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 16px; }
.progress-card, .controls-card, .table-card, .settings-form, .test-card { padding: 24px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.section-heading h3 { margin: 3px 0 0; font-size: 18px; }.section-heading > span { color: var(--muted); }
.progress-track { height: 10px; overflow: hidden; margin: 25px 0; border-radius: 10px; background: #07121f; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #24c98c, #6ff2c3); transition: width .5s ease; }
.stage-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }.stage-grid div { padding-right: 12px; border-right: 1px solid var(--line); }.stage-grid div:last-child { border: 0; }.stage-grid small, .stage-grid strong { display: block; }.stage-grid small { color: var(--muted); }.stage-grid strong { font-size: 19px; }
.control-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }.control-grid .button { min-height: 48px; }
.control-grid .clear-button { grid-column: 1 / -1; }
.control-grid .audit-button { grid-column: 1 / -1; }
.failure-card { margin-top: 16px; padding: 21px 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-color: rgba(255, 101, 119, .38); }.failure-card h3 { margin: 4px 0; }.failure-card p:last-child { color: var(--muted); margin: 0; }.failure-actions { display: flex; gap: 10px; }.danger-text { color: var(--red); }
.block-card { border-color: rgba(255, 184, 77, .35); }.warning-text { color: var(--amber); }
.type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }.type-card { padding: 18px 22px; display: flex; align-items: center; gap: 14px; }.type-card > span { padding: 7px 9px; border-radius: 7px; color: var(--blue); background: rgba(90, 169, 255, .1); font-size: 9px; font-weight: 900; }.type-card small, .type-card strong { display: block; }.type-card small { color: var(--muted); }.type-card strong { font-size: 22px; }
.catalog-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }.catalog-total { padding: 18px 22px; }.catalog-total small, .catalog-total strong { display: block; }.catalog-total small { color: var(--muted); }.catalog-total strong { margin-top: 3px; color: var(--green); font-size: 26px; }
.view { display: none; }.view.active { display: block; animation: appear .2s ease; }@keyframes appear { from { opacity: 0; transform: translateY(4px); } }
.filters { display: flex; flex-wrap: wrap; gap: 9px; }.filters input { min-width: 280px; }.filters input, .filters select, input, select, textarea { color: var(--text); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; outline: none; background: #091522; }.filters input:focus, input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(53, 224, 161, .08); }
.table-wrap { overflow-x: auto; margin-top: 20px; }table { width: 100%; border-collapse: collapse; }th { color: #6f849d; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; text-align: left; }th, td { padding: 13px 11px; border-bottom: 1px solid var(--line); }td { color: #c8d6e7; }td strong { color: var(--text); display: block; }td small { color: var(--muted); }.value { color: var(--green); font-weight: 800; }.detail-button { color: var(--blue); border: 0; background: transparent; font-weight: 700; }.empty { padding: 45px 10px; text-align: center; color: var(--muted); }.load-more { display: block; margin: 18px auto 0; }
.timeline, .log-list { display: grid; margin-top: 20px; }.timeline-item, .log-item { padding: 15px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 145px 1fr; gap: 18px; }.timeline-item time, .log-item time { color: #688099; font-size: 11px; }.timeline-item strong, .log-item strong { display: block; }.timeline-item p, .log-item p { color: var(--muted); margin: 4px 0 0; word-break: break-word; }.log-level { display: inline-block; margin-right: 7px; padding: 2px 6px; border-radius: 5px; color: var(--green); background: rgba(53, 224, 161, .1); font-size: 9px; text-transform: uppercase; }.log-level.error { color: var(--red); background: rgba(255, 101, 119, .1); }.log-level.warning { color: var(--amber); background: rgba(255, 189, 89, .1); }
.settings-grid { display: grid; grid-template-columns: 1fr 350px; gap: 16px; }.settings-side { display: grid; align-content: start; gap: 16px; }.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; margin-top: 20px; }.form-grid label { color: var(--muted); font-size: 12px; }.form-grid .wide { grid-column: 1 / -1; }.form-grid input, .form-grid textarea { display: block; width: 100%; margin-top: 6px; }.form-grid textarea { resize: vertical; min-height: 140px; line-height: 1.45; }.field-help { display: block; margin-top: 6px; color: #6f8096; line-height: 1.4; }.section-divider { height: 1px; background: var(--line); margin: 28px 0; }.save-button { width: 100%; margin-top: 22px; }.switch input { display: none; }.switch span { display: block; width: 46px; height: 25px; border-radius: 20px; background: #27364a; position: relative; transition: .2s; }.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: white; transition: .2s; }.switch input:checked + span { background: var(--green); }.switch input:checked + span::after { transform: translateX(21px); }.test-card h3 { margin: 4px 0 8px; }.test-row { width: 100%; padding: 14px 0; color: var(--text); border: 0; border-bottom: 1px solid var(--line); background: transparent; display: flex; align-items: center; justify-content: space-between; text-align: left; }.test-row:last-child { border: 0; }.test-row strong, .test-row small { display: block; }.test-row small { color: var(--muted); }.test-row em { color: var(--green); font-style: normal; font-size: 12px; }
.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(2, 7, 13, .76); backdrop-filter: blur(7px); }.modal-panel { width: min(850px, 100%); max-height: 84vh; padding: 22px; overflow: auto; border: 1px solid var(--line); border-radius: 17px; background: #0b1726; box-shadow: var(--shadow); }.modal pre { padding: 18px; border-radius: 12px; overflow: auto; color: #bcebd9; background: #06101b; }.icon-button { width: 34px; height: 34px; border: 0; border-radius: 8px; color: var(--text); background: #18283b; font-size: 21px; }
.toast-container { position: fixed; z-index: 40; right: 20px; bottom: 20px; display: grid; gap: 9px; }.toast { max-width: 380px; padding: 13px 16px; border: 1px solid var(--line); border-left: 3px solid var(--green); border-radius: 10px; color: var(--text); background: #101e30; box-shadow: var(--shadow); }.toast.error { border-left-color: var(--red); }
.hidden { display: none !important; }.mobile-menu { display: none; }

@media (max-width: 1100px) { .metrics-grid { grid-template-columns: 1fr 1fr; }.settings-grid { grid-template-columns: 1fr; }.settings-side { grid-template-columns: 1fr 1fr; } }
@media (max-width: 820px) { .shell { display: block; }.sidebar { position: fixed; z-index: 30; width: 245px; transform: translateX(-100%); transition: .25s; }.sidebar.open { transform: translateX(0); }.main { padding: 0 18px 35px; }.mobile-menu { display: block; border: 0; color: var(--text); background: transparent; font-size: 22px; }.topbar { min-height: 90px; }.reference-chip { display: none; }.dashboard-grid { grid-template-columns: 1fr; }.hero { padding: 25px; }.progress-orbit { width: 110px; height: 110px; }.failure-card { align-items: flex-start; flex-direction: column; }.settings-side { grid-template-columns: 1fr; } }
@media (max-width: 580px) { .topbar { gap: 8px; }.topbar > div:nth-child(2) { min-width: 0; flex: 1; }.topbar h1 { font-size: 21px; }.top-actions { flex: 0 0 auto; }.top-actions .button { width: 42px; font-size: 0; padding: 11px 13px; }.top-actions .button::after { content: "▶"; font-size: 14px; }.hero-copy { width: 100%; }.hero h2 { font-size: 22px; overflow-wrap: anywhere; }.hero-progress { display: none; }.metrics-grid, .type-grid, .catalog-summary { grid-template-columns: 1fr; }.stage-grid { grid-template-columns: 1fr 1fr; }.stage-grid div:nth-child(2) { border: 0; }.control-grid, .form-grid { grid-template-columns: 1fr; }.section-heading.wrap { align-items: stretch; flex-direction: column; }.filters { display: grid; }.filters input { min-width: 0; }.timeline-item, .log-item { grid-template-columns: 1fr; gap: 4px; }.failure-actions { width: 100%; flex-direction: column; }.failure-actions .button { width: 100%; } }
