/* OUTBOUND G.O.A.T — dashboard theme (logo palette) */
:root {
  --color-navy: #2c5375;
  --color-navy-deep: #1f3d58;
  --color-accent: #f2996a;
  --color-accent-hover: #e8895a;
  --color-sky: #a6bbcf;
  --color-sky-muted: #e8eef4;
  --color-text: #1a2f44;
  --color-text-muted: #5a7189;
  --sidebar-width: 260px;
  --radius: 10px;
  --shadow-soft: 0 4px 24px rgba(44, 83, 117, 0.08);
  --font-display: "Montserrat", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-display);
  color: var(--color-text);
  background: var(--color-sky-muted);
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, var(--color-navy) 0%, var(--color-navy-deep) 100%);
  color: var(--color-sky-muted);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 0 2rem;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
  /* Pin the sidebar to the viewport so the signed-in user / sign-out controls
     at the bottom stay visible instead of sitting at the end of a long page. */
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem 1.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-brand-link {
  display: flex;
  line-height: 0;
  border-radius: var(--radius);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-brand-link:hover {
  transform: scale(1.03);
}

.sidebar-brand-link:hover .sidebar-brand-logo {
  filter: contrast(1.1) saturate(1.22) brightness(1.06);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.5),
    0 0 32px rgba(242, 153, 106, 0.75),
    0 12px 36px rgba(0, 0, 0, 0.55);
}

.sidebar-brand-link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.sidebar-brand-logo {
  width: 120px;
  height: 120px;
  border-radius: var(--radius);
  object-fit: cover;
  flex-shrink: 0;
  display: block;
  /* Pop against dark sidebar: brighter colors + accent ring + glow */
  filter: contrast(1.08) saturate(1.18) brightness(1.05);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.38),
    0 0 24px rgba(242, 153, 106, 0.55),
    0 8px 28px rgba(0, 0, 0, 0.45);
  transition: filter 0.2s ease, box-shadow 0.2s ease;
}

.nav-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  padding: 1.35rem 1.25rem 0.5rem;
}

.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 0 0.75rem;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar-nav a.is-active {
  background: rgba(242, 153, 106, 0.22);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--color-accent);
}

.sidebar-nav svg {
  width: 20px;
  height: 20px;
  opacity: 0.95;
}

.sidebar-nav-dropdown-panel {
  margin: 0;
}

.sidebar-nav-dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.88);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  list-style: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-nav-dropdown-toggle::-webkit-details-marker {
  display: none;
}

.sidebar-nav-dropdown-label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.sidebar-nav-dropdown-toggle:hover,
.sidebar-nav-dropdown-panel[open] > .sidebar-nav-dropdown-toggle {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar-nav-dropdown.is-active-group > .sidebar-nav-dropdown-panel > .sidebar-nav-dropdown-toggle {
  background: rgba(242, 153, 106, 0.22);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--color-accent);
}

.sidebar-nav-dropdown-chevron {
  width: 16px;
  height: 16px;
  opacity: 0.8;
  transition: transform 0.15s ease;
}

.sidebar-nav-dropdown-panel[open] .sidebar-nav-dropdown-chevron {
  transform: rotate(180deg);
}

.sidebar-nav-submenu {
  list-style: none;
  margin: 0.25rem 0 0.35rem;
  padding: 0 0 0 0.45rem;
}

.sidebar-nav-submenu a {
  padding: 0.6rem 0.85rem 0.6rem 2.35rem;
  font-size: 0.86rem;
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.main-header {
  padding: 1.5rem 2rem;
  background: #fff;
  border-bottom: 1px solid rgba(166, 187, 207, 0.35);
  box-shadow: var(--shadow-soft);
}

.main-header-inner {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.main-header-copy {
  min-width: 0;
  flex: 1;
}

.main-header-domain {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  max-width: min(40%, 22rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-navy);
  text-align: center;
  pointer-events: none;
}

.main-header h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-navy);
}

