#root { min-height: 100vh; }
.auth-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.locked-screen__card, .card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); }
.locked-screen__card { max-width: 540px; width: 100%; text-align: center; padding: 28px; }
.locked-screen__title { margin: 0 0 8px; font-size: 22px; color: #263244; }
.locked-screen__text { color: var(--muted); margin: 0; font-size: 14px; }
.app-shell { width: 100%; min-height: 100vh; }
.content { max-width: 1080px; margin: 0 auto; padding: 22px 22px 40px; }
.content-tabs { display: flex; border-bottom: 1px solid #d9e4ee; margin: 0 0 22px; gap: 0; }
.content-tabs__btn { border: none; background: transparent; color: #64748b; padding: 0 18px 13px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: 0; font-size: 14px; font-weight: 400; }
.content-tabs__btn:first-child { padding-left: 0; }
.content-tabs__btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 400; }
.dashboard-card { padding: 18px; border-radius: 20px; }
.dashboard-card, .screen, .analytics-grid, .panel { min-width: 0; }
.dashboard-head { display: flex; justify-content: space-between; gap: 18px; align-items: start; margin-bottom: 24px; }
.dashboard-title { margin: 0 0 8px; font-size: 18px; line-height: 1.25; color: #2d3748; }
.dashboard-subtitle { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.filters { display: grid; grid-template-columns: minmax(220px, 1fr) 170px minmax(260px, 1.25fr); gap: 14px; align-items: end; margin-bottom: 18px; padding: 14px; border: 1px solid var(--border); border-radius: 16px; background: linear-gradient(180deg, #fbfdff 0%, #f7fbfd 100%); }
.field { min-width: 0; }
.field-label { display: block; margin: 0 0 7px; font-size: 12px; color: #66758a; font-weight: 700; }
.input { width: 100%; margin: 0; min-height: 39px; padding: 9px 12px; border: 1px solid #d7e2ed; border-radius: 9px; background: var(--surface); color: var(--text); font: inherit; font-size: 14px; }
.input:focus { outline: none; border-color: rgba(36, 125, 139, 0.55); box-shadow: 0 0 0 3px rgba(36, 125, 139, 0.10); }
.select { cursor: pointer; }
.btn { border: none; border-radius: 10px; padding: 10px 16px; min-height: 39px; background: var(--primary); color: #fff; cursor: pointer; font-weight: 700; font-size: 14px; white-space: nowrap; }
.btn:hover { background: var(--primary-hover); }
.btn:disabled { opacity: 0.65; cursor: wait; }
.screen { display: none; }
.screen[aria-hidden="false"] { display: block; }
.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi-card { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 13px 12px 12px; min-height: 94px; box-shadow: 0 10px 24px rgba(39, 79, 96, 0.05); }
.kpi-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: #dce7f1; }
.kpi-card_active::before { background: #247d8b; }
.kpi-card_done::before { background: #43a96a; }
.kpi-card_failed::before { background: #d95b69; }
.kpi-card_active { border-color: rgba(36, 125, 139, 0.22); }
.kpi-card_done { border-color: rgba(34, 197, 94, 0.20); }
.kpi-card_failed { border-color: rgba(239, 68, 68, 0.22); }
.kpi-title { margin: 0 0 8px; color: #5f6f84; font-size: 12px; font-weight: 700; }
.kpi-value { margin: 0; font-size: 25px; line-height: 1.15; font-weight: 800; color: #273548; letter-spacing: -0.03em; }
.kpi-hint { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.3; }
.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.panel { border: 1px solid var(--border); border-radius: 14px; padding: 14px; background: var(--surface-soft); }
.panel_table { background: var(--surface); padding: 0; overflow: hidden; }
.panel-title { margin: 0 0 12px; font-size: 16px; color: #2d3748; }
.panel_table .panel-title { padding: 14px 14px 0; }
.panel-head { margin-bottom: 12px; }
.panel-head .panel-title { margin-bottom: 4px; }
.panel-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.analytics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.chart-panel { min-height: 260px; }
.chart-panel_wide { grid-column: 1 / -1; }
.chart-summary { min-height: 220px; }
.bar-chart { display: grid; gap: 10px; }
.chart-row { display: grid; grid-template-columns: minmax(110px, 0.9fr) minmax(120px, 2fr) auto; gap: 10px; align-items: center; }
.chart-label { color: #344055; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-track { height: 12px; border-radius: 999px; background: #e8eef4; overflow: hidden; }
.chart-fill { height: 100%; min-width: 2px; border-radius: inherit; background: var(--primary); }
.chart-fill_done { background: #43a96a; }
.chart-fill_failed { background: #d95b69; }
.chart-fill_active { background: #247d8b; }
.chart-fill_hidden { background: #94a3b8; }
.chart-value { color: #273548; font-size: 13px; font-weight: 700; min-width: 28px; text-align: right; }
.timeline-chart { display: flex; align-items: flex-end; gap: 8px; height: 230px; padding: 14px 8px 4px; border: 1px solid #dce7f1; border-radius: 14px; background: linear-gradient(180deg, #fbfdff 0%, #f6fafc 100%); overflow-x: auto; }
.timeline-bar-wrap { display: grid; grid-template-rows: 1fr auto; align-items: end; min-width: 36px; height: 100%; gap: 8px; }
.timeline-bar { align-self: end; width: 100%; min-height: 3px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, #2b9aae, #247d8b); }
.timeline-label { color: var(--muted); font-size: 11px; text-align: center; transform: rotate(-35deg); transform-origin: top center; white-space: nowrap; min-height: 32px; }
.quality-chart { display: grid; grid-template-columns: 150px 1fr; gap: 18px; align-items: center; min-height: 132px; }
.quality-ring { --value: 0deg; position: relative; width: 132px; height: 132px; border-radius: 50%; background: conic-gradient(#d95b69 var(--value), #e8eef4 0); display: grid; place-items: center; }
.quality-ring::before { content: ""; width: 92px; height: 92px; border-radius: 50%; background: var(--surface-soft); position: absolute; }
.quality-ring span { position: relative; z-index: 1; font-size: 24px; font-weight: 800; color: #273548; }
.quality-facts { display: grid; gap: 8px; }
.quality-fact { display: flex; justify-content: space-between; gap: 10px; padding: 9px 10px; border: 1px solid #dce7f1; border-radius: 10px; background: var(--surface); color: #344055; font-size: 13px; }
.quality-fact strong { color: var(--primary); }
.breakdown-list { display: grid; gap: 8px; }
.breakdown-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 9px 10px; border: 1px solid #dce7f1; border-radius: 10px; background: var(--surface); }
.breakdown-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #344055; font-size: 13px; }
.breakdown-count { color: var(--primary); font-weight: 800; font-size: 13px; }
.table-wrap { width: 100%; overflow: auto; border-top: 1px solid var(--border); }
.data-table { width: 100%; border-collapse: collapse; min-width: 820px; background: var(--surface); }
.data-table th, .data-table td { padding: 11px 13px; border-bottom: 1px solid #edf2f7; text-align: left; vertical-align: top; font-size: 13px; }
.data-table th { background: #f8fbfd; color: #66758a; font-weight: 700; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover td { background: #f6fbfd; }
.status-badge { display: inline-block; padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.status-badge_active { background: rgba(36, 125, 139, 0.12); color: var(--primary); }
.status-badge_done { background: rgba(34, 197, 94, 0.13); color: var(--success); }
.status-badge_failed { background: rgba(239, 68, 68, 0.14); color: var(--danger); }
.status-badge_hidden { background: var(--surface-disabled); color: var(--muted); }
.status-badge_created, .status-badge_unknown { background: var(--surface-disabled); color: #3d4a5c; }
.muted { color: var(--muted); }
.error-text { max-width: 460px; color: var(--danger); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty-state { padding: 20px; color: var(--muted); text-align: center; font-size: 13px; }
.modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; padding: 20px; z-index: 30; }
.modal[aria-hidden="false"] { display: flex; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.38); }
.modal__panel { position: relative; width: 100%; max-width: 460px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25); padding: 16px; }
.modal__panel_wide { max-width: 780px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.modal__title { margin: 0; font-size: 18px; color: #2d3748; }
.modal-close { border: 1px solid var(--border); background: var(--surface); color: var(--muted); border-radius: 999px; width: 32px; height: 32px; cursor: pointer; }
.detail-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.detail-field { border: 1px solid var(--border); border-radius: 10px; padding: 9px 10px; background: var(--surface-soft); }
.detail-field__label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.detail-field__value { display: block; color: var(--text); font-size: 13px; font-weight: 700; word-break: break-word; }
.tech-title { margin: 12px 0 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.detail-pre { max-height: 54vh; overflow: auto; padding: 12px; border-radius: 10px; background: var(--surface-soft); border: 1px solid var(--border); font-size: 12px; white-space: pre-wrap; word-break: break-word; }

@media (max-width: 980px) {
  .dashboard-head { align-items: stretch; flex-direction: column; }
  .filters { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-grid { grid-template-columns: 1fr; }
  .analytics-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .content { padding: 16px 14px 32px; }
  .content-tabs { overflow-x: auto; }
  .dashboard-card { padding: 16px; }
  .filters { padding: 12px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-title { font-size: 18px; }
  .detail-summary { grid-template-columns: 1fr; }
  .chart-row { grid-template-columns: 1fr; gap: 5px; }
  .chart-value { text-align: left; }
  .quality-chart { grid-template-columns: 1fr; }
  .timeline-chart { gap: 6px; }
  .timeline-bar-wrap { min-width: 28px; }
  .timeline-label { font-size: 10px; }
}

@media (max-width: 360px) {
  .kpi-grid { grid-template-columns: 1fr; }
}
