:root {
  color-scheme: light;
  --ink: #182438;
  --ink-soft: #566276;
  --muted: #8791a2;
  --line: #e8ebf0;
  --canvas: #f5f7fa;
  --white: #fff;
  --navy: #101c32;
  --navy-light: #1a2a47;
  --blue: #4879e8;
  --blue-soft: #edf3ff;
  --green: #24a47c;
  --green-soft: #eaf7f1;
  --orange: #e89b4a;
  --red: #d86670;
  --radius: 15px;
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  background: var(--canvas);
  color: var(--ink);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--canvas); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 7px; color: #8490a4; font-size: 10px; font-weight: 700; letter-spacing: .16em; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: radial-gradient(ellipse at 16% 12%, rgba(70, 111, 189, .2), transparent 34%), linear-gradient(140deg, #101c32 0%, #172541 58%, #1d3153 100%); }
.login-card { width: min(100%, 440px); padding: 42px 44px 34px; background: #fff; border-radius: 21px; box-shadow: 0 24px 80px rgba(4, 12, 27, .3); }
.brand-mark { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: linear-gradient(145deg, #4879e8, #294f9f); color: #fff; font: 800 27px/1 Manrope, sans-serif; box-shadow: 0 9px 20px rgba(72, 121, 232, .24); }
.login-card .brand-mark { margin-bottom: 26px; }
.login-card .eyebrow { color: #5877b8; }
.login-card h1 { margin: 0; font: 750 27px/1.2 Manrope, sans-serif; letter-spacing: -.04em; }
.login-copy { margin: 12px 0 29px; font-size: 14px; line-height: 1.65; }
#login-form { display: grid; gap: 9px; }
#login-form label, .field label { margin-top: 5px; color: #596579; font-size: 11px; font-weight: 700; }
#login-form input, .field input, .field select { width: 100%; height: 43px; padding: 0 12px; border: 1px solid #dfe4ec; border-radius: 8px; color: #26354d; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
#login-form input:focus, .field input:focus, .field select:focus { border-color: #7295ea; box-shadow: 0 0 0 3px rgba(72, 121, 232, .12); }
.login-button { margin-top: 14px; width: 100%; justify-content: center; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 41px; padding: 0 16px; border: 1px solid transparent; border-radius: 8px; font-size: 12px; font-weight: 700; transition: transform .15s, background .15s, box-shadow .15s; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: #3e6fd9; box-shadow: 0 5px 12px rgba(58, 101, 204, .15); }
.button-primary:hover { background: #315fc4; box-shadow: 0 7px 16px rgba(58, 101, 204, .24); }
.button-primary:disabled { opacity: .62; cursor: wait; transform: none; }
.button-quiet { color: #657187; background: #f6f7f9; border-color: #eaedf2; }
.button-quiet:hover { background: #edf0f5; }
.button-outline { border-color: #dfe4ec; color: #53617a; background: #fff; }
.button-outline:hover { border-color: #b7c7ed; color: #315fc4; background: #f9fbff; }
.button-outline:disabled { opacity: .55; cursor: wait; transform: none; }
.login-note { margin: 21px 0 0; color: #9099a8; font-size: 10px; line-height: 1.5; text-align: center; }

.app-layout { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 5; display: flex; flex-direction: column; width: 226px; padding: 26px 16px 17px; color: #c7d0df; background: var(--navy); }
.brand-lockup { display: flex; align-items: center; gap: 11px; padding: 0 9px 38px; color: #f5f7fb; }
.brand-lockup strong, .brand-lockup span { display: block; font-family: Manrope, sans-serif; }
.brand-lockup strong { font-size: 13px; letter-spacing: .1em; }
.brand-lockup span { margin-top: 2px; color: #8191ad; font-size: 9px; font-weight: 700; letter-spacing: .19em; }
.brand-mark-small { width: 36px; height: 36px; border-radius: 11px; font-size: 21px; }
.sidebar-label { padding: 0 11px 10px; color: #687a99; font-size: 9px; font-weight: 700; letter-spacing: .16em; }
.nav-item { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 42px; padding: 0 11px; border: 0; border-radius: 8px; color: #c5cede; background: transparent; text-align: left; font-size: 12px; }
.nav-item.active { color: #fff; background: #243858; box-shadow: inset 3px 0 #6390f2; }
.nav-icon { width: 18px; color: #83a5f5; font-size: 16px; text-align: center; }
.sidebar-bottom { margin-top: auto; }
.connection-state { display: flex; align-items: center; gap: 8px; padding: 12px 8px 17px; border-bottom: 1px solid rgba(218, 228, 244, .1); color: #91a0b9; font-size: 9px; }
.status-dot, .live-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: #45c59a; box-shadow: 0 0 0 3px rgba(69, 197, 154, .12); }
.logout-button { display: flex; justify-content: space-between; width: 100%; padding: 14px 8px 2px; border: 0; color: #aebbd0; background: transparent; font-size: 11px; text-align: left; }
.logout-button:hover { color: #fff; }

.main-content { min-height: 100vh; margin-left: 226px; padding: 29px 36px 18px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin: 0 auto 23px; max-width: 1440px; }
.topbar h1 { margin: 0; font: 750 25px/1.2 Manrope, sans-serif; letter-spacing: -.04em; }
.topbar-meta { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border: 1px solid #e5e9ef; border-radius: 20px; color: #69758a; background: #fff; font-size: 10px; }
.live-dot { width: 6px; height: 6px; }

.filter-panel, .panel { border: 1px solid #eaedf2; border-radius: var(--radius); background: #fff; box-shadow: 0 3px 12px rgba(25, 39, 62, .025); }
.filter-panel { max-width: 1440px; margin: 0 auto 21px; padding: 20px 22px 16px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; }
.filter-heading { margin-bottom: 17px; }
.section-heading h2, .report-title-row h2 { margin: 0; font: 700 15px/1.3 Manrope, sans-serif; letter-spacing: -.02em; }
.section-heading p { margin: 4px 0 0; color: #8993a3; font-size: 10px; }
.text-button { padding: 2px 0; border: 0; color: #63718a; background: transparent; font-size: 10px; font-weight: 600; }
.text-button:hover { color: #315fc4; }
.filter-grid { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 11px 13px; }
.filter-grid-primary { grid-template-columns: repeat(4, minmax(150px, 1fr)); margin-top: 10px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field label { overflow: hidden; margin: 0; color: #6d788a; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.field-hint { color: #8a95a5; font-size: 9px; line-height: 1.35; }
.field input, .field select { height: 37px; padding: 0 10px; border-color: #e3e7ee; border-radius: 7px; color: #38465b; font-size: 11px; }
.smart-select { position: relative; min-width: 0; }
.smart-select-input { padding-right: 34px !important; cursor: text; }
.smart-select-input::placeholder { color: #a4adba; }
.smart-select-toggle { position: absolute; top: 1px; right: 2px; display: grid; place-items: center; width: 32px; height: 34px; border: 0; border-radius: 6px; color: #7d899c; background: transparent; font-size: 16px; }
.smart-select-toggle:hover { color: #3d68c5; background: #f2f5fb; }
.smart-select-menu { position: absolute; z-index: 20; top: calc(100% + 5px); right: 0; left: 0; max-height: 265px; overflow-y: auto; overscroll-behavior: contain; padding: 4px; border: 1px solid #e1e6ef; border-radius: 9px; background: #fff; box-shadow: 0 13px 32px rgba(24, 38, 61, .15); }
.smart-select-info { position: sticky; top: -4px; z-index: 1; padding: 7px 8px; border-bottom: 1px solid #f0f2f5; color: #929cab; background: #fff; font-size: 9px; }
.smart-select-option { display: block; width: 100%; overflow: hidden; padding: 8px 9px; border: 0; border-radius: 6px; color: #536178; background: #fff; font-size: 10px; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.smart-select-option:hover, .smart-select-option.is-active { color: #315fc4; background: #f0f4fc; }
.smart-select-option[aria-selected="true"] { color: #315fc4; font-weight: 700; background: #edf3ff; }
.smart-select-empty { padding: 16px 9px; color: #929cab; font-size: 10px; text-align: center; }
.advanced-filters { margin-top: 15px; border-top: 1px solid #eff1f5; }
.advanced-filters summary { display: flex; align-items: center; gap: 9px; padding: 13px 0 3px; color: #50617b; cursor: pointer; list-style: none; font-size: 10px; font-weight: 700; }
.advanced-filters summary::-webkit-details-marker { display: none; }
.advanced-filters summary::after { content: '+'; margin-left: auto; color: #8290a5; font-size: 16px; font-weight: 400; }
.advanced-filters[open] summary::after { content: '−'; }
.advanced-hint { color: #9aa3b1; font-size: 9px; font-weight: 400; }
#advanced-filter-fields { padding: 13px 0 1px; }
.filter-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; margin-top: 16px; padding-top: 13px; border-top: 1px solid #f0f2f5; }
.filter-actions .button { min-height: 36px; font-size: 10px; }
.duration-option { display: flex; align-items: center; gap: 9px; margin-right: auto; color: #40506a; cursor: pointer; }
.duration-option input { width: 15px; height: 15px; accent-color: #4776dd; }
.duration-option span { display: grid; gap: 3px; }
.duration-option strong { font-size: 10px; font-weight: 700; }
.duration-option small { color: #919aa9; font-size: 9px; }

.report-area { max-width: 1440px; margin: auto; }
.empty-state { display: grid; justify-items: center; min-height: 260px; align-content: center; padding: 28px; border: 1px dashed #dce2eb; border-radius: var(--radius); background: rgba(255, 255, 255, .62); text-align: center; }
.empty-icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 13px; border-radius: 13px; color: #567cda; background: #eaf0ff; font-size: 23px; }
.empty-state h2 { margin: 0; font: 700 15px Manrope, sans-serif; }
.empty-state p { max-width: 425px; margin: 8px 0 0; color: #8b95a4; font-size: 11px; line-height: 1.6; }
.progress-panel { margin: 0 0 18px; padding: 19px 21px; border: 1px solid #e5eaf2; border-radius: var(--radius); background: #fff; }
.progress-top, .progress-top > div { display: flex; align-items: center; }
.progress-top { justify-content: space-between; gap: 15px; }
.progress-top > div { gap: 10px; color: #40506a; font-size: 11px; }
.progress-top > span { color: #8090a6; font-size: 10px; }
.progress-track { height: 5px; overflow: hidden; margin-top: 15px; border-radius: 8px; background: #edf0f5; }
.progress-track > div { width: 3%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4273dc, #6b93ea); transition: width .25s ease; }
.progress-panel p { margin: 8px 0 0; color: #919aa9; font-size: 10px; }
.spinner { width: 15px; height: 15px; border: 2px solid #dce5f8; border-top-color: #4776dd; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.notice { padding: 12px 14px; border-radius: 8px; font-size: 11px; line-height: 1.5; }
.notice-error { margin-bottom: 16px; border: 1px solid #f0c8cb; color: #9b424c; background: #fff4f4; }
.report-title-row { display: flex; align-items: center; justify-content: space-between; margin: 24px 0 14px; }
.report-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.report-title-row h2 { font-size: 19px; }
.report-title-row .muted { margin: 5px 0 0; font-size: 10px; }
.report-title-row .button { min-height: 35px; font-size: 10px; }
.metrics-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.duration-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 12px; }
.duration-metrics .metric-value { font-size: 22px; letter-spacing: -.035em; }
.metric-card { position: relative; min-height: 110px; padding: 16px 17px 13px; overflow: hidden; border: 1px solid #e9edf2; border-radius: 12px; background: #fff; box-shadow: 0 3px 10px rgba(25, 39, 62, .025); }
.metric-primary { border-color: #dce7ff; background: linear-gradient(135deg, #f2f6ff, #fff 77%); }
.metric-label { display: flex; align-items: center; justify-content: space-between; color: #707d91; font-size: 10px; font-weight: 600; }
.metric-symbol { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; color: #517be0; background: #e8efff; font-size: 14px; }
.symbol-blue { color: #5181df; background: #edf3ff; }
.symbol-orange { color: #da9145; background: #fff4e6; }
.symbol-green { color: #259c76; background: #e8f7f0; }
.symbol-red { color: #c65d68; background: #fff0f1; }
.metric-value { margin-top: 8px; color: #1d2b42; font: 750 25px/1 Manrope, sans-serif; letter-spacing: -.05em; }
.metric-note { margin-top: 8px; color: #9aa3b1; font-size: 9px; }
.quality-note { margin-top: 11px; padding: 9px 12px; border: 1px solid #f2e3c5; border-radius: 8px; color: #87632e; background: #fffaf0; font-size: 10px; line-height: 1.5; }
.charts-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 13px; margin-top: 13px; }
.lower-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); }
.panel { min-width: 0; padding: 17px 18px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.panel-heading h3 { margin: 0; color: #27364d; font: 700 12px Manrope, sans-serif; }
.panel-heading p { margin: 4px 0 0; color: #969eac; font-size: 9px; }
.panel-icon { display: grid; place-items: center; width: 27px; height: 27px; flex: none; border-radius: 8px; color: #6384cf; background: #eff3fb; font-size: 14px; }
.bar-chart { display: grid; gap: 11px; margin-top: 19px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 1.1fr) minmax(70px, 2fr) 37px; align-items: center; gap: 10px; }
.bar-name { overflow: hidden; color: #657187; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 7px; overflow: hidden; border-radius: 9px; background: #f0f2f6; }
.bar-fill { height: 100%; min-width: 2px; border-radius: inherit; background: linear-gradient(90deg, #4d78d5, #7899e2); }
.bar-fill.purpose-fill { background: linear-gradient(90deg, #39a887, #77c6aa); }
.bar-value { color: #48566d; font: 700 10px Manrope, sans-serif; text-align: right; }
.chart-empty { padding: 23px 6px; color: #a0a8b5; font-size: 10px; text-align: center; }
.daily-chart { display: flex; align-items: end; height: 136px; gap: 5px; margin-top: 19px; padding: 3px 0 19px; border-bottom: 1px solid #eef0f4; }
.day-column { position: relative; display: flex; align-items: end; justify-content: center; flex: 1; min-width: 5px; height: 100%; }
.day-bar { width: min(100%, 16px); min-height: 3px; border-radius: 4px 4px 1px 1px; background: linear-gradient(180deg, #77a0ef, #4776dc); }
.day-label { position: absolute; top: calc(100% + 6px); color: #98a1af; font-size: 8px; white-space: nowrap; }
.status-list { display: grid; gap: 12px; margin-top: 19px; }
.status-row { display: flex; align-items: center; justify-content: space-between; color: #657187; font-size: 10px; }
.status-name { display: inline-flex; align-items: center; gap: 8px; }
.status-key { width: 7px; height: 7px; border-radius: 50%; background: #6c8fe2; }
.status-row:nth-child(2) .status-key { background: #37a984; }
.status-row:nth-child(3) .status-key { background: #e5a35e; }
.status-row:nth-child(4) .status-key { background: #d86670; }
.status-row:nth-child(5) .status-key { background: #9a87d0; }
.status-value { color: #40506a; font: 700 10px Manrope, sans-serif; }
.table-panel { margin-top: 13px; padding-bottom: 3px; }
.table-heading { align-items: center; }
.table-count { color: #8390a2; font-size: 9px; }
.table-wrap { width: 100%; overflow: auto; margin-top: 14px; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { padding: 9px 10px; color: #9aa3b1; font-size: 8px; font-weight: 700; text-align: left; text-transform: uppercase; letter-spacing: .07em; }
td { padding: 11px 10px; border-top: 1px solid #f0f2f5; color: #657187; font-size: 10px; }
td:first-child { color: #34445c; font-weight: 700; }
td:nth-child(2) { color: #3c5fa8; font-weight: 700; }
.type-pill { display: inline-block; max-width: 290px; overflow: hidden; padding: 4px 7px; border-radius: 5px; color: #54806e; background: #eef8f3; font-size: 8px; text-overflow: ellipsis; vertical-align: middle; }
.type-breakdown { min-width: 260px; max-width: 440px; color: #68758a; line-height: 1.7; white-space: normal; }
.data-footnote { margin: 10px 2px 0; color: #9aa3b0; font-size: 9px; line-height: 1.5; }
.page-footer { display: flex; justify-content: space-between; max-width: 1440px; margin: 17px auto 0; padding: 12px 0 3px; border-top: 1px solid #e9edf1; color: #a1a9b5; font-size: 8px; }
.toast { position: fixed; right: 22px; bottom: 20px; z-index: 10; max-width: min(420px, calc(100vw - 44px)); padding: 11px 15px; border: 1px solid #dce4f2; border-radius: 9px; color: #40536e; background: #fff; box-shadow: 0 12px 35px rgba(21, 36, 60, .14); font-size: 10px; }

@media (max-width: 1100px) {
  .main-content { padding: 24px 23px 16px; }
  .sidebar { width: 202px; }
  .main-content { margin-left: 202px; }
  .metrics-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filter-grid { grid-template-columns: repeat(3, minmax(135px, 1fr)); }
}
@media (max-width: 760px) {
  .sidebar { position: static; width: 100%; height: auto; min-height: 58px; flex-direction: row; align-items: center; padding: 10px 15px; }
  .brand-lockup { padding: 0; }
  .brand-lockup span, .sidebar-label, .nav-item, .connection-state { display: none; }
  .sidebar-bottom { margin: 0 0 0 auto; }
  .logout-button { width: auto; padding: 8px 4px; font-size: 10px; }
  .main-content { margin-left: 0; padding: 20px 14px 14px; }
  .topbar { align-items: flex-start; gap: 10px; }
  .topbar h1 { font-size: 21px; }
  .topbar-meta { max-width: 140px; padding: 7px 9px; font-size: 8px; }
  .filter-panel { padding: 17px 14px 13px; }
  .filter-grid, .filter-grid-primary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .charts-grid, .lower-grid { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card { min-height: 101px; padding: 13px; }
  .metric-primary { grid-column: span 2; }
  .report-title-row { align-items: flex-start; gap: 12px; }
  .report-title-row h2 { font-size: 17px; }
  .report-title-row .button { min-height: 32px; padding: 0 9px; font-size: 8px; }
  .report-actions { max-width: 60%; }
  .panel { padding: 15px 13px; }
  .bar-row { grid-template-columns: minmax(85px, 1.1fr) minmax(50px, 2fr) 30px; gap: 7px; }
  .bar-name { font-size: 8px; }
  .page-footer { gap: 10px; font-size: 7px; }
}
@media (max-width: 410px) {
  .login-card { padding: 34px 24px 28px; }
  .filter-grid, .filter-grid-primary { grid-template-columns: 1fr; }
  .filter-actions { justify-content: stretch; flex-wrap: wrap; }
  .duration-option { flex-basis: 100%; margin: 0 0 4px; }
  .filter-actions .button { flex: 1; padding: 0 9px; }
  .topbar-meta { display: none; }
  .daily-chart { gap: 2px; }
  .day-label { font-size: 7px; }
}
