/* Portal-wide layout and component adaptations. Typography stays in the I4 tokens. */
.layout {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding-inline: clamp(16px, 2.5vw, 32px);
  padding-bottom: 36px;
}

.main, .view, .view-head > div, .field, .grid > *, .access-field, .access-row > * {
  min-width: 0;
}

.view-head { align-items: flex-start; }
.view-head p { max-width: 72ch; line-height: 1.5; }
/* Keep automatic report scrolling clear of the sticky, two-row desktop bar. */
#reportPreview, #reports .report-form { scroll-margin-top: 8rem; }
.app-navbar .user { min-width: 0; max-width: 380px; }
.app-navbar .user #userName { min-width: 0; overflow-wrap: anywhere; }
.card { padding: clamp(16px, 2vw, 24px); }
.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.actions { flex-wrap: wrap; align-items: center; }
.actions > select { max-width: 100%; }
.btn, .access-button { min-height: 36px; padding: 9px 14px; }
.btn:disabled { cursor: not-allowed; opacity: .55; }

/* Cyan actions use the same dark foreground in both themes for contrast. */
.btn.primary, .access-button { background: var(--i4-primary); color: #0f172a; }
.btn.primary:hover, .access-button:hover { background: #06a9c2; color: #0f172a; }
html[data-theme="dark"] .btn.primary,
html[data-theme="dark"] .access-button { background: var(--i4-primary); color: #0f172a; }
html[data-theme="dark"] .btn.primary:hover,
html[data-theme="dark"] .access-button:hover { background: #67e8f9; color: #0f172a; }
.btn.secondary { background: var(--i4-card); border: 1px solid var(--i4-border); color: var(--i4-foreground); }
.btn.secondary:hover { background: #f1f5f9; border-color: #94a3b8; }
html[data-theme="dark"] .btn.secondary { background: #334155; border-color: #475569; color: var(--i4-foreground); }
html[data-theme="dark"] .btn.secondary:hover { background: #475569; border-color: #64748b; }

/* Secondary and destructive actions retain their individual meanings. */
.access-button.secondary { background: var(--i4-card); color: var(--i4-foreground); }
.access-button.secondary:hover { background: #e2e8f0; color: #0f172a; }
.access-button.danger, .access-button.danger:hover { background: #b91c1c; color: #fff; }
html[data-theme="dark"] .access-button.secondary { background: #1e293b; color: var(--i4-foreground); }
html[data-theme="dark"] .access-button.secondary:hover { background: #334155; color: var(--i4-foreground); }
html[data-theme="dark"] .access-button.danger,
html[data-theme="dark"] .access-button.danger:hover { background: #991b1b; color: #fff; }

.table-wrap, .access-table-wrap { min-width: 0; max-width: 100%; overflow-x: auto; }
.table-wrap > .table { min-width: 620px; }
.table th, .table td, .access-table th, .access-table td { padding: 10px 12px; }
.table th, .access-table th { letter-spacing: .04em; text-transform: uppercase; }
.table td, .access-table td { vertical-align: top; }
.table tbody tr:hover, .access-table tbody tr:hover { background: rgba(8, 145, 178, .045); }
html[data-theme="dark"] .table tbody tr:hover,
html[data-theme="dark"] .access-table tbody tr:hover { background: rgba(34, 211, 238, .07); }

.dashboard-metric { min-width: 0; border-radius: var(--i4-radius-card); box-shadow: var(--i4-shadow); }
.dashboard-metric b, .dashboard-ticket, .access-row { overflow-wrap: anywhere; }
.dashboard-order { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; margin: -2px 0 10px; border-bottom: 1px solid var(--i4-border); }
.dashboard-order-label { color: var(--i4-muted); font-size: .72rem; }
.dashboard-order-button { display: inline-flex; align-items: center; gap: 3px; min-height: 32px; padding: 4px 0; border: 0; background: transparent; color: var(--i4-muted); font: inherit; font-size: .72rem; font-weight: 600; letter-spacing: .035em; text-transform: uppercase; cursor: pointer; }
.dashboard-order-button:hover { color: var(--i4-foreground); }
.dashboard-order-button:focus-visible { outline: 2px solid var(--i4-primary); outline-offset: 2px; border-radius: 3px; }
.dashboard-order-icon { width: 12px; height: 12px; flex: 0 0 12px; color: #94a3b8; }
.dashboard-order-button[aria-pressed="true"] .dashboard-order-icon { color: #0891b2; }
.dashboard-order-button[data-direction="asc"] .sort-down,
.dashboard-order-button[data-direction="desc"] .sort-up { display: none; }
.report-state-filter { min-width: 0; margin: 0; padding: 0; border: 0; color: var(--i4-foreground); }
.report-state-filter legend { padding: 0; margin-bottom: 8px; font-size: .85rem; font-weight: 650; }
.report-state-options { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.report-state-options label { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; }
.report-state-options input { width: 16px; height: 16px; margin: 0; accent-color: var(--i4-primary); }
.report-state-help { display: block; margin-top: 6px; color: var(--i4-muted); font-size: .75rem; }
.report-dates[hidden] { display: none; }
html[data-theme="dark"] .dashboard-order { border-color: #475569; }
html[data-theme="dark"] .dashboard-order-button { color: #cbd5e1; }
html[data-theme="dark"] .dashboard-order-button:hover { color: #f1f5f9; }
html[data-theme="dark"] .dashboard-order-icon { color: #94a3b8; }
html[data-theme="dark"] .dashboard-order-button[aria-pressed="true"] .dashboard-order-icon { color: #22d3ee; }
html[data-theme="dark"] .report-state-filter { color: var(--i4-foreground); }
html[data-theme="dark"] .report-state-help { color: var(--i4-muted); }
.mcp-workspace { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.history-filters select, .history-filters input { min-width: 0; max-width: 100%; }
.attachment-item { min-width: 0; overflow-wrap: anywhere; }
.attachment-item small { white-space: normal; }
html[data-theme="dark"] .history-filters select,
html[data-theme="dark"] .history-filters input { background: #0f172a; border-color: #475569; color: var(--i4-foreground); }
html[data-theme="dark"] :is(.history-filters input, .field input, .field textarea, .access-field input, .access-field textarea)::placeholder { color: #94a3b8; opacity: 1; }
html[data-theme="dark"] .attachment-item { background: #0f172a; color: var(--i4-muted); }
html[data-theme="dark"] .attachment-item button { color: #fca5a5; }
html[data-theme="dark"] .audit b { color: var(--i4-foreground); }

/* Focus must remain visible while menu visibility depends only on .open. */
.primary-navigation .navbutton:focus-visible,
.nav-menu-item:focus-visible,
.dashboard-ticket:focus-visible,
.access-nav button:focus-visible {
  outline: 3px solid var(--i4-primary);
  outline-offset: 2px;
}

.access-shell { width: 100%; padding: 24px 0 48px; }
.access-header { padding: 12px 20px; border-radius: var(--i4-radius-card); }
.access-brand img { width: 36px; height: 36px; padding: 3px; }
.access-main { width: 100%; max-width: none; min-width: 0; }
.access-main h1 { font-size: 1.5rem; }
.access-card { border-radius: var(--i4-radius-card); padding: clamp(16px, 2vw, 24px); }
.access-row { min-width: 0; }
.access-nav { scrollbar-width: thin; }
.access-nav button { min-height: 36px; padding: 8px 14px; }

/* A normal-flow footer cannot cover content at small heights or high zoom. */
.app-footer { position: static; }
/* Dialogs cover the sticky bar; global feedback stays above both. */
.modal-backdrop { z-index: 80; }
#notice { z-index: 100; }

/* Mid-size desktops get a separate nav row before controls become crowded. */
@media (max-width: 1100px) {
  .app-navbar { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 14px; }
  .app-navbar .navbar-brand { grid-column: 1; grid-row: 1; min-width: 0; }
  .app-navbar .user { grid-column: 2; grid-row: 1; }
  .primary-navigation { grid-column: 1 / -1; grid-row: 2; width: 100%; }
}

@media (min-width: 761px) and (max-width: 1100px) {
  .primary-navigation { flex-wrap: wrap; overflow: visible; }
}

@media (max-width: 760px) {
  .layout { padding: 20px 16px 32px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .primary-navigation { flex-wrap: nowrap; overflow-x: auto; padding-block: 4px; }
  .app-footer { min-height: 0; }
  .access-shell { width: calc(100% - 28px); padding-top: 14px; }
  .access-grid { grid-template-columns: minmax(0, 1fr); }
  .access-header { align-items: flex-start; flex-direction: column; }
  .access-row { align-items: flex-start; flex-direction: column; }
  .access-field input, .access-field select, .access-field textarea,
  .field select, .field textarea, .history-filters input, .history-filters select { font-size: 1rem; }
}

@media (max-width: 480px) {
  .app-navbar .user { gap: 6px; }
  .navbar-brand-copy { min-width: 0; }
  .navbar-brand-copy strong, .navbar-brand-copy small { overflow-wrap: anywhere; }
  .dashboard-summary { grid-template-columns: minmax(0, 1fr); }
  .actions > .btn, .actions > select, .access-actions > .access-button { max-width: 100%; }
}

/* ASSETS-inspired institutional bar and dark, explicitly opened menus. */
.app-navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 56px;
  border-radius: 0;
  padding: 7px clamp(16px, 2vw, 32px);
  gap: clamp(12px, 1.6vw, 24px);
}
.navbar-logo { width: 28px; height: 32px; flex-basis: 28px; }
.navbar-logo img { width: 28px; }
.navbar-brand-copy strong { font-size: .82rem; }
.navbar-brand-copy small { font-size: .68rem; }
.app-navbar .user { gap: 9px; font-size: .78rem; }
.app-navbar .user [data-theme-toggle] { order: 0; }
.app-navbar .user .avatar { order: 1; width: 30px; height: 30px; border-radius: 8px; font-size: .72rem; }
.app-navbar .user #userName { order: 2; }
.app-navbar .portal-logout { order: 3; display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 7px 9px; border: 1px solid #475569; border-radius: 8px; background: transparent; color: #e2e8f0; white-space: nowrap; font-size: .75rem; }
.app-navbar .portal-logout:hover { background: #334155; color: #fff; }
.app-navbar .portal-logout:focus-visible { outline: 3px solid var(--i4-primary); outline-offset: 2px; }
html[data-theme="dark"] .app-navbar .portal-logout { border-color: #64748b; color: #f1f5f9; }
html[data-theme="dark"] .app-navbar .portal-logout:hover { background: #334155; }
.primary-navigation .navbutton {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 8px 10px;
  font-size: .8rem;
  font-weight: 500;
  color: #b8c6d8;
}
.primary-navigation .navbutton::before,
.nav-menu-item::before {
  content: '';
  display: inline-block;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: var(--nav-icon, url('/assets/icons/news.svg')) center / contain no-repeat;
  mask: var(--nav-icon, url('/assets/icons/news.svg')) center / contain no-repeat;
}
.primary-navigation [data-view="dashboard"] { --nav-icon: url('/assets/icons/dashboard.svg'); }
.primary-navigation [data-nav-section="tickets"] { --nav-icon: url('/assets/icons/ticket.svg'); }
.primary-navigation [data-nav-section="assistant"] { --nav-icon: url('/assets/icons/sparkles.svg'); }
.primary-navigation [data-nav-section="admin"] { --nav-icon: url('/assets/icons/users.svg'); }
.primary-navigation [data-view="releases"] { --nav-icon: url('/assets/icons/news.svg'); }
.primary-navigation .nav-menu-item[data-view="new"] { --nav-icon: url('/assets/icons/ticket.svg'); }
.primary-navigation .nav-menu-item[data-view="review"] { --nav-icon: url('/assets/icons/users.svg'); }
.primary-navigation .nav-menu-item[data-view="history"] { --nav-icon: url('/assets/icons/news.svg'); }
.primary-navigation .nav-menu-item[data-view="reports"] { --nav-icon: url('/assets/icons/dashboard.svg'); }
.primary-navigation .nav-menu-item[data-mcp-action="minutes"] { --nav-icon: url('/assets/icons/news.svg'); }
.primary-navigation .nav-menu-item[data-mcp-action="reports"] { --nav-icon: url('/assets/icons/dashboard.svg'); }
.primary-navigation .navbutton:hover,
.primary-navigation .navbutton:focus-visible { background: #24344a; color: #f8fafc; }
.primary-navigation .navbutton.active,
.primary-navigation .nav-group.active .nav-group-trigger { background: var(--i4-primary); color: #0f172a; }
html[data-theme="dark"] .primary-navigation .navbutton:hover,
html[data-theme="dark"] .primary-navigation .navbutton:focus-visible { background: #24344a; color: #f8fafc; }
html[data-theme="dark"] .primary-navigation .navbutton.active,
html[data-theme="dark"] .primary-navigation .nav-group.active .nav-group-trigger { background: var(--i4-primary); color: #0f172a; }
.nav-menu-panel { min-width: 220px; padding: 6px; border-color: #334155; background: #1e293b; }
.nav-menu-item { display: flex; align-items: center; gap: 10px; color: #d5e0ee; font-size: .82rem; font-weight: 500; }
.primary-navigation [hidden] { display: none !important; }
.nav-menu-item::before { color: #22d3ee; }
.nav-menu-item:hover, .nav-menu-item:focus-visible, .nav-menu-item.active { background: #334155; color: #f8fafc; }
html[data-theme="dark"] .nav-menu-panel { border-color: #475569; background: #1e293b; }
html[data-theme="dark"] .nav-menu-item { color: #d5e0ee; }
html[data-theme="dark"] .nav-menu-item:hover,
html[data-theme="dark"] .nav-menu-item:focus-visible,
html[data-theme="dark"] .nav-menu-item.active { background: #334155; color: #f8fafc; }

/* The same sun/moon switch is used on the portal and access pages. */
button[data-theme-toggle], .access-header-actions button[data-theme-toggle] {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  gap: 2px;
  width: 78px;
  height: 36px;
  padding: 3px;
  border: 1px solid #94a3b8;
  border-radius: 999px;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 0;
}
button[data-theme-toggle]::before, button[data-theme-toggle]::after {
  content: '';
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-position: center;
  background-size: 18px 18px;
  background-repeat: no-repeat;
}
button[data-theme-toggle]::before { background-image: url('/assets/icons/sun.svg'); background-color: #a5f3fc; }
button[data-theme-toggle]::after { background-image: url('/assets/icons/moon.svg'); }
html[data-theme="dark"] button[data-theme-toggle],
html[data-theme="dark"] .access-header-actions button[data-theme-toggle] { background: #1e293b; border-color: #64748b; }
html[data-theme="dark"] button[data-theme-toggle]::before { background-color: transparent; }
html[data-theme="dark"] button[data-theme-toggle]::after { background-color: #a5f3fc; }
button[data-theme-toggle]:focus-visible { outline: 3px solid var(--i4-primary); outline-offset: 3px; }

/* KPI cards keep GDC's real data while adopting the reference hierarchy. */
.dashboard-summary { gap: 16px; margin-bottom: 24px; }
.dashboard-metric { min-height: 120px; padding: 18px 20px; background: var(--i4-card); border-radius: var(--i4-radius-card); }
.dashboard-metric-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.dashboard-metric .dashboard-metric-label { margin: 0; color: var(--i4-muted); font-size: .7rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.dashboard-metric .dashboard-metric-icon { display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; margin: 0; border-radius: 50%; color: #0891b2; background: rgba(0, 184, 212, .10); }
.dashboard-metric-icon::before { content: ''; width: 20px; height: 20px; background: currentColor; -webkit-mask: var(--metric-icon) center / contain no-repeat; mask: var(--metric-icon) center / contain no-repeat; }
.metric-icon--tickets { --metric-icon: url('/assets/icons/ticket.svg'); }
.metric-icon--mentions { --metric-icon: url('/assets/icons/users.svg'); }
.metric-icon--sync { --metric-icon: url('/assets/icons/dashboard.svg'); }
.dashboard-metric b { margin-top: -8px; font-size: 1.8rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.dashboard-metric small { display: block; margin-top: 5px; color: var(--i4-muted); font-size: .75rem; line-height: 1.4; }
html[data-theme="dark"] .dashboard-metric { background: var(--i4-card); border-color: var(--i4-border); }
html[data-theme="dark"] .dashboard-metric .dashboard-metric-label,
html[data-theme="dark"] .dashboard-metric small { color: var(--i4-muted); }
html[data-theme="dark"] .dashboard-metric .dashboard-metric-icon { background: rgba(0, 184, 212, .14); color: #67e8f9; }
.dashboard-section-head h2, .access-main h2 { font-size: 1rem; }
.dashboard-ticket { padding: 12px 14px; border-radius: var(--i4-radius-control); }
.history-filters { gap: 8px; }
.table-wrap { padding: 16px 20px; }
.table th, .access-table th { font-size: .72rem; font-weight: 600; }
.table td, .access-table td { font-size: .875rem; }
.minute-preview { grid-template-columns: minmax(0, 1fr); min-width: 0; }
.minute-preview > .card { min-width: 0; }
.minute-actions-editor { max-width: 100%; overflow-x: auto; }

/* Access workspaces share the same compact institutional header. */
.access-shell { width: 100%; max-width: none; padding: 0 0 48px; }
.client-shell { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; padding-bottom: 0; }
.client-shell .access-main { flex: 1 0 auto; }
.access-header { position: sticky; top: 0; z-index: 50; min-height: 56px; padding: 8px clamp(16px, 2vw, 32px); border-radius: 0; }
.access-brand img { width: 28px; height: 32px; padding: 0; background: transparent; }
.access-brand strong { font-size: .82rem; }
.access-brand small { font-size: .68rem; }
.access-main { width: calc(100% - clamp(32px, 5vw, 64px)); margin: 24px auto 0; }
.access-header-actions .access-back, .access-header-actions #accessAdminLogout { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; }
.client-header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; }
.client-header .access-brand { grid-column: 1; }
.client-header .access-header-actions { grid-column: 3; justify-content: flex-end; flex-wrap: nowrap; }
.client-header #externalUser { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #e2e8f0; font-size: .78rem; }
.client-header #externalLogout { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 7px 9px; white-space: nowrap; font-size: .75rem; }
html[data-theme="dark"] .client-header #externalLogout,
html[data-theme="dark"] #accessAdminLogout { border-color: #64748b; color: #f1f5f9; }
.client-navigation { grid-column: 2; display: flex; align-items: center; gap: 3px; min-width: 0; }
.client-navigation button { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; border: 0; border-radius: 8px; padding: 8px 10px; background: transparent; color: #b8c6d8; font-size: .8rem; font-weight: 500; white-space: nowrap; }
.client-navigation button::before { content: ''; width: 16px; height: 16px; background: currentColor; -webkit-mask: var(--client-icon) center / contain no-repeat; mask: var(--client-icon) center / contain no-repeat; }
.client-navigation [data-external-view="new"] { --client-icon: url('/assets/icons/ticket.svg'); }
.client-navigation [data-external-view="history"] { --client-icon: url('/assets/icons/news.svg'); }
.client-navigation [data-external-view="reports"] { --client-icon: url('/assets/icons/dashboard.svg'); }
.client-navigation button:hover, .client-navigation button:focus-visible { background: #24344a; color: #f8fafc; }
.client-navigation button.active { background: var(--i4-primary); color: #0f172a; }
.client-navigation button:focus-visible, .client-menu-toggle:focus-visible { outline: 3px solid var(--i4-primary); outline-offset: 2px; }
html[data-theme="dark"] .client-navigation button { color: #d5e0ee; }
html[data-theme="dark"] .client-navigation button:hover { background: #334155; color: #f8fafc; }
html[data-theme="dark"] .client-navigation button.active { background: var(--i4-primary); color: #0f172a; }
.client-menu-toggle { display: none; }
.client-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 40px; padding: 12px clamp(16px, 2vw, 32px); background: var(--i4-nav); color: #94a3b8; font-size: .72rem; }
#externalProposal, #externalHistoryDetail, #externalReportResult { scroll-margin-top: 8rem; }

/* Customer ticket review mirrors the internal portal without exposing an owner selector. */
.client-ticket-card { display: flex; align-items: flex-start; gap: 14px; padding: 18px; border: 1px solid var(--i4-border); border-radius: 12px; background: var(--i4-card); }
.client-ticket-card > input { flex: 0 0 auto; width: 17px; height: 17px; margin: 4px 0 0; accent-color: var(--i4-primary-strong); }
.client-ticket-content { flex: 1; min-width: 0; }
.client-ticket-content h3 { margin: 0; font-size: 1rem; line-height: 1.4; overflow-wrap: anywhere; }
.client-ticket-description { margin: 8px 0 12px; color: var(--i4-muted); line-height: 1.55; overflow-wrap: anywhere; }
.client-ticket-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.client-ticket-priority { display: inline-flex; align-items: center; gap: 8px; color: var(--i4-muted); font-size: .85rem; font-weight: 600; }
.client-ticket-priority select { border: 1px solid var(--i4-border); border-radius: 7px; padding: 6px 9px; background: var(--i4-card); color: var(--i4-foreground); }
.client-ticket-priority select:focus-visible { outline: 3px solid var(--i4-primary); outline-offset: 2px; }
.client-ticket-badge { padding: 5px 9px; border: 1px solid var(--i4-border); border-radius: 999px; color: var(--i4-muted); font-size: .8rem; }
.client-ticket-badge.is-created { background: #ecfeff; border-color: #a5f3fc; color: #0e7490; font-weight: 700; }
#externalHistory .access-row > div { min-width: 0; }
#externalHistory .access-row small { overflow-wrap: anywhere; }
#externalHistory .client-history-numbers { color: #0e7490; font-weight: 700; }
.client-confirm-dialog { width: min(560px, calc(100% - 32px)); max-height: calc(100vh - 32px); overflow: auto; border: 1px solid var(--i4-border); border-radius: 14px; padding: 24px; background: var(--i4-card); color: var(--i4-foreground); box-shadow: 0 20px 60px rgba(15,23,42,.3); }
.client-confirm-dialog::backdrop { background: rgba(2, 6, 23, .65); }
.client-confirm-dialog h2 { margin: 0 0 10px; font-size: 1.25rem; }
.client-confirm-dialog p { line-height: 1.5; }
.client-dialog-eyebrow { margin: 0 0 8px; color: var(--i4-muted); font-size: .8rem; font-weight: 600; }
.client-confirm-dialog ul { max-height: 36vh; overflow: auto; padding-left: 22px; line-height: 1.5; overflow-wrap: anywhere; }
.client-dialog-actions { justify-content: flex-end; }
html[data-theme="dark"] .client-ticket-card { background: var(--i4-card); border-color: var(--i4-border); }
html[data-theme="dark"] .client-ticket-priority select { background: #0f172a; color: var(--i4-foreground); border-color: #475569; }
html[data-theme="dark"] .client-ticket-badge { border-color: #475569; color: var(--i4-muted); }
html[data-theme="dark"] .client-ticket-badge.is-created { background: #083344; border-color: #155e75; color: #67e8f9; }
html[data-theme="dark"] #externalHistory .client-history-numbers { color: #67e8f9; }
html[data-theme="dark"] .client-confirm-dialog { background: var(--i4-card); color: var(--i4-foreground); border-color: var(--i4-border); }
@media (max-width: 480px) { .client-ticket-card { padding: 14px; gap: 10px; } .client-dialog-actions .access-button { flex: 1 1 auto; } }
html[data-theme="dark"] .client-footer { background: #020617; color: #94a3b8; }
.client-filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px; }
.client-filter-grid .access-field { margin: 0; min-width: 0; }
.client-filter-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 12px; font-size: .85rem; }
.client-filter-hint { margin: 12px 0; color: var(--i4-muted); font-size: .78rem; }
.client-report-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.client-report-metric { min-width: 0; padding: 14px; border: 1px solid var(--i4-border); border-top: 2px solid var(--i4-primary); border-radius: 10px; background: var(--i4-card); }
.client-report-metric span, .client-report-metric strong { display: block; }
.client-report-metric span { color: var(--i4-muted); font-size: .75rem; }
.client-report-metric strong { margin-top: 5px; color: var(--i4-foreground); font-size: 1.5rem; }
.client-report-table th { text-transform: uppercase; letter-spacing: .04em; }
html[data-theme="dark"] .client-filter-hint { color: #94a3b8; }
html[data-theme="dark"] .client-report-metric { background: #0f172a; border-color: #475569; border-top-color: #22d3ee; }
html[data-theme="dark"] .client-report-metric strong { color: #f1f5f9; }
html[data-theme="dark"] .client-report-table th { color: #94a3b8; }
.mobile-nav-toggle { display: none; }

@media (min-width: 761px) and (max-width: 1100px) {
  .client-header { grid-template-columns: minmax(0, 1fr) auto; }
  .client-header .access-brand { grid-column: 1; grid-row: 1; }
  .client-header .access-header-actions { grid-column: 2; grid-row: 1; }
  .client-navigation { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 760px) {
  .app-navbar { grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; min-height: 56px; }
  .app-navbar .navbar-brand { grid-column: 1; grid-row: 1; }
  .app-navbar .user { grid-column: 2; grid-row: 1; justify-self: end; }
  .app-navbar .user .avatar { display: none; }
  .mobile-nav-toggle { display: grid; place-items: center; grid-column: 3; grid-row: 1; width: 38px; height: 38px; border: 1px solid #475569; border-radius: 8px; background: transparent; color: #e2e8f0; font-size: 0; }
  html[data-theme="dark"] .mobile-nav-toggle { border-color: #64748b; background: #0f172a; color: #f1f5f9; }
  .mobile-nav-toggle::before { content: ''; width: 20px; height: 20px; background: currentColor; -webkit-mask: url('/assets/icons/menu.svg') center / contain no-repeat; mask: url('/assets/icons/menu.svg') center / contain no-repeat; }
  .mobile-nav-toggle:focus-visible { outline: 3px solid var(--i4-primary); outline-offset: 2px; }
  .primary-navigation { position: fixed; z-index: 60; top: 56px; bottom: 0; left: 0; display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 4px; width: min(320px, calc(100vw - 28px)); padding: 12px; overflow-x: hidden; overflow-y: auto; background: #0f172a; box-shadow: 12px 0 24px rgba(0, 0, 0, .24); visibility: hidden; transform: translateX(-105%); transition: transform .16s ease; }
  .app-navbar.mobile-menu-open .primary-navigation { visibility: visible; transform: translateX(0); }
  .primary-navigation .navbutton { width: 100%; justify-content: flex-start; }
  .primary-navigation .nav-group { position: static; display: block; width: 100%; }
  .primary-navigation .nav-menu-panel { position: static; width: 100%; min-width: 0; margin-top: 4px; padding: 4px; border-color: #334155; background: #1e293b; box-shadow: none; }
  html[data-theme="dark"] .primary-navigation .nav-menu-panel { background: #1e293b; border-color: #475569; }
  .access-shell { width: 100%; padding-top: 0; }
  .access-header { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .access-header:not(.client-header) { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .access-header:not(.client-header) .access-brand { min-width: 0; }
  .access-header:not(.client-header) .access-header-actions { flex-wrap: nowrap; gap: 6px; }
  .client-header { grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; }
  .client-header .access-brand { grid-column: 1; grid-row: 1; min-width: 0; }
  .client-header .access-header-actions { grid-column: 2; grid-row: 1; gap: 6px; }
  .client-header #externalUser, .client-header #externalLogout span { display: none; }
  .client-menu-toggle:not([hidden]) { display: grid; place-items: center; grid-column: 3; grid-row: 1; width: 38px; height: 38px; border: 1px solid #475569; border-radius: 8px; background: transparent; color: #e2e8f0; font-size: 0; }
  .client-menu-toggle::before { content: ''; width: 20px; height: 20px; background: currentColor; -webkit-mask: url('/assets/icons/menu.svg') center / contain no-repeat; mask: url('/assets/icons/menu.svg') center / contain no-repeat; }
  .client-navigation:not([hidden]) { position: fixed; z-index: 60; top: 56px; bottom: 0; left: 0; display: flex; flex-direction: column; align-items: stretch; gap: 4px; width: min(320px, calc(100vw - 28px)); padding: 12px; overflow-y: auto; background: #0f172a; box-shadow: 12px 0 24px rgba(0,0,0,.24); visibility: hidden; transform: translateX(-105%); transition: transform .16s ease; }
  .client-header.menu-open .client-navigation:not([hidden]) { visibility: visible; transform: translateX(0); }
  .client-navigation button { width: 100%; justify-content: flex-start; }
  .client-report-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html[data-theme="dark"] .client-menu-toggle:not([hidden]) { border-color: #64748b; background: #0f172a; color: #f1f5f9; }
  html[data-theme="dark"] .client-navigation:not([hidden]) { background: #0f172a; }
  .dashboard-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-metric { padding: 14px; min-height: 112px; }
  .dashboard-metric b { font-size: clamp(1.2rem, 5vw, 1.8rem); }
}
@media (max-width: 340px) {
  .dashboard-summary { grid-template-columns: minmax(0, 1fr); }
  .app-navbar .navbar-brand-copy { display: none; }
  .client-header .access-brand span { display: none; }
  .access-header:not(.client-header) .access-brand span { display: none; }
}
@media (max-width: 700px) {
  .access-header-actions .access-back span, .access-header-actions #accessAdminLogout span { display: none; }
  .access-header-actions .access-back, .access-header-actions #accessAdminLogout { padding: 7px 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .client-navigation { transition: none; }
}
