/* pgapp theme: apex_universal
 * Evokes Oracle APEX's "Universal Theme" (Theme 42, the "Vita" default
 * color scheme that shipped with every APEX app for years before
 * Redwood): white regions with a bold title underlined in APEX's
 * signature blue, rectangular low-radius buttons (solid blue for
 * primary, light gray for secondary), a plain white top nav bar with a
 * thin bottom border, and a light-gray Interactive-Report-style table
 * header. Not a pixel-exact reproduction (Universal Theme is a large,
 * JavaScript-templated component library; this is a plain CSS file
 * over the fixed `.pgapp-*` contract, same as every other theme here) —
 * the goal is "recognizably Universal Theme," the same spirit as
 * themes/plain and themes/vivid rather than themes/shadcn's literal
 * design-system parity. No dark mode: Universal Theme predates
 * APEX's Redwood-era dark mode support, so this theme doesn't attempt
 * one either.
 */

:root {
  color-scheme: light;

  --au-blue: #2c67c8;
  --au-blue-dark: #1f4f9e;
  --au-red: #c74634;
  --au-border: #d9d9d9;
  --au-bg: #fff;
  --au-header-bg: #f7f7f7;
  --au-text: #333;
  --au-muted: #6f6f6f;
  --au-radius: 3px;

  /* Chart categorical palette (bar/pie/donut per-category fill, see
     render.rs's `chart_slice_fill`) — the dataviz skill's validated
     8-hue reference order (worst adjacent CVD ΔE 9.1, worst adjacent
     normal-vision ΔE 19.6 in light mode; this theme has no dark mode). */
  --chart-1: #2a78d6;
  --chart-2: #008300;
  --chart-3: #e87ba4;
  --chart-4: #eda100;
  --chart-5: #1baf7a;
  --chart-6: #eb6834;
  --chart-7: #4a3aa7;
  --chart-8: #e34948;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 14px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
  color: var(--au-text);
  background: var(--au-bg);
}

/* Top nav: a plain white bar with a thin bottom border, the app name
   bold on the left — Universal Theme's default "Desktop" header
   template, minus its JS-driven mega-menu. */
.pgapp-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  row-gap: 0.35rem;
  gap: 1.25rem;
  margin: 0 -1.25rem 1.5rem;
  padding: 0.85rem 1.25rem;
  background: var(--au-header-bg);
  border-bottom: 1px solid var(--au-border);
}
.pgapp-nav-collapse { display: flex; align-items: center; flex-wrap: wrap; row-gap: 0.35rem; gap: 1.25rem; flex: 1; }
.pgapp-nav-toggle { display: none; border: none; background: transparent; cursor: pointer; font-size: 1.25rem; line-height: 1; padding: 0.1rem 0.35rem; color: var(--au-text); }
.pgapp-link { color: var(--au-blue); text-decoration: none; }
.pgapp-link:hover { text-decoration: underline; }
.pgapp-row-link::after { content: " \2192"; opacity: 0.6; }
.pgapp-title { margin: 1.5rem 0 1rem; font-size: 1.5rem; }
.pgapp-subtitle {
  margin: 1.75rem 0 0.9rem;
  font-size: 1.05rem;
  font-weight: 700;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--au-blue);
}

.pgapp-navbar { display: flex; flex-wrap: wrap; row-gap: 0.35rem; gap: 1.25rem; list-style: none; margin: 0; padding: 0; }
.pgapp-navbar-item { position: relative; }
.pgapp-navbar-label { color: var(--au-text); font-weight: 600; }
.pgapp-navbar-submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 9rem;
  margin: 0;
  padding: 0.4rem 0;
  list-style: none;
  background: var(--au-bg);
  border: 1px solid var(--au-border);
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.12);
  z-index: 20;
}
.pgapp-navbar-item.pgapp-open > .pgapp-navbar-submenu,
.pgapp-navbar-item:hover > .pgapp-navbar-submenu,
.pgapp-navbar-item:focus-within > .pgapp-navbar-submenu { display: block; }
.pgapp-navbar-submenu .pgapp-navbar-item { display: block; }
.pgapp-navbar-submenu .pgapp-link { display: block; padding: 0.4rem 0.9rem; color: var(--au-text); }
.pgapp-navbar-submenu .pgapp-link:hover { background: var(--au-header-bg); text-decoration: none; }
.pgapp-navbar-row { display: inline-flex; align-items: center; }
.pgapp-navbar-toggle { border: none; background: transparent; cursor: pointer; padding: 0.2rem 0.35rem; font-size: 0.65rem; color: var(--au-muted); }

