:root {
  --navy: #0A1D37;
  --aviation: #235A9A;
  --technical: #4C9BE8;
  --white: #F4F8FF;
  --soft: rgba(244, 248, 255, 0.76);
  --line: rgba(255, 255, 255, 0.09);
  --panel: rgba(255, 255, 255, 0.055);
  --panel-strong: rgba(255, 255, 255, 0.08);
  --success: #72D6A4;
  --danger: #FF8B8B;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: Inter, Arial, Helvetica, sans-serif;
  color: var(--white);
  background:
    radial-gradient(circle at top right, rgba(76, 155, 232, 0.16), transparent 24%),
    radial-gradient(circle at bottom left, rgba(35, 90, 154, 0.20), transparent 28%),
    linear-gradient(135deg, #05101d 0%, #081729 35%, #0A1D37 100%);
  min-height: 100vh;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(76,155,232,0.05) 1px, transparent 1px),
    linear-gradient(rgba(76,155,232,0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  opacity: .45;
}
.shell { position: relative; z-index: 1; min-height: 100vh; padding: 32px; }
.panel {
  background: linear-gradient(165deg, rgba(255,255,255,0.08), rgba(255,255,255,0.035));
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.flash {
  max-width: 560px; margin: 0 auto 18px; padding: 14px 16px; border-radius: 16px;
  border: 1px solid var(--line); background: rgba(255,255,255,0.06);
}
.flash-success { color: var(--success); }
.flash-error { color: var(--danger); }
.form-grid { display: grid; gap: 14px; }
.form-row { display: grid; gap: 8px; }
label { font-size: .92rem; color: var(--soft); font-weight: 700; }
input {
  width: 100%; min-height: 50px; border-radius: 14px; border: 1px solid var(--line);
  background: rgba(255,255,255,0.06); color: var(--white); padding: 0 14px; outline: none;
}
input::placeholder { color: rgba(244,248,255,.45); }
button, .btn {
  min-height: 50px; border-radius: 14px; border: 0; cursor: pointer; font-weight: 800;
  padding: 0 18px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.btn-primary { background: linear-gradient(135deg, var(--technical), #86BFFF); color: #06111E; box-shadow: 0 12px 26px rgba(76,155,232,.28); }
.btn-secondary { background: rgba(255,255,255,.06); color: var(--white); border: 1px solid var(--line); }
.muted { color: var(--soft); }
.topbar {
  display:flex; justify-content:space-between; gap:16px; align-items:center; flex-wrap:wrap; margin-bottom:24px;
}
.brand h1 { margin: 0 0 8px; font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.05em; }
.brand p { margin: 0; max-width: 760px; line-height: 1.65; color: var(--soft); }
.badge {
  display:inline-flex; align-items:center; min-height: 38px; padding: 0 12px; border-radius:999px; background: rgba(255,255,255,.06);
  border: 1px solid var(--line); font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 800;
}
.dashboard-grid { display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:18px; }
.card { padding: 22px; border-radius: 22px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.card small { display:block; margin-bottom:10px; color: rgba(244,248,255,.58); text-transform: uppercase; letter-spacing: .11em; font-size: .72rem; font-weight:700; }
.card strong { display:block; font-size:1.4rem; margin-bottom:10px; }
.card p { margin:0; color: var(--soft); line-height:1.6; }
.setup-grid { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:14px; }
.setup-grid .full { grid-column: 1 / -1; }
@media (max-width: 900px) {
  .shell { padding: 18px; }
  .dashboard-grid, .setup-grid { grid-template-columns: 1fr; }
}


.app-shell {
  position: relative;
  z-index: 1;
}

.app-shell.is-authenticated {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  min-height: 100vh;
  padding: 24px;
}

.app-shell.is-authenticated .shell {
  padding: 0;
}

.portal-sidebar {
  position: sticky;
  top: 24px;
  height: calc(100vh - 48px);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.sidebar-brand-block {
  display: grid;
  gap: 8px;
}

.sidebar-brand-badge {
  display: inline-flex;
  width: fit-content;
  min-height: 34px;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(76,155,232,.12);
  border: 1px solid rgba(76,155,232,.18);
  color: #d9ecff;
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 800;
}

.sidebar-brand-block strong {
  font-size: 1.25rem;
}

.sidebar-brand-block p {
  margin: 0;
  color: var(--soft);
  line-height: 1.55;
}

.sidebar-nav {
  display: grid;
  gap: 10px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 14px;
  color: rgba(244,248,255,.82);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.03);
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.sidebar-nav-item:hover {
  background: rgba(255,255,255,.05);
  border-color: rgba(76,155,232,.18);
  transform: translateY(-1px);
}

.sidebar-nav-item i {
  width: 18px;
  text-align: center;
  color: rgba(244,248,255,.72);
}

.sidebar-nav-item.is-active {
  background: linear-gradient(135deg, rgba(76,155,232,.18), rgba(35,90,154,.18));
  border-color: rgba(76,155,232,.26);
  color: var(--white);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.sidebar-nav-item.is-active i {
  color: #cfe5ff;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 14px;
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.08);
}

.sidebar-user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(76,155,232,.34), rgba(35,90,154,.24));
  border: 1px solid rgba(76,155,232,.26);
  color: #d9ecff;
  font-weight: 800;
}

.sidebar-user-meta {
  display: grid;
  gap: 3px;
}

.sidebar-user-meta strong {
  font-size: .95rem;
}

.sidebar-user-meta span {
  color: var(--soft);
  font-size: .88rem;
}

.sidebar-logout-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  color: var(--white);
  text-decoration: none;
}

.sidebar-logout-link:hover {
  background: rgba(255,255,255,.06);
}

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

  .portal-sidebar {
    position: static;
    height: auto;
  }
}

.sidebar-connected-apps {
  display: grid;
  gap: 12px;
  padding-top: 2px;
}

.sidebar-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-section-kicker {
  color: rgba(244,248,255,.58);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: .72rem;
  font-weight: 800;
}

.sidebar-connected-apps-list {
  display: grid;
  gap: 10px;
}

.sidebar-connected-app-link {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.035);
  color: var(--white);
  text-decoration: none;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.sidebar-connected-app-link:hover {
  background: rgba(255,255,255,.055);
  border-color: rgba(76,155,232,.2);
  transform: translateY(-1px);
}

.sidebar-connected-app-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(76,155,232,.18), rgba(35,90,154,.18));
  border: 1px solid rgba(76,155,232,.2);
  color: #d9ecff;
}

.sidebar-connected-app-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.sidebar-connected-app-copy strong {
  font-size: .94rem;
}

.sidebar-connected-app-copy small {
  color: var(--soft);
  font-size: .8rem;
}

.sidebar-connected-app-arrow {
  color: rgba(244,248,255,.56);
  font-size: .82rem;
  justify-self: end;
}

body,
body * {
  caret-color: transparent;
}

input,
textarea {
  caret-color: auto;
}

/* ==========================================================
   SKIES2 BRAND PALETTE REFRESH — Staff Portal
   Applied as a visual override layer so existing integrations,
   layout, permissions, auto-refresh and connected apps remain intact.
   ========================================================== */
:root {
  --navy: #0A1D37;
  --aviation: #235A9A;
  --technical: #4C9BE8;
  --carbon: #2B2B2B;
  --interaction-green: #2EC662;
  --interaction-yellow: #F9CC2C;
  --interaction-red: #E93434;
  --interaction-info: #7EA2D6;
  --white: #F4F8FF;
  --brand-surface: rgba(10, 29, 55, .86);
  --brand-surface-soft: rgba(35, 90, 154, .14);
  --brand-surface-strong: rgba(10, 29, 55, .96);
  --brand-line: rgba(126, 162, 214, .24);
  --brand-line-strong: rgba(76, 155, 232, .34);
  --brand-text: #F4F8FF;
  --brand-text-soft: rgba(244, 248, 255, .80);
  --brand-text-muted: rgba(244, 248, 255, .64);
  --brand-heading: #FFFFFF;
  --line: var(--brand-line);
  --panel: var(--brand-surface);
  --panel-strong: var(--brand-surface-strong);
  --soft: var(--brand-text-soft);
  --success: var(--interaction-green);
  --warning: var(--interaction-yellow);
  --danger: var(--interaction-red);
  --info: var(--interaction-info);
  --shadow: 0 24px 64px rgba(3, 10, 24, .42);
}

html,
body {
  background:
    radial-gradient(circle at top right, rgba(76, 155, 232, .22), transparent 28%),
    radial-gradient(circle at bottom left, rgba(35, 90, 154, .30), transparent 32%),
    linear-gradient(135deg, #061424 0%, var(--navy) 42%, #071120 100%) !important;
  color: var(--brand-text) !important;
}

body::before {
  background:
    linear-gradient(90deg, rgba(126, 162, 214, .07) 1px, transparent 1px),
    linear-gradient(rgba(126, 162, 214, .05) 1px, transparent 1px) !important;
  opacity: .42 !important;
}

.panel,
.card,
.dashboard-hero,
.dashboard-overview,
.dashboard-profile-card,
.dashboard-summary-card,
.dashboard-stat-card,
.dashboard-info-list li,
.form-panel,
.helper-card,
.roles-access-card,
.roles-access-panel,
.roles-access-option,
.portal-configuration-panel,
.portal-configuration-stat-card,
.users-filters-card,
.users-stat-card,
.users-table-wrap,
.users-empty-state,
.users-sync-banner,
.user-form-hero,
.user-form-shell,
.forbidden-card,
.staff-login-panel,
.staff-password-card {
  background: linear-gradient(165deg, rgba(10, 29, 55, .92), rgba(35, 90, 154, .18)) !important;
  border-color: var(--brand-line) !important;
  box-shadow: var(--shadow) !important;
}

.portal-sidebar {
  background: linear-gradient(180deg, rgba(10, 29, 55, .98), rgba(7, 17, 32, .98)) !important;
  border-color: var(--brand-line) !important;
}

h1,
h2,
h3,
.brand h1,
.dashboard-hero-copy h1,
.dashboard-overview-head h2,
.section-heading,
.section-heading-inline,
.roles-access-head h1,
.portal-configuration-head h1,
.user-form-hero-copy h1,
.users-hero-copy h1,
.forbidden-card h1,
.staff-login-copy h1,
.staff-password-brand h1,
.card strong,
.dashboard-stat-card strong,
.dashboard-info-list li strong,
.sidebar-brand-block strong,
.sidebar-connected-app-copy strong,
.sidebar-user-meta strong {
  color: var(--brand-heading) !important;
  letter-spacing: -.025em;
}

p,
small,
label,
.muted,
.brand p,
.card p,
.dashboard-hero-copy p,
.dashboard-overview-head p,
.dashboard-profile-meta span,
.dashboard-info-list li span,
.sidebar-brand-block p,
.sidebar-user-meta span,
.sidebar-connected-app-copy small,
.form-note,
.helper-list,
.helper-status,
.users-section-copy,
.users-workspace-meta,
.portal-configuration-field small,
.roles-access-option-copy small {
  color: var(--brand-text-soft) !important;
}

.card small,
.dashboard-section-kicker,
.sidebar-section-kicker,
.roles-access-kicker,
.portal-configuration-kicker,
.staff-login-copy__eyebrow,
.staff-password-brand__eyebrow,
.badge,
.sidebar-brand-badge,
.users-meta-pill,
.tag-chip,
.dashboard-pill {
  color: #D7E9FF !important;
  background: rgba(35, 90, 154, .34) !important;
  border-color: rgba(76, 155, 232, .36) !important;
}

input,
textarea,
select,
.brand-select-trigger,
.brand-select-menu,
.users-filter-search input,
.users-filter-field input,
.users-filter-field select {
  background: rgba(7, 17, 32, .82) !important;
  border-color: var(--brand-line) !important;
  color: var(--brand-text) !important;
  box-shadow: inset 0 1px 0 rgba(244, 248, 255, .04) !important;
}

input:focus,
textarea:focus,
select:focus,
.brand-select.is-open .brand-select-trigger,
.brand-select-trigger:focus-visible {
  border-color: var(--technical) !important;
  box-shadow: 0 0 0 4px rgba(76, 155, 232, .16) !important;
  outline: none !important;
}

input::placeholder,
textarea::placeholder {
  color: rgba(244, 248, 255, .48) !important;
}

.btn-primary,
.staff-login-form__submit,
.staff-password-form__submit,
.portal-configuration-actions .btn-primary,
.roles-access-actions .btn-primary,
.form-actions .btn-primary,
.user-action-btn-edit,
.users-filter-actions .btn-primary {
  background: linear-gradient(135deg, var(--technical), var(--aviation)) !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(126, 162, 214, .28) !important;
  box-shadow: 0 14px 30px rgba(76, 155, 232, .30) !important;
}

.btn-primary:hover,
.staff-login-form__submit:hover,
.staff-password-form__submit:hover,
.user-action-btn-edit:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 38px rgba(76, 155, 232, .36) !important;
}

.btn-secondary,
.sidebar-logout-link,
.user-action-btn,
.users-pagination-actions a,
.users-pagination-actions span,
.form-actions .btn-secondary,
.forbidden-actions .btn-secondary {
  background: rgba(10, 29, 55, .78) !important;
  color: var(--brand-text) !important;
  border: 1px solid var(--brand-line) !important;
}

.sidebar-nav-item,
.sidebar-connected-app-link,
.sidebar-user-card,
.brand-select-option,
.check-option,
.role-panel,
.role-group,
.portal-configuration-toggle,
.users-table tbody tr,
.helper-action-box {
  background: rgba(10, 29, 55, .58) !important;
  border-color: rgba(126, 162, 214, .18) !important;
  color: var(--brand-text) !important;
}

.sidebar-nav-item:hover,
.sidebar-connected-app-link:hover,
.brand-select-option:hover,
.check-option:hover,
.roles-access-option:hover,
.users-table tbody tr:hover {
  background: rgba(35, 90, 154, .28) !important;
  border-color: var(--brand-line-strong) !important;
}

.sidebar-nav-item.is-active,
.sidebar-connected-app-icon,
.dashboard-profile-avatar,
.sidebar-user-avatar,
.staff-login-brand__logo,
.staff-password-brand__logo,
.forbidden-icon {
  background: linear-gradient(135deg, var(--aviation), var(--technical)) !important;
  border-color: rgba(126, 162, 214, .42) !important;
  color: #FFFFFF !important;
}

.sidebar-nav-item i,
.sidebar-connected-app-arrow,
.sidebar-connected-app-icon i,
.dashboard-profile-avatar,
.sidebar-user-avatar {
  color: #FFFFFF !important;
}

.flash,
.users-sync-banner {
  background: rgba(126, 162, 214, .12) !important;
  border-color: rgba(126, 162, 214, .28) !important;
}

.flash-success,
.user-status.is-active,
.helper-status.is-ok,
.tag-chip-app,
.check-option-status.is-enabled {
  color: var(--interaction-green) !important;
}

.flash-error,
.user-status.is-inactive,
.user-action-btn-toggle.is-danger,
.check-option-status.is-disabled,
.forbidden-icon {
  color: var(--interaction-red) !important;
}

.user-action-btn-toggle.is-danger {
  background: rgba(233, 52, 52, .12) !important;
  border-color: rgba(233, 52, 52, .28) !important;
}

.user-action-btn-toggle:not(.is-danger),
.helper-status.is-warning {
  color: var(--interaction-yellow) !important;
}

.users-table thead th {
  color: #D7E9FF !important;
  background: rgba(35, 90, 154, .24) !important;
  border-bottom-color: rgba(126, 162, 214, .24) !important;
}

.users-table td,
.user-email-cell,
.user-identity-handle,
.users-date-label {
  color: var(--brand-text-soft) !important;
}

/* ==========================================================
   SKIES2 ECOSYSTEM STANDARDIZATION — Staff Portal layer
   Keeps current logic intact and aligns Staff Portal with TMS.
   ========================================================== */
:root {
  --sk2-navy: #0A1D37;
  --sk2-aviation: #235A9A;
  --sk2-technical: #4C9BE8;
  --sk2-carbon: #2B2B2B;
  --sk2-green: #2EC662;
  --sk2-yellow: #F9CC2C;
  --sk2-red: #E93434;
  --sk2-info: #7EA2D6;
  --sk2-text: #F4F8FF;
  --sk2-text-soft: rgba(244, 248, 255, .78);
  --sk2-text-muted: rgba(244, 248, 255, .60);
  --sk2-bg-deep: #061424;
  --sk2-bg: #0A1D37;
  --sk2-sidebar: linear-gradient(180deg, rgba(10, 29, 55, .98), rgba(7, 17, 32, .98));
  --sk2-panel: linear-gradient(165deg, rgba(10, 29, 55, .94), rgba(35, 90, 154, .18));
  --sk2-panel-quiet: rgba(10, 29, 55, .62);
  --sk2-line: rgba(126, 162, 214, .24);
  --sk2-line-strong: rgba(76, 155, 232, .38);
  --sk2-shadow: 0 24px 64px rgba(3, 10, 24, .42);
  --sk2-radius-shell: 28px;
  --sk2-radius-card: 24px;
  --sk2-radius-control: 16px;
  --sk2-space-page: 28px;
  --sk2-space-panel: 24px;
}

html,
body {
  background:
    radial-gradient(circle at 84% 2%, rgba(76, 155, 232, .20), transparent 30%),
    radial-gradient(circle at 0% 100%, rgba(35, 90, 154, .28), transparent 34%),
    linear-gradient(135deg, var(--sk2-bg-deep) 0%, var(--sk2-bg) 46%, #071120 100%) !important;
}

.app-shell.is-authenticated {
  grid-template-columns: 280px minmax(0, 1fr) !important;
  gap: var(--sk2-space-page) !important;
  align-items: start !important;
  padding: var(--sk2-space-page) !important;
}

.app-shell.is-authenticated .shell,
.shell.shell-with-sidebar {
  min-width: 0 !important;
  padding: 0 !important;
  display: grid !important;
  gap: 22px !important;
}

.portal-sidebar {
  top: var(--sk2-space-page) !important;
  height: calc(100vh - (var(--sk2-space-page) * 2)) !important;
  padding: var(--sk2-space-panel) !important;
  border-radius: var(--sk2-radius-shell) !important;
  background: var(--sk2-sidebar) !important;
  border: 1px solid var(--sk2-line) !important;
  box-shadow: var(--sk2-shadow) !important;
  gap: 22px !important;
}

.panel,
.dashboard-hero,
.dashboard-overview,
.dashboard-profile-card,
.dashboard-summary-card,
.dashboard-stat-card,
.dashboard-info-list li,
.card,
.form-panel,
.helper-card,
.roles-access-card,
.roles-access-panel,
.roles-access-option,
.portal-configuration-panel,
.portal-configuration-stat-card,
.users-filters-card,
.users-stat-card,
.users-table-wrap,
.users-empty-state,
.users-sync-banner,
.user-form-hero,
.user-form-shell,
.forbidden-card,
.staff-login-panel,
.staff-password-card {
  border-radius: var(--sk2-radius-card) !important;
  background: var(--sk2-panel) !important;
  border-color: var(--sk2-line) !important;
  box-shadow: var(--sk2-shadow) !important;
}

.dashboard-hero,
.user-form-hero,
.users-hero,
.roles-access-panel,
.portal-configuration-panel {
  padding: 28px !important;
}

.sidebar-brand-badge,
.badge,
.dashboard-pill,
.users-meta-pill,
.tag-chip,
.card small,
.dashboard-section-kicker,
.sidebar-section-kicker,
.roles-access-kicker,
.portal-configuration-kicker {
  min-height: 34px !important;
  padding: 0 12px !important;
  border-radius: 999px !important;
  background: rgba(35, 90, 154, .34) !important;
  border: 1px solid rgba(76, 155, 232, .36) !important;
  color: #D7E9FF !important;
  letter-spacing: .08em !important;
  text-transform: uppercase !important;
  font-weight: 800 !important;
}

.sidebar-nav,
.sidebar-connected-apps-list {
  gap: 10px !important;
}

.sidebar-nav-item,
.sidebar-connected-app-link,
.sidebar-user-card,
.sidebar-logout-link,
.brand-select-option,
.check-option,
.role-panel,
.role-group,
.portal-configuration-toggle,
.users-table tbody tr,
.helper-action-box {
  min-height: 48px;
  border-radius: var(--sk2-radius-control) !important;
  background: var(--sk2-panel-quiet) !important;
  border-color: rgba(126, 162, 214, .20) !important;
  color: var(--sk2-text) !important;
}

.sidebar-nav-item:hover,
.sidebar-connected-app-link:hover,
.sidebar-logout-link:hover,
.brand-select-option:hover,
.check-option:hover,
.roles-access-option:hover,
.users-table tbody tr:hover {
  background: rgba(35, 90, 154, .30) !important;
  border-color: var(--sk2-line-strong) !important;
}

.sidebar-nav-item.is-active,
.sidebar-connected-app-icon,
.dashboard-profile-avatar,
.sidebar-user-avatar,
.staff-login-brand__logo,
.staff-password-brand__logo {
  background: linear-gradient(135deg, var(--sk2-aviation), var(--sk2-technical)) !important;
  border-color: rgba(126, 162, 214, .42) !important;
  color: #FFFFFF !important;
}

h1,
h2,
h3,
.brand h1,
.dashboard-hero-copy h1,
.dashboard-overview-head h2,
.section-heading,
.section-heading-inline,
.roles-access-head h1,
.portal-configuration-head h1,
.user-form-hero-copy h1,
.users-hero-copy h1,
.card strong,
.dashboard-stat-card strong,
.sidebar-brand-block strong,
.sidebar-connected-app-copy strong,
.sidebar-user-meta strong {
  color: #FFFFFF !important;
  letter-spacing: -.025em !important;
}

p,
small,
label,
.muted,
.brand p,
.dashboard-hero-copy p,
.dashboard-overview-head p,
.card p,
.sidebar-brand-block p,
.sidebar-connected-app-copy small,
.sidebar-user-meta span,
.form-note,
.helper-list,
.helper-status,
.users-section-copy,
.users-workspace-meta,
.portal-configuration-field small,
.roles-access-option-copy small {
  color: var(--sk2-text-soft) !important;
}

input,
textarea,
select,
.brand-select-trigger,
.brand-select-menu,
.users-filter-search input,
.users-filter-field input,
.users-filter-field select {
  border-radius: var(--sk2-radius-control) !important;
  background: rgba(7, 17, 32, .82) !important;
  border-color: var(--sk2-line) !important;
  color: var(--sk2-text) !important;
}

.btn-primary,
.staff-login-form__submit,
.staff-password-form__submit,
.portal-configuration-actions .btn-primary,
.roles-access-actions .btn-primary,
.form-actions .btn-primary,
.user-action-btn-edit,
.users-filter-actions .btn-primary {
  background: linear-gradient(135deg, var(--sk2-aviation), var(--sk2-technical)) !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(126, 162, 214, .34) !important;
  border-radius: var(--sk2-radius-control) !important;
}

.btn-secondary,
.user-action-btn,
.users-pagination-actions a,
.users-pagination-actions span,
.form-actions .btn-secondary,
.forbidden-actions .btn-secondary {
  background: rgba(10, 29, 55, .78) !important;
  color: var(--sk2-text) !important;
  border: 1px solid var(--sk2-line) !important;
  border-radius: var(--sk2-radius-control) !important;
}

.flash-success,
.user-status.is-active,
.helper-status.is-ok,
.tag-chip-app,
.check-option-status.is-enabled {
  color: var(--sk2-green) !important;
}

.flash-error,
.user-status.is-inactive,
.user-action-btn-toggle.is-danger,
.check-option-status.is-disabled {
  color: var(--sk2-red) !important;
}

.user-action-btn-toggle:not(.is-danger),
.helper-status.is-warning {
  color: var(--sk2-yellow) !important;
}

@media (max-width: 1100px) {
  .app-shell.is-authenticated {
    grid-template-columns: 1fr !important;
    padding: 18px !important;
  }

  .portal-sidebar {
    position: static !important;
    height: auto !important;
  }
}

/* ==========================================================
   SKIES2 ECOSYSTEM — Calm visual hierarchy refinement
   Purpose: keep Staff Portal/TMS aligned without visual saturation.
   Uses solid surfaces, minimal shadows, clear typography hierarchy,
   and reserves interaction colors for status/feedback only.
   ========================================================== */
:root {
  --sk2-calm-bg: #071525;
  --sk2-calm-bg-deep: #06111F;
  --sk2-calm-sidebar: #08172A;
  --sk2-calm-surface: #10233A;
  --sk2-calm-surface-raised: #142B47;
  --sk2-calm-surface-muted: #0D1D32;
  --sk2-calm-line: rgba(126, 162, 214, .20);
  --sk2-calm-line-strong: rgba(76, 155, 232, .34);
  --sk2-calm-title: #F4F8FF;
  --sk2-calm-text: rgba(244, 248, 255, .84);
  --sk2-calm-muted: rgba(244, 248, 255, .64);
  --sk2-calm-subtle: rgba(244, 248, 255, .50);
  --sk2-calm-shadow: 0 14px 34px rgba(0, 0, 0, .24);
  --sk2-calm-shadow-soft: 0 8px 18px rgba(0, 0, 0, .16);
}

html,
body {
  background: var(--sk2-calm-bg) !important;
  color: var(--sk2-calm-text) !important;
}

body::before {
  opacity: 0 !important;
  background: none !important;
}

.app-shell.is-authenticated {
  background: var(--sk2-calm-bg) !important;
}

.portal-sidebar {
  background: var(--sk2-calm-sidebar) !important;
  border: 1px solid var(--sk2-calm-line) !important;
  box-shadow: var(--sk2-calm-shadow) !important;
}

.panel,
.card,
.dashboard-hero,
.dashboard-overview,
.dashboard-profile-card,
.dashboard-summary-card,
.dashboard-stat-card,
.dashboard-info-list li,
.form-panel,
.helper-card,
.roles-access-card,
.roles-access-panel,
.roles-access-option,
.portal-configuration-panel,
.portal-configuration-stat-card,
.users-filters-card,
.users-stat-card,
.users-table-wrap,
.users-empty-state,
.users-sync-banner,
.user-form-hero,
.user-form-shell,
.forbidden-card,
.staff-login-panel,
.staff-password-card {
  background: var(--sk2-calm-surface) !important;
  border: 1px solid var(--sk2-calm-line) !important;
  box-shadow: var(--sk2-calm-shadow-soft) !important;
}

.dashboard-hero,
.user-form-hero,
.users-hero,
.roles-access-panel,
.portal-configuration-panel {
  background: var(--sk2-calm-surface-raised) !important;
}

.dashboard-summary-card,
.dashboard-stat-card,
.dashboard-info-list li,
.card,
.form-panel,
.helper-card,
.roles-access-card,
.portal-configuration-stat-card,
.users-filters-card,
.users-stat-card,
.users-table-wrap,
.users-empty-state,
.users-sync-banner,
.user-form-shell {
  background: var(--sk2-calm-surface) !important;
}

.sidebar-nav-item,
.sidebar-connected-app-link,
.sidebar-user-card,
.sidebar-logout-link,
.brand-select-option,
.check-option,
.role-panel,
.role-group,
.portal-configuration-toggle,
.users-table tbody tr,
.helper-action-box {
  background: var(--sk2-calm-surface-muted) !important;
  border: 1px solid rgba(126, 162, 214, .16) !important;
  box-shadow: none !important;
}

.sidebar-nav-item:hover,
.sidebar-connected-app-link:hover,
.sidebar-logout-link:hover,
.brand-select-option:hover,
.check-option:hover,
.roles-access-option:hover,
.users-table tbody tr:hover {
  background: rgba(35, 90, 154, .26) !important;
  border-color: var(--sk2-calm-line-strong) !important;
  transform: translateY(-1px);
}

.sidebar-nav-item.is-active {
  background: var(--sk2-aviation) !important;
  border-color: rgba(126, 162, 214, .42) !important;
  color: #FFFFFF !important;
  box-shadow: inset 4px 0 0 var(--sk2-technical) !important;
}

.sidebar-connected-app-icon,
.dashboard-profile-avatar,
.sidebar-user-avatar,
.staff-login-brand__logo,
.staff-password-brand__logo,
.forbidden-icon {
  background: var(--sk2-aviation) !important;
  border-color: rgba(126, 162, 214, .34) !important;
  box-shadow: none !important;
}

h1,
h2,
h3,
.brand h1,
.dashboard-hero-copy h1,
.dashboard-overview-head h2,
.section-heading,
.section-heading-inline,
.roles-access-head h1,
.portal-configuration-head h1,
.user-form-hero-copy h1,
.users-hero-copy h1,
.forbidden-card h1,
.staff-login-copy h1,
.staff-password-brand h1,
.card strong,
.dashboard-stat-card strong,
.dashboard-info-list li strong,
.sidebar-brand-block strong,
.sidebar-connected-app-copy strong,
.sidebar-user-meta strong {
  color: var(--sk2-calm-title) !important;
}

p,
small,
label,
.muted,
.brand p,
.card p,
.dashboard-hero-copy p,
.dashboard-overview-head p,
.dashboard-profile-meta span,
.dashboard-info-list li span,
.sidebar-brand-block p,
.sidebar-user-meta span,
.sidebar-connected-app-copy small,
.form-note,
.helper-list,
.helper-status,
.users-section-copy,
.users-workspace-meta,
.portal-configuration-field small,
.roles-access-option-copy small {
  color: var(--sk2-calm-text) !important;
}

.card small,
.dashboard-section-kicker,
.sidebar-section-kicker,
.roles-access-kicker,
.portal-configuration-kicker,
.staff-login-copy__eyebrow,
.staff-password-brand__eyebrow,
.badge,
.sidebar-brand-badge,
.users-meta-pill,
.tag-chip,
.dashboard-pill {
  background: rgba(126, 162, 214, .14) !important;
  border-color: rgba(126, 162, 214, .24) !important;
  color: #CFE3FF !important;
  box-shadow: none !important;
}

input,
textarea,
select,
.brand-select-trigger,
.brand-select-menu,
.users-filter-search input,
.users-filter-field input,
.users-filter-field select {
  background: var(--sk2-calm-bg-deep) !important;
  border-color: var(--sk2-calm-line) !important;
  color: var(--sk2-calm-title) !important;
  box-shadow: none !important;
}

input:focus,
textarea:focus,
select:focus,
.brand-select.is-open .brand-select-trigger,
.brand-select-trigger:focus-visible {
  border-color: var(--sk2-technical) !important;
  box-shadow: 0 0 0 3px rgba(76, 155, 232, .16) !important;
}

.btn-primary,
.staff-login-form__submit,
.staff-password-form__submit,
.portal-configuration-actions .btn-primary,
.roles-access-actions .btn-primary,
.form-actions .btn-primary,
.user-action-btn-edit,
.users-filter-actions .btn-primary {
  background: var(--sk2-technical) !important;
  color: #06111F !important;
  border: 1px solid rgba(126, 162, 214, .28) !important;
  box-shadow: none !important;
}

.btn-primary:hover,
.staff-login-form__submit:hover,
.staff-password-form__submit:hover,
.user-action-btn-edit:hover,
.users-filter-actions .btn-primary:hover {
  background: #6EB1F2 !important;
  box-shadow: 0 8px 18px rgba(76, 155, 232, .20) !important;
}

.btn-secondary,
.user-action-btn,
.users-pagination-actions a,
.users-pagination-actions span,
.form-actions .btn-secondary,
.forbidden-actions .btn-secondary {
  background: transparent !important;
  color: var(--sk2-calm-title) !important;
  border: 1px solid var(--sk2-calm-line) !important;
  box-shadow: none !important;
}

.flash,
.users-sync-banner {
  background: rgba(126, 162, 214, .10) !important;
  border-color: rgba(126, 162, 214, .24) !important;
}

.users-table thead th {
  background: var(--sk2-calm-surface-muted) !important;
  color: #D7E9FF !important;
  border-bottom-color: var(--sk2-calm-line) !important;
}

.user-action-btn-toggle.is-danger {
  background: rgba(233, 52, 52, .10) !important;
  border-color: rgba(233, 52, 52, .26) !important;
}

/* ==========================================================
   SKIES2 STAFF PORTAL — calm UI refinements
   Scope: Staff Portal only. TMS styles are intentionally not included.
   Focus: vertical alignment, cleaner sidebar navigation, softer
   connected app items.
   ========================================================== */

/* Keep badge/kicker text vertically centered inside their own capsules. */
.badge,
.sidebar-brand-badge,
.sidebar-section-kicker,
.dashboard-section-kicker,
.dashboard-pill,
.users-meta-pill,
.tag-chip,
.card > small,
.dashboard-summary-card > small,
.dashboard-stat-card > small,
.roles-access-kicker,
.portal-configuration-kicker,
.staff-login-copy__eyebrow,
.staff-password-brand__eyebrow {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: fit-content !important;
  line-height: 1 !important;
  vertical-align: middle !important;
}

/* Avoid full-width label bars inside dashboard cards. */
.dashboard-summary-card > small,
.dashboard-stat-card > small,
.card > small {
  align-self: start !important;
  margin-bottom: 4px !important;
}

/* Ensure common compact containers keep their content visually centered. */
.sidebar-nav-item,
.sidebar-connected-app-link,
.sidebar-user-card,
.sidebar-logout-link,
.dashboard-profile-card,
.btn,
button,
.user-action-btn,
.users-pagination-actions a,
.users-pagination-actions span {
  align-items: center !important;
  line-height: 1.2 !important;
}

.sidebar-connected-app-copy,
.sidebar-user-meta,
.dashboard-profile-meta {
  justify-content: center !important;
}

/* Remove the active navigation left stripe. Active state is now shown by
   solid Aviation Blue background + border only. */
.sidebar-nav-item.is-active {
  box-shadow: none !important;
  border-left: 1px solid rgba(126, 162, 214, .32) !important;
}

.sidebar-nav-item.is-active::before,
.sidebar-nav-item.is-active::after {
  display: none !important;
  content: none !important;
}

/* Connected Apps should feel secondary when idle and only gain emphasis
   on hover/focus. */
.sidebar-connected-app-link {
  background: rgba(7, 17, 32, .42) !important;
  border-color: rgba(126, 162, 214, .12) !important;
  box-shadow: none !important;
}

.sidebar-connected-app-link:hover,
.sidebar-connected-app-link:focus-visible {
  background: rgba(35, 90, 154, .20) !important;
  border-color: rgba(76, 155, 232, .26) !important;
  box-shadow: none !important;
}

.sidebar-connected-app-icon {
  background: rgba(35, 90, 154, .36) !important;
  border-color: rgba(126, 162, 214, .20) !important;
  color: #D7E9FF !important;
}

.sidebar-connected-app-link:hover .sidebar-connected-app-icon,
.sidebar-connected-app-link:focus-visible .sidebar-connected-app-icon {
  background: rgba(35, 90, 154, .62) !important;
  border-color: rgba(126, 162, 214, .30) !important;
}

/* ==========================================================
   SKIES2 STAFF PORTAL — Connected Apps low-contrast idle state
   Scope: Staff Portal only. Keeps Connected Apps readable but
   visually secondary until hover/focus.
   ========================================================== */
.sidebar-connected-apps {
  gap: 12px !important;
}

.sidebar-connected-apps-list {
  gap: 8px !important;
}

.sidebar-connected-app-link {
  background: rgba(255, 255, 255, .018) !important;
  border-color: rgba(126, 162, 214, .075) !important;
  box-shadow: none !important;
}

.sidebar-connected-app-link:hover,
.sidebar-connected-app-link:focus-visible {
  background: rgba(35, 90, 154, .18) !important;
  border-color: rgba(126, 162, 214, .22) !important;
  transform: translateY(-1px) !important;
}

.sidebar-connected-app-icon {
  background: rgba(126, 162, 214, .12) !important;
  border-color: rgba(126, 162, 214, .14) !important;
  color: #D7E9FF !important;
  box-shadow: none !important;
}

.sidebar-connected-app-link:hover .sidebar-connected-app-icon,
.sidebar-connected-app-link:focus-visible .sidebar-connected-app-icon {
  background: rgba(35, 90, 154, .36) !important;
  border-color: rgba(126, 162, 214, .24) !important;
}

.sidebar-connected-app-copy strong {
  color: rgba(244, 248, 255, .92) !important;
}

.sidebar-connected-app-copy small,
.sidebar-connected-app-arrow {
  color: rgba(244, 248, 255, .58) !important;
}


/* ==========================================================
   SKIES2 STAFF PORTAL — Sidebar controlled internal scroll
   Purpose: keep all navigation, connected apps, profile and logout
   accessible when the sidebar content exceeds viewport height.
   ========================================================== */
.app-shell.is-authenticated {
  min-height: 100vh !important;
}

.portal-sidebar {
  position: sticky !important;
  top: var(--sk2-space-page, 24px) !important;
  align-self: start !important;
  max-height: calc(100vh - (var(--sk2-space-page, 24px) * 2)) !important;
  height: auto !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.sidebar-brand-block,
.sidebar-footer {
  flex: 0 0 auto !important;
}

.sidebar-scroll {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  display: grid !important;
  align-content: start !important;
  gap: 22px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain !important;
  padding-right: 0.45rem !important;
  margin-right: -0.45rem !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(76, 155, 232, .42) transparent;
}

.sidebar-scroll::-webkit-scrollbar {
  width: 6px;
}

.sidebar-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(76, 155, 232, .42);
  border-radius: 999px;
}

.sidebar-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(109, 213, 247, .58);
}

/* Keep the user card and logout reachable and visually separated from the
   scrollable module list without hiding any existing navigation items. */
.sidebar-footer {
  margin-top: 0 !important;
  padding-top: 0.25rem !important;
}

/* On very short desktop viewports the full sidebar can scroll as a safety
   fallback, while normal desktop keeps profile/logout visible. */
@media (max-height: 720px) and (min-width: 1101px) {
  .portal-sidebar {
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(76, 155, 232, .42) transparent;
  }

  .portal-sidebar::-webkit-scrollbar {
    width: 6px;
  }

  .portal-sidebar::-webkit-scrollbar-track {
    background: transparent;
  }

  .portal-sidebar::-webkit-scrollbar-thumb {
    background: rgba(76, 155, 232, .42);
    border-radius: 999px;
  }

  .sidebar-scroll {
    flex: 0 0 auto !important;
    overflow: visible !important;
    padding-right: 0 !important;
    margin-right: 0 !important;
  }
}

@media (max-width: 1100px) {
  .portal-sidebar {
    position: static !important;
    top: auto !important;
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
  }

  .sidebar-scroll {
    overflow: visible !important;
    max-height: none !important;
    padding-right: 0 !important;
    margin-right: 0 !important;
  }
}

/* Staff Portal flash messages: compact width and auto-dismiss transition. */
.flash {
  width: fit-content !important;
  max-width: min(520px, calc(100vw - 2rem)) !important;
  min-width: min(220px, 100%) !important;
  margin: 0 0 1rem !important;
  padding: 0.85rem 1rem !important;
  border-radius: 16px !important;
  border: 1px solid rgba(76, 155, 232, 0.24) !important;
  background: rgba(10, 29, 55, 0.92) !important;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.22) !important;
  line-height: 1.45 !important;
  transition: opacity 0.25s ease, transform 0.25s ease, max-height 0.25s ease, margin 0.25s ease, padding 0.25s ease !important;
}

.flash-success {
  color: var(--sk2-green, var(--success)) !important;
  border-color: rgba(79, 154, 58, 0.32) !important;
  background: rgba(79, 154, 58, 0.10) !important;
}

.flash-error {
  color: var(--sk2-red, var(--danger)) !important;
  border-color: rgba(233, 52, 52, 0.32) !important;
  background: rgba(233, 52, 52, 0.10) !important;
}

.flash-warning {
  color: #FBBF24 !important;
  border-color: rgba(251, 191, 36, 0.30) !important;
  background: rgba(251, 191, 36, 0.10) !important;
}

.flash-info {
  color: var(--sk2-calm-title, #BFD3EA) !important;
  border-color: rgba(76, 155, 232, 0.28) !important;
  background: rgba(76, 155, 232, 0.10) !important;
}

.flash.is-dismissing {
  opacity: 0 !important;
  transform: translateY(-6px) !important;
  max-height: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

.dashboard-page--simple .flash,
.shell > .flash,
.shell .flash:first-child {
  justify-self: start;
}

@media (max-width: 640px) {
  .flash {
    width: 100% !important;
    max-width: 100% !important;
  }
}


/* Staff Portal flash messages: tighter toast sizing for short messages. */
.flash {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  flex: 0 0 auto !important;
  width: fit-content !important;
  inline-size: fit-content !important;
  min-width: 0 !important;
  max-width: min(340px, calc(100vw - 2rem)) !important;
  min-height: 0 !important;
  padding: 0.58rem 0.82rem !important;
  margin: 0 0 0.85rem 0 !important;
  border-radius: 13px !important;
  font-size: 0.92rem !important;
  line-height: 1.28 !important;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: anywhere !important;
}

.dashboard-page--simple .flash,
.shell > .flash,
.shell .flash:first-child {
  display: inline-flex !important;
  width: fit-content !important;
  inline-size: fit-content !important;
  max-width: min(340px, calc(100vw - 2rem)) !important;
  min-width: 0 !important;
  justify-self: start !important;
  align-self: start !important;
}

@media (max-width: 640px) {
  .flash,
  .dashboard-page--simple .flash,
  .shell > .flash,
  .shell .flash:first-child {
    width: fit-content !important;
    inline-size: fit-content !important;
    max-width: calc(100vw - 2rem) !important;
    min-width: 0 !important;
  }
}