.main-header .sub {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.btn-refresh {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  padding: 0.55rem 0.95rem;
  border-radius: 8px;
  border: 1px solid rgba(44, 83, 117, 0.35);
  background: rgba(166, 187, 207, 0.15);
  color: var(--color-navy);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-refresh:hover {
  background: rgba(242, 153, 106, 0.18);
  border-color: var(--color-accent);
  color: var(--color-navy-deep);
}

.btn-refresh:active {
  transform: translateY(1px);
}

.btn-refresh:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.main-body {
  padding: 2rem;
  flex: 1;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.dashboard-section {
  margin-top: 1.75rem;
}

.dashboard-section-header {
  margin-bottom: 1rem;
}

.dashboard-section-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}

.dashboard-section-sub {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.ticket-breakdown-grid {
  margin-top: 1.25rem;
}

.ticket-breakdown-card .value {
  display: none;
}

.ticket-breakdown-list {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.ticket-breakdown-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.95rem;
}

.ticket-breakdown-label {
  color: var(--color-navy);
  font-weight: 600;
}

.ticket-breakdown-count {
  color: var(--color-text-muted);
  font-weight: 800;
}

.accounts-domain-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.9rem;
  margin: 0 0 1.35rem;
}

.accounts-domain-filter label {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

.accounts-domain-filter select.form-control {
  min-width: min(100%, 280px);
  max-width: 420px;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(166, 187, 207, 0.55);
  border-radius: var(--radius);
  background: #fff;
  color: var(--color-navy);
  font: inherit;
  font-weight: 600;
}

.accounts-dashboard .accounts-domain-table-panel {
  margin-top: 0;
  margin-bottom: 1.25rem;
}

.accounts-dashboard .accounts-domain-table-panel:last-child {
  margin-bottom: 0;
}

.accounts-dashboard .accounts-domain-table-panel .table-title {
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--color-navy-deep);
}

.accounts-dashboard .accounts-domain-table-panel .dashboard-section-sub {
  margin: 0 0 1rem;
}

.accounts-stats-table td {
  font-weight: 700;
  color: var(--color-navy);
}

.accounts-stats-table td.accounts-stats-error {
  font-weight: 600;
  color: var(--color-text-muted);
}

.metric-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.35rem 1.45rem;
  border: 1px solid rgba(166, 187, 207, 0.4);
  box-shadow: var(--shadow-soft);
}

.metric-card h2 {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}

.metric-card .value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-navy);
}

.metric-card .hint {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.form-static-value {
  margin: 0;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(166, 187, 207, 0.55);
  border-radius: 8px;
  background: rgba(166, 187, 207, 0.12);
  color: var(--color-navy);
  font-weight: 600;
}

.license-meter {
  margin-top: 0.85rem;
  height: 10px;
  border-radius: 999px;
  background: rgba(166, 187, 207, 0.35);
  overflow: hidden;
}

.license-meter-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--color-navy);
  transition: width 0.2s ease;
}

.license-meter-fill.is-warn {
  background: var(--color-accent);
}

.license-meter-fill.is-full {
  background: #a33;
}

.label-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 0.3rem;
  color: var(--color-text-muted);
  cursor: help;
  vertical-align: middle;
}

.label-tooltip-text {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  background: var(--color-navy-deep);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  max-width: 320px;
  white-space: normal;
  text-align: center;
  line-height: 1.35;
  pointer-events: none;
  z-index: 10;
}

.label-tooltip:hover .label-tooltip-text,
.label-tooltip:focus .label-tooltip-text {
  display: block;
}

.storage-chart-panel {
  margin-top: 1.25rem;
}

.storage-chart {
  margin: 0;
}

.storage-chart-plot {
  display: grid;
  grid-template-columns: 4.75rem 1fr;
  gap: 0.5rem 0.65rem;
  min-height: 220px;
}

.storage-chart-y {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0.15rem 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.storage-chart-bars {
  display: flex;
  align-items: stretch;
  gap: 3px;
  height: 200px;
  padding: 0.15rem 0 0;
  border-left: 1px solid rgba(166, 187, 207, 0.55);
  border-bottom: 1px solid rgba(166, 187, 207, 0.55);
  overflow-x: auto;
}

.storage-chart-col {
  flex: 1 1 0;
  min-width: 6px;
  display: flex;
  align-items: flex-end;
}

.storage-chart-bar {
  display: block;
  width: 100%;
  min-height: 0;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, var(--color-accent) 0%, var(--color-navy) 100%);
}

