/* The ONE admin idiom (2026-07-22).
 *
 * History, kept short because it explains the class prefix: the admin side grew four separate
 * page-local style systems (adm-sup, adm-dash, adm-asm, and this one, adm-data) plus six pages of
 * raw inline styles — seven idioms, two near-identical tab bars, six card treatments. This file is
 * the survivor: the adm-data-* classes already dressed the most screens, so the others were folded
 * into it rather than inventing an eighth. Every colour is a design-system token, so these screens
 * follow the platform theme, light and dark, exactly like the supplier side.
 *
 * Loaded globally from layouts/application (the ONLY live layout — layouts/admin was dead code and
 * is deleted). It was previously inlined per-page via a partial, which meant every page paid the
 * bytes and any page that forgot the render looked broken.
 */

.adm-data { font-family: Inter, -apple-system, sans-serif; }
.adm-data-head { margin-bottom: 14px; }
.adm-data-head h1 { font-size: 22px; font-weight: 800; color: var(--text); margin: 0 0 3px; }
.adm-data-head p  { font-size: 13px; color: var(--text-muted); margin: 0; }

.adm-data-tabs { display: flex; gap: 4px; flex-wrap: wrap; background: var(--card); padding: 6px; border-radius: 12px; box-shadow: var(--shadow-sm); margin-bottom: 14px; border: 1px solid var(--border); }
.adm-data-tab  { padding: 8px 18px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text-muted); text-decoration: none; transition: background .15s, color .15s; }
.adm-data-tab:hover  { background: var(--bg); color: var(--text); }
.adm-data-tab.active { background: var(--primary); color: #fff; }

.adm-data-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 14px 0 18px; }
.adm-data-kpi  { background: var(--card); border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow-sm); border: 1px solid var(--border); border-left: 4px solid var(--primary); }
.adm-data-kpi-label { font-size: 11px; font-weight: 700; color: var(--text-subtle); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 5px; }
.adm-data-kpi-val   { font-size: 24px; font-weight: 800; color: var(--text); line-height: 1.1; }
.adm-data-kpi-val small { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.adm-data-kpi-note  { font-size: 11px; color: var(--text-subtle); margin-top: 5px; line-height: 1.4; }

.adm-data-card { background: var(--card); border-radius: 14px; box-shadow: var(--shadow-sm); border: 1px solid var(--border); overflow: hidden; margin-bottom: 14px; }
.adm-data-card-head { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.adm-data-card-head h3 { font-size: 14px; font-weight: 800; color: var(--text); margin: 0; }
.adm-data-count { font-size: 12px; color: var(--text-subtle); font-weight: 600; white-space: nowrap; }
.adm-data-body  { padding: 6px 20px 16px; }

/* A CARD THAT CONTAINS A DROPDOWN MUST NOT CLIP IT.
 * .adm-data-card sets overflow:hidden so a table's corners stay inside its radius. But the platform's
 * select enhancer (shared/_zt_select) renders its menu as an absolutely-positioned child, so inside a
 * clipped card the open menu is cut off at the card edge — reported on the support request detail,
 * where the assignee list was sliced in half. */
.adm-data-card.has-dropdown { overflow: visible; }

/* Labelled controls in an admin form. Distinct from .adm-data-filter, which is a search/filter BAR:
 * a row of unlabelled controls reads fine when it sits above a table and badly when it IS the form,
 * where each control needs to say what it changes. */
.adm-fields { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.adm-field  { display: flex; flex-direction: column; gap: 5px; min-width: 200px; }
.adm-field > label { font-size: 11px; font-weight: 700; color: var(--text-subtle);
                     text-transform: uppercase; letter-spacing: .4px; }
/* Cap the ENHANCED wrapper, not just the native element the enhancer hides — otherwise the visible
 * trigger sizes itself to the row and truncates its own label ("Normal — ..."). */
.adm-field select, .adm-field .zt-cs { width: 100%; box-sizing: border-box; }
.adm-field input, .adm-field select {
  padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 8px;
  font-size: 13px; color: var(--text); background: var(--card);
}

/* The state actions on a request. Separated from the edit form by a rule, because "resolve this" is a
 * decision and "reassign it" is bookkeeping — and because a status buried in a dropdown is not a
 * discoverable way to close a request. */
.adm-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
               margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.adm-actions form { display: inline; }
.adm-actions-note { font-size: 12px; color: var(--text-subtle); margin: 0 0 0 auto; }

.adm-data-table { width: 100%; border-collapse: collapse; }
.adm-data-table thead tr { background: var(--bg); }
.adm-data-table thead th { padding: 10px 16px; text-align: left; font-size: 11px; font-weight: 700; color: var(--text-subtle); text-transform: uppercase; letter-spacing: .4px; }
.adm-data-table tbody tr { border-top: 1px solid var(--border); }
.adm-data-table tbody td { padding: 11px 16px; font-size: 13px; color: var(--text); vertical-align: top; }
.adm-data-table td.q { width: 52%; color: var(--text-muted); }
.adm-data-table .val { font-weight: 700; color: var(--text); }
.adm-data-table .num { font-variant-numeric: tabular-nums; text-align: right; }
.adm-data-none { color: var(--text-subtle); opacity: .7; }
.adm-data-empty { text-align: center; padding: 30px; color: var(--text-subtle); font-size: 13px; }

.adm-data-pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.adm-pill-active { background: var(--success-light); color: var(--success); }
.adm-pill-watch  { background: var(--warning-light); color: var(--warning); }
.adm-pill-draft  { background: var(--bg); color: var(--text-muted); }
.adm-pill-info   { background: var(--info-light); color: var(--info); }

.adm-data-skipped { margin: 10px 0 2px; }
.adm-data-skipped summary { font-size: 12px; color: var(--text-subtle); cursor: pointer; font-weight: 600; }
.adm-data-skipped ul { margin: 8px 0 0 18px; font-size: 12px; color: var(--text-subtle); line-height: 1.7; }

.adm-data-filter { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.adm-data-filter select, .adm-data-filter input { padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: 8px; font-size: 13px; color: var(--text); background: var(--card); }
.adm-data-filter button { padding: 7px 16px; background: var(--primary); color: #fff; border: 0; border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer; }
.adm-data-scroll { overflow-x: auto; }

.adm-btn         { display: inline-block; padding: 9px 18px; background: var(--primary); color: #fff; border: 0; border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer; text-decoration: none; }
.adm-btn:hover   { background: var(--primary-hover); }
.adm-btn-ghost   { display: inline-block; padding: 9px 16px; background: var(--card); color: var(--primary); border: 1px solid var(--border-strong); border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer; text-decoration: none; }
.adm-btn-danger  { display: inline-block; padding: 9px 18px; background: var(--danger); color: #fff; border: 0; border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer; }

/* Pagination (Kaminari) — shared by every paginated admin page. Previously page-local CSS on
 * master_esg_questions, which also shipped a page-wide `a:hover { transform }` that nudged every
 * link on the page including the sidebar; that rule was deleted, not migrated. */
.pagination { display: flex; gap: 6px; align-items: center; }
.pagination a, .pagination span {
  min-width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; font-size: 13px; text-decoration: none; color: var(--text-muted);
  border: 1px solid var(--border-strong); background: var(--card); padding: 0 10px;
}
.pagination a:hover { background: var(--bg); }
.pagination .current { background: var(--primary); color: #fff; border: none; font-weight: 600; }
.pagination .disabled { opacity: .4; pointer-events: none; }

/* THE admin page scaffold (owner walkthrough round 2, 2026-07-22). Every admin page renders through
 * admin/shared/_page — same width, same padding, same header anatomy on every sidebar click. Pages
 * hand-rolling their own frame is how the layout came to jump between tabs. */
.adm-page { max-width: 1200px; margin: 0 auto; padding: 24px 32px; }
.adm-page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px;
                 flex-wrap: wrap; margin-bottom: 16px; }
.adm-page-head h1 { font-size: 22px; font-weight: 800; color: var(--text); margin: 0 0 3px; }
.adm-page-head .adm-page-sub { font-size: 13px; color: var(--text-muted); margin: 0; }
.adm-page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
