/* Infrasys POS page. Colours, fonts and radii come from tokens.css variables only. */

/* ---- tabs ---- */
.is-tabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.is-tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 9px 13px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--text-secondary); cursor: pointer; }
.is-tab:hover { color: var(--text-primary); }
.is-tab:focus-visible { outline: 2px solid var(--accent-gold); outline-offset: -2px; }
.is-tab.active { color: var(--text-primary); border-bottom-color: var(--accent-gold); }
.is-panel[hidden], .is-msg[hidden], .is-banner[hidden], .is-conn[hidden] { display: none; }
.is-conn { font-size: 12px; color: var(--status-pending-text); background: var(--status-pending-bg); border: 1px solid var(--status-pending-border); border-radius: 999px; padding: 4px 10px; }
.is-banner a { color: inherit; font-weight: 700; text-decoration: underline; }

/* ---- layout helpers ---- */
.is-card { padding: 14px 16px; margin-bottom: 14px; }
.is-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.is-row { display: flex; align-items: center; gap: 8px; }
.is-wrap { flex-wrap: wrap; }
.is-between { justify-content: space-between; }
.is-note { color: var(--text-secondary); margin: 0 0 10px; }
.is-loading { opacity: .7; }
.is-muted { color: var(--text-secondary); }
.is-small { font-size: 12px; }
.is-h { margin: 18px 0 8px; font-family: var(--font-display); font-size: 14px; }
.is-ok { color: var(--status-done-text); }
.is-warn { color: var(--status-pending-text); }
.is-bad { color: var(--status-down-text); }
.is-check { font-size: 12.5px; color: var(--text-secondary); display: inline-flex; gap: 6px; align-items: center; }
.is-actions { margin-top: 12px; display: flex; gap: 8px; }
.is-err { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--status-down-border); background: var(--status-down-bg); color: var(--status-down-text); border-radius: var(--radius-control); }
.is-pick, .is-mon-filters { margin-bottom: 12px; }
.is-pick .filter-left { flex-wrap: wrap; }

/* ---- badges ---- */
.badge-ok { background: var(--status-done-bg); color: var(--status-done-text); }
.badge-warn { background: var(--status-pending-bg); color: var(--status-pending-text); }
.badge-bad { background: var(--status-down-bg); color: var(--status-down-text); }
.badge-run { background: var(--accent-gold-ring); color: var(--accent-gold-deep); }

/* ---- progress bars (native <progress>: accessible, no inline styles) ---- */
.is-bar { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border: 0; border-radius: 999px; background: var(--bg-row-alt); overflow: hidden; display: block; }
.is-bar::-webkit-progress-bar { background: var(--bg-row-alt); border-radius: 999px; }
.is-bar::-webkit-progress-value { background: var(--accent-gold); border-radius: 999px; transition: width .4s ease; }
.is-bar::-moz-progress-bar { background: var(--accent-gold); border-radius: 999px; }
.is-bar:indeterminate { background: linear-gradient(90deg, var(--bg-row-alt) 0, var(--accent-gold-light) 50%, var(--bg-row-alt) 100%); background-size: 200% 100%; animation: is-slide 1.2s linear infinite; }
.is-bar.is-thin { height: 5px; }
.is-bar[hidden] { display: none; }
@keyframes is-slide { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .is-bar:indeterminate { animation: none; } .is-bar::-webkit-progress-value { transition: none; } }