.storage-chart-x {
  display: flex;
  justify-content: space-between;
  margin: 0.4rem 0 0 4.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.storage-chart figcaption.hint {
  margin: 0.75rem 0 0;
}

.table-panel {
  margin-top: 1.5rem;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid rgba(166, 187, 207, 0.4);
  box-shadow: var(--shadow-soft);
  padding: 1.25rem 1.35rem;
}

.table-title {
  margin: 0 0 1rem;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}

.bucket-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.65rem;
}

.bucket-list a {
  display: block;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(166, 187, 207, 0.5);
  color: var(--color-navy);
  font-weight: 700;
  text-decoration: none;
  background: #f8fbfd;
}

.bucket-list a:hover {
  border-color: var(--color-accent);
  background: #fff;
}

.recordings-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.recordings-meta .table-title {
  margin: 0;
}

.recordings-bucket-link {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-navy);
}

.recordings-meta-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.recording-search-form {
  margin: 0 0 1.25rem;
  padding: 1rem;
  border: 1px solid rgba(166, 187, 207, 0.5);
  border-radius: 10px;
  background: #f8fbfd;
}

.recording-search-primary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.recording-search-input {
  flex: 1 1 320px;
  min-width: 0;
}

.recording-search-advanced {
  margin-top: 0.85rem;
}

.recording-search-advanced-toggle {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--color-navy);
  width: fit-content;
}

.recording-search-advanced-toggle::-webkit-details-marker {
  color: var(--color-navy);
}

.recording-search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem 1rem;
  margin-top: 0.85rem;
}

.recording-search-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.recording-search-field > span {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-ink-muted, #5a7189);
}

.recording-search-actions {
  margin-top: 0.85rem;
}

.recording-search-summary {
  margin: 0 0 0.75rem;
}

.recording-search-summary .sub {
  margin: 0;
}

.recording-search-pagination {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  margin-top: 1rem;
}

.recording-search-pages {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.recording-search-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(166, 187, 207, 0.7);
  background: #fff;
  color: var(--color-navy);
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
}

.recording-search-page:hover {
  filter: brightness(0.97);
}

.recording-search-page.is-current {
  background: var(--color-navy);
  color: #fff;
  border-color: var(--color-navy);
}

.recording-search-ellipsis {
  padding: 0 0.25rem;
  color: var(--color-ink-muted, #5a7189);
}

.recording-search-jump {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
}

.recording-search-jump-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-ink-muted, #5a7189);
}

.recording-search-jump-input {
  width: 5rem;
}

.bucket-create {
  position: relative;
}

.bucket-create-toggle {
  list-style: none;
  cursor: pointer;
}

.bucket-create-toggle::-webkit-details-marker {
  display: none;
}

.bucket-create[open] .bucket-create-toggle {
  filter: brightness(0.96);
}

.bucket-create-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.bucket-create-input {
  width: auto;
  min-width: 220px;
}

.role-create-form {
  flex-direction: column;
  align-items: stretch;
  max-width: 520px;
}

.role-trust-label {
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--color-navy);
  margin-top: 0.25rem;
}

.role-trust-input {
  width: 100%;
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
  font-size: 0.82rem;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.btn-row {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  border: 1px solid rgba(166, 187, 207, 0.7);
  background: #f8fbfd;
  color: var(--color-navy);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
  list-style: none;
}

.btn-row::-webkit-details-marker {
  display: none;
}

.btn-row:hover {
  border-color: var(--color-accent);
  background: #fff;
}

.btn-row-danger {
  color: #a33;
  border-color: rgba(180, 60, 60, 0.4);
}

.btn-row-danger:hover {
  border-color: #a33;
  background: rgba(180, 60, 60, 0.08);
}

.row-edit {
  position: relative;
}

.row-edit-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.row-edit-form .form-control {
  width: auto;
  min-width: 180px;
  padding: 0.4rem 0.55rem;
  font-size: 0.82rem;
}

.row-delete-form {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}

.row-force {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--color-text-muted);
  cursor: pointer;
  white-space: nowrap;
}

.row-panel {
  margin-top: 0.45rem;
  padding: 0.6rem;
  border: 1px solid rgba(166, 187, 207, 0.45);
  border-radius: 8px;
  background: #f8fbfd;
  min-width: 240px;
}

