/* Shared across every admin-*.html page (and the admin.html
   switchboard itself) -- Endian-style navy top bar + breadcrumb above
   a card-based content area, so each admin section can live on its
   own page without re-declaring all of this per file. */
body { font-family: var(--cat-font-family-primary); max-width: 1100px; margin: 0 auto 2rem; color: var(--cat-color-neutral-90); padding: 0 1rem; background: var(--cat-color-neutral-10); }
h1 { font-size: 1.4rem; }
h2 { font-size: 1.1rem; margin-bottom: 0.4rem; }
a.back { display: inline-block; margin-bottom: 1rem; color: var(--cat-color-brand-blue-70); text-decoration: none; }
a.back:hover { text-decoration: underline; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
section { background: var(--cat-color-neutral-0); border: 1px solid var(--cat-color-neutral-20); border-radius: var(--cat-border-radius-lg); padding: 1rem 1.25rem; margin-bottom: 1.5rem; box-shadow: var(--cat-box-shadow-sm); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.35rem 0.4rem; border-bottom: 1px solid var(--cat-color-neutral-20); vertical-align: top; }
th { color: var(--cat-color-neutral-70); font-weight: 600; }
input[type=text], input[type=password] { padding: .4rem .5rem; border: 1px solid var(--cat-color-neutral-40); border-radius: var(--cat-border-radius-md); box-sizing: border-box; font-family: inherit; }
.row-form { display: flex; gap: 0.4rem; margin-bottom: 0.75rem; flex-wrap: wrap; align-items: center; }
.row-form input[type=text], .row-form input[type=password] { flex: 1; min-width: 8rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0.2rem 0; }
.chip { background: var(--cat-color-brand-blue-10); color: var(--cat-color-brand-blue-90); border-radius: 10px; padding: 0.1rem 0.5rem; font-size: 0.75rem; display: flex; align-items: center; gap: 0.3rem; }
.chip button { padding: 0; background: none; border: none; cursor: pointer; color: var(--cat-color-brand-red-70); font-weight: bold; line-height: 1; }
select { padding: 0.3rem; border: 1px solid var(--cat-color-neutral-40); border-radius: var(--cat-border-radius-md); }
.msg { font-size: .9rem; min-height: 1.2rem; padding: 0; }
.admin-badge { background: var(--cat-color-neutral-100); color: var(--cat-color-brand-yellow-60); border-radius: 4px; padding: 0 0.3rem; font-size: 0.7rem; margin-left: 0.3rem; }
.hidden { display: none; }
/* Combined selector beats the plain .hidden rule above on specificity
   (two classes > one) -- needed because .totp-bundle sets its own
   `display` below, which .hidden alone can't otherwise override. */
.totp-bundle { display: flex; gap: 1.25rem; align-items: flex-start; }
.totp-bundle.hidden { display: none; }

/* --- Switchboard-style top bar + breadcrumb, on every admin page --- */
.admin-topbar { display: flex; align-items: center; justify-content: space-between; background: var(--cat-color-neutral-100); color: var(--cat-color-neutral-0); margin: 0 -1rem; padding: 0.85rem 1.5rem; border-bottom: 4px solid var(--cat-color-brand-yellow-60); }
.admin-topbar-title { display: flex; align-items: center; gap: .6rem; font-size: 1.05rem; font-weight: 600; letter-spacing: .01em; }
.admin-topbar-title img { height: 2rem; }
.admin-topbar a.admin-topbar-title { color: inherit; text-decoration: none; }
.admin-topbar-title .admin-brand-logo { margin-right: .5rem; }
.admin-topbar-title cat-icon-cat-vantage { color: var(--cat-color-brand-yellow-60); }
.admin-breadcrumb { padding: 0.6rem 0 1rem; color: var(--cat-color-neutral-70); font-size: 0.9rem; }
.admin-breadcrumb a { color: var(--cat-color-brand-blue-70); text-decoration: none; }
.admin-breadcrumb a:hover { text-decoration: underline; }

/* --- Switchboard tile grid (admin.html) ------------------------------ */
.switchboard-category { margin: 1.5rem 0 0.5rem; color: #57606a; font-size: 0.85rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.switchboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.switchboard-tile { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.4rem; background: var(--cat-color-neutral-0); border: 1px solid var(--cat-color-neutral-20); border-radius: var(--cat-border-radius-lg); padding: 1.25rem 0.75rem; text-decoration: none; color: var(--cat-color-neutral-90); box-shadow: var(--cat-box-shadow-sm); transition: transform .1s, box-shadow .1s; }
.switchboard-tile:hover { transform: translateY(-2px); box-shadow: var(--cat-box-shadow-md); border-color: var(--cat-color-brand-yellow-60); }
.switchboard-tile-icon { font-size: 2rem; line-height: 1; }
.switchboard-tile-title { font-weight: 600; font-size: 0.95rem; }
.switchboard-tile-desc { font-size: 0.75rem; color: #57606a; }

/* --- Pager under every admin-*.html list page's table ------------------ */
.pager { display: flex; gap: 0.6rem; align-items: center; margin-top: 0.6rem; }
.pager-info { font-size: 0.85rem; color: #57606a; }
.router-cert-intro { color: #57606a; }
.router-valid-days { max-width: 10rem; }
.router-cert-bundle, .totp-bundle { background: #f6f8fa; border: 1px solid #ddd; border-radius: 6px; padding: .75rem; margin-bottom: .75rem; }
.router-cert-warning, .totp-warning { color: #9a6700; }
.router-cert-warning { margin-bottom: .4rem; }
.router-cert-pem { width: 100%; font-family: monospace; font-size: .75rem; }

/* --- Per-column header filter popover (addColumnFilter, admin-common.js)
   -- an Endian switchboard-style "\u25BD next to the column name" affordance,
   optional and hidden until clicked, instead of an always-visible search
   toolbar above the table. */
.col-filter-btn { background: none; border: none; color: var(--cat-color-neutral-60); cursor: pointer; padding: 0 0.2rem; font-size: 0.7rem; margin-left: 0.2rem; }
.col-filter-btn:hover { color: var(--cat-color-brand-blue-70); background: none; }
.col-filter-btn.active { color: var(--cat-color-brand-blue-70); font-weight: bold; }
.col-filter-popover { position: absolute; top: 100%; left: 0; z-index: 50; background: #fff; border: 1px solid #ddd; border-radius: 8px; box-shadow: 0 10px 25px rgba(0,0,0,.15); padding: 0.6rem; display: flex; flex-direction: column; gap: 0.4rem; font-weight: normal; text-transform: none; letter-spacing: normal; white-space: nowrap; }
/* Combined selector beats the plain .col-filter-popover rule above on
   specificity (two classes > one) -- without this, .hidden's
   `display: none` loses the tie (equal specificity, later rule wins)
   to this rule's own `display: flex`, leaving every popover visibly
   open at once instead of only the one just clicked. */
.col-filter-popover.hidden { display: none; }
.col-filter-control { display: flex; flex-direction: column; gap: 0.15rem; font-size: 0.75rem; color: #57606a; }
.col-filter-control input[type=text], .col-filter-control select { font-size: 0.85rem; min-width: 10rem; }
.col-filter-actions { display: flex; gap: 0.4rem; justify-content: flex-end; }

/* --- Searchable "pick one" modal (openPicker, admin-common.js) ------- */
.picker-overlay { position: fixed; inset: 0; background: rgba(20,35,60,.45); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.picker-modal { background: #fff; border-radius: 10px; padding: 1rem 1.25rem; width: min(28rem, 90vw); max-height: 80vh; display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.picker-modal h3 { margin: 0 0 0.6rem; font-size: 1rem; }
.picker-search { width: 100%; box-sizing: border-box; margin-bottom: 0.5rem; }
.picker-list { overflow-y: auto; flex: 1; min-height: 6rem; border: 1px solid #eee; border-radius: 6px; margin-bottom: 0.5rem; }
.picker-row { padding: 0.4rem 0.6rem; cursor: pointer; font-size: 0.9rem; border-bottom: 1px solid #f2f2f2; }
.picker-row:last-child { border-bottom: none; }
.picker-row:hover { background: #f0f4fb; }
.picker-empty { padding: 0.6rem; color: #57606a; font-size: 0.85rem; }
.picker-pager { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.6rem; font-size: 0.85rem; }