/* ---- collector ---- */
.is-pbox { margin: 10px 0; display: grid; gap: 6px; }
.is-phases { list-style: none; display: flex; gap: 4px; flex-wrap: wrap; margin: 2px 0 0; padding: 0; font-size: 11.5px; }
.is-phases li { padding: 2px 9px; border-radius: 999px; background: var(--bg-row-alt); color: var(--text-secondary); }
.is-phases li.done { background: var(--status-done-bg); color: var(--status-done-text); }
.is-phases li.now { background: var(--accent-gold-ring); color: var(--accent-gold-deep); font-weight: 700; }
.is-phases li.bad { background: var(--status-down-bg); color: var(--status-down-text); font-weight: 700; }
.is-orun { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.is-orow { border: 1px solid var(--border); border-radius: var(--radius-control); padding: 8px 10px; display: grid; gap: 5px; background: var(--bg-card); }
.is-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.is-chip { font-size: 11px; padding: 2px 7px; border-radius: 999px; background: var(--bg-row-alt); color: var(--text-secondary); white-space: nowrap; }
.is-chip-ok { background: var(--status-done-bg); color: var(--status-done-text); }
.is-chip-bad { background: var(--status-down-bg); color: var(--status-down-text); }
.is-chip-warn { background: var(--status-pending-bg); color: var(--status-pending-text); }
.is-chip-run { background: var(--accent-gold-ring); color: var(--accent-gold-deep); }

/* ---- stats ---- */
.is-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 6px; margin: 6px 0; }
.is-stats-wide { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); margin-bottom: 10px; }
.is-summary { margin-bottom: 8px; grid-template-columns: repeat(auto-fit, minmax(84px, 130px)); }
.is-stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-control); padding: 5px 8px; min-width: 0; }
.is-stat-l { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-secondary); }
.is-stat-v { display: block; font-size: 13.5px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.is-stat.is-ok .is-stat-v { color: var(--status-done-text); }
.is-stat.is-warn .is-stat-v { color: var(--status-pending-text); }
.is-stat.is-bad .is-stat-v { color: var(--status-down-text); }

/* ---- outlet cards (monitor) ---- */
.is-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 10px; }
.is-card-o { border: 1px solid var(--border); border-left-width: 4px; border-radius: var(--radius-card); background: var(--bg-card); box-shadow: var(--shadow-card); padding: 9px 11px; display: grid; gap: 6px; align-content: start; min-width: 0; }
.is-v-ok { border-left-color: var(--status-done-text); }
.is-v-warn { border-left-color: var(--status-pending-text); }
.is-v-bad { border-left-color: var(--status-down-text); }
.is-v-nodata, .is-v-pending { border-left-color: var(--input-border); }
.is-o-name { font-size: 13.5px; overflow-wrap: anywhere; }
.is-files { display: flex; flex-wrap: wrap; gap: 4px; }
.is-file { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--bg-row-alt); color: var(--text-secondary); white-space: nowrap; }
.is-file-ok { background: var(--status-done-bg); color: var(--status-done-text); }
.is-file-no { background: var(--status-down-bg); color: var(--status-down-text); }
.is-card-o .is-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; }
.is-card-o .is-stat { padding: 3px 6px; }
.is-card-o .is-stat-v { font-size: 12.5px; }
.is-recon { display: grid; gap: 2px; }
.is-delta { font-weight: 700; font-variant-numeric: tabular-nums; }
.is-up { color: var(--status-done-text); }
.is-down { color: var(--status-down-text); }
.is-flags { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.is-flag { font-size: 12px; padding: 2px 8px; border-radius: var(--radius-control); background: var(--bg-row-alt); color: var(--text-secondary); }
.is-flag-warn { background: var(--status-pending-bg); color: var(--status-pending-text); }
.is-flag-bad { background: var(--status-down-bg); color: var(--status-down-text); }
.is-push { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 3px; font-size: 12.5px; }

/* ---- tables ---- */
.is-tbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; }
.is-search { max-width: 240px; }
.is-info { margin-left: auto; font-size: 12px; color: var(--text-secondary); }
.is-scroll { max-height: 460px; overflow: auto; }
.is-compact th, .is-compact td { padding: 6px 10px; font-size: 12.5px; }
.is-compact thead th { position: sticky; top: 0; background: var(--bg-card); z-index: 1; }
.is-sortable { cursor: pointer; user-select: none; }
.is-sortable:hover { color: var(--text-primary); }
.is-sortable[aria-sort="ascending"]::after { content: " \25B2"; font-size: 9px; }
.is-sortable[aria-sort="descending"]::after { content: " \25BC"; font-size: 9px; }
.is-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.is-more { margin: 8px 0; }
.is-more button[hidden] { display: none; }
.is-sec { margin: 8px 0; }
.is-sec > summary { cursor: pointer; font-weight: 600; padding: 6px 0; }

/* ---- upload ---- */
.is-drop { display: grid; place-items: center; gap: 2px; text-align: center; padding: 22px 12px; border: 2px dashed var(--input-border); border-radius: var(--radius-card); background: var(--bg-card); color: var(--text-secondary); cursor: pointer; }
.is-drop:hover, .is-drop.is-over { border-color: var(--accent-gold); background: var(--accent-gold-ring); }
.is-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.is-drop:focus-within { outline: 2px solid var(--accent-gold); outline-offset: 2px; }
.is-files-list { list-style: none; margin: 10px 0 4px; padding: 0; display: grid; gap: 4px; }
.is-files-list li { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: var(--radius-control); padding: 4px 8px; font-size: 12.5px; }
.is-fname { flex: 1; min-width: 0; overflow-wrap: anywhere; }

@media (max-width: 560px) {
  .is-card-o .is-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .is-info { margin-left: 0; width: 100%; }
}

/* ---- SFTP page additions ---- */
.is-pullstat { display: grid; gap: 4px; margin: 4px 0 8px; font-size: 13px; }
.is-pushbox { border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--bg-card); padding: 10px 12px; margin: 10px 0; display: grid; gap: 6px; }
.is-pushbox .is-bar { margin-top: 4px; }
.is-row-void td { color: var(--status-down-text); background: var(--status-down-bg); text-decoration: line-through; text-decoration-color: var(--status-down-border); }
.is-row-missing td { color: var(--text-secondary); background: var(--bg-row-alt); }
.is-row-bad td:first-child { box-shadow: inset 3px 0 0 var(--status-down-text); }
.is-compact tbody th { text-align: left; font-weight: 600; white-space: nowrap; width: 1%; }

/* ---- the two data sources (extension / SFTP) ---- */
.is-source { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.is-source-link { display: grid; gap: 1px; padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--bg-card); color: var(--text-primary); text-decoration: none; min-width: 200px; }
.is-source-link span { font-size: 12px; color: var(--text-secondary); }
.is-source-link:hover { border-color: var(--accent-gold); }
.is-source-link.active { border-color: var(--accent-gold); background: var(--accent-gold-ring); box-shadow: var(--shadow-card); }