.row-panel-empty {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.6rem;
  padding: 0;
  list-style: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.3rem 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(44, 83, 117, 0.1);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-navy-deep);
  max-width: 100%;
}

.chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

.chip-form {
  margin: 0;
  display: inline-flex;
}

.chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: rgba(180, 60, 60, 0.15);
  color: #a33;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.chip-remove:hover {
  background: #a33;
  color: #fff;
}

.row-panel select.form-control {
  min-width: 200px;
}

.recordings-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 1rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.recordings-breadcrumbs a {
  color: var(--color-navy);
  text-decoration: none;
}

.recordings-breadcrumbs a:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

.recordings-breadcrumbs-sep {
  color: var(--color-text-muted);
}

.recordings-breadcrumbs-current {
  color: var(--color-text-muted);
}

.recordings-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.25rem 0 0.25rem;
}

.recordings-pagination .btn-secondary {
  text-decoration: none;
  min-width: 6.5rem;
}

.recordings-pagination .btn-secondary.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.recordings-pagination-status {
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--color-navy);
  min-width: 4.5rem;
  text-align: center;
}

.domain-status {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.domain-status--enabled {
  color: #1f6b3a;
}

.domain-status--disabled {
  color: #a33;
}

.deployment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  min-width: 16rem;
}

.deployment-action-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.deployment-action-select {
  min-width: 11rem;
  max-width: 16rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid rgba(166, 187, 207, 0.55);
  border-radius: var(--radius);
  background: #fff;
  color: var(--color-navy);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
}

.deployment-actions .inline-form {
  display: inline;
  margin: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.folder-listing {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.65rem;
}

.folder-listing-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(166, 187, 207, 0.5);
  color: var(--color-navy);
  font-weight: 700;
  text-decoration: none;
  background: #f8fbfd;
}

.folder-listing-link:hover {
  border-color: var(--color-accent);
  background: #fff;
}

.folder-listing-link--file:hover .folder-listing-name {
  color: var(--color-accent);
  text-decoration: underline;
}

.folder-listing-name {
  word-break: break-word;
}

.folder-listing-meta {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.recordings-section-title {
  margin-top: 1.25rem;
}

.recordings-section-title:first-of-type {
  margin-top: 0;
}

.recording-file-link {
  color: var(--color-navy);
  font-weight: 700;
  text-decoration: none;
}

.recording-file-link:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

.file-tree-empty {
  margin: 0;
  padding: 1rem 0.25rem;
  color: var(--color-text-muted);
  font-weight: 600;
}

.table-wrap {
  overflow-x: auto;
}

.table-controls {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  margin: 0 0 0.85rem;
}

.table-filter-input {
  width: min(320px, 100%);
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(166, 187, 207, 0.75);
  font-family: var(--font-display);
  font-size: 0.86rem;
}

.table-filter-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(242, 153, 106, 0.2);
}

.table-filter-clear {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(44, 83, 117, 0.35);
  background: #fff;
  color: var(--color-navy);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.lead-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

.lead-table th,
.lead-table td {
  text-align: left;
  padding: 0.75rem 0.65rem;
  border-bottom: 1px solid rgba(166, 187, 207, 0.35);
  font-size: 0.9rem;
}

.lead-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-muted);
  font-weight: 700;
}

.lead-table th.sortable-header {
  cursor: pointer;
  user-select: none;
}

.lead-table th.sortable-header::after {
  content: ' \2195';
  opacity: 0.35;
}

.lead-table .column-filter-row th {
  padding: 0.4rem 0.55rem 0.65rem;
  background: #f4f7fa;
  border-bottom: 1px solid rgba(166, 187, 207, 0.45);
  vertical-align: middle;
  font-weight: 500;
  cursor: default;
  user-select: auto;
}

.lead-table .column-filter-row th::after {
  content: none;
}

.column-filter-input {
  display: block;
  width: 100%;
  min-width: 5.5rem;
  box-sizing: border-box;
  padding: 0.35rem 0.45rem;
  border-radius: 6px;
  border: 1px solid rgba(166, 187, 207, 0.75);
  background: #fff;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--color-text);
}

.column-filter-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(242, 153, 106, 0.2);
}

.column-filter-input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.75;
}

.lead-table th.sort-asc::after {
  content: ' \2191';
  opacity: 0.9;
}

