:root {
  --canvas: #f5f5f7;
  --surface: rgba(255, 255, 255, .88);
  --surface-solid: #fff;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --hairline: rgba(0, 0, 0, .08);
  --blue: #0071e3;
  --blue-soft: #e8f2ff;
  --green: #16884a;
  --amber: #a35b00;
  --red: #c9342f;
  --shadow: 0 14px 36px rgba(0, 0, 0, .07);
  --radius: 22px;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button { cursor: pointer; }
svg { fill: currentColor; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 248px; padding: 30px 18px 22px; display: flex; flex-direction: column; border-right: 1px solid var(--hairline); background: rgba(249, 249, 251, .82); backdrop-filter: blur(24px) saturate(160%); z-index: 4; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 34px; }
.brand-mark, .login-mark { display: grid; place-items: center; color: white; background: linear-gradient(145deg, #1d1d1f, #54545a); box-shadow: inset 0 1px rgba(255,255,255,.35); font-weight: 700; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 17px; letter-spacing: -.02em; }
.brand span { color: var(--muted); font-size: 12px; margin-top: 2px; }
nav { display: grid; gap: 5px; }
.nav-item { appearance: none; border: 0; background: transparent; color: #515154; height: 44px; display: flex; align-items: center; gap: 13px; padding: 0 13px; border-radius: 12px; text-align: left; transition: background .16s ease, color .16s ease; }
.nav-item svg { width: 19px; height: 19px; }
.nav-item:hover { background: rgba(0,0,0,.04); color: var(--ink); }
.nav-item.is-active { background: var(--surface-solid); color: var(--blue); box-shadow: 0 5px 16px rgba(0,0,0,.06); font-weight: 600; }
.sidebar-foot { margin-top: auto; padding: 14px 11px 0; border-top: 1px solid var(--hairline); color: var(--muted); font-size: 12px; display: flex; gap: 8px; align-items: center; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #8e8e93; }
main { grid-column: 2; min-width: 0; padding: 28px 42px 54px; max-width: 1660px; width: 100%; margin: 0 auto; }
.topbar { min-height: 68px; display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 32px; }
.eyebrow { margin: 0 0 7px; color: #8e8e93; font-size: 10px; line-height: 1; font-weight: 700; letter-spacing: .14em; }
h1, h2, h3, p { margin-top: 0; }
.topbar h1 { margin-bottom: 0; font-size: 32px; line-height: 1.08; letter-spacing: -.04em; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.role-pill { padding: 7px 11px; border-radius: 999px; background: var(--surface-solid); border: 1px solid var(--hairline); color: var(--muted); font-size: 12px; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--hairline); background: var(--surface-solid); color: #4d4d52; border-radius: 50%; display: grid; place-items: center; }
.icon-button:hover { color: var(--blue); box-shadow: 0 4px 14px rgba(0,0,0,.06); }
.icon-button svg { width: 17px; }
.view { display: none; animation: reveal .26s ease both; }
.view.is-visible { display: block; }
@keyframes reveal { from { opacity: 0; transform: translateY(5px); } }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.section-heading h2 { margin-bottom: 4px; font-size: 21px; letter-spacing: -.025em; }
.section-heading p, .panel-title p { margin: 0; color: var(--muted); font-size: 13px; }
.heading-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.primary-button, .secondary-button { border-radius: 11px; padding: 10px 16px; border: 0; font-weight: 600; font-size: 13px; }
.primary-button { background: var(--blue); color: white; }
.primary-button:hover { background: #0077ed; }
.secondary-button { background: var(--surface-solid); color: var(--blue); border: 1px solid var(--hairline); }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-card { position: relative; min-height: 150px; padding: 21px 20px 17px; background: var(--surface-solid); border: 1px solid var(--hairline); border-radius: 19px; overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,.035); }
.metric-card::before { content: ""; position: absolute; inset: 20px 20px auto auto; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.metric-card[data-status="unavailable"]::before { background: #c7c7cc; }
.metric-card[data-status="observing"]::before { background: #ff9f0a; }
.metric-label { color: var(--muted); font-size: 12px; font-weight: 600; }
.metric-value { margin: 14px 0 9px; font-size: 30px; line-height: 1; letter-spacing: -.045em; font-weight: 680; }
.metric-unit { margin-left: 4px; color: var(--muted); font-size: 12px; font-weight: 500; }
.metric-note { color: #8e8e93; font-size: 11px; line-height: 1.45; }
.chart-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(320px, .7fr); gap: 14px; margin-top: 14px; }
.panel { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.035); }
.chart-panel { min-height: 340px; padding: 22px 22px 16px; }
.panel-title { display: flex; justify-content: space-between; align-items: flex-start; }
.panel-title h3 { margin-bottom: 4px; font-size: 16px; }
.legend { display: flex; gap: 14px; color: var(--muted); font-size: 11px; }
.legend i { width: 7px; height: 7px; display: inline-block; border-radius: 2px; margin-right: 5px; }
.legend-blue { background: var(--blue); }.legend-gray { background: #c7c7cc; }
.legend-red { background: #ff3b30; }.legend-green { background: #34c759; }
.chart { width: 100%; height: 250px; margin-top: 18px; overflow: visible; }
.donut-layout { min-height: 250px; display: grid; grid-template-columns: 170px 1fr; align-items: center; gap: 14px; }
.donut { width: 165px; height: 165px; }
.region-legend { display: grid; gap: 10px; color: var(--muted); font-size: 12px; }
.region-row { display: grid; grid-template-columns: 9px 1fr auto; gap: 8px; align-items: center; }
.region-color { width: 8px; height: 8px; border-radius: 50%; }
.region-color.color-0 { background: #0071e3; }.region-color.color-1 { background: #34c759; }.region-color.color-2 { background: #ff9f0a; }.region-color.color-3 { background: #af52de; }.region-color.color-4 { background: #5ac8fa; }.region-color.color-5 { background: #ff3b30; }.region-color.color-6 { background: #8e8e93; }
.filter-bar { display: flex; gap: 10px; margin-bottom: 14px; padding: 11px; border-radius: 16px; background: rgba(255,255,255,.64); border: 1px solid var(--hairline); }
.list-filters { flex-wrap: wrap; align-items: stretch; }
.list-filters .search-field { flex: 1 1 230px; min-width: 210px; }
.list-filters .compact-search { flex-basis: 190px; }
.search-field { min-width: 280px; flex: 1; display: flex; align-items: center; gap: 8px; background: white; border: 1px solid var(--hairline); border-radius: 10px; padding: 0 11px; }
.search-field svg { width: 16px; color: #8e8e93; }
.search-field input { width: 100%; border: 0; outline: 0; padding: 10px 0; background: transparent; }
select { min-width: 150px; border: 1px solid var(--hairline); border-radius: 10px; background: white; color: var(--ink); padding: 0 32px 0 12px; }
.date-field { min-height: 40px; display: flex; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid var(--hairline); border-radius: 10px; background: white; color: var(--muted); font-size: 11px; }
.date-field input { min-width: 124px; border: 0; outline: 0; background: transparent; color: var(--ink); }
.clear-filter { display: inline-flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); }
.clear-filter svg { width: 14px; }
.table-panel { overflow: hidden; }
.table-meta { display: flex; justify-content: space-between; padding: 15px 18px 12px; color: var(--muted); font-size: 11px; border-bottom: 1px solid var(--hairline); }
.table-meta-actions { display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.page-size-control { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.page-size-control select { min-width: 66px; min-height: 30px; padding: 0 24px 0 9px; border-radius: 8px; font-size: 11px; }
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 920px; }
th, td { text-align: left; padding: 14px 17px; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
th { color: #86868b; font-size: 11px; font-weight: 600; background: rgba(250,250,252,.84); white-space: nowrap; }
td { font-size: 12px; line-height: 1.45; }
tbody tr:hover { background: rgba(0,113,227,.025); }
tbody tr[data-detail] { cursor: pointer; }
tbody tr[data-detail]:hover { background: rgba(0,113,227,.055); }
.cell-title { display: block; color: var(--ink); font-weight: 600; }
.cell-sub { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.tag { display: inline-flex; padding: 4px 7px; border-radius: 7px; color: #4c4c50; background: #ededf0; font-size: 10px; font-weight: 650; }
.tag.good { color: var(--green); background: #e9f7ef; }.tag.warn { color: var(--amber); background: #fff4df; }.tag.bad { color: var(--red); background: #fff0ef; }
.empty-row td { padding: 56px 20px; text-align: center; color: var(--muted); }
.pagination { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 13px 17px; }
.pagination button { border: 1px solid var(--hairline); background: white; border-radius: 8px; padding: 6px 10px; }
.pagination-status { min-width: 130px; color: var(--muted); font-size: 11px; text-align: center; }
.source-banner { margin-bottom: 13px; padding: 11px 14px; border-radius: 12px; background: #f0f0f2; color: var(--muted); font-size: 12px; }
.source-banner.ready { background: #e9f7ef; color: var(--green); }
.source-banner .tag { margin-right: 9px; }
.cost-heading { margin: 26px 0 10px; }
.cost-heading h3, .cost-import h3 { margin: 0 0 4px; font-size: 16px; }
.cost-heading p, .cost-import p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.cost-total-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.cost-empty-total { max-width: 280px; }
.cost-import { display: grid; grid-template-columns: minmax(250px, 1fr) auto; gap: 18px 26px; align-items: center; margin-bottom: 14px; padding: 18px; }
.cost-import-actions { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.file-picker { position: relative; display: inline-flex; align-items: center; min-width: 180px; max-width: 260px; padding: 9px 12px; overflow: hidden; border: 1px solid var(--hairline); border-radius: 11px; background: white; color: var(--ink); font-size: 12px; cursor: pointer; }
.file-picker span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.cost-import-status { grid-column: 1 / -1; padding-top: 12px; border-top: 1px solid var(--hairline); }
.cost-import-history { margin-top: 14px; }
.support-lookup > input { flex: 1; min-width: 190px; border: 1px solid var(--hairline); border-radius: 10px; background: white; padding: 10px 12px; outline: none; }
.support-result { min-height: 210px; padding: 22px; color: var(--muted); }
.issue-create { align-items: stretch; flex-wrap: wrap; }
.issue-create input { min-width: 220px; flex: 1; border: 1px solid var(--hairline); border-radius: 10px; background: white; color: var(--ink); padding: 10px 12px; outline: none; }
.issue-create input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,113,227,.1); }
.issue-editor { display: grid; gap: 10px; }
.issue-editor select { min-height: 42px; }
.issue-editor textarea { min-height: 96px; resize: vertical; border: 1px solid var(--hairline); border-radius: 12px; background: white; color: var(--ink); padding: 12px; font: inherit; outline: none; }
.issue-editor textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,113,227,.1); }
.detail-grid { display: grid; grid-template-columns: minmax(150px, .35fr) 1fr; margin: 0; }
.detail-grid dt, .detail-grid dd { margin: 0; padding: 11px 4px; border-bottom: 1px solid var(--hairline); overflow-wrap: anywhere; }
.detail-grid dt { color: var(--muted); font-size: 11px; }
.detail-grid dd { color: var(--ink); font-size: 12px; font-weight: 550; }
.quality-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.compact-metric-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.compact-metric { min-height: 126px; padding: 18px; }
.compact-metric > span, .compact-metric > small { display: block; color: var(--muted); font-size: 11px; }
.compact-metric > strong { display: block; margin: 14px 0 9px; font-size: 25px; letter-spacing: -.04em; }
.rate-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.rate-card { min-height: 138px; padding: 16px; }
.rate-card > span, .rate-card > small { display: block; color: var(--muted); font-size: 10px; line-height: 1.45; }
.rate-card > strong { display: block; margin: 12px 0 7px; font-size: 21px; letter-spacing: -.035em; }
.preset-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.preset-card { min-height: 210px; padding: 21px; display: flex; flex-direction: column; }
.preset-card[data-status="unavailable"] { background: rgba(245,245,247,.75); }
.preset-card h3 { margin: 0 0 7px; font-size: 16px; }
.preset-count { display: block; margin: 17px 0 8px; font-size: 30px; line-height: 1; letter-spacing: -.04em; }
.preset-count small { margin-left: 5px; color: var(--muted); font-size: 11px; font-weight: 550; }
.preset-meta, .preset-note { color: var(--muted); font-size: 11px; line-height: 1.55; }
.preset-note { margin: 9px 0 16px; }
.preset-card .secondary-button { align-self: flex-start; margin-top: auto; }
.cancellation-chart-panel { min-height: 330px; margin-bottom: 14px; }
.quality-card { padding: 21px; min-height: 150px; }
.quality-card strong { display: block; margin-top: 18px; font-size: 27px; letter-spacing: -.04em; }
.quality-card span { color: var(--muted); font-size: 12px; }
.checklist { margin-top: 14px; padding: 22px; }.checklist h3 { font-size: 16px; }.checklist ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }.checklist li { padding: 13px 0; border-top: 1px solid var(--hairline); font-size: 13px; }.checklist li span { display: inline-block; width: 32px; color: var(--blue); font-family: ui-monospace, "SFMono-Regular", monospace; }
.alert { margin: -16px 0 18px; padding: 12px 14px; border-radius: 11px; background: #fff0ef; color: var(--red); font-size: 12px; }
.login-layer { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 10%, #fff 0, #f4f5f8 48%, #eceef2 100%); z-index: 10; }
.login-card { width: min(430px, 100%); padding: 38px; border: 1px solid rgba(255,255,255,.8); border-radius: 28px; background: rgba(255,255,255,.78); backdrop-filter: blur(28px); box-shadow: var(--shadow); }
.login-mark { width: 52px; height: 52px; border-radius: 16px; margin-bottom: 28px; font-size: 22px; }
.login-card h1 { margin-bottom: 10px; font-size: 32px; letter-spacing: -.045em; }.login-card > p:not(.eyebrow) { color: var(--muted); font-size: 13px; line-height: 1.55; }
.login-card label { display: grid; gap: 7px; margin-top: 16px; color: var(--muted); font-size: 12px; font-weight: 600; }.login-card label:first-of-type { margin-top: 28px; }.login-card input { border: 1px solid #d5d5da; border-radius: 12px; padding: 13px; outline: none; background: rgba(255,255,255,.9); }.login-card input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,113,227,.12); }.login-button { width: 100%; margin-top: 13px; padding: 13px; }.login-error { display: block; min-height: 18px; margin-top: 10px; color: var(--red); font-size: 11px; }
.detail-dialog { width: min(860px, calc(100vw - 32px)); max-height: min(860px, calc(100vh - 32px)); padding: 0; border: 1px solid rgba(255,255,255,.84); border-radius: 24px; color: var(--ink); background: rgba(250,250,252,.96); box-shadow: 0 30px 90px rgba(0,0,0,.23); overflow: hidden; }
.detail-dialog::backdrop { background: rgba(20,20,24,.24); backdrop-filter: blur(8px); }
.detail-header { position: sticky; top: 0; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 23px 24px 18px; border-bottom: 1px solid var(--hairline); background: rgba(250,250,252,.91); backdrop-filter: blur(22px); }
.detail-header h2 { margin-bottom: 4px; font-size: 22px; letter-spacing: -.03em; }
.detail-header > div > p:last-child { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.detail-header .icon-button { flex: 0 0 auto; font-size: 23px; line-height: 1; }
.detail-content { padding: 20px 24px 28px; overflow: auto; max-height: calc(100vh - 150px); }
.detail-section { margin-top: 20px; padding: 18px; border: 1px solid var(--hairline); border-radius: 17px; background: white; }
.detail-section:first-child { margin-top: 0; }
.detail-section h3 { margin-bottom: 13px; font-size: 15px; }
.detail-section > p { color: var(--muted); font-size: 12px; line-height: 1.6; }
.detail-list { display: grid; gap: 0; }
.detail-row { display: grid; grid-template-columns: minmax(145px,.38fr) 1fr; gap: 14px; padding: 10px 0; border-top: 1px solid var(--hairline); font-size: 12px; }
.detail-row:first-child { border-top: 0; }
.detail-key { color: var(--muted); }
.detail-value { font-weight: 550; overflow-wrap: anywhere; }
.detail-timeline { display: grid; gap: 0; }
.timeline-item { position: relative; display: grid; grid-template-columns: 116px 1fr; gap: 16px; padding: 12px 0 12px 19px; border-left: 2px solid #d9d9df; font-size: 12px; }
.timeline-item::before { content: ""; position: absolute; width: 8px; height: 8px; left: -5px; top: 17px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 4px white; }
.timeline-time { color: var(--muted); font-size: 11px; }
.timeline-title { display: block; font-weight: 650; }
.timeline-note { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.detail-empty { margin: 0; padding: 18px 0; color: var(--muted); text-align: center; font-size: 12px; }
.related-list { display: grid; gap: 8px; }
.record-link { width: 100%; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 12px; border: 0; border-radius: 11px; background: #f5f5f7; color: var(--ink); text-align: left; }
.record-link:hover { background: var(--blue-soft); color: var(--blue); }
.record-link > span { min-width: 0; }
.record-link strong, .record-link small { display: block; overflow-wrap: anywhere; }
.record-link strong { font-size: 12px; }
.record-link small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.record-link svg { width: 16px; flex: 0 0 auto; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(0,113,227,.3); outline-offset: 2px; }
@media (max-width: 1120px) { .metric-grid { grid-template-columns: repeat(2, 1fr); }.chart-grid { grid-template-columns: 1fr; }.compact-chart { min-height: 290px; }.compact-metric-grid, .rate-grid { grid-template-columns: repeat(3, 1fr); }.quality-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .app-shell { grid-template-columns: 1fr; }.sidebar { position: static; width: auto; height: auto; padding: 16px; border-right: 0; border-bottom: 1px solid var(--hairline); }.brand { padding-bottom: 14px; } nav { display: flex; overflow-x: auto; }.nav-item { flex: 0 0 auto; }.sidebar-foot { display: none; } main { grid-column: 1; padding: 22px 16px 40px; }.topbar h1 { font-size: 27px; }.role-pill { display: none; }.metric-grid, .compact-metric-grid, .rate-grid, .preset-grid { grid-template-columns: 1fr; }.chart-grid { grid-template-columns: 1fr; }.donut-layout { grid-template-columns: 150px 1fr; }.filter-bar { flex-wrap: wrap; }.search-field, .list-filters .search-field { min-width: 100%; }.filter-bar select { min-height: 40px; flex: 1; }.date-field { flex: 1 1 100%; justify-content: space-between; }.date-field input { min-width: 0; font-size: 16px; }.list-filters .primary-button, .list-filters .secondary-button { flex: 1; }.table-meta { align-items: flex-start; gap: 10px; }.table-meta-actions { align-items: flex-end; flex-direction: column; gap: 7px; }.section-heading { align-items: flex-start; }.quality-grid { grid-template-columns: 1fr; }.cost-import { grid-template-columns: 1fr; }.cost-import-actions { justify-content: stretch; }.cost-import-actions > * { flex: 1 1 100%; justify-content: center; max-width: none; }.detail-dialog { width: calc(100vw - 18px); max-height: calc(100vh - 18px); }.detail-header, .detail-content { padding-left: 17px; padding-right: 17px; }.detail-row, .timeline-item { grid-template-columns: 1fr; gap: 4px; } }