/* ---- charts, calendar, share tables, view switch ---- */
.is-chart { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--bg-card); padding: 6px 8px; margin: 8px 0 12px; }
.is-svg { display: block; width: 100%; min-width: 320px; height: auto; max-height: 220px; }
.is-svg-grid { stroke: var(--border); stroke-dasharray: 3 3; }
.is-svg-axis { stroke: var(--input-border); }
.is-svg-text { fill: var(--text-secondary); font-size: 9px; font-family: var(--font-body); }
.is-svg-bar rect { fill: var(--input-border); }
.is-svg-bar.is-svg-ok rect { fill: var(--status-done-text); }
.is-svg-bar.is-svg-warn rect { fill: var(--status-pending-text); }
.is-svg-bar.is-svg-bad rect { fill: var(--status-down-text); }
.is-svg-bar.is-svg-run rect { fill: var(--accent-gold); }
.is-svg-bar[role="button"] { cursor: pointer; }
.is-svg-bar[role="button"]:hover rect, .is-svg-bar:focus rect { opacity: .7; }
.is-svg-bar rect.is-svg-gap { fill: var(--status-down-text); }
.is-cal { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin: 8px 0 12px; }
.is-cal-month { border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--bg-card); padding: 8px 10px; }
.is-cal-title { margin: 0 0 6px; font-family: var(--font-display); font-size: 13px; }
.is-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.is-cal-wd { font-size: 10px; color: var(--text-secondary); text-align: center; }
.is-cal-cell { display: grid; align-content: center; justify-items: center; min-height: 40px; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--bg-row-alt); color: var(--text-secondary); font: inherit; padding: 2px; }
.is-cal-cell b { font-size: 12px; }
.is-cal-cell small { font-size: 9px; line-height: 1.1; overflow: hidden; max-width: 100%; text-overflow: ellipsis; white-space: nowrap; }
button.is-cal-cell { cursor: pointer; }
button.is-cal-cell:hover, .is-cal-cell:focus-visible { outline: 2px solid var(--accent-gold); outline-offset: -2px; }
.is-cal-out { opacity: .35; background: transparent; border-style: dashed; }
.is-cal-none { background: var(--bg-row-alt); }
.is-cal-ok { background: var(--status-done-bg); color: var(--status-done-text); border-color: var(--status-done-border); }
.is-cal-warn { background: var(--status-pending-bg); color: var(--status-pending-text); border-color: var(--status-pending-border); }
.is-cal-bad { background: var(--status-down-bg); color: var(--status-down-text); border-color: var(--status-down-border); }
.is-cal-run { background: var(--accent-gold-ring); color: var(--accent-gold-deep); border-color: var(--accent-gold); }
.is-cal-miss { background: transparent; color: var(--text-secondary); border-style: dashed; }
.is-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--text-secondary); margin: 4px 0 0; }
.is-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; border: 1px solid var(--border); background: var(--bg-row-alt); }
.is-legend .k-ok::before { background: var(--status-done-text); }
.is-legend .k-warn::before { background: var(--status-pending-text); }
.is-legend .k-bad::before { background: var(--status-down-text); }
.is-legend .k-run::before { background: var(--accent-gold); }
.is-views { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-control); overflow: hidden; margin: 0 0 10px; }
.is-views button { background: var(--bg-card); border: 0; border-right: 1px solid var(--border); padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--text-secondary); }
.is-views button:last-child { border-right: 0; }
.is-views button.active { background: var(--accent-gold-ring); color: var(--text-primary); font-weight: 600; }
.is-view[hidden] { display: none; }
.is-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.is-share .is-sharebar { width: 28%; min-width: 80px; }
.is-share tfoot th { border-top: 1px solid var(--border); }
.is-pos { color: var(--status-done-text); font-variant-numeric: tabular-nums; }
.is-neg { color: var(--status-down-text); font-variant-numeric: tabular-nums; }
.is-mx td, .is-mx th { text-align: center; padding: 4px 6px; }
.is-mx td.is-mx-ok { background: var(--status-done-bg); color: var(--status-done-text); }
.is-mx td.is-mx-no { background: var(--status-down-bg); color: var(--status-down-text); }
.is-mx th:first-child, .is-mx td:first-child { text-align: left; white-space: nowrap; position: sticky; left: 0; background: var(--bg-card); }
.is-hmap td, .is-hmap th { text-align: center; padding: 2px; font-size: 10.5px; }
.is-hmap th:first-child, .is-hmap td:first-child { text-align: left; white-space: nowrap; padding-right: 8px; position: sticky; left: 0; background: var(--bg-card); font-size: 12px; }
.is-hmap td button, .is-hmap td span { display: block; width: 100%; min-width: 26px; padding: 5px 0; border: 1px solid var(--border); border-radius: 3px; font: inherit; font-size: 10.5px; background: var(--bg-row-alt); color: var(--text-secondary); }
.is-hmap td button { cursor: pointer; }
.is-hmap td .k-ok { background: var(--status-done-bg); color: var(--status-done-text); border-color: var(--status-done-border); }
.is-hmap td .k-warn { background: var(--status-pending-bg); color: var(--status-pending-text); border-color: var(--status-pending-border); }
.is-hmap td .k-bad { background: var(--status-down-bg); color: var(--status-down-text); border-color: var(--status-down-border); }
.is-hmap td .k-run { background: var(--accent-gold-ring); color: var(--accent-gold-deep); border-color: var(--accent-gold); }
.is-hmap td .k-none { background: transparent; border-style: dashed; }
.is-chips-btn { cursor: pointer; border: 0; font: inherit; }
.is-guide li { margin: 4px 0; }
.is-guide h3 { font-family: var(--font-display); font-size: 14px; margin: 14px 0 4px; }