.lead-table th.sort-desc::after {
  content: ' \2193';
  opacity: 0.9;
}

.table-column-hint {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
}

.lead-table--reorderable th {
  white-space: nowrap;
}

.column-drag-handle {
  display: inline-block;
  margin-right: 0.35rem;
  padding: 0 0.15rem;
  cursor: grab;
  opacity: 0.45;
  font-size: 0.7rem;
  letter-spacing: -0.12em;
  vertical-align: middle;
  user-select: none;
  touch-action: none;
}

.column-drag-handle:active {
  cursor: grabbing;
}

.lead-table th.column-dragging {
  opacity: 0.55;
}

.lead-table th.column-drag-over {
  background: rgba(242, 153, 106, 0.18);
  box-shadow: inset 0 -2px 0 var(--color-orange, #f2996a);
}

.lead-table tbody tr:hover {
  background: rgba(166, 187, 207, 0.12);
}

.lead-table td.time-between {
  font-weight: 700;
  color: var(--color-navy);
}

.flash-stack {
  margin-bottom: 1.25rem;
}

.flash {
  margin: 0 0 0.5rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid rgba(242, 153, 106, 0.45);
  background: rgba(242, 153, 106, 0.12);
  color: var(--color-navy-deep);
}

.flash-error {
  border-color: rgba(180, 60, 60, 0.35);
  background: rgba(180, 60, 60, 0.1);
}

.panel {
  max-width: 520px;
  width: 100%;
  background: #fff;
  border-radius: var(--radius);
  padding: 1.5rem 1.65rem;
  border: 1px solid rgba(166, 187, 207, 0.4);
  box-shadow: var(--shadow-soft);
}

/* Settings summary tables should match the panel/field width, not the
   recordings table min-width. */
.panel .lead-table {
  min-width: 0;
  table-layout: fixed;
  word-break: break-word;
}

.panel .lead-table th {
  width: 38%;
}

.panel-title {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}

.panel-banner {
  margin: 0 0 1.15rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-navy-deep);
  background: rgba(166, 187, 207, 0.25);
  border: 1px solid rgba(166, 187, 207, 0.5);
}

.panel-banner--success {
  background: rgba(80, 160, 115, 0.15);
  border-color: rgba(80, 160, 115, 0.4);
}

.panel-banner--warn {
  background: rgba(242, 153, 106, 0.18);
  border-color: rgba(242, 153, 106, 0.55);
  color: var(--color-navy-deep);
}

.settings-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 1.35rem;
  max-width: 520px;
}

.settings-subnav-link {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-navy);
  text-decoration: none;
  padding-bottom: 0.2rem;
  border-bottom: 2px solid transparent;
}

.settings-subnav-link:hover {
  color: var(--color-accent);
}

.settings-subnav-link.is-active {
  border-bottom-color: var(--color-accent);
  color: var(--color-navy-deep);
}

.settings-env-note {
  margin: 0;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  line-height: 1.45;
}

.settings-env-note code {
  font-size: 0.85em;
  font-weight: 600;
  color: var(--color-navy-deep);
}

.settings-field-heading {
  display: block;
  font-weight: 700;
  font-size: 0.82rem;
  margin-bottom: 0.38rem;
  color: var(--color-navy);
}

.settings-form .field {
  margin-bottom: 1.15rem;
}

.settings-form label {
  display: block;
  font-weight: 700;
  font-size: 0.82rem;
  margin-bottom: 0.38rem;
  color: var(--color-navy);
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(166, 187, 207, 0.75);
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--color-text);
  background: #fff;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(242, 153, 106, 0.25);
}

.field-hint {
  display: block;
  margin-top: 0.38rem;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.field-error {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #a33;
}

.field-inline {
  margin-bottom: 1.35rem;
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  cursor: pointer;
}

.deploy-feature-checks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.65rem 1rem;
  margin-bottom: 1rem;
}

.deploy-feature-panel[hidden] {
  display: none !important;
}

.checkbox input[type='checkbox'] {
  margin-top: 0.18rem;
  accent-color: var(--color-accent);
}

