/* Inner Compass Suite — shared shell (used by host + admin RCL) */
:root {
  --suite-nav-from: #141c28;
  --suite-nav-to: #1c2838;
  --suite-accent: #4db3d9;
  --suite-accent-dim: #2d8ab0;
}

.navbar-suite {
  background: linear-gradient(90deg, var(--suite-nav-from), var(--suite-nav-to)) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.navbar-suite .navbar-brand {
  letter-spacing: 0.02em;
}

.navbar-suite .nav-link {
  color: rgba(255, 255, 255, 0.78) !important;
  font-weight: 500;
  padding: 0.35rem 0.5rem !important;
  font-size: 0.9rem;
}

.navbar-suite .dropdown-menu { font-size: 0.875rem; }

.navbar-suite .nav-link:focus-visible,
.navbar-suite .navbar-brand:focus-visible {
  outline: 2px solid var(--suite-accent);
  outline-offset: 1px;
  border-radius: 0.25rem;
}

.navbar-suite .nav-link:hover,
.navbar-suite .nav-link:focus {
  color: #fff !important;
}

.suite-page-header .card-body {
  padding: 0.6rem 1rem;
}

.suite-app-hero {
  border-radius: 0.5rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
}

.suite-app-hero .suite-app-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--suite-accent-dim), var(--suite-accent));
  color: #fff;
  font-size: 1.35rem;
}

body.suite-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.suite-body > main {
  flex: 1 0 auto;
}

.ai-usage-token-detail { font-size: 0.72rem; }
.ai-usage-filter-user { width: 180px; }
.ai-usage-filter-intent { width: 160px; }
.ai-usage-filter-provider { width: 140px; }
.ai-insights-filter-section { width: 160px; }
.ai-insights-max-tokens { width: 85px; }
.admin-user-agent { max-width: 16rem; }
.admin-app-role-select { min-width: 9rem; }
.feature-flag-column-name { width: 30%; }
.feature-flag-column-description { width: 28%; }
.feature-flag-column-enabled { width: 14%; }
.feature-flag-column-notes { width: 20%; }
.feature-flag-column-save { width: 8%; }

/* Full-bleed app embedding — toggled by launcher JS */
body.suite-body.app-open > #suite-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
}

#launcher-app-embed {
  display: none;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

body.suite-body.app-open #launcher-app-embed {
  display: flex;
}

.launcher-iframe-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#launcher-app-iframe {
  flex: 1 1 auto;
  display: block;
  width: 100%;
  min-height: 0;
  border: 0;
  background: #fff;
}

.launcher-embed-resizer {
  flex: 0 0 12px;
  cursor: ns-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.03), rgba(0, 0, 0, 0.07));
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  user-select: none;
  touch-action: none;
}

.launcher-embed-resizer:hover {
  background: rgba(77, 179, 217, 0.14);
}

.launcher-embed-resizer::after {
  content: '';
  width: 44px;
  height: 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
}

/* ── Launcher grid ────────────────────────────────────────────────── */

.launcher-header {
  padding-bottom: 0.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.launcher-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.2rem;
  letter-spacing: -0.01em;
}

.launcher-subtitle {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0;
}

/* Card */
.launcher-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  overflow: hidden;
}

.launcher-card:not(.launcher-card--disabled):hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10);
  transform: translateY(-2px);
}

.launcher-card--disabled {
  background: #f9fafb;
  border-color: #e5e7eb;
  opacity: 0.75;
}

/* Card body */
.launcher-card-body {
  flex: 1 1 auto;
  padding: 1rem;
}

.launcher-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

/* Icon badge */
.launcher-icon {
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.625rem;
  background: linear-gradient(135deg, var(--suite-accent-dim), var(--suite-accent));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 2px 8px rgba(77, 179, 217, 0.35);
}