.is-hmap th.is-mstart { border-left: 2px solid var(--accent-gold); }

/* =====================================================================================================================
   Readable, roomy layout (overrides the earlier compact sizes). Larger type, more air between things, calmer motion.
   ===================================================================================================================== */
#infrasys { font-size: 15px; line-height: 1.55; }
#infrasys .page-header { margin-bottom: 22px; }
#infrasys .page-subtitle { font-size: 15px; max-width: 80ch; }

/* the two data sources */
.is-source { gap: 12px; margin-bottom: 22px; }
.is-source-link { padding: 14px 20px; min-width: 260px; transition: border-color .15s, box-shadow .15s, transform .15s; }
.is-source-link b { font-size: 16px; }
.is-source-link span { font-size: 13.5px; }
.is-source-link:hover { transform: translateY(-1px); box-shadow: var(--shadow-card); }

/* tabs */
.is-tabs { gap: 4px; margin-bottom: 24px; position: sticky; top: 0; z-index: 5; background: var(--bg-cream); padding-top: 4px; }
.is-tab { padding: 14px 20px; font-size: 15.5px; border-bottom-width: 3px; transition: color .15s, border-color .15s, background .15s; border-radius: 6px 6px 0 0; }
.is-tab:hover { background: var(--bg-row-alt); }
.is-panel { animation: is-fade .18s ease-out; }
@keyframes is-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .is-panel { animation: none; } .is-source-link, .is-tab { transition: none; } }

/* cards and sections */
.is-card { padding: 20px 22px; margin-bottom: 22px; }
.is-card-head { margin-bottom: 12px; }
.is-card-head b { font-size: 17px; }
.is-note { font-size: 15px; margin-bottom: 14px; }
.is-small { font-size: 13.5px; }
.is-h { font-size: 17px; margin: 28px 0 12px; }
.is-sec { margin: 14px 0; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--bg-card); }
.is-sec > summary { padding: 14px 18px; font-size: 16px; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; cursor: pointer; }
.is-sec > summary::before { content: "\25B8"; color: var(--accent-gold-deep); transition: transform .15s; }
.is-sec[open] > summary::before { transform: rotate(90deg); }
.is-sec > summary:hover { background: var(--bg-row-alt); }
.is-sec[open] > summary { border-bottom: 1px solid var(--border); }
.is-sec > :not(summary) { margin-left: 18px; margin-right: 18px; }
.is-sec > :last-child { margin-bottom: 18px; }
.is-sec > summary + * { margin-top: 16px; }

/* number tiles */
.is-stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 14px 0; }
.is-stats-wide { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.is-summary { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.is-stat { padding: 14px 16px; border-radius: var(--radius-card); }
.is-stat-l { font-size: 12px; letter-spacing: .06em; margin-bottom: 4px; }
.is-stat-v { font-size: 20px; line-height: 1.25; }
.is-card-o .is-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.is-card-o .is-stat { padding: 10px 12px; }
.is-card-o .is-stat-v { font-size: 17px; }

/* chips, badges, flags */
.badge-status { font-size: 12.5px; padding: 4px 11px; }
.is-chip { font-size: 13px; padding: 4px 11px; }
.is-chips { gap: 8px; }
.is-flag { font-size: 14.5px; padding: 10px 14px; line-height: 1.5; }
.is-flags { gap: 8px; margin: 12px 0; }
.is-push { font-size: 14.5px; gap: 8px; margin: 12px 0; }
.is-legend { font-size: 13.5px; gap: 8px 18px; margin: 10px 0 14px; }
.is-legend span::before { width: 14px; height: 14px; }
.is-delta { font-size: 14px; }

/* toolbars and tables */
#infrasys .filter-bar { padding: 16px 18px; gap: 12px; margin-bottom: 18px; }
#infrasys .filter-left { gap: 12px; }
#infrasys .admin-select, #infrasys .admin-search-input { min-height: 42px; font-size: 15px; }
#infrasys .btn { font-size: 14.5px; }
#infrasys .btn-sm { padding: 8px 14px; min-height: 36px; }
.is-tbar { gap: 12px; margin-bottom: 12px; }
.is-search { max-width: 340px; }
.is-info { font-size: 14px; }
.is-compact th, .is-compact td { padding: 12px 16px; font-size: 14.5px; line-height: 1.45; }
.is-compact thead th { font-size: 12.5px; letter-spacing: .05em; white-space: nowrap; }
.is-compact tbody tr { transition: background .12s; }
.is-compact tbody tr:hover td { background: var(--bg-row-alt); }
.is-scroll { max-height: 640px; }
.is-compact td:first-child, .is-compact th:first-child { position: sticky; left: 0; background: var(--bg-card); z-index: 1; }
.is-compact thead th:first-child { z-index: 3; }
.is-roomy th, .is-roomy td { padding: 14px 18px; font-size: 15px; text-align: left; vertical-align: top; }
.is-roomy th { font-size: 12.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-secondary); }
.is-roomy td.is-num, .is-roomy th.is-num { text-align: right; }
.is-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; overflow-wrap: anywhere; }
.is-share .is-sharebar { width: 30%; min-width: 120px; }
.is-two { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 22px; }