.form-errors {
  margin-bottom: 1rem;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(180, 60, 60, 0.35);
  background: rgba(180, 60, 60, 0.08);
  font-weight: 600;
  font-size: 0.85rem;
  color: #802222;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.72rem 1.35rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: linear-gradient(180deg, var(--color-accent) 0%, var(--color-accent-hover) 100%);
  color: var(--color-navy-deep);
  box-shadow: 0 2px 8px rgba(44, 83, 117, 0.2);
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-primary:active {
  transform: translateY(1px);
}

@media (max-width: 768px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 1rem;
    gap: 0.5rem;
    position: static;
    height: auto;
    overflow: visible;
  }

  .sidebar-brand {
    border-bottom: none;
    padding: 0 0.75rem 0 0;
    justify-content: flex-start;
  }

  .nav-label {
    width: 100%;
    padding: 0.75rem 0 0.25rem;
  }

  .sidebar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    width: 100%;
  }

  .sidebar-nav > li:not(.sidebar-nav-dropdown) > a {
    flex: 1;
    min-width: 140px;
    justify-content: center;
  }

  .sidebar-nav-dropdown {
    width: 100%;
  }

  .sidebar-nav-dropdown-toggle {
    width: 100%;
  }

  .sidebar-nav-submenu a {
    padding-left: 2.5rem;
  }

  .table-controls {
    justify-content: stretch;
  }

  .table-filter-input {
    width: 100%;
  }

  .main-header-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .main-header-domain {
    position: static;
    transform: none;
    max-width: none;
    order: -1;
    pointer-events: auto;
  }

  .btn-refresh {
    align-self: flex-end;
  }
}

/* --- Recordings page: keep the wide table's horizontal scrollbar pinned to
   the bottom of the viewport instead of the bottom of the whole page. The page
   fills the viewport height and the table body scrolls inside its own box. --- */
@media (min-width: 769px) {
  body.page-recordings,
  body.page-recordings .app-shell {
    height: 100vh;
    overflow: hidden;
  }

  body.page-recordings .main {
    height: 100vh;
    min-height: 0;
  }

  body.page-recordings .main-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  body.page-recordings .table-panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: auto;
  }

  body.page-recordings .table-wrap {
    flex: 1;
    min-height: 0;
    overflow: auto;
  }
}

/* --- Authentication / login page --- */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, var(--color-navy) 0%, var(--color-navy-deep) 100%);
}

.auth-shell {
  width: 100%;
  max-width: 420px;
}

.auth-card {
  background: #fff;
  border-radius: calc(var(--radius) * 1.6);
  box-shadow: 0 20px 60px rgba(15, 32, 50, 0.35);
  padding: 40px 36px 36px;
}

.auth-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.auth-logo {
  border-radius: var(--radius);
  object-fit: cover;
  box-shadow: 0 6px 18px rgba(44, 83, 117, 0.25);
}

.auth-title {
  margin: 0 0 4px;
  text-align: center;
  font-size: 1.6rem;
  color: var(--color-navy-deep);
}

.auth-sub {
  margin: 0 0 22px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-submit {
  margin-top: 6px;
  width: 100%;
}

.auth-alt {
  margin: 18px 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.auth-alt a {
  color: var(--color-navy);
  font-weight: 700;
  text-decoration: none;
}

.auth-alt a:hover {
  text-decoration: underline;
}

.field-optional {
  font-weight: 500;
  color: var(--color-text-muted);
}

.user-create-form {
  max-width: 360px;
  margin-top: 12px;
}

/* --- Recording row: in-browser play (Bootstrap btn-info btn-lg style) --- */
.recording-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid #46b8da;
  border-radius: 6px;
  background: #5bc0de;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.33;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.recording-play-btn:hover {
  background: #31b0d5;
  border-color: #269abc;
}

.recording-play-btn:active {
  background: #269abc;
  border-color: #1f7e9a;
}

.recording-play-btn:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(91, 192, 222, 0.45);
}

.recording-play-btn svg {
  width: 18px;
  height: 18px;
}

.recording-play-btn .icon-pause,
.recording-play-btn .label-pause {
  display: none;
}

.recording-play-btn.is-disabled,
.recording-play-btn:disabled {
  background: #c8d4de;
  border-color: #b0bec8;
  color: #6b7c8a;
  cursor: not-allowed;
  opacity: 0.85;
}

