@font-face {
    font-family: "Manrope";
    src: url("/assets/fonts/Manrope-Variable.ttf") format("truetype");
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: light;
    --bg: #f5f7fb;
    --panel: #fff;
    --ink: #152033;
    --muted: #677389;
    --line: #e2e7f0;
    --blue: #075bff;
    --blue-dark: #0045c7;
    --green: #147a50;
    --red: #bd2d3a;
    font-family: "Manrope", "Segoe UI Variable", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.45; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.top {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    padding: 38px max(24px, calc((100vw - 1440px) / 2));
    background: linear-gradient(120deg, #071d4a, #063da5 58%, #075bff);
    color: #fff;
}

.top h1 { margin: 0; font-size: clamp(28px, 4vw, 46px); font-weight: 760; letter-spacing: -.045em; line-height: 1.08; }
.eyebrow { margin: 0 0 10px; color: #aac8ff; font-size: 11px; font-weight: 760; letter-spacing: .12em; text-transform: uppercase; }
.lead { margin: 12px 0 0; color: #d7e4ff; }
.back { display: inline-block; margin-bottom: 18px; color: #d7e4ff; }
.top nav { display: flex; flex-wrap: wrap; gap: 10px; }
.app-nav { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.app-nav__links, .app-nav__actions { display: flex; align-items: center; gap: 6px; }
.app-nav__links { padding: 4px; border: 1px solid rgba(255,255,255,.18); border-radius: 12px; background: rgba(1,14,48,.24); }
.app-nav__link, .app-nav__refresh, .app-nav__logout { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 7px 10px; border-radius: 8px; color: #dce8ff; font-size: 12px; font-weight: 780; line-height: 1; white-space: nowrap; transition: background .16s ease, color .16s ease, transform .16s ease; }
.app-nav__link:hover, .app-nav__refresh:hover, .app-nav__logout:hover { color: #fff; background: rgba(255,255,255,.14); }
.app-nav__link.is-active { background: #fff; color: #12346f; box-shadow: 0 2px 7px rgba(0,0,0,.16); }
.app-nav__icon { display: grid; width: 15px; place-items: center; font-size: 15px; line-height: 1; }
.app-nav__refresh { border: 1px solid rgba(255,255,255,.24); }
.app-nav__logout { color: #fff; background: rgba(6,11,28,.28); border: 1px solid rgba(255,255,255,.16); }
.product-context-nav { background: #eef3ff; border-bottom: 1px solid #d9e2f3; }
.product-context-nav .container { display: flex; justify-content: flex-end; margin-top: 0; padding-top: 12px; padding-bottom: 12px; }
.product-tabs { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.container { width: min(1440px, calc(100% - 48px)); margin: 28px auto 60px; }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--blue);
    color: #fff;
    font-weight: 720;
    letter-spacing: -.01em;
    cursor: pointer;
}
.button:hover { background: var(--blue-dark); }
.top .button { background: #fff; color: #12346f; }
.top .button.secondary { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25); color: #fff; }
.top .button.ghost { background: transparent; border-color: rgba(255,255,255,.25); color: #fff; }
.button.secondary { background: #fff; border-color: var(--line); color: var(--ink); }
.button.danger { background: #fff; border-color: #efc2c7; color: var(--red); }
.button.compact { min-height: 36px; padding: 7px 12px; border-radius: 8px; }

.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
.metric { padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: 0 8px 30px rgba(25,45,80,.05); }
.metric span { display: block; color: var(--muted); font-size: 13px; }
.metric strong { display: block; margin-top: 5px; font-size: 32px; font-weight: 760; letter-spacing: -.04em; }

.panel { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: 0 8px 30px rgba(25,45,80,.05); }
.panel-head { display: flex; justify-content: space-between; gap: 20px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 21px; font-weight: 740; letter-spacing: -.025em; }
.panel-head p { margin: 6px 0 0; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 18px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); background: #fbfcfe; font-size: 10px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
tbody tr:hover { background: #f8faff; }
tbody tr:last-child td { border-bottom: 0; }
td.title { min-width: 290px; white-space: normal; font-weight: 700; letter-spacing: -.01em; }
td.actions { display: flex; gap: 14px; }
code, .copy-id { color: #173f88; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-weight: 700; }
.copy-id { padding: 4px 7px; border: 1px solid #cfdbef; border-radius: 6px; background: #f4f8ff; cursor: copy; }
.copy-id.copied { border-color: #9ad7bc; background: #effaf5; color: var(--green); }
.text-link { color: #52627e; font-weight: 700; }
.text-link.accent { color: var(--blue); }
.muted { color: var(--muted); }
.badge { display: inline-block; padding: 5px 9px; border-radius: 999px; background: #eef1f6; color: #687389; font-size: 12px; font-weight: 750; }
.badge.active { background: #eaf7f1; color: var(--green); }
.empty { padding: 60px 24px; color: var(--muted); text-align: center; }
.notice { margin-bottom: 18px; padding: 14px 16px; border: 1px solid; border-radius: 12px; }
.notice.success { border-color: #a9dcc6; background: #ecf9f3; color: #126342; }
.notice.error { border-color: #f0bec3; background: #fff0f2; color: #95212d; }

.operation-form { display: flex; align-items: flex-end; gap: 9px; }
.price-field { display: grid; gap: 3px; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.price-field input { width: 112px; height: 36px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 20px; border-top: 1px solid var(--line); }

.rules-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 18px; margin-bottom: 22px; }
.rule-panel { overflow: visible; }
.rule-list { display: grid; gap: 14px; margin: 0; padding: 22px 28px 24px 44px; line-height: 1.55; }
.rule-list li::marker { color: var(--blue); font-weight: 800; }
.timeline-list { display: grid; gap: 0; margin: 0; padding: 8px 24px 20px; list-style: none; }
.timeline-list li { display: grid; grid-template-columns: 74px 1fr; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.timeline-list li:last-child { border-bottom: 0; }
.timeline-list time { color: var(--blue); font-size: 21px; font-weight: 800; }
.timeline-list strong, .timeline-list span { display: block; }
.timeline-list span { margin-top: 4px; color: var(--muted); font-size: 13px; }
.cron-panel { margin-top: 0; }
.cron-notice { margin: 20px; }
.command-cell { max-width: 600px; white-space: normal; overflow-wrap: anywhere; }

.price-monitor { display: grid; gap: 22px; }
.price-monitor-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.price-monitor-head .status { color: var(--muted); font-size: 13px; text-align: right; }
.price-monitor-head .status strong { display: block; color: var(--ink); font-size: 15px; }
.price-chart { padding: 18px 20px 12px; }
.price-chart svg { display: block; width: 100%; min-height: 310px; overflow: visible; }
.price-chart .grid { stroke: #e2e7f0; stroke-width: 1; }
.price-chart .axis-label { fill: #677389; font-size: 12px; }
.price-chart .line-card { fill: none; stroke: #075bff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.price-chart .line-regular { fill: none; stroke: #8757e7; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.price-chart .point-card { fill: #075bff; stroke: #fff; stroke-width: 2; }
.price-chart .point-regular { fill: #8757e7; stroke: #fff; stroke-width: 2; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 18px; padding: 0 22px 22px; color: var(--muted); font-size: 13px; font-weight: 700; }
.chart-legend i { display: inline-block; width: 12px; height: 12px; margin-right: 7px; border-radius: 50%; vertical-align: -1px; }
.chart-legend .card { background: #075bff; }.chart-legend .regular { background: #8757e7; }
.monitor-empty { padding: 52px 24px; color: var(--muted); text-align: center; }
.dashboard-empty { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 260px; padding: 34px; }
.dashboard-empty .eyebrow { color: var(--blue); }.dashboard-empty h2 { margin: 0; font-size: clamp(24px, 3vw, 34px); }.dashboard-empty p:not(.eyebrow) { margin: 10px 0 0; color: var(--muted); max-width: 560px; line-height: 1.55; }

@media (max-width: 800px) {
    .top { align-items: flex-start; flex-direction: column; padding: 28px 20px; }
    .app-nav { width: 100%; }
    .app-nav { align-items: stretch; flex-direction: column; }
    .app-nav__links { width: 100%; overflow-x: auto; }
    .app-nav__actions { justify-content: space-between; }
    .app-nav__link { flex: 1 0 auto; }
    .product-context-nav .container, .product-tabs { justify-content: flex-start; }
    .container { width: min(100% - 24px, 1440px); margin-top: 16px; }
    .summary { grid-template-columns: 1fr; }
    .rules-grid { grid-template-columns: 1fr; }
    .metric { padding: 17px; }
    .panel-head { padding: 18px; }
    .price-monitor-head { align-items: flex-start; flex-direction: column; }
    .price-monitor-head .status { text-align: left; }
    .price-chart { padding: 12px 8px 8px; }
    .price-chart svg { min-height: 250px; }
    .dashboard-empty { align-items: flex-start; flex-direction: column; min-height: 210px; padding: 24px 20px; }
    th, td { padding: 13px; }
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(135deg, #061534, #063a9b);
}
.login-card {
    width: min(460px, 100%);
    padding: 30px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 30px 100px rgba(0,0,0,.3);
}
.login-card h1 { margin: 0; }
.login-card p:not(.eyebrow) { color: var(--muted); line-height: 1.55; }
.login-card .eyebrow { color: var(--blue); }
.login-field { display: grid; gap: 7px; margin: 22px 0 16px; font-weight: 700; }
.login-field input { width: 100%; height: 48px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 10px; }