/* outlet cards of the monitor */
.is-grid { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 18px; }
.is-card-o { padding: 18px 20px; gap: 12px; transition: box-shadow .15s, transform .15s; }
.is-card-o:hover { box-shadow: var(--shadow-card-md); transform: translateY(-1px); }
.is-o-name { font-size: 17px; }
.is-file { font-size: 13px; padding: 3px 11px; }
.is-card-o footer { margin-top: 4px; }

/* run progress */
.is-orun { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.is-orow { padding: 14px 16px; gap: 8px; }
.is-phases { font-size: 13.5px; gap: 8px; }
.is-phases li { padding: 5px 13px; }
.is-bar { height: 12px; }
.is-bar.is-thin { height: 8px; }
.is-pbox { gap: 10px; margin: 14px 0; }

/* calendar and charts */
.is-cal { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 20px; }
.is-cal-month { padding: 16px 18px; }
.is-cal-title { font-size: 16px; margin-bottom: 10px; }
.is-cal-grid { gap: 6px; }
.is-cal-wd { font-size: 12px; padding-bottom: 4px; }
.is-cal-cell { min-height: 62px; padding: 4px; transition: transform .1s, box-shadow .1s; }
.is-cal-cell b { font-size: 15px; }
.is-cal-cell small { font-size: 11px; }
button.is-cal-cell:hover { transform: translateY(-1px); box-shadow: var(--shadow-card); }
.is-chart { padding: 14px 16px; }
.is-svg { max-height: 300px; }
.is-svg-text { font-size: 11px; }
.is-views button { padding: 10px 20px; font-size: 14.5px; }
.is-views { margin-bottom: 18px; }

/* heat map: big cells, readable header, amounts inside the cells */
.is-hmap { border-collapse: separate; border-spacing: 5px; }
.is-hmap th, .is-hmap td { padding: 0; }
.is-hmap thead th { font-size: 13px; padding: 4px 0 8px; min-width: 62px; color: var(--text-secondary); font-weight: 600; }
.is-hmap th:first-child, .is-hmap td:first-child { font-size: 15px; font-weight: 600; padding-right: 16px; min-width: 190px; }
.is-hmap td button, .is-hmap td span { min-width: 62px; height: 62px; padding: 6px 2px; font-size: 18px; border-radius: 8px; display: grid; align-content: center; justify-items: center; line-height: 1.1; transition: transform .1s, box-shadow .1s; }
.is-hmap td button small, .is-hmap td span small { font-size: 11px; opacity: .85; }
.is-hmap td button:hover { transform: scale(1.06); box-shadow: var(--shadow-card-md); position: relative; z-index: 2; }
.is-hmap th.is-mstart { border-left: 3px solid var(--accent-gold); padding-left: 4px; }
.is-hmap tr:hover td:first-child { color: var(--accent-gold-deep); }

/* upload */
.is-drop { padding: 40px 20px; font-size: 16px; transition: border-color .15s, background .15s; }
.is-files-list li { padding: 10px 14px; font-size: 14.5px; }

/* messages, push box */
.is-err { padding: 14px 18px; font-size: 15px; }
.is-pushbox { padding: 20px 22px; gap: 12px; margin: 20px 0; }
.is-pushbox > b { font-size: 17px; }
.is-check { font-size: 14.5px; gap: 8px; }
#infrasys .flash-alert { font-size: 15px; padding: 14px 18px; }

/* =====================================================================================================================
   Modal (opened books, comparisons)
   ===================================================================================================================== */
body.is-modal-open { overflow: hidden; }
.is-modal-overlay { position: fixed; inset: 0; background: rgba(26, 16, 8, .62); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 16px; z-index: 200; overflow-y: auto; animation: is-fade .15s ease-out; }
.is-modal { background: var(--bg-cream); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-card-md); width: min(760px, 100%); outline: none; }
.is-modal-wide { width: min(1080px, 100%); }
.is-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 24px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg-cream); border-radius: 12px 12px 0 0; z-index: 2; }
.is-modal-title { margin: 0; font-family: var(--font-display); font-size: 20px; }
.is-modal-body { padding: 22px 24px 28px; font-size: 15px; line-height: 1.55; }
.is-compare-note { color: var(--text-secondary); margin: 0 0 16px; }

/* =====================================================================================================================
   Library (CSV archive): shelves of books, a book per business day
   ===================================================================================================================== */