.recording-play-btn.is-disabled:hover,
.recording-play-btn:disabled:hover {
  background: #c8d4de;
  border-color: #b0bec8;
}

.recording-play-btn.is-playing {
  background: #31b0d5;
  border-color: #269abc;
}

.recording-play-btn.is-playing .icon-play,
.recording-play-btn.is-playing .label-play {
  display: none;
}

.recording-play-btn.is-playing .icon-pause {
  display: inline-flex;
}

.recording-play-btn.is-playing .label-pause {
  display: inline;
}

.cred-readout {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 6px 0 22px;
}

.cred-value {
  display: block;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid var(--color-sky);
  border-radius: var(--radius);
  background: var(--color-sky-muted);
  color: var(--color-navy-deep);
  font-size: 0.92rem;
  word-break: break-all;
}

/* --- Sidebar signed-in user --- */
.sidebar-user {
  margin: auto 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-user-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.sidebar-user-name {
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 0.78rem;
  color: var(--color-sky);
}

.sidebar-user-logout {
  margin: 0;
}

.sidebar-logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-sky-muted);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.sidebar-logout-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--color-accent);
  color: #fff;
}

.sidebar-logout-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--color-navy);
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.link-button:hover {
  color: var(--color-accent-hover);
}

.link-button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- Deployment setup modal --- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 16px;
  overflow-y: auto;
  background: rgba(15, 32, 50, 0.55);
}

.modal-overlay.is-open {
  display: flex;
}

.modal-dialog {
  width: 100%;
  max-width: 640px;
  background: #fff;
  border-radius: calc(var(--radius) * 1.4);
  box-shadow: 0 24px 64px rgba(15, 32, 50, 0.35);
}

.modal-dialog-wide {
  max-width: 760px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 0;
}

.modal-title {
  margin: 0;
  font-size: 1.35rem;
  color: var(--color-navy-deep);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0 4px;
}

.modal-close:hover {
  color: var(--color-navy-deep);
}

.modal-body {
  padding: 18px 24px 8px;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 24px 24px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border: 2px solid var(--color-navy);
  border-radius: var(--radius);
  background: #fff;
  color: var(--color-navy);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
}

.btn-secondary:hover {
  background: #f4f7fa;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
  white-space: nowrap;
}

.log-view {
  margin: 0;
  padding: 1rem 1.1rem;
  background: #0f1b2d;
  color: #e6edf3;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
  max-height: 70vh;
}

.setup-copy-source {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.setup-section + .setup-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border, #e2e8f0);
}

.tutorial-progress {
  margin: 0 0 14px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}

.tutorial-step {
  display: none;
}

.tutorial-step.is-active {
  display: block;
}

/* Steps are shown one at a time, so drop the between-section divider. */
.tutorial-step + .tutorial-step {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.setup-param-highlight {
  background: #eef6ff;
  border-radius: 6px;
  padding-left: 8px;
  padding-right: 8px;
}

.setup-heading {
  margin: 0 0 10px;
  font-size: 1.05rem;
  color: var(--color-navy-deep);
}

.setup-subheading {
  margin: 14px 0 8px;
  font-weight: 700;
  color: var(--color-navy);
}

.setup-note {
  margin: 0 0 12px;
  color: var(--color-text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.setup-dl {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 8px 12px;
  margin: 0 0 12px;
}

.setup-dl dt {
  font-weight: 700;
  color: var(--color-navy);
}

.setup-dl dd {
  margin: 0;
}

.setup-code-block {
  display: block;
  padding: 8px 10px;
  background: #f4f7fa;
  border-radius: var(--radius);
  font-size: 0.85rem;
  word-break: break-all;
}

.setup-param-list,
.setup-config-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.setup-param-list li,
.setup-config-list li {
  padding: 6px 0;
  border-bottom: 1px solid #eef2f6;
  font-size: 0.92rem;
  line-height: 1.45;
}

.setup-param-name {
  display: inline-block;
  min-width: 140px;
  font-weight: 700;
  color: var(--color-navy);
}

.setup-param-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem;
}

.setup-required {
  color: var(--color-accent-hover, #c45a11);
  font-size: 0.82rem;
  font-weight: 600;
}

.setup-example {
  margin: 16px 0 0;
  padding: 0;
}

.setup-example img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  background: #fff;
}

.setup-example figcaption {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}
