:root {
  color-scheme: light;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: #1c2c43;
  background: #f4f7fb;
  --nav: #142846;
  --nav-ink: #baccdf;
  --panel: #fff;
  --ink: #1c2c43;
  --muted: #5c6c82;
  --line: #dce5ef;
  --blue: #1554b0;
  --light-blue: #e9f2ff;
  --green: #13674f;
  --radius: 13px;
  --shadow: 0 2px 4px #27384d08;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button, a, select, input[type='checkbox'], label.file-drop, label.photo-picker { -webkit-tap-highlight-color: #183f731a; }
button, a, select { touch-action: manipulation; }
button:disabled, select:disabled { opacity: .57; cursor: default; }
button:not(:disabled), label.file-drop, label.photo-picker { cursor: pointer; }
a { color: var(--blue); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid #5e92e1; outline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
svg.icon { width: 20px; height: 20px; flex: 0 0 auto; vertical-align: -4px; }
.splash { display: grid; place-items: center; min-height: 75vh; color: var(--muted); padding: 24px; }
.layout { min-height: 100vh; display: grid; grid-template-columns: 233px minmax(0, 1fr); }
.sidebar { display: flex; flex-direction: column; height: 100dvh; position: sticky; top: 0; padding: 27px 15px 15px; color: #fff; background: var(--nav); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.brand-icon { background: #2c66be; border: 1px solid #6492d3; color: #fff; border-radius: 10px; width: 39px; height: 39px; display: grid; place-items: center; flex: 0 0 39px; }
.brand-icon .icon { width: 22px; height: 22px; }
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: .005em; line-height: 1.25; }
.brand-caption { margin-top: 4px; font-size: 12px; color: var(--nav-ink); line-height: 1.25; }
.navigation { margin-top: 39px; display: grid; gap: 6px; }
.nav-button { display: flex; align-items: center; gap: 11px; width: 100%; border: 0; border-radius: 8px; padding: 11px 13px; background: transparent; color: var(--nav-ink); font-weight: 600; font-size: 14px; line-height: 1.3; text-align: left; white-space: nowrap; min-height: 43px; }
.nav-button .icon { width: 18px; height: 18px; }
.nav-button:hover { background: #ffffff0d; color: #fff; }
.nav-button.active { background: #29496f; color: #fff; }
.rail-footer { margin-top: auto; min-width: 0; padding: 15px 2px 4px; border-top: 1px solid #ffffff22; display: flex; align-items: center; gap: 9px; }
.avatar { display: grid; place-items: center; border-radius: 50%; background: #dcecff; color: #174780; height: 34px; width: 34px; font-size: 13px; font-weight: 700; flex: 0 0 auto; }
.rail-user { min-width: 0; flex: 1; }
.rail-user strong { display: block; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; font-size: 13px; }
.rail-user span { display: block; color: var(--nav-ink); margin-top: 3px; font-size: 12px; }
.rail-footer .icon-button { color: var(--nav-ink); background: transparent; border: 0; width: 35px; }
.rail-footer .icon-button:hover { color: #fff; background: #ffffff14; }
.shell { min-width: 0; }
.topbar { height: 67px; padding: 11px clamp(18px, 3vw, 44px); background: var(--panel); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.division-label { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; color: #3e5069; font-weight: 650; }
.division-label .icon { color: #52769e; width: 18px; height: 18px; }
.top-actions, .actions, .row-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.top-actions { flex-wrap: nowrap; }
.mobile-signout { display: none !important; }
.month-picker { display: flex; gap: 8px; align-items: center; }
.control-icon { position: relative; display: flex; align-items: center; min-width: 0; }
.control-icon > .icon { position: absolute; left: 11px; width: 16px; height: 16px; color: #647b97; pointer-events: none; }
.control-icon > input, .control-icon > select { padding-left: 35px; }
.button, .icon-button { border: 1px solid var(--line); background: var(--panel); color: #334862; border-radius: 8px; min-height: 40px; padding: 8px 13px; display: inline-flex; gap: 8px; align-items: center; justify-content: center; font-size: 14px; font-weight: 650; line-height: 1.25; text-decoration: none; white-space: nowrap; }
.button:hover:not(:disabled), .icon-button:hover:not(:disabled) { border-color: #acc4df; background: #f5f9ff; }
.button .icon, .icon-button .icon { width: 17px; height: 17px; }
.icon-button { width: 40px; padding: 0; }
.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.primary:hover:not(:disabled) { background: #104795; border-color: #104795; }
.quiet { border-color: transparent; color: var(--blue); }
.danger { color: #a02c32; }
.button.small { min-height: 34px; padding: 6px 10px; font-size: 13px; }
.text-button { font: inherit; color: var(--blue); font-size: 14px; font-weight: 650; border: 0; background: transparent; text-align: left; padding: 0; }
.text-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.content { width: min(100%, 1480px); margin-inline: auto; padding: 31px clamp(18px, 3vw, 44px) 48px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 24px; flex-wrap: wrap; }
.page-heading h1 { color: #142641; font-size: clamp(27px, 3.2vw, 36px); letter-spacing: -.035em; line-height: 1.12; margin: 0 0 6px; }
.page-heading p { color: var(--muted); margin: 0; line-height: 1.48; }
.sample-tag { font-size: 12px; font-weight: 700; color: #7b4b09; background: #fff0d7; border: 1px solid #f2ddb8; border-radius: 6px; padding: 3px 7px; vertical-align: 3px; margin-left: 7px; letter-spacing: 0; white-space: nowrap; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.panel-head { min-height: 65px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 19px; }
.panel-head h2, .panel-head h3 { font-size: 17px; color: #24364e; font-weight: 700; letter-spacing: -.012em; line-height: 1.3; margin: 0; }
.panel-head p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.empty-panel { display: flex; align-items: center; gap: 24px; padding: clamp(24px, 4.5vw, 49px); background: linear-gradient(126deg, #fff 68%, #edf5ff 100%); }
.empty-panel h2 { font-size: 23px; margin: 0 0 8px; letter-spacing: -.022em; }
.empty-panel p { max-width: 49ch; color: var(--muted); line-height: 1.55; margin-bottom: 18px; }
.empty-icon { background: #e9f2ff; color: #245da9; border: 1px solid #d4e4f8; border-radius: 16px; flex: 0 0 64px; width: 64px; height: 64px; display: grid; place-items: center; }
.empty-icon .icon { width: 35px; height: 35px; }
.table-toolbar { padding: 0 19px 14px; display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.table-toolbar .search { width: min(100%, 270px); }
.table-toolbar .search input { width: 100%; }
select, input:not([type='checkbox']):not([type='file']), textarea { background: #fff; border: 1px solid #cfdcea; color: #233b57; border-radius: 8px; min-width: 0; min-height: 40px; font-size: 14px; padding: 8px 11px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23495970' stroke-width='1.6' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; padding-right: 32px; max-width: 100%; }
.control-icon > select, .control-icon > input:not([type='checkbox']):not([type='file']) { padding-left: 34px; }
textarea { resize: vertical; line-height: 1.5; min-height: 79px; }
input::placeholder, textarea::placeholder { color: #6d7e94; }
input[type='checkbox'] { margin: 0; width: 16px; height: 16px; accent-color: var(--blue); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { font-size: 14px; padding: 11px 13px; border-bottom: 1px solid #e9eef5; vertical-align: middle; }
th { font-size: 13px; font-weight: 650; color: #50627a; background: #f5f8fc; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 19px; }
th:last-child, td:last-child { padding-right: 19px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background-color: #f9fbfe; }
td small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
td .text-button { white-space: nowrap; }
td .muted { white-space: nowrap; }
.case-table { min-width: 1140px; }
.consumer-cell { min-width: 165px; overflow-wrap: anywhere; }
.consumer-cell .text-button { white-space: normal; }
.comm-date { white-space: nowrap; }
.feeder-actions { display: flex; align-items: center; gap: 9px 14px; flex-wrap: wrap; padding: 0 19px 13px; font-size: 13px; color: var(--muted); }
.feeder-actions .checkbox-label { font-size: 13px; }
.feeder-actions .button { margin-left: auto; }
.team-table { min-width: 680px; }
.field-teams { margin-bottom: 14px; }
.field-teams table { min-width: 520px; }
.team-roster { display: grid; gap: 9px; max-height: 225px; overflow: auto; min-width: 0; margin: 0; padding: 10px 12px 13px; border: 1px solid var(--line); border-radius: 8px; }
.team-roster legend { padding-inline: 4px; font-size: 14px; font-weight: 650; }
.team-roster[hidden] { display: none; }
.check-cell { width: 40px; }
.text-cell { min-width: 120px; overflow-wrap: anywhere; }
.count-cell { width: 85px; }
.table-end { display: flex; justify-content: space-between; align-items: center; gap: 9px; border-top: 1px solid #e9eef5; padding: 10px 19px; color: var(--muted); font-size: 13px; }
.empty-table { color: var(--muted); padding: 23px 19px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 6px; background: #edf2f7; color: #526278; line-height: 1.25; font-size: 13px; font-weight: 650; white-space: nowrap; }
.pill.assigned { background: #e7f0ff; color: #215995; }
.pill.submitted { background: #fff0d9; color: #80500a; }
.pill.approved { background: #e4f5ed; color: #156348; }
.pill.checked { background: #e4f5ed; color: #156348; }
.pill.carried { background: #eeeafa; color: #594393; }
.pill.returned { background: #fae8e7; color: #933b3f; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.muted { color: var(--muted); }
.fine { color: var(--muted); font-size: 13px; line-height: 1.5; }
.agent-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 265px), 1fr)); gap: 12px; }
.agent-case { padding: 16px; }
.agent-case h2 { color: #223955; font-size: 18px; margin: 9px 0 5px; overflow-wrap: anywhere; }
.agent-case p { color: var(--muted); margin-bottom: 13px; line-height: 1.45; font-size: 14px; overflow-wrap: anywhere; }
.agent-case .button { min-height: 43px; }
.card-meter-fields { display: flex; flex-wrap: wrap; gap: 9px 14px; margin: 0 0 12px; font-size: 13px; }
.card-meter-fields dt { color: var(--muted); margin-bottom: 3px; }
.card-meter-fields dd { margin: 0; font-weight: 650; }
.agent-toolbar { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; margin-bottom: 15px; }
.form-stack { display: grid; gap: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: grid; gap: 6px; min-width: 0; font-size: 14px; font-weight: 650; color: #465a73; }
.field input, .field select, .field textarea { width: 100%; font-weight: 400; }
.field .fine { font-weight: 400; }
.checkbox-label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 650; color: #465a73; }
dialog { width: min(660px, calc(100vw - 26px)); max-height: calc(100dvh - 30px); color: var(--ink); background: #fff; padding: 0; border: 1px solid #d7e3f0; border-radius: 15px; box-shadow: 0 26px 62px #14284642; }
dialog::backdrop { background: #10244081; }
dialog.drawer { inset: 0 0 0 auto; width: min(560px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 14px 0 0 14px; }
.modal-head { position: sticky; top: 0; z-index: 2; background: #fff; padding: 16px 19px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-head h2 { margin: 0; color: #1b324f; font-size: 20px; letter-spacing: -.022em; overflow-wrap: anywhere; }
.modal-head p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.modal-body { padding: 18px 19px 24px; }
.modal-body > p { line-height: 1.55; color: var(--muted); }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; margin-top: 13px; }
.details { margin: 14px 0 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.details div { background: #f5f8fc; border-radius: 8px; padding: 9px 11px; min-width: 0; }
.details dt { color: var(--muted); font-size: 13px; margin-bottom: 3px; }
.details dd { margin: 0; color: #203650; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; line-height: 1.45; }
.section-line { border-top: 1px solid #e6edf5; padding-top: 16px; margin-top: 17px; }
.section-line h3 { margin-bottom: 10px; font-size: 16px; }
.case-remark-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 7px; }
.case-remark-heading h3 { margin: 0; }
.notice-block { background: #f1f6fc; border: 1px solid #dce8f6; padding: 10px 12px; border-radius: 8px; color: #344e6f; line-height: 1.5; font-size: 14px; margin: 0 0 12px; overflow-wrap: anywhere; }
.notice-block.returned { background: #fff1ed; color: #873b36; border-color: #f4d8d2; }
.source-remark { white-space: pre-wrap; }
.remark-summary { overflow: hidden; }
.remark-summary table { table-layout: fixed; }
.remark-summary th, .remark-summary td { padding-block: 13px; }
.remark-summary .remark-count { width: 100px; text-align: right; font-variant-numeric: tabular-nums; }
.remark-summary td.remark-count { font-weight: 700; color: #223a58; }
.remark-category { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 40%); gap: 13px; align-items: center; }
.remark-category .text-button { color: #254d7d; }
.remark-bar { display: block; height: 5px; background: #e8eef7; border-radius: 99px; overflow: hidden; }
.remark-bar span { display: block; height: 100%; background: #5184c3; border-radius: inherit; }
.file-drop, .photo-picker { display: flex; align-items: center; gap: 11px; padding: 13px; border: 1px dashed #9cb4d5; border-radius: 9px; background: #f5f9ff; color: #244e83; position: relative; min-width: 0; min-height: 57px; }
.file-drop:hover, .photo-picker:hover { background: #edf5ff; }
.file-drop strong, .photo-picker strong { display: block; overflow-wrap: anywhere; font-size: 14px; }
.file-drop small, .photo-picker small { display: block; color: var(--muted); margin-top: 3px; font-size: 12px; }
.file-drop input, .photo-picker input { position: absolute; opacity: 0; inset: 0; width: 100%; cursor: pointer; }
.file-drop:focus-within, .photo-picker:focus-within { outline: 3px solid #5e92e1; outline-offset: 2px; }
.section-heading { margin: 0; font-size: 15px; font-weight: 700; }
.preview { border: 1px solid var(--line); border-radius: 8px; overflow: auto; }
.preview td, .preview th { font-size: 13px; padding: 7px 9px; overflow-wrap: anywhere; }
.visit-controls { display: grid; gap: 9px; }
.evidence { width: 100%; margin: 5px 0 8px; max-height: 340px; object-fit: contain; display: block; background: #f2f6fb; border-radius: 9px; }
#photo-preview[hidden] { display: none; }
.visit-record { padding: 11px 0 3px; border-top: 1px solid #edf2f7; overflow-wrap: anywhere; }
.visit-record header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 7px; }
.visit-record h4 { margin: 0 0 3px; color: #283d55; font-size: 15px; }
.visit-record p { margin-bottom: 8px; line-height: 1.5; white-space: pre-wrap; }
.visit-record small { color: var(--muted); }
.visit-record .photo-link { display: block; }
.case-activity { list-style: none; margin: 0; padding: 0; }
.case-activity li { padding: 8px 0; border-top: 1px solid #edf2f7; font-size: 14px; overflow-wrap: anywhere; }
.case-activity time { display: block; font-size: 12px; margin-top: 3px; color: var(--muted); }
.error { color: #a12430; background: #fff1f2; border: 1px solid #f2d2d8; border-radius: 8px; padding: 9px 11px; margin: 0; font-size: 14px; line-height: 1.45; }
.error:empty { display: none; }
.sign-in { width: min(450px, calc(100% - 30px)); margin: min(13vh, 102px) auto; padding: clamp(20px, 5vw, 34px); }
.sign-in .brand-icon { margin-bottom: 18px; }
.sign-in h1 { color: #152e4d; font-size: 26px; letter-spacing: -.025em; margin-bottom: 9px; }
.sign-in p { color: var(--muted); line-height: 1.52; }
.sign-in .button { justify-self: start; }
#notice { position: fixed; right: 22px; bottom: 20px; z-index: 4; max-width: min(370px, calc(100% - 44px)); }
#notice:not(:empty) { color: #fff; background: #193c63; padding: 11px 15px; border-radius: 9px; box-shadow: 0 5px 15px #18345037; font-size: 14px; line-height: 1.4; }

@media (max-width: 1040px) {
  .layout { grid-template-columns: 190px minmax(0, 1fr); }
  .sidebar { padding-left: 11px; padding-right: 11px; }
  .brand { gap: 8px; }
  .brand-name { font-size: 14px; }
}
@media (max-width: 820px) {
  .layout { display: block; }
  .sidebar { position: static; height: auto; padding: 10px 14px 0; display: grid; grid-template-columns: 1fr auto; gap: 9px; }
  .brand { min-height: 42px; }
  .navigation { grid-row: 2; grid-column: 1 / -1; display: flex; margin: 0; padding-bottom: 7px; overflow-x: auto; }
  .nav-button { width: max-content; min-height: 37px; padding: 8px 10px; }
  .rail-footer { grid-row: 1; grid-column: 2; border: none; margin: 0; padding: 0; }
  .rail-user { display: none; }
  .rail-footer .avatar { display: none; }
  .topbar { height: 58px; }
  .content { padding-top: 24px; }
}
@media (max-width: 570px) {
  .feeder-actions .button { margin-left: 0; }
  .remark-summary .remark-count { width: 62px; }
  .remark-category { grid-template-columns: minmax(0, 1fr); }
  .remark-bar { display: none; }
  .page-heading { margin-bottom: 17px; }
  .topbar { gap: 5px; padding-inline: 13px; }
  .division-label { font-size: 13px; gap: 5px; }
  .division-label .icon { display: none; }
  .top-actions { gap: 6px; }
  .top-actions .control-icon { max-width: 148px; }
  .top-actions .control-icon > .icon { display: none; }
  .top-actions .control-icon > select { padding-left: 9px; }
  .empty-panel { align-items: flex-start; flex-direction: column; gap: 15px; padding: 21px; }
  .empty-icon { width: 49px; height: 49px; flex-basis: 49px; }
  .empty-icon .icon { width: 26px; height: 26px; }
  .table-toolbar .search { width: 100%; }
  .table-end { padding-inline: 12px; }
  .actions { gap: 7px; }
  .button { min-height: 42px; }
  .field input, .field select, .field textarea { font-size: 16px; }
  dialog.drawer { border-radius: 0; }
  .modal-head, .modal-body { padding-inline: 14px; }
  .form-grid { gap: 8px; }
  #notice { right: 12px; bottom: 12px; max-width: calc(100% - 24px); }
}