.is-lib { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; align-items: start; }
.is-lib-side { position: sticky; top: 64px; display: grid; gap: 8px; }
.is-lib-h { margin: 0 0 4px; font-family: var(--font-display); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary); }
.is-shelf { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left; padding: 14px 16px; border: 1px solid var(--border); border-left: 5px solid var(--input-border); border-radius: var(--radius-card); background: var(--bg-card); font: inherit; cursor: pointer; color: var(--text-primary); transition: border-color .15s, background .15s, box-shadow .15s; }
.is-shelf:hover { box-shadow: var(--shadow-card); }
.is-shelf.active { border-left-color: var(--accent-gold); background: var(--accent-gold-ring); }
.is-shelf-name { display: grid; gap: 2px; }
.is-shelf-name b { font-size: 16px; }
.is-shelf-name small { color: var(--text-secondary); font-size: 13px; }
.is-shelf-count { font-size: 13.5px; font-weight: 700; min-width: 34px; text-align: center; padding: 4px 10px; border-radius: 999px; background: var(--bg-row-alt); }
.is-lib-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 20px; }
.is-lib-bar .is-info { margin-left: auto; }
.is-lib-month { margin: 0 0 24px; }
.is-lib-month > summary { cursor: pointer; font-size: 17px; font-family: var(--font-display); padding: 8px 0 14px; list-style: none; display: flex; gap: 10px; align-items: baseline; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.is-lib-month > summary::before { content: "\25B8"; color: var(--accent-gold-deep); transition: transform .15s; }
.is-lib-month[open] > summary::before { transform: rotate(90deg); }
.is-lib-books { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.is-book { display: flex; gap: 14px; align-items: center; text-align: left; padding: 16px 18px; border: 1px solid var(--border); border-left: 6px solid var(--status-done-text); border-radius: var(--radius-card); background: var(--bg-card); font: inherit; color: var(--text-primary); cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; }
.is-book-bad { border-left-color: var(--status-down-text); }
.is-book:hover, .is-book:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow-card-md); outline: none; border-color: var(--accent-gold); }
.is-book-day { display: grid; justify-items: center; min-width: 56px; padding-right: 14px; border-right: 1px solid var(--border); }
.is-book-day b { font-family: var(--font-display); font-size: 30px; line-height: 1; }
.is-book-day small { color: var(--text-secondary); font-size: 13px; margin-top: 4px; }
.is-book-info { display: grid; gap: 3px; min-width: 0; }
.is-book-info b { font-size: 15.5px; overflow-wrap: anywhere; }
.is-book-info small { color: var(--text-secondary); font-size: 13.5px; }
.is-book-badge { justify-self: start; margin-top: 4px; font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--status-done-bg); color: var(--status-done-text); }
.is-book-bad .is-book-badge { background: var(--status-down-bg); color: var(--status-down-text); }
.is-book-open .is-preview { margin-top: 12px; }

@media (max-width: 900px) {
  .is-lib { grid-template-columns: 1fr; }
  .is-lib-side { position: static; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); overflow-x: auto; padding-bottom: 6px; }
  .is-lib-h { display: none; }
  .is-grid, .is-cal, .is-orun { grid-template-columns: 1fr; }
  .is-two { grid-template-columns: 1fr; }
  .is-tab { padding: 12px 14px; font-size: 14.5px; }
  .is-modal-overlay { padding: 0; }
  .is-modal { border-radius: 0; min-height: 100vh; }
}

/* grids never force the page wider than the screen: a column is at most the width of the container */
.is-two { grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); }
.is-grid { grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr)); }
.is-cal { grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr)); }
.is-orun { grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); }
.is-lib-books { grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); }
.is-stats, .is-stats-wide, .is-summary { grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); }
.is-two > *, .is-grid > *, .is-cal > *, .is-lib-main { min-width: 0; }
@media (max-width: 900px) {
  .is-grid, .is-cal, .is-orun, .is-two { grid-template-columns: minmax(0, 1fr); }
  .is-lib { grid-template-columns: minmax(0, 1fr); }
}

.is-row.is-between { flex-wrap: wrap; }
.is-card-o, .is-card-o > * { min-width: 0; max-width: 100%; }
.is-card-o header { flex-wrap: wrap; gap: 8px; }
.is-files { flex-wrap: wrap; }
.is-card-o footer { flex-wrap: wrap; }

.is-compare-btn { white-space: normal; text-align: left; width: 100%; line-height: 1.4; padding: 11px 14px; }

.is-book-open > * + * { margin-top: 20px; }
.is-modal-body .is-stats { margin-top: 0; }