.pgapp-nav-user { margin-left: auto; display: flex; align-items: center; gap: 0.75rem; }
.pgapp-nav-user .pgapp-inline-form { margin-left: 0; }
.pgapp-nav-username { font-weight: 700; }

.pgapp-items { margin-bottom: 1rem; }
.pgapp-text { color: var(--au-muted); }

.pgapp-table { border-collapse: collapse; width: 100%; margin-bottom: 1.5rem; font-size: 0.9rem; }
.pgapp-table th, .pgapp-table td { border-bottom: 1px solid var(--au-border); padding: 0.5rem 0.7rem; text-align: left; }
.pgapp-table th {
  background: var(--au-header-bg);
  color: var(--au-muted);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.pgapp-table tbody tr:hover { background: #fafbfd; }

.pgapp-form { display: block; }
.pgapp-form-wide { max-width: none; }
.pgapp-field { margin-bottom: 0.85rem; }
.pgapp-label { display: block; font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.02em; color: var(--au-muted); margin-bottom: 0.3rem; }
.pgapp-input, .pgapp-select {
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--au-border);
  border-radius: var(--au-radius);
  font-size: 0.9rem;
  color: var(--au-text);
  background: var(--au-bg);
}
.pgapp-input:focus, .pgapp-select:focus { outline: 2px solid var(--au-blue); outline-offset: 1px; }

/* Universal Theme's t-Button: rectangular, ~3px corners, a solid blue
   "hot" button for primary actions and a light-gray outlined button
   for everything else. */
.pgapp-btn {
  cursor: pointer;
  padding: 0.45rem 1rem;
  border-radius: var(--au-radius);
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid transparent;
}
.pgapp-btn-primary { background: var(--au-blue); border-color: var(--au-blue); color: #fff; }
.pgapp-btn-primary:hover { background: var(--au-blue-dark); border-color: var(--au-blue-dark); }
.pgapp-btn-destructive { background: #fff; border-color: var(--au-red); color: var(--au-red); }
.pgapp-btn-destructive:hover { background: var(--au-red); color: #fff; }
.pgapp-btn-secondary { background: #fff; border-color: var(--au-border); color: var(--au-text); }
.pgapp-btn-secondary:hover { background: var(--au-header-bg); }
.pgapp-btn:disabled, .pgapp-icon-btn:disabled, input[type="submit"]:disabled { opacity: 0.6; cursor: not-allowed; }

/* Card panels the App Builder's own JS builds into `text` placeholder
   slots — the preview link, the persistent section subnav, and the
   Add Component form. */
.pgapp-toolbar-slot { display: flex; justify-content: flex-end; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.pgapp-toolbar-slot:empty { display: none; }

.pgapp-inline-form { display: inline; margin-left: 0.5rem; }
.pgapp-alert { padding: 0.6rem 0.8rem; margin-bottom: 1rem; border-radius: var(--au-radius); border-left: 4px solid; }
.pgapp-alert-error { color: var(--au-red); background: #fdf1ef; border-left-color: var(--au-red); }
.pgapp-list { list-style: none; padding: 0; }

.pgapp-checkbox { width: 1.1rem; height: 1.1rem; accent-color: var(--au-blue); }
.pgapp-readonly { display: inline-block; padding: 0.4rem 0.55rem; color: var(--au-muted); background: var(--au-header-bg); border-radius: var(--au-radius); }
.pgapp-radio-group { display: flex; flex-direction: column; gap: 0.3rem; }
.pgapp-radio-option { display: flex; align-items: center; gap: 0.35rem; font-weight: 400; }
.pgapp-radio-option input { accent-color: var(--au-blue); }

.pgapp-switch { display: inline-flex; align-items: center; cursor: pointer; }
.pgapp-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.pgapp-switch-track { width: 2.4rem; height: 1.4rem; background: var(--au-border); border-radius: 999px; position: relative; transition: background 0.15s; }
.pgapp-switch-track::before { content: ""; position: absolute; top: 0.15rem; left: 0.15rem; width: 1.1rem; height: 1.1rem; background: #fff; border-radius: 50%; transition: transform 0.15s; }
.pgapp-switch input:checked + .pgapp-switch-track { background: var(--au-blue); }
.pgapp-switch input:checked + .pgapp-switch-track::before { transform: translateX(1rem); }
.pgapp-checkbox-group { display: flex; flex-direction: column; gap: 0.3rem; }
.pgapp-checkbox-group-option { display: flex; align-items: center; gap: 0.35rem; font-weight: 400; }
.pgapp-checkbox-group-option input { accent-color: var(--au-blue); }

.pgapp-star-rating { display: inline-flex; }
.pgapp-star { cursor: pointer; font-size: 1.4rem; color: var(--au-border); }
.pgapp-star-on { color: var(--au-blue); }
.pgapp-list-manager-items { list-style: none; margin: 0 0 0.4rem; padding: 0; }
.pgapp-list-manager-items li { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.2rem 0; border-bottom: 1px solid var(--au-border); }
.pgapp-list-manager-add { display: flex; gap: 0.4rem; }
.pgapp-list-manager-add input { flex: 1; }

.pgapp-popup { display: inline-block; }
.pgapp-popup-dialog { min-width: 15rem; padding: 0.6rem; border: 1px solid var(--au-border); border-radius: var(--au-radius); background: var(--au-bg); box-shadow: 0 4px 14px rgb(0 0 0 / 0.15); }
.pgapp-popup-search { width: 100%; margin-bottom: 0.45rem; }
.pgapp-popup-list { list-style: none; margin: 0 0 0.5rem; padding: 0; max-height: 14rem; overflow-y: auto; }
.pgapp-popup-list button { width: 100%; text-align: left; padding: 0.35rem 0.5rem; border: none; background: transparent; cursor: pointer; border-radius: var(--au-radius); }
.pgapp-popup-list button:hover { background: var(--au-header-bg); }
.pgapp-popup-empty { padding: 0.35rem 0.5rem; color: var(--au-muted); font-style: italic; }

.pgapp-slider { display: flex; align-items: center; gap: 0.5rem; }
.pgapp-slider-input { flex: 1; accent-color: var(--au-blue); }
.pgapp-slider-output { min-width: 2.5rem; text-align: right; color: var(--au-muted); }

.pgapp-header, .pgapp-footer { font-size: 0.85rem; color: var(--au-muted); }
.pgapp-header { margin: 0 -1.25rem 1rem; padding: 0.6rem 1.25rem; background: var(--au-header-bg); border-bottom: 1px solid var(--au-border); }
.pgapp-brand { color: var(--au-text); font-size: 1.15rem; font-weight: 700; margin-right: 1.25rem; }
.pgapp-footer { margin-top: 2rem; padding-top: 0.9rem; border-top: 1px solid var(--au-border); }
.pgapp-header .pgapp-items, .pgapp-footer .pgapp-items { margin-bottom: 0; }

.pgapp-region, .pgapp-dynamic-content { margin: 0 0 1.25rem; padding: 1rem 1.1rem; background: var(--au-bg); border: 1px solid var(--au-border); border-radius: var(--au-radius); }
.pgapp-region-title { margin: 0 0 0.75rem; font-size: 0.95rem; font-weight: 700; padding-bottom: 0.4rem; border-bottom: 2px solid var(--au-blue); }
.pgapp-region .pgapp-table { margin-bottom: 0; }

/* Components: Report, Form, EditableTable, Chart. */
.pgapp-report, .pgapp-form-panel, .pgapp-editable-table { margin-bottom: 1.75rem; }
.pgapp-report .pgapp-table, .pgapp-editable-table .pgapp-table { margin-bottom: 0.75rem; }

.pgapp-row-actions { display: flex; align-items: center; gap: 0.5rem; white-space: nowrap; }
.pgapp-row-actions .pgapp-inline-form { margin-left: 0; }
.pgapp-icon { width: 1rem; height: 1rem; vertical-align: -0.15em; color: var(--au-muted); }

.pgapp-pagination { display: flex; justify-content: space-between; gap: 0.75rem; }
.pgapp-btn-disabled { opacity: 0.4; cursor: default; pointer-events: none; }

/* EditableTable: Oracle APEX's own Interactive Grid look. One CSS Grid
   shares its column tracks between the header row and every data row
   — each row is its own <form> (a <form> can't wrap <tr>/<td>), styled
   `display: contents` so its cells become direct grid items right
   alongside the header's. */
.pgapp-editable-grid { display: grid; border: 1px solid var(--au-border); margin-bottom: 1.25rem; font-size: 0.9rem; }
.pgapp-editable-grid-row { display: contents; }
.pgapp-editable-grid-cell { display: flex; align-items: center; padding: 0.4rem 0.7rem; border-bottom: 1px solid var(--au-border); min-width: 0; }
.pgapp-editable-grid-cell .pgapp-field { width: 100%; margin-bottom: 0; }
.pgapp-editable-grid-cell .pgapp-input, .pgapp-editable-grid-cell .pgapp-select { width: 100%; }
.pgapp-editable-grid-header .pgapp-editable-grid-cell {
  background: var(--au-header-bg);
  color: var(--au-muted);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.pgapp-editable-grid-actions { display: flex; align-items: center; gap: 0.4rem; white-space: nowrap; }
.pgapp-editable-grid-actions .pgapp-inline-form { display: inline-flex; margin-left: 0; }
.pgapp-editable-grid-row-alt { background: #fafbfd; }
.pgapp-editable-grid-new .pgapp-editable-grid-cell { border-bottom: none; }

/* Lightweight code editor: line-number gutter + syntax-highlighted
   <pre> overlaid under a transparent-text <textarea> (pgappUpgradeCodeEditor
   in runtime.js) — no external JS, this project ships zero. */
.pgapp-code-editor { display: flex; align-items: stretch; border: 1px solid var(--au-border); border-radius: var(--au-radius); overflow: hidden; background: var(--au-bg); }
.pgapp-code-gutter { position: relative; flex: none; min-width: 2.5em; color: var(--au-muted); background: var(--au-header-bg); border-right: 1px solid var(--au-border); user-select: none; overflow: hidden; }
.pgapp-code-gutter-inner { position: absolute; top: 0; left: 0; right: 0; padding: 0.5rem 0.6rem 0.5rem 0.75rem; text-align: right; }
.pgapp-code-body { position: relative; flex: 1 1 auto; min-width: 0; overflow: hidden; }
.pgapp-code-gutter-inner, .pgapp-code-highlight, .pgapp-code-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.4;
  white-space: pre;
  tab-size: 2;
  margin: 0;
}
.pgapp-code-highlight { position: absolute; top: 0; left: 0; right: 0; padding: 0.5rem 0.75rem; pointer-events: none; color: var(--au-text); }
.pgapp-code-input {
  position: relative; display: block; width: 100%; height: 100%; box-sizing: border-box;
  padding: 0.5rem 0.75rem; border: none; outline: none; resize: vertical;
  background: transparent; color: transparent; -webkit-text-fill-color: transparent; caret-color: var(--au-text);
}
.pgapp-tok-kw { color: var(--au-blue-dark); font-weight: 700; }
.pgapp-tok-str { color: #1a7a3c; }
.pgapp-tok-com { color: var(--au-muted); font-style: italic; }
.pgapp-tok-num { color: #a1580a; }

/* Grammar-based autosuggestions popup (pgappUpgradeCodeEditor's `ac*`
   state in runtime.js) — position: fixed, set from JS. */
.pgapp-autocomplete { position: fixed; z-index: 1000; min-width: 8rem; max-height: 12rem; overflow-y: auto; background: var(--au-bg); border: 1px solid var(--au-border); border-radius: var(--au-radius); box-shadow: 0 4px 16px rgba(0,0,0,0.2); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.82rem; }
.pgapp-autocomplete-item { padding: 0.3rem 0.6rem; cursor: pointer; white-space: nowrap; color: var(--au-text); }
.pgapp-autocomplete-item-active { background: var(--au-blue); color: #fff; }

/* VS-Code-style file tree + editor for a directory-based (multi-file)
   app's /admin/reload page (bindFileTree in runtime.js). */
.pgapp-file-editor { display: flex; align-items: stretch; border: 1px solid var(--au-border); border-radius: var(--au-radius); overflow: hidden; margin-bottom: 1.25rem; min-height: 24rem; }
.pgapp-file-tree { flex: 0 0 14rem; overflow: auto; background: var(--au-header-bg); border-right: 1px solid var(--au-border); padding: 0.5rem 0; font-size: 0.85rem; }
.pgapp-file-tree-list { list-style: none; margin: 0; padding-left: 1rem; }
.pgapp-file-tree > .pgapp-file-tree-list { padding-left: 0.25rem; }
.pgapp-file-tree-list.pgapp-file-tree-collapsed { display: none; }
.pgapp-file-tree-row { display: flex; align-items: center; gap: 0.3rem; padding: 0.25rem 0.5rem; border-radius: 2px; cursor: pointer; white-space: nowrap; }
.pgapp-file-tree-row:hover { background: #eef2fa; }
.pgapp-file-tree-dir { font-weight: 700; color: var(--au-text); }
.pgapp-file-tree-caret { display: inline-block; width: 0.9em; font-size: 0.7em; color: var(--au-muted); }
.pgapp-file-tree-file { color: var(--au-text); padding-left: 1.4rem; }
.pgapp-file-tree-file::before { content: "📄"; margin-right: 0.3rem; font-size: 0.8em; }
.pgapp-file-tree-file.pgapp-file-tree-active { background: #e3ecfb; color: var(--au-blue-dark); font-weight: 700; }
.pgapp-file-editor-main { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.pgapp-file-editor-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--au-border); background: var(--au-header-bg); }
.pgapp-file-editor-path { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85rem; color: var(--au-muted); }
.pgapp-file-editor-main .pgapp-code-editor { flex: 1 1 auto; border: none; border-radius: 0; }
.pgapp-file-editor-main .pgapp-code-input, .pgapp-file-editor-main .pgapp-code-body, .pgapp-file-editor-main .pgapp-code-gutter { height: 100%; }

.pgapp-chart { margin: 0 0 1.25rem; padding: 1rem 1.1rem; background: var(--au-bg); border: 1px solid var(--au-border); border-radius: var(--au-radius); }
.pgapp-chart-svg { width: 100%; height: auto; color: var(--au-blue); }
.pgapp-chart canvas { max-width: 100%; }
/* A donut's punched-out center — matches this theme's white background
   rather than a separately hardcoded white, so the two can never drift
   apart. */
.pgapp-chart-donut-hole { fill: #fff; }

/* Map region: inline-SVG lat/lng scatter, no tile server (see model::ComponentDef::Map). */
.pgapp-map { margin: 0 0 1.25rem; padding: 1rem 1.1rem; background: var(--au-bg); border: 1px solid var(--au-border); border-radius: var(--au-radius); }

/* Faceted Search: a panel of facets filtering a sibling Report (see model::ComponentDef::FacetedSearch). */
.pgapp-facet-search { margin: 0 0 1.25rem; padding: 1rem 1.1rem; background: var(--au-bg); border: 1px solid var(--au-border); border-radius: var(--au-radius); }
.pgapp-facet-search form { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: flex-start; }
.pgapp-facet-group { display: flex; flex-direction: column; gap: 0.35rem; min-width: 10rem; }
.pgapp-facet-title { font-weight: 600; font-size: 0.85rem; }
.pgapp-facet-group input[type="number"], .pgapp-facet-group input[type="date"] { width: 8rem; }
.pgapp-map-svg { width: 100%; height: auto; color: var(--au-red); }

/* Report toolbar, saved views, actions, notices */
.pgapp-report-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-bottom: 0.7rem; padding: 0.5rem 0.6rem; background: var(--au-header-bg); border-radius: var(--au-radius); }
.pgapp-report-views { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.85rem; }
.pgapp-view-chip { display: inline-flex; align-items: center; gap: 0.2rem; border: 1px solid var(--au-border); border-radius: 999px; padding: 0.15rem 0.65rem; font-size: 0.8rem; }
.pgapp-btn-viewdel { border: none; background: transparent; color: var(--au-red); font-weight: 700; cursor: pointer; }
.pgapp-view-save { display: inline-flex; align-items: center; gap: 0.35rem; }
.pgapp-view-public { font-size: 0.8rem; color: var(--au-muted); }
.pgapp-action { display: inline-block; margin-bottom: 1rem; }
.pgapp-alert-success { color: #1a7f37; background: #edf9f0; border-left-color: #1a7f37; }

/* Report header ("+ New" trigger next to the title) and table scroll
   wrapper (narrow viewports scroll the table instead of blowing out the
   page layout). */
.pgapp-report-header { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.pgapp-report-header .pgapp-subtitle { margin: 0; border-bottom: none; padding-bottom: 0; }
.pgapp-table-wrap { overflow-x: auto; }

/* Report display: cards | list (Oracle APEX's Card/List regions folded
   into Report as a display mode — see model::REPORT_DISPLAY_MODES). */
.pgapp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.9rem; margin-bottom: 0.75rem; }
.pgapp-card { background: var(--au-bg); border: 1px solid var(--au-border); border-radius: var(--au-radius); padding: 0.75rem 0.9rem; }
.pgapp-card-field { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.2rem 0; }
.pgapp-card-label { color: var(--au-muted); font-size: 0.8rem; }
.pgapp-card-value { text-align: right; }
.pgapp-card .pgapp-row-actions { margin-top: 0.5rem; justify-content: flex-end; }

.pgapp-list-view { list-style: none; margin: 0 0 0.75rem; padding: 0; }
.pgapp-list-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.6rem 0; border-bottom: 1px solid var(--au-border); }
.pgapp-list-row-fields { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; }
.pgapp-list-row-label { color: var(--au-muted); font-size: 0.8rem; }

/* Interactive Report's clickable column-header sort. */
.pgapp-sort-link { color: inherit; text-decoration: none; white-space: nowrap; }
.pgapp-sort-link:hover { text-decoration: underline; }

/* Interactive Report's per-column footer aggregates. */
.pgapp-report-agg-row td { font-weight: 700; background: var(--au-header-bg); border-top: 2px solid var(--au-border); }
.pgapp-agg-label { font-weight: 400; color: var(--au-muted); font-size: 0.75rem; text-transform: uppercase; margin-right: 0.3rem; }

/* Interactive Report's Control Break: a top border marks each new group. */
.pgapp-break-row td { border-top: 2px solid var(--au-border); }

/* Calendar region: a month grid, one entry per day (see model::ComponentDef::Calendar). */
.pgapp-calendar-header { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.6rem; }
.pgapp-calendar-header .pgapp-subtitle { margin: 0; border-bottom: none; padding-bottom: 0; }
.pgapp-calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--au-border); border: 1px solid var(--au-border); border-radius: var(--au-radius); overflow: hidden; }
.pgapp-calendar-daylabel { background: var(--au-header-bg); padding: 0.35rem 0.5rem; font-size: 0.8rem; font-weight: 600; text-align: center; }
.pgapp-calendar-day { background: var(--au-bg); min-height: 5.5rem; padding: 0.35rem 0.5rem; display: flex; flex-direction: column; gap: 0.2rem; }
.pgapp-calendar-day-outside { background: var(--au-header-bg); }
.pgapp-calendar-daynum { font-size: 0.85rem; color: var(--au-muted); }
.pgapp-calendar-entry { display: block; font-size: 0.8rem; padding: 0.15rem 0.3rem; background: var(--au-header-bg); border-left: 3px solid var(--au-blue); text-decoration: none; color: inherit; }

/* A Report's edit/create Form renders as a centered modal over the
   report: a dimmed, full-viewport backdrop (.pgapp-modal-overlay) with
   the form panel (.pgapp-form-floating) centered on top of it at 60% of
   the viewport width. */
.pgapp-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(0 0 0 / 0.5);
  padding: 1rem;
}
.pgapp-form-floating {
  position: relative;
  width: 60vw;
  max-width: 36rem;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  background: var(--au-bg);
  border: 1px solid var(--au-border);
  border-radius: var(--au-radius);
  border-top: 3px solid var(--au-blue);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.25);
  padding: 1.1rem 1.3rem;
}
.pgapp-form-floating-close {
  position: absolute;
  top: 0.6rem;
  right: 0.8rem;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--au-muted);
  text-decoration: none;
}
.pgapp-form-floating-close:hover { color: var(--au-text); }

/* Mobile: no per-app work required to get a usable narrow-viewport
   layout — nav wraps, the report toolbar stacks, and the form modal
   widens toward a near-full-width sheet instead of the fixed 60vw box
   (still centered by .pgapp-modal-overlay's flex layout, just wider). */
@media (max-width: 640px) {
  body { padding: 0 0.85rem 1.5rem; }
  .pgapp-nav { margin: 0 -0.85rem 1.25rem; padding: 0.7rem 0.85rem; flex-wrap: wrap; row-gap: 0.5rem; }
  .pgapp-navbar { flex-wrap: wrap; row-gap: 0.35rem; }
  .pgapp-nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .pgapp-nav-collapse {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    flex-basis: 100%;
    margin-top: 0.5rem;
  }
  .pgapp-nav.pgapp-nav-open .pgapp-nav-collapse { display: flex; }
  .pgapp-nav-collapse .pgapp-nav-user { margin-left: 0; }
  .pgapp-report-toolbar .pgapp-input[type="search"] { min-width: 0; flex: 1 1 100%; }
  .pgapp-form-floating {
    width: 100%;
    max-width: none;
    max-height: calc(100vh - 2rem);
  }
}

/* Themed alert/confirm dialogs (runtime.js pgapp.alert/pgapp.confirm),
   replacing the browser's native, unstyleable alert()/confirm(). */
.pgapp-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}
.pgapp-dialog-box {
  background: var(--au-bg);
  border: 1px solid var(--au-border);
  border-top: 3px solid var(--au-blue);
  border-radius: var(--au-radius);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.2);
  padding: 1.1rem 1.2rem;
  max-width: 22rem;
  width: 100%;
}
.pgapp-dialog-message { margin: 0 0 1rem; font-weight: 600; }
.pgapp-dialog-actions { display: flex; justify-content: flex-end; gap: 0.5rem; }
.pgapp-shuttle { display: flex; align-items: center; gap: 0.5rem; }
.pgapp-shuttle-list { flex: 1; min-width: 10rem; height: auto; }
.pgapp-shuttle-controls { display: flex; flex-direction: column; gap: 0.3rem; }
.pgapp-rich-text { border: 1px solid var(--au-border); border-radius: var(--au-radius); overflow: hidden; }
.pgapp-rich-text-toolbar { display: flex; gap: 0.2rem; padding: 0.4rem; border-bottom: 1px solid var(--au-border); background: var(--au-header-bg); }
.pgapp-rich-text-toolbar button { cursor: pointer; padding: 0.25rem 0.55rem; border: 1px solid var(--au-border); border-radius: var(--au-radius); background: var(--au-bg); color: var(--au-text); }
.pgapp-rich-text-editor { min-height: 6rem; padding: 0.5rem 0.6rem; font-size: 0.9rem; color: var(--au-text); background: var(--au-bg); }
.pgapp-rich-text-editor:focus { outline: none; }
.pgapp-file-browse { display: flex; align-items: center; gap: 0.6rem; }
.pgapp-file-browse-link { color: var(--au-blue); text-decoration: none; }
.pgapp-file-browse-link:hover { text-decoration: underline; }
