/* ube-admin.css — ci_ube's own additions on top of the ported bundle.
 *
 * WHY THIS FILE EXISTS
 * ────────────────────
 * style.css is a PREBUILT, PURGED Tailwind bundle carried over from ci_data. It
 * contains only the utilities ci_data's own markup used, and there is no build
 * step here to regenerate it — so a class ci_data never wrote simply does not
 * exist at runtime. The markup looks correct, the browser silently ignores it,
 * and the layout is subtly wrong in a way that reads as a design mistake rather
 * than a missing rule. `lg:grid-cols-5` was exactly that: the dashboard asked
 * for five columns and rendered two.
 *
 * So: anything ci_ube's admin needs that the bundle does not carry is declared
 * HERE, by hand, rather than by editing style.css. Two reasons — style.css is
 * generated output and an edit to it is lost the moment it is regenerated or
 * re-copied from ci_data, and keeping the additions in one small file makes it
 * obvious what this app added and why.
 *
 * HOW TO CHECK. Before using a utility that is not already visible elsewhere in
 * the admin markup, grep the bundle for it:
 *
 *     grep -F '.lg\:grid-cols-5' assets/ui_ube/admin/css/style.css
 *
 * Nothing back means it must be added here. Escaping follows Tailwind's own
 * selector output: `:` `/` `[` `]` `.` are backslash-escaped in the class name.
 *
 * Values match Tailwind's defaults so a rule here behaves exactly as the same
 * class does anywhere else, and can be deleted the day the bundle is rebuilt
 * with these classes in scope.
 */

/* ── Sizing ──────────────────────────────────────────────────────────────
   The bundle carries no `size-*` at ALL — not one of them. That is worth
   knowing because the failure is loud on an <svg>: with neither width nor
   height the browser falls back to the intrinsic size, so a 14px icon renders
   as a 300px illustration across the middle of the page. It looked like a
   broken image; it was a missing utility. The whole set used by this app is
   declared here rather than one at a time as each is discovered. */
.size-3\.5 { width: 0.875rem; height: 0.875rem; }
.size-4    { width: 1rem;     height: 1rem; }
.size-5    { width: 1.25rem;  height: 1.25rem; }
.size-8    { width: 2rem;     height: 2rem; }
.size-9    { width: 2.25rem;  height: 2.25rem; }
.size-10   { width: 2.5rem;   height: 2.5rem; }
.size-11   { width: 2.75rem;  height: 2.75rem; }

/* ── Spacing ─────────────────────────────────────────────────────────────
   The bundle stops at ml-2. Used between the two inline action forms on the
   admins table. */
.ml-3 { margin-left: 0.75rem; }

/* ── Arbitrary values ────────────────────────────────────────────────────
   Arbitrary-value classes are generated per use-site, so one ci_data never
   wrote is never present. This is the flash message's accent rule — it has been
   in the markup since the CMS was first built and has never actually drawn. */
.border-l-\[3px\] { border-left-width: 3px; }

/* ── Hover states ────────────────────────────────────────────────────────
   The base classes exist; these hover variants do not. `hover:border-primary`
   is what makes a dashboard tile read as clickable; `hover:text-background`
   flips the delete button's label when its destructive fill comes in. */
.hover\:border-primary:hover  { border-color: var(--primary); }
.hover\:text-background:hover { color: var(--background); }

/* ── PER-ROW ACTION BUTTONS ──────────────────────────────────────────────
   -FORMAT.md §B7, in this app's vocabulary.
 *
 * The doc is written for Bootstrap 5 + Metronic (`btn btn-sm btn-primary`);
 * ci_ube's admin is Tailwind, so the RULES are what port, not the class names:
 * small, filled, primary, text only, never stacked vertically. One class here
 * rather than a class string repeated per page, because §B7's own reasoning is
 * that this column repeats on every list and small inconsistencies multiply.
 *
 * SIZED AND SHAPED AS THE LIST'S STATUS-FILTER PILLS. Those filters sit a few
 * rows above this column on every list screen, so the two read as one control
 * vocabulary or as an accident — there is no third option. The filter's box is
 * `px-3 py-1 rounded-md text-xs font-medium border` (resource_list/index.php,
 * $_pill); every declaration below is that box resolved against the bundle's
 * own tokens, so the buttons match by construction rather than by eye:
 *
 *   padding   py-1 / px-3     -> .25rem / .75rem  (--spacing: .25rem)
 *   font      text-xs         -> .75rem, line-height calc(1 / .75) = 1rem
 *   weight    font-medium     -> 500
 *   border    border          -> 1px  (transparent here: the fill IS the edge)
 *   radius    rounded-md      -> .4rem
 *
 * The radius is the literal .4rem, NOT calc(var(--radius) - 2px): radius.css
 * flattens every rounded-* utility to .4rem unlayered, so that is what the
 * filter actually computes to, and the token arithmetic would miss it by 2px.
 *
 * Height is left to the padding rather than pinned, which is how the filter
 * derives its own — pinning it here would drift the moment either the text
 * size or the padding moved. Both land on 26px: 16 + 8 + 2.
 *
 * `a.ube-btn-row` is spelled out so the anchor beats the design system's own
 * link colour; §B7 requires <a>, not <button>, for routed actions. */
.ube-btn-row,
a.ube-btn-row {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.25rem 0.75rem;
  border-radius: 0.4rem; border: 1px solid transparent;
  font-size: 0.75rem; font-weight: 500; line-height: 1rem; white-space: nowrap;
  background: var(--primary); color: var(--primary-foreground);
  text-decoration: none; cursor: pointer;
  transition: background-color .12s, opacity .12s;
}
.ube-btn-row:hover, a.ube-btn-row:hover { opacity: .9; text-decoration: none; }