.launcher-card--disabled .launcher-icon {
  background: linear-gradient(135deg, #9ca3af, #d1d5db);
  box-shadow: none;
}

/* App name + badge */
.launcher-card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.launcher-card-name {
  font-size: 1rem;
  font-weight: 650;
  color: #111827;
  margin: 0;
  line-height: 1.3;
}

.launcher-badge {
  display: inline-block;
  white-space: nowrap;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
}

.launcher-badge--active {
  background: #d1fae5;
  color: #065f46;
}

.launcher-badge--disabled {
  background: #f3f4f6;
  color: #6b7280;
}

/* Description */
.launcher-card-desc {
  font-size: 0.85rem;
  color: #6b7280;
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Footer with action button */
.launcher-card-footer {
  padding: 0.6rem 1rem;
  border-top: 1px solid #f3f4f6;
}

/* Buttons */
.launcher-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  padding: 0.4rem 1rem;
  min-height: 34px;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.launcher-btn--primary {
  background: linear-gradient(135deg, var(--suite-accent-dim), var(--suite-accent));
  color: #fff;
  box-shadow: 0 2px 6px rgba(77, 179, 217, 0.30);
}

.launcher-btn--primary:hover {
  background: linear-gradient(135deg, #1e6f8f, var(--suite-accent-dim));
  box-shadow: 0 4px 12px rgba(77, 179, 217, 0.40);
}

.launcher-btn--admin {
  background: transparent;
  color: #b45309;
  border: 1.5px solid #fbbf24;
}

.launcher-btn--admin:hover {
  background: #fffbeb;
}

.launcher-btn--unavailable {
  background: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
}

/* Empty state */
.launcher-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: #fff;
  border: 1px dashed #d1d5db;
  border-radius: 0.75rem;
}

.launcher-empty-icon {
  font-size: 3rem;
  color: #d1d5db;
  margin-bottom: 1rem;
}

.launcher-empty-text {
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.25rem;
}

.launcher-empty-sub {
  font-size: 0.85rem;
  color: #9ca3af;
  margin: 0;
}

/* AI usage page — custom badge colours */
.bg-purple { background-color: #7c3aed !important; }
.bg-orange  { background-color: #ea580c !important; }

.launcher-btn:focus-visible,
.act-btn:focus-visible,
.chip-toggle:focus-visible,
.suite-collapse-toggle:focus-visible,
.suite-collapse-header:focus-visible {
  outline: 2px solid var(--suite-accent-dim);
  outline-offset: 2px;
}

/* ── Density: page shell ─────────────────────────────────────────── */
.suite-main { padding: 0.75rem 1rem; }
.suite-section-title { font-size: 0.8rem; letter-spacing: 0.06em; }

/* ── Dense admin table (was page-local <style> in Users/Index + AiUsage) ── */
.tbl-admin { font-size: 0.85rem; }
.tbl-admin thead th {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6b7280;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  padding: 0.35rem 0.6rem;
  white-space: nowrap;
}
.tbl-admin tbody td { padding: 0.3rem 0.6rem; vertical-align: middle; border-bottom: 1px solid #f3f4f6; }
.tbl-admin tbody tr:last-child td { border-bottom: none; }
.tbl-admin tbody tr:hover td { background: #fafafa; }
.tbl-admin .cell-secondary { font-size: 0.8rem; color: #6b7280; line-height: 1.25; }
.tbl-admin .cell-small { font-size: 0.8rem; }
.tbl-admin .cell-nowrap { white-space: nowrap; }
.tbl-admin .cell-trunc { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl-admin .col-shrink { width: 1%; }
.tbl-admin .col-check { width: 2rem; }

/* Scroll container with sticky header for long lists */
.tbl-scroll { max-height: calc(100vh - 16rem); min-height: 12rem; overflow: auto; }
.tbl-scroll thead th { position: sticky; top: 0; z-index: 1; }

/* ── Status badges (suite-prefixed; do not clash with Bootstrap .badge) ── */
.status-badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em;
  padding: 0.15rem 0.55rem; border-radius: 999px;
  white-space: nowrap;
}
.status-badge .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; background: currentColor; }
.status-badge--pending   { background: #fef9c3; color: #92400e; border: 1px solid #fde68a; }
.status-badge--approved  { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.status-badge--rejected  { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.status-badge--suspended { background: #ffedd5; color: #9a3412; border: 1px solid #fdba74; }
.status-badge--active    { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.status-badge--inactive  { background: #f3f4f6; color: #6b7280; border: 1px solid #d1d5db; }
.status-badge--warning   { background: #ffedd5; color: #9a3412; border: 1px solid #fdba74; }
.status-badge--role      { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

.status-badges { display: flex; flex-wrap: wrap; gap: 0.25rem; }

/* ── Row action buttons ───────────────────────────────────────────── */
.act-btn {
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-size: 0.8rem; font-weight: 600; padding: 0.2rem 0.6rem; min-height: 28px;
  border-radius: 0.375rem; border: 1.5px solid; cursor: pointer;
  white-space: nowrap; text-decoration: none; transition: all 0.12s;
  background: transparent; line-height: 1.4;
}
.act-btn-secondary { color: #374151; border-color: #d1d5db; }
.act-btn-secondary:hover { background: #f3f4f6; border-color: #9ca3af; color: #111827; }
.act-btn-success { color: #065f46; border-color: #6ee7b7; }
.act-btn-success:hover { background: #d1fae5; }
.act-btn-danger { color: #991b1b; border-color: #fca5a5; }
.act-btn-danger:hover { background: #fee2e2; }
.act-btn-warning { color: #92400e; border-color: #fde68a; }
.act-btn-warning:hover { background: #fef9c3; }
.act-btn-primary { color: #1d4ed8; border-color: #bfdbfe; }
.act-btn-primary:hover { background: #eff6ff; }

/* ── AI usage log ─────────────────────────────────────────────────── */
.ai-log-pre {
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px;
  padding: 0.6rem 0.8rem; font-size: 0.8rem; white-space: pre-wrap;
  word-break: break-word; max-height: 200px; overflow-y: auto; margin: 0;
}
.ai-log-detail-cell { padding: 0.75rem !important; }

/* ── Chips + collapsible chip groups ──────────────────────────────── */
.chip-group { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.8rem; padding: 0.2rem 0.65rem; border-radius: 999px;
  background: #f8f9fa; color: #212529; border: 1px solid #dee2e6;
  white-space: nowrap; max-width: 100%; overflow-wrap: anywhere;
}
/* Visible outlined "+N more / Show less" pill. */
.chip-toggle {
  display: inline-flex; align-items: center; gap: 0.3rem;
  min-height: 28px; font-size: 0.8rem; font-weight: 600;
  padding: 0.15rem 0.7rem; border-radius: 999px;
  background: #fff; color: #1d4ed8; border: 1.5px solid #93c5fd; cursor: pointer;
}
.chip-toggle:hover { background: #eff6ff; }
.chip-toggle .bi { transition: transform 0.15s; }
.chip-toggle[aria-expanded="true"] .bi { transform: rotate(180deg); }
.chip-toggle .when-open { display: none; }
.chip-toggle[aria-expanded="true"] .when-open { display: inline; }
.chip-toggle[aria-expanded="true"] .when-closed { display: none; }
/* Extra chips live in a collapse that flows inline with the group. */
.chip-group .chip-more.collapse:not(.show) { display: none; }
.chip-group .chip-more.collapse.show,
.chip-group .chip-more.collapsing { display: contents; }

/* Two-line clamp for free text with a visible toggle (<details>-based). */
.clamp-text { font-size: 0.8rem; color: #6b7280; max-width: 42rem; }
.clamp-text summary {
  list-style: none; cursor: pointer;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; overflow-wrap: anywhere;
}
.clamp-text summary::-webkit-details-marker { display: none; }
.clamp-text[open] summary { display: block; }
.clamp-text .clamp-toggle {
  display: inline-flex; align-items: center; gap: 0.2rem; margin-top: 0.15rem;
  font-size: 0.75rem; font-weight: 600; color: #1d4ed8; cursor: pointer;
  min-height: 24px; border-radius: 0.25rem;
}
.clamp-text .clamp-toggle .when-open { display: none; }
.clamp-text[open] .clamp-toggle .when-open { display: inline; }
.clamp-text[open] .clamp-toggle .when-closed { display: none; }
.clamp-text summary:focus-visible { outline: 2px solid var(--suite-accent-dim); outline-offset: 2px; }
.clamp-text .clamp-body { overflow-wrap: anywhere; white-space: pre-wrap; }

/* Collapsible card header (FeatureFlags) */
.suite-collapse-header { cursor: pointer; }
.suite-collapse-header .bi-chevron-down,
.suite-collapse-header .bi-chevron-up { font-size: 1.1rem; }

@media print {
  .chip-group .chip-more.collapse { display: contents !important; }
  .chip-toggle { display: none; }
  .tbl-scroll { max-height: none; overflow: visible; }
}

/* ── Auth status card (ApprovalPending) ───────────────────────────── */
.suite-auth-card { overflow: hidden; margin-top: 0.5rem; }
.suite-auth-accent { height: 4px; background: linear-gradient(90deg, var(--suite-accent-dim), var(--suite-accent)); }
.suite-status-icon {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 0.75rem;
  background: linear-gradient(135deg, var(--suite-accent-dim), var(--suite-accent));
  box-shadow: 0 4px 16px rgba(77, 179, 217, 0.35);
  color: #fff; font-size: 1.25rem;
}
.suite-auth-title { color: #111827; }
.suite-auth-text { font-size: 0.9rem; line-height: 1.55; }
.suite-auth-divider { border-color: #e5e7eb; margin: 1rem 0; }
.suite-status-pill {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.35rem 0.75rem; border-radius: 0.5rem; margin-bottom: 1rem;
  background: #fef9c3; border: 1px solid #fde68a;
  font-size: 0.8rem; font-weight: 600; color: #92400e;
}
.suite-status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; flex-shrink: 0; }
.suite-btn-accent {
  background: linear-gradient(135deg, var(--suite-accent-dim), var(--suite-accent));
  color: #fff; border: none; border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(77, 179, 217, 0.3); font-weight: 600;
}
.suite-btn-accent:hover, .suite-btn-accent:focus-visible { color: #fff; filter: brightness(0.93); }
.suite-auth-footnote { font-size: 0.8rem; }

/* ── Cookie banner: slim single row; body gets bottom padding while shown ── */
.ic-cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1055;
  background: #1e293b; color: #e2e8f0;
  padding: 0.5rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
body.has-cookie-banner { padding-bottom: 3.5rem; }
@media (max-width: 575.98px) { body.has-cookie-banner { padding-bottom: 6rem; } }

/* ── Coarse pointers: larger targets ──────────────────────────────── */
@media (pointer: coarse) {
  .act-btn, .chip-toggle, .launcher-btn { min-height: 44px; }
  .navbar-suite .nav-link { padding-block: 0.6rem !important; }
}

/* Forms that must not affect table/flex layout (single-form + formaction pattern). */
.d-contents { display: contents !important; }

/* ── Density: form controls ~34px (Bootstrap default is 38px) ─────── */
.form-control:not(textarea):not(.form-control-sm):not(.form-control-lg),
.form-select:not(.form-select-sm):not(.form-select-lg) {
  min-height: 34px;
  padding-block: 0.3rem;
}
.btn:not(.btn-sm):not(.btn-lg) { padding-block: 0.3rem; min-height: 34px; }
.form-label { margin-bottom: 0.25rem; }
.form-control:focus-visible, .form-select:focus-visible, .btn:focus-visible { outline: 2px solid var(--suite-accent-dim); outline-offset: 1px; }
@media (pointer: coarse) {
  .form-control:not(textarea), .form-select, .btn { min-height: 44px; }
}

/* ── AI Provider & Platform Management ─────────────────────────────── */
.nav-tabs-ai {
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 1.5rem;
}
.nav-tabs-ai .nav-link {
  color: #64748b;
  font-weight: 500;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.6rem 1rem;
  margin-bottom: -2px;
  transition: all 0.15s ease-in-out;
}
.nav-tabs-ai .nav-link:hover {
  color: #0f172a;
  border-bottom-color: #cbd5e1;
}
.nav-tabs-ai .nav-link.active {
  color: var(--suite-accent-dim);
  font-weight: 600;
  background: transparent;
  border-bottom: 2px solid var(--suite-accent-dim);
}

.ai-platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: 9999px;
  line-height: 1;
}
.ai-platform-badge-cloud {
  background-color: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}
.ai-platform-badge-local {
  background-color: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.ai-platform-badge-recommended {
  background-color: #f0fdf4;
  color: #15803d;
  border: 1px solid #86efac;
}
.ai-platform-badge-supported {
  background-color: #f0f9ff;
  color: #0369a1;
  border: 1px solid #7dd3fc;
}
.ai-platform-badge-risky {
  background-color: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}
.ai-platform-badge-unsupported {
  background-color: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.ai-hardware-metric-card {
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #ffffff;
  padding: 1rem;
  height: 100%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.ai-metric-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.375rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
  background: #f1f5f9;
  color: var(--suite-accent-dim);
}
.ai-metric-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}
.ai-metric-label {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 0.2rem;
}

.ai-fingerprint {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
  background-color: #f8fafc;
  color: #475569;
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  border: 1px solid #e2e8f0;
}
.ai-safety-alert {
  background-color: #f8fafc;
  border-left: 4px solid var(--suite-accent-dim);
  border-radius: 0.25rem;
  padding: 0.85rem 1.15rem;
}

