@font-face { font-family: "Plus Jakarta Sans"; src: url("./assets/fonts/plus-jakarta-sans.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: Manrope; src: url("./assets/fonts/manrope-variable.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

* { box-sizing: border-box; }
body { margin: 0; color: var(--jis-text); background: var(--jis-canvas); font: 15px/1.55 var(--jis-font); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button, a, input, textarea, select { transition: background-color .16s, border-color .16s, box-shadow .16s; }
:focus-visible { outline: 3px solid #0868dd; outline-offset: 3px; }
.side :focus-visible, .gate-feature :focus-visible { outline-color: var(--jis-gold); }
:disabled { cursor: not-allowed; opacity: .65; }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.overlay-open { overflow: hidden; }
.ui-icon { display: block; width: 20px; height: 20px; flex: none; }
.btn-icon, .icon-slot, [data-ui-icon] { display: inline-flex; align-items: center; justify-content: center; flex: none; }

.app { min-height: 100vh; display: grid; grid-template-columns: var(--jis-sidebar-width) minmax(0,1fr); }
.side { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow: auto; padding: 28px 16px 22px; color: white; background: var(--jis-gradient); }
.brand, .gate-brand { display: flex; align-items: center; gap: 12px; line-height: 1.35; }
.brand { padding: 0 4px 24px; border-bottom: 1px solid #ffffff28; }
.brand small, .gate-brand small { display: block; font-size: 12px; margin-top: 3px; }
.brand small { color: #c7d9ee; }
.logo, .gate-identity img { width: 46px; height: 46px; flex: none; border-radius: 10px; background: white; object-fit: contain; }
.logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.nav { padding-top: 20px; }
.nav-caption { display: block; margin: 0 10px 8px; color: #b9d0eb; font-size: 11px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.nav button, .nav-toggle { display: flex; align-items: center; gap: 10px; min-height: 46px; width: 100%; margin-bottom: 4px; padding: 8px 10px; background: transparent; border: 1px solid transparent; border-radius: 9px; color: #e5effd; text-align: left; font-size: 13px; font-weight: 700; }
.nav button:hover, .nav-toggle:hover { background: #ffffff18; }
.nav button.active { background: linear-gradient(100deg,#084597,#0969dd); box-shadow: inset 3px 0 var(--jis-gold), 0 4px 12px #0003; color: white; border-color: #ffffff25; }
.nav-toggle { display: none; }
.sidefoot { display: flex; align-items: center; gap: 12px; margin-top: auto; padding: 20px 6px 0; color: #c7d9ee; font-size: 12px; }
.sidefoot b { color: white; }
.sidefoot .ui-icon { color: var(--jis-gold); width: 28px; height: 28px; }
.main { min-width: 0; }
.top { position: sticky; top: 0; z-index: 4; min-height: var(--jis-topbar-height); padding: 8px clamp(20px,3vw,38px); display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--jis-border); background: #fffffffa; font-size: 13px; }
.breadcrumb, .user { display: flex; align-items: center; gap: 9px; min-width: 0; overflow-wrap: anywhere; }
.breadcrumb { color: var(--jis-muted); }
.user { font-weight: 700; line-height: 1.3; }
.user > span { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--jis-navy-800); color: white; font-size: 12px; }
.user-dept { display: block; color: var(--jis-muted); font-size: 11px; font-weight: 600; }
.content { max-width: 1550px; margin: auto; padding: clamp(22px,3vw,36px); }
.title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.title > :first-child { flex: 1 1 320px; min-width: 0; }
.title h1 { margin: 0; color: var(--jis-navy-950); font-weight: 800; font-size: clamp(27px,3vw,38px); line-height: 1.16; letter-spacing: -.04em; }
.title p { margin: 6px 0 0; color: var(--jis-muted); }
.page-heading { display: flex; align-items: center; gap: 14px; }
.page-icon, .ico { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 12px; background: var(--jis-blue-100); color: var(--jis-blue-700); }
.page-icon .ui-icon { width: 29px; height: 29px; }
.ico .ui-icon { width: 25px; height: 25px; }
.overview-hero { padding: 27px 28px; border-radius: var(--jis-radius-lg); border: 1px solid #184779; box-shadow: var(--jis-shadow); background: url("./assets/branding/signal-background.svg") right center/cover, var(--jis-gradient); }
.overview-hero h1 { color: white; }
.overview-hero p { color: #ebf4ff; }
.hero-date { margin-bottom: 6px; color: var(--jis-gold); font-weight: 700; font-size: 13px; }
.overview-hero .pill { margin: 6px 0 0; }

.btn, .text-btn, .rule-apply { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 9px 15px; border-radius: 9px; border: 1px solid transparent; font-weight: 700; font-size: 14px; text-align: center; }
.btn { background: var(--jis-blue-700); border-color: #064da8; color: white; }
.btn:hover { background: #06479c; }
.btn.alt, .text-btn, .rule-apply { background: white; border-color: #bdcde0; color: #084a9e; }
.btn.alt:hover, .text-btn:hover, .rule-apply:hover { background: var(--jis-blue-100); border-color: #849fbe; }
.admin-report-action { display: none; }
.actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

.grid { display: grid; gap: 16px; margin-bottom: 18px; }
.grid > *, .card { min-width: 0; }
.grid > .card { margin-bottom: 0; }
.stats { grid-template-columns: repeat(4,minmax(0,1fr)); }
.two { grid-template-columns: repeat(2,minmax(0,1fr)); }
#p-home .two { grid-template-columns: minmax(0,1.25fr) minmax(0,1fr); }
.card, .insight-panel { margin: 0 0 18px; padding: 20px; border: 1px solid var(--jis-border); border-radius: var(--jis-radius-lg); background: white; box-shadow: var(--jis-shadow); }
.cardhead { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 14px; }
.cardhead h3, .insight-panel h3 { display: flex; align-items: center; gap: 9px; margin: 0; color: var(--jis-navy-950); font-size: 20px; font-weight: 800; letter-spacing: -.025em; }
.cardhead h3 [data-ui-icon] { color: var(--jis-blue-700); }
.cardhead small, .muted { color: var(--jis-muted); font-size: 13px; }
.stat { min-height: 104px; display: flex; justify-content: space-between; align-items: center; gap: 8px; background: linear-gradient(135deg,#fff 55%,#f1f6ff); }
.stat small, .kpi small { display: block; color: var(--jis-muted); font-size: 13px; font-weight: 700; }
.stat b, .kpi b, .insight-metric strong { display: block; font-size: 36px; font-weight: 800; line-height: 1.18; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stat[data-state="complete"] .ico { color: var(--jis-success); background: var(--jis-success-bg); }
.stat[data-state="pending"] .ico { color: var(--jis-warning); background: var(--jis-warning-bg); }
.stat[data-state="overdue"] .ico { color: var(--jis-danger); background: var(--jis-danger-bg); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit,minmax(128px,1fr)); gap: 10px; }
.kpi { padding: 12px; border-radius: 12px; border: 1px solid var(--jis-border); background: #f4f8ff; }
.kpi b { font-size: 30px; }
.empty { margin: 0; padding: 18px; text-align: center; border: 1px dashed #bdcde0; border-radius: 9px; color: var(--jis-muted); background: #f7faff; }

.bars { display: flex; align-items: end; gap: 6px; height: 168px; padding: 8px 3px 0; border-bottom: 1px solid var(--jis-border); background: repeating-linear-gradient(to top,#e9f0f8 0 1px,transparent 1px 25%); }
.barcol { display: flex; align-items: center; justify-content: flex-end; flex-direction: column; gap: 4px; flex: 1; height: 100%; min-width: 0; font-size: 13px; }
.barcol small { color: var(--jis-muted); font-size: 12px; font-weight: 600; }
.bar { width: min(38px,70%); background: linear-gradient(#1676ed,#064fae); border-radius: 6px 6px 0 0; }
.home-stack { display: flex; flex-direction: column; overflow: hidden; }
.home-stack i { display: block; background: var(--jis-gold); }
.legend { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 10px; color: var(--jis-muted); font-size: 12px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--jis-blue-700); }
.dot.gold { background: #b17800; margin-left: 6px; }
.upcoming-list { display: grid; gap: 7px; }
.upcoming-item { display: grid; grid-template-columns: minmax(58px,84px) 1fr auto; align-items: center; gap: 9px; min-height: 47px; padding: 6px 9px; border: 1px solid var(--jis-border); border-radius: 9px; background: white; color: var(--jis-text); text-align: left; }
.upcoming-item:hover { background: var(--jis-blue-100); }
.upcoming-time { padding: 4px; text-align: center; color: #084a9e; background: var(--jis-blue-100); border-radius: 6px; font-size: 12px; font-weight: 700; }
.upcoming-item b, .upcoming-item small { display: block; }
.upcoming-item small { color: var(--jis-muted); }
.upcoming-list p { margin: 2px 0; }

.tablewrap { max-width: 100%; border: 1px solid var(--jis-border); border-radius: 10px; overflow: auto; }
table { border-collapse: collapse; width: 100%; min-width: 600px; text-align: left; }
th { background: var(--jis-navy-800); color: white; font-size: 13px; font-weight: 700; }
td, th { padding: 11px 12px; vertical-align: top; white-space: normal; overflow-wrap: anywhere; }
td { border-bottom: 1px solid var(--jis-border); font-size: 13px; }
tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: #f5f8fd; }
tbody tr:hover { background: var(--jis-blue-100); }
.category-cell { display: inline-flex; gap: 8px; align-items: center; }
.category-cell .ui-icon { color: var(--jis-blue-700); }
.pill { display: inline-block; border-radius: 20px; padding: 3px 9px; color: var(--jis-neutral); background: var(--jis-neutral-bg); font-size: 12px; font-weight: 700; }
.pill.positive { color: var(--jis-success); background: var(--jis-success-bg); }
.pill.negative, .pill.priority-high { color: var(--jis-danger); background: var(--jis-danger-bg); }
.pill.high, .pill.priority-medium { color: var(--jis-warning); background: var(--jis-warning-bg); }
.notice, .sample-disclaimer { padding: 12px 14px; margin: 0 0 16px; border: 1px solid #e4d296; border-radius: 9px; color: #674500; background: #fff8e5; font-size: 14px; }
.rule-guidance { display: block; margin-top: 4px; }

.formgrid, .settings-grid, .filters { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.filters { grid-template-columns: repeat(auto-fit,minmax(145px,1fr)); align-items: end; }
.field, .gate-card label, .settings-grid label { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
label { font-size: 14px; font-weight: 700; }
input:not([type=checkbox]), select, textarea { min-width: 0; width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid #b7c9de; border-radius: 9px; color: var(--jis-text); background: white; }
input::placeholder, textarea::placeholder { color: var(--jis-muted); }
input[type=checkbox] { width: 18px; height: 18px; margin: 0; accent-color: var(--jis-blue-700); }
textarea { min-height: 102px; resize: vertical; }
fieldset { min-inline-size: 0; }
.wide { grid-column: span 2; }
.form-section:has(#summary) .field:has(#summary) { grid-column: 1/-1; }
.form-section:has(#tone) .formgrid, .mail-grid, .settings-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.rule-hint { padding: 7px 9px; border-left: 3px solid #c08b10; border-radius: 0 8px 8px 0; color: var(--jis-muted); background: #f3f7fd; font-size: 13px; }
.rule-apply { align-self: start; }
.route-list { display: grid; gap: 8px; margin-bottom: 13px; }
.route-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto; align-items: center; gap: 7px; }
.route-row button, .modal-close { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 10px; }
.route-row button { background: var(--jis-danger-bg); color: var(--jis-danger); }
.schedule-time { min-width: 200px !important; }
.check-label { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.preview-email { display: flex; align-items: center; gap: 13px; flex-wrap: wrap; padding: 13px; border: 1px solid #e4d296; border-radius: 10px; background: #fff5d9; }
.preview-email p { margin: 3px 0 0; color: var(--jis-muted); font-size: 13px; }
.mailicon { color: var(--jis-warning); }

.insight-mast { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px; border-radius: 14px; background: var(--jis-gradient); color: white; }
.insight-mast h2 { margin: 0; font-size: 25px; }
.insight-mast p { margin: 4px 0 0; color: #e4edfb; font-size: 13px; overflow-wrap: anywhere; }
.insight-emblem .ui-icon { width: 30px; height: 30px; color: var(--jis-gold); }
.insight-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin: 14px 0 18px; }
.insight-metric { position: relative; display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 14px; border: 1px solid var(--jis-border); border-radius: 12px; background: #eaf3ff; }
.insight-metric > span:not(.insight-icon) { font-weight: 700; }
.insight-metric.flagged { background: #fdf0f1; }
.insight-metric.flagged strong, .insight-row.urgent strong { color: var(--jis-danger); }
.insight-metric:nth-child(2) { background: var(--jis-success-bg); }
.insight-metric small { color: var(--jis-muted); }
.insight-icon { color: var(--jis-blue-700); }
.insight-panels { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.insight-panels .insight-panel { margin: 0; }
.insight-review { margin-top: 14px; }
.insight-panel h3 { margin-bottom: 9px; }
.insight-row { display: grid; grid-template-columns: minmax(96px,1fr) minmax(25px,1fr) minmax(24px,auto); align-items: center; gap: 7px; margin: 8px 0; font-size: 13px; overflow-wrap: anywhere; }
.insight-row strong { text-align: right; }
.insight-track, .insight-track i { display: block; height: 8px; border-radius: 8px; }
.insight-track { background: #e6eef9; }
.insight-track i { background: #1469da; }
.insight-row.urgent .insight-track i, .insight-row.negative .insight-track i { background: var(--jis-danger); }
.insight-row.positive .insight-track i { background: var(--jis-success); }
.insight-row.medium .insight-track i { background: #a76602; }
.insight-review ul { padding-left: 20px; }
.insight-review small { display: block; color: var(--jis-muted); }
.dept-summary { display: grid; grid-template-columns: repeat(auto-fit,minmax(145px,1fr)); gap: 7px; }
.dept-line { display: flex; justify-content: space-between; gap: 8px; padding: 8px; border-radius: 8px; background: #eef4fc; font-size: 13px; }
.story { padding: 15px 0; border-bottom: 1px solid var(--jis-border); overflow-wrap: anywhere; }
.story:last-child { border: 0; }
.story h4 { margin: 0 0 5px; font-size: 17px; }
.story p { margin: 6px 0; }
.meta { display: flex; flex-wrap: wrap; gap: 5px; }
#printOut { padding: clamp(14px,2vw,26px); border: 1px solid var(--jis-border); border-radius: 18px; background: white; box-shadow: var(--jis-shadow); }
.print-head { display: flex; align-items: center; gap: 14px; padding-bottom: 12px; border-bottom: 3px solid var(--jis-gold); }
.print-head img { width: 58px; height: 58px; object-fit: contain; flex: none; }
.print-head h2, .print-head p { margin: 0; }
#printOut .print-brand { padding: 0; border: 0; box-shadow: none; }
#printOut .insight-mast { color: var(--jis-navy-950); background: #fff2ce; }
#printOut .insight-mast p { color: #574116; }
#printOut .insight-emblem .ui-icon { color: #805500; }

.gate { position: fixed; inset: 0; z-index: 20; overflow: auto; background: white; }
.gate-shell { display: grid; grid-template-columns: 45% 55%; min-height: 100%; align-items: stretch; }
.gate-feature { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: clamp(24px,6vh,58px); padding: clamp(28px,6vw,94px); color: white; background: url("./assets/branding/signal-background.svg") center/cover, var(--jis-gradient); }
.gate-identity { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 700; }
.gate-feature h2 { margin: 0; color: white; font-size: clamp(38px,6vw,82px); font-weight: 800; line-height: 1.01; letter-spacing: -.06em; }
.gate-feature p { max-width: 31ch; margin: 14px 0 0; color: #e4efff; font-size: 17px; }
.gate-feature p::after { content: ""; display: block; width: 48px; height: 4px; margin-top: 20px; border-radius: 9px; background: var(--jis-gold); }
.gate-orbit { display: grid; place-items: center; width: 78px; height: 78px; border: 1px solid #9fc9ff55; border-radius: 20px; background: #103b72b0; }
.gate-symbol .ui-icon { width: 46px; height: 46px; color: var(--jis-gold); }
.gate-shell { background: radial-gradient(ellipse at top right,#e8f3ff,transparent 66%),#f6f9fe; }
.gate-card { align-self: center; justify-self: center; width: min(90%,488px); margin: 24px 0; padding: clamp(20px,3vw,36px); border: 1px solid var(--jis-border); border-radius: 20px; background: white; box-shadow: var(--jis-shadow); }
.gate-brand { margin-bottom: 16px; padding-bottom: 13px; border-bottom: 1px solid var(--jis-border); }
.gate-brand small, .gate-card p, .gate-note { color: var(--jis-muted); }
.gate-card h1 { margin: 0; font-size: clamp(24px,3vw,32px); line-height: 1.15; letter-spacing: -.035em; }
.gate-card p { margin: 8px 0 15px; font-size: 14px; }
.gate-card label { margin-bottom: 11px; }
.gate-card button { width: 100%; margin-top: 4px; border-color: #cb9200; color: var(--jis-navy-950); background: var(--jis-gold); }
.gate-card button:hover { background: #f6bc1d; }
.gate-note { display: block; font-size: 12px; margin-top: 11px; }
.reminder-modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 15px; overflow: auto; background: #071b36bf; }
.reminder-card { position: relative; width: min(100%,480px); padding: 24px; border-radius: 18px; background: white; box-shadow: 0 19px 65px #061a3b78; }
.reminder-mark { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 14px; border-radius: 12px; color: var(--jis-gold); background: var(--jis-navy-800); }
.reminder-mark .ui-icon { width: 29px; height: 29px; }
.modal-close { position: absolute; right: 12px; top: 12px; color: var(--jis-navy-800); background: var(--jis-blue-100); }
.reminder-card h2 { font-size: 24px; line-height: 1.25; margin: 10px 0 5px; }
.reminder-card p { color: var(--jis-muted); }
.reminder-actions { display: grid; gap: 8px; }

@media (max-width: 1150px) {
  .app { grid-template-columns: 204px minmax(0,1fr); }
  .stat { padding: 13px; }
  .stat .ico { width: 38px; height: 38px; }
  .settings-grid, #p-settings .two { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 950px) {
  .stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .formgrid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #p-home .two { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 800px) {
  .app { display: block; }
  .side { position: relative; height: auto; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; padding: 9px 15px; }
  .brand { padding: 0; border: 0; }
  .brand .logo { width: 38px; height: 38px; }
  .nav-toggle { display: flex; margin: 0; width: auto; border-color: #ffffff45; }
  .nav { display: none; grid-column: 1/-1; padding-top: 2px; }
  .nav.nav-open { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 3px; }
  .nav-caption, .sidefoot { display: none; }
  .top { position: static; min-height: 52px; }
}
@media (max-width: 620px) {
  .content { padding: 16px; }
  .top { padding: 8px 14px; }
  .title { gap: 10px; margin-bottom: 16px; }
  .title > :first-child { flex-basis: 100%; }
  .title > .btn { flex: 1 1 auto; }
  .overview-hero { padding: 19px; }
  .page-icon { width: 39px; height: 39px; }
  .card, .insight-panel { padding: 14px; }
  .cardhead h3, .insight-panel h3 { font-size: 18px; }
  .grid { gap: 10px; }
  .stat { align-items: flex-start; flex-direction: column-reverse; min-height: auto; }
  .stat b { font-size: 30px; }
  .stat small { font-size: 12px; }
  .two, .formgrid, .filters, .form-section:has(#tone) .formgrid, .mail-grid, .insight-panels { grid-template-columns: minmax(0,1fr); }
  .wide { grid-column: auto; }
  .insight-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .route-row { grid-template-columns: minmax(0,1fr) auto; }
  .route-row input { grid-column: 1; }
  .route-row button { grid-column: 2; grid-row: 1/3; }
  .gate-shell { display: block; padding-bottom: 1px; }
  .gate-feature { padding: 19px 22px; gap: 12px; }
  .gate-feature h2 { font-size: 35px; }
  .gate-feature h2 br { display: none; }
  .gate-feature h2 br::after { content: " "; }
  .gate-feature p { margin-top: 6px; font-size: 14px; }
  .gate-feature p::after { margin-top: 10px; }
  .gate-orbit { display: none; }
  .gate-card { margin: 15px auto; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

/* Keep labels intact in wide record tables. The table region can scroll at narrow widths. */
#latest table { min-width: 1040px; }
#latest .pill { white-space: nowrap; }
#latest :is(th,td):nth-child(3) { min-width: 220px; }
#latest :is(th,td):nth-child(7) { min-width: 105px; }
.app { background: linear-gradient(90deg,var(--jis-navy-900) var(--jis-sidebar-width),var(--jis-canvas) var(--jis-sidebar-width)); }
.main { background: var(--jis-canvas); }
@media (max-width: 1150px) { .app { background: var(--jis-navy-900); } }
@media (max-width: 800px) { .app { background: var(--jis-canvas); } }

.breadcrumb b, .breadcrumb > [aria-hidden] { flex: none; }
#checkTable table { min-width: 760px; }
#checkTable .pill { white-space: nowrap; }
#checkTable th, #outletsTable th { overflow-wrap: normal; }
#outletsTable th:first-child { min-width: 150px; }
#outletsTable th:nth-child(2) { min-width: 225px; }