/* Destructive sibling — §B7 allows exactly two colours in this column. */
.ube-btn-row-danger,
a.ube-btn-row-danger { background: var(--destructive); color: var(--destructive-foreground); }

/* The CONSTRUCTIVE sibling: a row action that settles the record rather than
   removing it — Enquiries' "Followed up". §B7 wants two colours in this column
   and this is a third, which is a rule worth breaking exactly here: the button
   and the badge it produces are the same green, so the click and its result
   read as one thing. Any other use should go back to the primary fill. */
.ube-btn-row-success,
a.ube-btn-row-success { background: var(--color-green-500); color: oklch(99% 0 0); }

/* ── STATUS BADGES ───────────────────────────────────────────────────────
   A status cell used to be one grey outline whatever it said, so a list of
   enquiries gave no sense of its own shape — you had to READ every row to see
   which were still waiting. These carry the meaning in the colour, which is
   what makes a column scannable rather than merely present.

   THEY LIVE HERE, NOT IN A CLASS STRING IN THE MODEL. style.css is prebuilt and
   PURGED: a utility combination no page already uses does not exist at runtime,
   and a badge assembled from `bg-green-500/15 text-green-600 …` would silently
   render unstyled. This file is hand-written and never purged, so a class
   defined here always exists.

   The fill is a color-mix against `transparent` rather than a fixed tint, so the
   same declaration works on the light card and on a dark one — the surface
   underneath shows through instead of being painted over. That is the same
   technique `.up-panel-head` uses.

   Tone, not value. The model maps a status string onto one of these
   (M_resource_crud::_status_tone), so `published`, `subscribed` and
   `followed_up` all read as "settled" without this file listing them. */
.ube-badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px; border: 1px solid transparent;
  font-size: 0.75rem; font-weight: 500; line-height: 1rem; white-space: nowrap;
}

/* Waiting for someone — the state a new row lands in. */
.ube-badge-primary {
  background: color-mix(in oklch, var(--primary) 14%, transparent);
  color: var(--primary);
  border-color: color-mix(in oklch, var(--primary) 32%, transparent);
}

/* Dealt with. The one the Followed up button produces. */
.ube-badge-success {
  background: color-mix(in oklch, var(--color-green-500) 16%, transparent);
  color: color-mix(in oklch, var(--color-green-500) 72%, #000);
  border-color: color-mix(in oklch, var(--color-green-500) 36%, transparent);
}

/* Underway, or not yet live — in_progress, draft, scheduled. */
.ube-badge-warn {
  background: color-mix(in oklch, var(--color-amber-500) 18%, transparent);
  color: var(--color-amber-700);
  border-color: color-mix(in oklch, var(--color-amber-500) 38%, transparent);
}

/* THE TWO PALETTE TONES NEED BOTH THEMES SPELLED OUT.
 *
 * `primary` and `muted` above ride theme TOKENS, which the dark theme already
 * redefines — they follow it for free. Green and amber are fixed Tailwind
 * palette values with no dark counterpart, so a colour picked to read on the
 * white card is the same colour on the dark one, where it is far too dark to
 * read against a 16% tint. The label is stated per theme instead.
 *
 * DARKENED WITH #000, NOT WITH `--foreground`. Mixing toward the foreground
 * token dragged the HUE as well as the lightness — green-500 came out at hue
 * 172 (teal) and amber-700 at hue 30 (brick), because that token carries a blue
 * cast of its own. Black is achromatic, so only the lightness moves and the
 * colour stays the colour it was named after. */
html.dark .ube-badge-success { color: var(--color-green-500); }
html.dark .ube-badge-warn    { color: var(--color-amber-400); }

/* Finished, or gone quiet — closed, unsubscribed, archived. The default for a
   status this app has no opinion about, so an unknown value still renders as a
   badge rather than as unstyled text. */
.ube-badge-muted {
  background: color-mix(in oklch, var(--muted-foreground) 12%, transparent);
  color: var(--muted-foreground);
  border-color: color-mix(in oklch, var(--muted-foreground) 28%, transparent);
}

/* The wrapper: never stacked vertically (§B7). */
.ube-row-actions { display: flex; flex-wrap: nowrap; gap: 0.25rem; }

/* ── Type ────────────────────────────────────────────────────────────────
   The bundle has font-bold and font-semibold but stops short of 800. */
.font-extrabold { font-weight: 800; }

/* ── Responsive steps the bundle never compiled ──────────────────────────
   Each of these exists at the base breakpoint but not at the sm:/lg: variant
   the auth pages ask for — the variant is generated per use-site, so one
   ci_data never wrote does not exist here. Without them the sign-in and error
   pages simply never grow: the 404's numeral stays small on a desktop, and the
   brand panel keeps its phone padding at 1400px wide. */
@media (min-width: 640px) {
  .sm\:text-2xl { font-size: 1.5rem;  line-height: 2rem; }
  .sm\:text-6xl { font-size: 3.75rem; line-height: 1; }
  .sm\:gap-2\.5 { gap: 0.625rem; }
  .sm\:px-8     { padding-left: 2rem;   padding-right: 2rem; }
  .sm\:px-10    { padding-left: 2.5rem; padding-right: 2.5rem; }
}
@media (min-width: 1024px) {
  .lg\:text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
  .lg\:px-14    { padding-left: 3.5rem; padding-right: 3.5rem; }
}

/* ── Grid ────────────────────────────────────────────────────────────────
   The bundle's lg: track counts are 2, 3, 4, 6 and 12 — no 5. The dashboard's
   content counters are a five-across row. */
@media (min-width: 1024px) {
  .lg\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
