/* Panel fixes on top of the template's style.css (loaded after it).
   Same look, readable colours: every pair here meets WCAG AA 4.5:1. */
:root {
  --pi-blue: #143493;   /* the brand blue of the top bar */
  --pi-green: #0b7a3b;  /* was #11c15b, 2.4:1 with white */
  --pi-red: #c62828;    /* was #ff5252, 3.2:1 with white */
  --pi-muted: #5f6b73;  /* was #78909c / #aaa, 3.4:1 and 2.3:1 on white */
  --pi-teal: #00796b;   /* was #00bcd4, 2.3:1 with white */
}

.text-success, .text-c-green { color: var(--pi-green) !important; }
.text-danger, .text-c-red { color: var(--pi-red) !important; }
.bg-success, .bg-c-green, .label-success { background: var(--pi-green) !important; }
.bg-danger, .bg-c-red, .label-danger { background: var(--pi-red) !important; }
.text-muted, .form-group label { color: var(--pi-muted) !important; }
.text-info { color: var(--pi-teal) !important; }
.bg-info, .label-info { background: var(--pi-teal) !important; }
.nz-idle { background: var(--pi-blue) !important; color: #fff; }

/* The template removes outlines; give keyboard users a visible focus. */
:focus-visible { outline: 2px solid var(--pi-blue) !important; outline-offset: 2px; }

/* Panel shell: one font, type scale, banner */
/* One font. The login's argonstyle.css sets Rubik (body) and Open Sans (card
   body); chart and map libraries set Verdana/Helvetica. Icon fonts set
   their own family on their own classes and are untouched. */
:root { --bs-font-sans-serif: "Roboto", sans-serif; }
.card .card-body, body .leaflet-container { font-family: "Roboto", sans-serif; } /* leaflet.css loads after this file */
svg text { font-family: "Roboto", sans-serif !important; } /* ApexCharts writes it inline */
select.goog-te-combo, .pcoded-header .logo-text { font-family: "Roboto", sans-serif; } /* Google's picker sets Arial; style.css sets Open Sans */
/* Fixed steps, ratio ~1.15: 12 small, 13 caption (p), 14 body, 16 card title,
   18 figure, 20 page title. Body and p already sit at 14 / 13 in style.css.
   The template had headings at 15 / 20 / 22 and a link size that jumped from
   13 to 14 px at 1400 px wide; links now take their text's size. */
a { font-size: inherit; }
small, .btn-sm, .btn-mini, .label { font-size: .75rem; }
h4 { font-size: 1.125rem; }
h5, .card .card-header h5 { font-size: 1rem; }
.alert { font-size: .875rem; } /* style.css has 15 px, off the scale */
/* Banner: ~64 px on desktop (was 122). Title and subtitle stay stacked, the
   breadcrumb stays right. The extra 25% shade under the template's overlay
   keeps white text at 4.5:1 even over the photo's brightest road markings
   (measured 3.3:1 there without it). */
.page-header .page-block { padding: 10px 40px; background: rgba(0, 0, 0, .25); }
.page-header .page-header-title h5 { font-size: 1.25rem; line-height: 1.2; margin-bottom: 2px; }
.page-header .page-header-title p { line-height: 1.4; }
/* Phones: the columns stack, the breadcrumb sits just under the subtitle. */
@media (max-width: 768px) {
  .page-header .page-block { padding: 8px 20px; }
  .page-header .page-block .breadcrumb-title { margin-top: 2px; }
}

/* The station switcher lists every station. Past about 15 it ran below the
   window inside the fixed top bar, so the wheel moved the page, not the list. */
.header-navbar .navbar-wrapper .navbar-container .nav-left .header-notification .profile-notification { max-height: calc(100vh - 90px); overflow-y: auto; overscroll-behavior: contain; }

/* Figures in tables line up. */
table { font-variant-numeric: tabular-nums; }

/* Wide tables scroll sideways inside their card. Covers the DataTables
   wrapper and any plain .table's own box; the bar stays visible so a cut-off
   column reads as "scroll", not "missing". */
.card div:has(> table.table) { overflow-x: auto; }
.card div:has(> table.table)::-webkit-scrollbar { height: 10px; }
.card div:has(> table.table)::-webkit-scrollbar-track { background: #eef1f3; }
.card div:has(> table.table)::-webkit-scrollbar-thumb { background: #8a959c; border-radius: 5px; }

/* Google Translate injects a banner frame and sets body{top:40px} once it
   loads. The fixed top bar already hides the banner, so the offset only
   pushed the page down late. Keep the picker, drop the banner and offset. */
iframe.goog-te-banner-frame, iframe.VIpgJd-ZVi9od-ORHb-OEVmcd { display: none !important; }
body { top: 0 !important; }

/* Template buttons, badges and border-* boxes in the same readable colours.
   Hover darkens instead of the template's lighter (less readable) shade. */
.btn-success, .btn-success:hover, .btn-success:focus, .badge-success { background-color: var(--pi-green) !important; border-color: var(--pi-green) !important; }
.btn-danger, .btn-danger:hover, .btn-danger:focus, .badge-danger { background-color: var(--pi-red) !important; border-color: var(--pi-red) !important; }
.btn-info, .btn-info:hover, .btn-info:focus, .badge-info { background-color: var(--pi-teal) !important; border-color: var(--pi-teal) !important; }
.btn-success:hover, .btn-danger:hover, .btn-info:hover { filter: brightness(0.9); }

/* ------------------------------------------------------------------------
   Report pages (Transaction Report, Deliveries, Shift Report). One kit so the
   three read as one report: labelled filters, a totals strip, sections with a
   plain heading, light tables with right-aligned figures, CSS bars. Wrap the
   page body in .rpt. Same Roboto and brand blue as the rest of the panel. */
.rpt { --rpt-ink: #1b2733; --rpt-line: #e2e6ea; --rpt-soft: #f4f6f8; --rpt-bar: var(--pi-blue); --rpt-bar-2: #9fb0dc; color: var(--rpt-ink); }
.rpt h2 { font-size: 1.0625rem; font-weight: 600; margin: 0; color: var(--rpt-ink); }
.rpt-sub { font-size: .875rem; color: var(--pi-muted); margin: 2px 0 12px; }
.rpt-note { font-size: .8125rem; color: var(--pi-muted); }
.rpt-section { margin-top: 32px; }
.rpt-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-end; justify-content: space-between; margin-bottom: 12px; }
.rpt-head .rpt-sub { margin-bottom: 0; }
.rpt-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rpt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 32px; }

/* Filters: visible labels above the controls, one row on desktop. */
.rpt-filters { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; padding: 16px; background: var(--rpt-soft); border-radius: 8px; }
.rpt-field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 170px; min-width: 0; }
.rpt-field > label { font-size: .8125rem; font-weight: 500; color: var(--pi-muted); margin: 0; }
.rpt-filters .form-control { height: 38px; padding: 6px 10px; border: 1px solid #c3ccd4; border-radius: 6px; background: #fff; color: var(--rpt-ink); }
.rpt-filters .btn { height: 38px; padding: 0 20px; border-radius: 6px; flex: 0 0 auto; }

/* Totals strip: one bordered row of figures, hairline dividers, wraps 2-up on phones. */
.rpt-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--rpt-line); border: 1px solid var(--rpt-line); border-radius: 8px; overflow: hidden; margin-top: 16px; }
.rpt-kpi { background: #fff; padding: 14px 18px; min-width: 0; }
.rpt-kpi-label { font-size: .8125rem; color: var(--pi-muted); }
.rpt-kpi-value { font-size: clamp(1.125rem, 1.5vw, 1.5rem); font-weight: 600; line-height: 1.25; font-variant-numeric: tabular-nums; }
.rpt-kpi-value small { font-size: .8125rem; font-weight: 500; color: var(--pi-muted); margin-left: 3px; display: inline-block; }
.rpt-kpi.is-alert .rpt-kpi-value { color: var(--pi-red); }
.rpt-delta { font-size: .8125rem; font-variant-numeric: tabular-nums; color: var(--pi-muted); }
.rpt-delta.up { color: var(--pi-green); }
.rpt-delta.down { color: var(--pi-red); }

/* Tables: light header, hairlines, figures right-aligned. */
.rpt-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.rpt-table th { background: var(--rpt-soft); color: var(--rpt-ink); font-weight: 600; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rpt-line); white-space: nowrap; }
.rpt-table td { padding: 9px 12px; border-bottom: 1px solid var(--rpt-line); vertical-align: middle; }
.rpt-table tbody tr:hover { background: #f9fafb; }
/* all_header.php has a global .num (tank gauge label: absolute, 28px, bold); reset it for table cells. */
.rpt-table .num { position: static; width: auto; height: auto; display: table-cell; font-size: inherit; font-weight: inherit; color: inherit; z-index: auto; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rpt-table th.num, .rpt-table tfoot td.num { font-weight: 600; }
.rpt-table tfoot td { font-weight: 600; border-top: 2px solid var(--rpt-line); border-bottom: 0; }
.rpt-table td small { color: var(--pi-muted); }

/* Bars: horizontal share bars and a vertical column chart (days, hours). */
.rpt-bar { height: 8px; background: var(--rpt-soft); border-radius: 4px; overflow: hidden; min-width: 60px; }
.rpt-bar > span { display: block; height: 100%; background: var(--rpt-bar); border-radius: 4px; }
.rpt-cols { display: flex; align-items: flex-end; gap: 3px; height: 160px; border-bottom: 1px solid #c3ccd4; }
.rpt-cols > span { flex: 1 1 0; min-width: 2px; min-height: 1px; background: var(--rpt-bar); border-radius: 3px 3px 0 0; }
.rpt-cols > span.is-prev { background: var(--rpt-bar-2); }
.rpt-cols > span:hover { filter: brightness(1.25); }
.rpt-axis { display: flex; justify-content: space-between; gap: 4px; font-size: .75rem; color: var(--pi-muted); margin-top: 6px; font-variant-numeric: tabular-nums; }

/* Badges and the grade dot. Every pair meets 4.5:1. */
.rpt-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.rpt-badge.ok { background: #e2f1e8; color: #0b5a2d; }
.rpt-badge.warn { background: #fff1d0; color: #6e4300; }
.rpt-badge.bad { background: #fde5e5; color: #a01b1b; }
.rpt-badge.info { background: #e5eaf8; color: var(--pi-blue); }
.rpt-badge.neutral { background: #eceff2; color: #3b4853; }
.rpt-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18); }

.rpt-empty { padding: 32px 16px; text-align: center; color: var(--pi-muted); }
.rpt-empty strong { display: block; color: var(--rpt-ink); font-weight: 600; margin-bottom: 4px; }
.rpt-loading { opacity: .5; transition: opacity .2s ease-out; }

@media (max-width: 575px) {
  .rpt-kpis { grid-template-columns: 1fr 1fr; }
  .rpt-kpi { padding: 12px 14px; }
  .rpt-kpi-value { font-size: 1.25rem; }
  .rpt-filters .btn { width: 100%; }
  .rpt-grid { grid-template-columns: 1fr; gap: 24px; }
}