/* ---- pagination ---- */
.is-pagebar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0 14px; }
.is-pagebar nav[hidden], .is-pagebar select[hidden] { display: none; }
.is-pager { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.is-pg { min-width: 36px; min-height: 36px; padding: 4px 10px; font-size: 14px; }
.is-pg.is-cur { background: var(--accent-gold); border-color: var(--accent-gold); color: var(--on-accent, #fff); font-weight: 700; }
.is-pg[disabled] { opacity: .45; cursor: not-allowed; }
.is-gap { padding: 0 4px; color: var(--text-secondary); }
.is-pgof { margin-left: 8px; font-size: 13px; color: var(--text-secondary); }
.is-size { min-height: 36px; font-size: 14px; }

/* ---- phones and small tablets ---- */
@media (max-width: 760px) {
  .is-tbar > * { flex: 1 1 100%; max-width: none; }
  .is-tbar .btn { width: 100%; min-height: 42px; }
  .is-tbar select, .is-tbar input { min-height: 42px; font-size: 16px; } /* 16px stops iOS zooming the page on focus */
  .is-pagebar { justify-content: center; }
  .is-pager { justify-content: center; }
  .is-pgof { display: none; }
  .is-pg { min-width: 42px; min-height: 42px; }
  .is-modal, .is-modal-box { max-width: 100vw; }
  /* a table with few columns becomes one card per row; every cell says what it is */
  .is-scroll { max-height: none; }
  .admin-table.is-stack thead { display: none; }
  .admin-table.is-stack, .admin-table.is-stack tbody { display: block; width: 100%; }
  .admin-table.is-stack tr { display: block; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--bg-card); margin: 0 0 10px; padding: 4px 0; }
  .admin-table.is-stack td { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; border: 0; padding: 6px 12px; text-align: right; font-size: 14px; overflow-wrap: anywhere; }
  .admin-table.is-stack td::before { content: attr(data-label); flex: 0 0 38%; max-width: 38%; text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--text-secondary); }
  .admin-table.is-stack td:not([data-label])::before { content: none; }
  .admin-table.is-stack td.cell-empty { display: block; text-align: center; }
  .admin-table.is-stack td.cell-empty::before { content: none; }
  .admin-table.is-stack td.is-num { text-align: right; }
}
@media (max-width: 760px) {
  .is-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
  .is-tab { flex: 0 0 auto; white-space: nowrap; }
  .is-modal-overlay { padding: 0; align-items: stretch; }
  .is-modal, .is-modal-wide { width: 100%; min-height: 100%; border-radius: 0; border: 0; }
  .is-modal-head { border-radius: 0; padding: 14px 16px; }
}

/* ---- pipeline stepper ---- */
/* Source > Files > Combine > Separate > Check > Send: the same list on both routes. Colours from tokens only. */
.is-pipe { list-style: none; display: flex; margin: 0 0 18px; padding: 0; }
.is-pipe-step { flex: 1 1 0; min-width: 0; position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 6px; }
/* Connector = the bar between two dots: it starts 6px after the previous dot and stops 6px before this one, and sits on the dots' centre line.
   It is gold when the step before it is finished (done / warn), grey otherwise, dashed when either side is switched off. */
.is-pipe-step::before { content: ''; position: absolute; top: 14.5px; left: calc(-50% + 22px); width: calc(100% - 44px); height: 3px; border-radius: 2px; background: var(--border); z-index: 0; }
.is-pipe-live .is-pipe-step::before { top: 18.5px; } /* the step buttons have 4px padding above the dot */
.is-pipe-step:first-child::before { display: none; }
.is-pipe-done + .is-pipe-step::before, .is-pipe-warn + .is-pipe-step::before { background: var(--accent-gold); }
.is-pipe-off + .is-pipe-step::before, .is-pipe-step.is-pipe-off::before { background: repeating-linear-gradient(90deg, var(--border-strong, var(--border)) 0 6px, transparent 6px 12px); }
.is-pipe-dot { position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font: 700 13px var(--font-body); border: 2px solid var(--border); background: var(--bg-card); color: var(--text-secondary); }
.is-pipe-done .is-pipe-dot { background: linear-gradient(var(--status-done-bg), var(--status-done-bg)), var(--bg-card); border-color: var(--status-done-text); color: var(--status-done-text); }
.is-pipe-warn .is-pipe-dot { background: linear-gradient(var(--status-pending-bg), var(--status-pending-bg)), var(--bg-card); border-color: var(--status-pending-text); color: var(--status-pending-text); }
.is-pipe-bad .is-pipe-dot { background: linear-gradient(var(--status-down-bg), var(--status-down-bg)), var(--bg-card); border-color: var(--status-down-text); color: var(--status-down-text); }
.is-pipe-active .is-pipe-dot { background: var(--accent-gold); border-color: var(--accent-gold-deep); color: var(--text-primary); box-shadow: 0 0 0 4px var(--accent-gold-ring); }
.is-pipe-off .is-pipe-dot { border-style: dashed; }
.is-pipe-body { margin-top: 6px; min-width: 0; max-width: 100%; display: grid; gap: 1px; }
.is-pipe-body b { font-size: 13px; }
.is-pipe-off .is-pipe-body b, .is-pipe-todo .is-pipe-body b { color: var(--text-secondary); font-weight: 600; }
.is-pipe-sub { font-size: 12px; color: var(--text-secondary); overflow-wrap: anywhere; }
.is-pipe-compact .is-pipe-sub { display: none; }
.is-pipe-compact .is-pipe-dot { width: 26px; height: 26px; font-size: 11.5px; }
.is-pipe-compact .is-pipe-step::before { top: 11.5px; left: calc(-50% + 19px); width: calc(100% - 38px); }
.is-pipe-card { padding: 14px 10px 6px; margin-bottom: 14px; }
@media (max-width: 760px) {
  .is-pipe { flex-direction: column; gap: 2px; }
  .is-pipe-step { flex-direction: row; align-items: flex-start; text-align: left; gap: 12px; padding: 0 0 12px; }
  .is-pipe-step::before { display: none; }
  .is-pipe-step:not(:last-child)::after { content: ''; position: absolute; top: 38px; bottom: 4px; left: 14.5px; width: 3px; border-radius: 2px; background: var(--border); }
  .is-pipe-live .is-pipe-step:not(:last-child)::after { top: 42px; left: 20.5px; }
  .is-pipe-done:not(:last-child)::after, .is-pipe-warn:not(:last-child)::after { background: var(--accent-gold); }
  .is-pipe-off:not(:last-child)::after { background: repeating-linear-gradient(180deg, var(--border) 0 6px, transparent 6px 12px); }
  .is-pipe-body { margin-top: 2px; }
}
.is-lab-drop { border: 2px dashed var(--input-border); border-radius: var(--radius-card); padding: 22px; text-align: center; cursor: pointer; background: var(--bg-card); }
.is-lab-drop:hover, .is-lab-drop.over { border-color: var(--accent-gold); background: var(--accent-gold-ring); }
.is-lab-drop:focus-visible { outline: 2px solid var(--accent-gold); outline-offset: 2px; }
.is-pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--bg-row-alt); color: var(--text-secondary); white-space: nowrap; }
.is-pill.ok { background: var(--status-done-bg); color: var(--status-done-text); }
.is-pill.warn { background: var(--status-pending-bg); color: var(--status-pending-text); }
.is-pill.bad { background: var(--status-down-bg); color: var(--status-down-text); }
.is-in { width: 100%; min-width: 110px; }
.is-scroll { overflow: auto; max-height: 560px; border: 1px solid var(--border); border-radius: var(--radius-card); }
.is-sub { margin: 4px 0 0; }

/* ---- hub card ---- */
/* One card: data source, the pipeline (each step a button) and the tabs that belong to the open step. */
.is-hub { padding: 16px 18px 6px; margin-bottom: 16px; }
.is-hub-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.is-route { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--bg-row-alt); }
.is-route-link { display: grid; gap: 0; padding: 7px 16px; border-radius: calc(var(--radius-card) - 2px); color: var(--text-secondary); text-decoration: none; }
.is-route-link b { font-size: 13.5px; color: inherit; }
.is-route-link span { font-size: 12px; }
.is-route-link:hover { color: var(--text-primary); }
.is-route-link.active { background: var(--bg-card); color: var(--text-primary); box-shadow: var(--shadow-card); outline: 1px solid var(--accent-gold); }
.is-hub-pipe { min-height: 92px; }
.is-pipe-btn { background: none; border: 0; padding: 4px 6px 8px; margin: 0; font: inherit; color: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; width: 100%; border-radius: var(--radius-card); }
.is-pipe-btn:hover:not(:disabled) .is-pipe-body b { text-decoration: underline; }
.is-pipe-btn:focus-visible { outline: 2px solid var(--accent-gold); outline-offset: 1px; }
.is-pipe-btn:disabled { cursor: default; opacity: .55; }
.is-pipe-current .is-pipe-btn { background: var(--accent-gold-ring); }
.is-pipe-current .is-pipe-body b { color: var(--text-primary); }
.is-hub-tabs { margin: 6px -18px 0; padding: 0 12px; border-top: 1px solid var(--border); border-bottom: 0; background: var(--bg-row-alt); border-radius: 0 0 var(--radius-card) var(--radius-card); }
.is-hub-tabs .is-tab[hidden] { display: none; }
.is-hub + .flash-alert, .is-hub ~ .is-panel { margin-top: 0; }
@media (max-width: 760px) {
  .is-pipe-btn { flex-direction: row; align-items: flex-start; gap: 12px; text-align: left; padding: 2px 6px 8px; }
  .is-route { width: 100%; }
  .is-route-link { flex: 1; }
}

/* ---- what is missing and why (under the stepper) ---- */
.is-why { color: var(--text-primary); margin: 4px 0 14px; padding: 12px 14px; border: 1px solid var(--border); border-left-width: 4px; border-radius: var(--radius-card); background: var(--bg-card); display: grid; gap: 10px; font-size: 14px; line-height: 1.5; }
.is-why-bad { border-left-color: var(--status-down-text); }
.is-why-info { border-left-color: var(--accent-gold); }
.is-why-closed { border-left-color: var(--input-border); background: var(--bg-row-alt); }
.is-why-head b { font-size: 15px; }
.is-why-table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.is-why-table th, .is-why-table td { padding: 6px 10px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.is-why-table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-secondary); }
.is-why-c.is-why-ok { color: var(--status-done-text); }
.is-why-c.is-why-missing { color: var(--status-down-text); background: var(--status-down-bg); font-weight: 600; }
.is-why-c.is-why-unknown { color: var(--text-secondary); }
.is-why-title { margin: 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-secondary); }
.is-why-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.is-why-list li { padding: 7px 11px; border-radius: var(--radius-control); background: var(--bg-row-alt); color: var(--text-secondary); overflow-wrap: anywhere; }
.is-why-list li.is-why-bad { background: var(--status-down-bg); color: var(--status-down-text); }
.is-why-list li.is-why-warn { background: var(--status-pending-bg); color: var(--status-pending-text); }
.is-v-closed { border-left-color: var(--input-border); opacity: .85; }
@media (max-width: 760px) { .is-why { padding: 10px 12px; } .is-why-table th, .is-why-table td { padding: 5px 8px; } }
.is-why b, .is-why-table tbody th { color: var(--text-primary); }
