/* ==========================================================================
   main.css
   ========================================================================== */

:root {
  --brand-primary: #F23A24;
  --brand-primary-dark: #D92F1B;
  --brand-primary-soft: rgba(242, 58, 36, 0.10);
  --brand-primary-soft-strong: rgba(242, 58, 36, 0.16);
  --brand-dark: #1E1E1E;
  --brand-dark-soft: #2A2A2A;
  --brand-bg: #E6E6E6;
  --brand-surface: #FFFFFF;
  --sidebar-bg: #1E1E1E;
  --sidebar-w: 230px;
  --sidebar-text: #B8B8B8;
  --surface: #FFFFFF;
  --surface-muted: #F5F5F5;
  --surface-soft: #FAFAFA;
  --border-soft: #D8D8D8;
  --border-strong: #C9C9C9;
  --text-strong: #1E1E1E;
  --text-muted: #6C6C6C;
  --text-soft: #8A8A8A;
  --shadow-soft: 0 10px 30px rgba(30, 30, 30, 0.08);
  --shadow-card: 0 24px 56px rgba(30, 30, 30, 0.10);
  --shadow-card-hover: 0 28px 64px rgba(30, 30, 30, 0.13);
  --success: #15803D;
  --success-soft: rgba(34, 197, 94, 0.12);
  --danger: #DC2626;
  --danger-soft: rgba(239, 68, 68, 0.12);
  --neutral-soft: rgba(148, 163, 184, 0.14);
  --info: #2557D6;
  --info-soft: rgba(37, 87, 214, 0.10);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background: var(--brand-bg);
  color: var(--text-strong);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  min-height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  box-shadow: 6px 0 24px rgba(0, 0, 0, 0.08);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  text-decoration: none;
  color: #fff;
  font-weight: 600;
  font-size: 15px;
}

.sidebar-brand:hover {
  color: #fff;
}

.sidebar-brand-text {
  min-width: 0;
  line-height: 1.1;
}

.sidebar-brand-text small {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.56);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-top: 4px;
}

.sidebar-brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 6px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
}

.sidebar-brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.nav-section {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .42);
  padding: 14px 16px 4px;
}

.sidebar .nav-link {
  color: var(--sidebar-text);
  font-size: 13.5px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: 0;
  transition: background .15s ease, color .15s ease;
  position: relative;
}

.sidebar .nav-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: .78;
}

.sidebar .nav-link:hover {
  background: rgba(255, 255, 255, .05);
  color: #FFFFFF;
}

.sidebar .nav-link:hover svg {
  opacity: 1;
}

.sidebar .nav-link.active {
  background: rgba(242, 58, 36, 0.10);
  color: #FFFFFF;
  font-weight: 600;
}

.sidebar .nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--brand-primary);
  border-radius: 0 999px 999px 0;
}

.sidebar .nav-link.active svg {
  opacity: 1;
  color: var(--brand-primary);
}

/* Sidebar footer */
.sidebar-footer {
  margin-top: auto;
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 8px 18px rgba(242, 58, 36, 0.20);
}

.sidebar-username {
  font-size: 13px;
  font-weight: 500;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.sidebar-role {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.58);
  text-transform: capitalize;
}

.btn-logout {
  background: none;
  border: none;
  color: var(--sidebar-text);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  line-height: 1;
  flex-shrink: 0;
  transition: color .16s ease, background-color .16s ease;
}

.btn-logout:hover {
  color: var(--brand-primary);
  background: rgba(242, 58, 36, 0.08);
}

.btn-logout svg {
  width: 15px;
  height: 15px;
}

/* ── Main layout ── */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(30, 30, 30, 0.06);
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar-title {
  font-size: 15px;
  font-weight: 600;
  flex: 1;
  color: var(--text-strong);
}

.topbar-role-badge {
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  border: 1px solid transparent;
}

.topbar-role-admin {
  background: rgba(242, 58, 36, 0.12);
  color: var(--brand-primary-dark);
  border-color: rgba(242, 58, 36, 0.18);
}

.topbar-role-operator {
  background: rgba(30, 30, 30, 0.08);
  color: var(--brand-dark);
  border-color: rgba(30, 30, 30, 0.10);
}

.page-body {
  padding: 24px;
  flex: 1;
}

/* ── Dashboard ── */
.dashboard-shell {
  width: 100%;
  max-width: 1320px;
}

.dashboard-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(242, 58, 36, 0.10) 0%, rgba(242, 58, 36, 0) 30%),
    linear-gradient(180deg, #FFFFFF 0%, #FCFCFC 100%);
  border: 1px solid rgba(30, 30, 30, 0.06);
  border-radius: 22px;
  box-shadow: 0 12px 28px rgba(30, 30, 30, 0.05);
  padding: 26px 28px;
}

.dashboard-hero-compact {
  padding: 22px 28px;
}

.dashboard-hero-copy {
  max-width: 760px;
}

.dashboard-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(242, 58, 36, 0.10);
  color: var(--brand-primary-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.dashboard-heading {
  font-size: clamp(28px, 4vw, 34px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-strong);
}

.dashboard-subheading {
  max-width: 620px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.dashboard-description {
  max-width: 620px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.dashboard-section-heading {
  display: flex;
  flex-direction: column;
}

.dashboard-section-heading-compact {
  gap: 1px;
}

.dashboard-section-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-strong);
}

.dashboard-section-text {
  color: var(--text-muted);
  font-size: 13px;
}

.dashboard-stat-card,
.dashboard-action-card {
  border-radius: 18px;
  background: linear-gradient(180deg, #FFFFFF 0%, #FCFCFC 100%);
  box-shadow: 0 10px 24px rgba(30, 30, 30, 0.05);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background-color .18s ease;
}

.dashboard-stat-card {
  border: 1px solid rgba(30, 30, 30, 0.06);
  padding: 20px 20px 18px;
}

.dashboard-action-card {
  border: 1px solid rgba(30, 30, 30, 0.06);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: inherit;
}

.dashboard-stat-card .card-body {
  padding: 20px 20px 18px;
}

.dashboard-action-card .card-body {
  padding: 18px 20px;
}

.dashboard-stat-card-compact .card-body {
  padding: 18px 20px 16px;
}

.dashboard-action-card-compact .card-body {
  padding: 16px 18px;
}

.dashboard-stat-card:hover,
.dashboard-action-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 34px rgba(30, 30, 30, 0.08);
}

.dashboard-action-card:hover {
  border-color: rgba(242, 58, 36, 0.20);
  background: linear-gradient(180deg, #FFFFFF 0%, #FFF9F8 100%);
}

.dashboard-stat-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.dashboard-stat-card-compact .dashboard-stat-top {
  margin-bottom: 14px;
}

.dashboard-stat-icon,
.dashboard-action-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform .18s ease, box-shadow .18s ease;
}

.dashboard-stat-icon svg,
.dashboard-action-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.dashboard-stat-icon-amber,
.dashboard-action-icon-amber {
  background: rgba(242, 58, 36, 0.10);
  color: var(--brand-primary-dark);
}

.dashboard-stat-icon-blue,
.dashboard-action-icon-blue {
  background: rgba(30, 30, 30, 0.08);
  color: var(--brand-dark);
}

.dashboard-stat-icon-green,
.dashboard-action-icon-green {
  background: #E6F6EC;
  color: #177245;
}

.dashboard-action-icon--scanner {
  background: rgba(242, 58, 36, 0.10);
  color: var(--brand-primary-dark);
}

.dashboard-action-icon--users {
  background: rgba(30, 30, 30, 0.08);
  color: var(--brand-dark);
}

.dashboard-action-icon--connection {
  background: #E6F6EC;
  color: #177245;
}

.dashboard-stat-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 10px;
}

.dashboard-stat-value {
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text-strong);
  margin-bottom: 8px;
}

.dashboard-stat-card-compact .dashboard-stat-value {
  margin-bottom: 6px;
}

.dashboard-stat-meta {
  font-size: 13px;
  color: var(--success);
  font-weight: 600;
}

.dashboard-stat-footnote {
  font-size: 13px;
  color: var(--text-muted);
}

.dashboard-action-copy,
.dashboard-action-body {
  min-width: 0;
  flex: 1;
}

.dashboard-action-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-strong);
  margin-bottom: 4px;
}

.dashboard-action-text {
  font-size: 13px;
  color: var(--text-muted);
}

.dashboard-action-arrow {
  color: #7C7C7C;
  transition: transform .18s ease, color .18s ease, opacity .18s ease;
  opacity: .9;
  flex-shrink: 0;
}

.dashboard-action-arrow svg {
  width: 18px;
  height: 18px;
  display: block;
}

.dashboard-action-card:hover .dashboard-action-arrow {
  color: var(--text-strong);
  opacity: 1;
  transform: translateX(3px);
}

.dashboard-action-card:hover .dashboard-action-icon {
  transform: scale(1.04);
}

/* ── Operator Dashboard ── */
.operator-dashboard-shell {
  width: 100%;
  max-width: 1320px;
}

.operator-dashboard-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(242, 58, 36, 0.08) 0%, rgba(242, 58, 36, 0) 30%),
    linear-gradient(180deg, #FFFFFF 0%, #FCFCFC 100%);
  border: 1px solid rgba(30, 30, 30, 0.06);
  border-radius: 22px;
  box-shadow: 0 12px 28px rgba(30, 30, 30, 0.05);
  padding: 26px 28px;
}

.operator-dashboard-hero-copy {
  max-width: 760px;
}

.operator-dashboard-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(242, 58, 36, 0.10);
  color: var(--brand-primary-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.operator-dashboard-heading {
  font-size: clamp(28px, 4vw, 34px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-strong);
}

.operator-dashboard-description {
  max-width: 640px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.operator-dashboard-section-heading {
  display: flex;
  flex-direction: column;
}

.operator-dashboard-section-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-strong);
}

.operator-dashboard-section-text {
  color: var(--text-muted);
  font-size: 13px;
}

.operator-dashboard-action-card {
  border-radius: 18px;
  border: 1px solid rgba(30, 30, 30, 0.06);
  background: linear-gradient(180deg, #FFFFFF 0%, #FCFCFC 100%);
  box-shadow: 0 10px 24px rgba(30, 30, 30, 0.05);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background-color .18s ease;
}

.operator-dashboard-action-card .card-body {
  padding: 18px 20px;
}

.operator-dashboard-action-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 34px rgba(30, 30, 30, 0.08);
  border-color: rgba(242, 58, 36, 0.20);
  background: linear-gradient(180deg, #FFFFFF 0%, #FFF9F8 100%);
}

.operator-dashboard-action-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform .18s ease, box-shadow .18s ease;
}

.operator-dashboard-action-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.operator-dashboard-action-icon-amber {
  background: rgba(242, 58, 36, 0.10);
  color: var(--brand-primary-dark);
}

.operator-dashboard-action-icon-blue {
  background: rgba(30, 30, 30, 0.08);
  color: var(--brand-dark);
}

.operator-dashboard-action-copy {
  min-width: 0;
}

.operator-dashboard-action-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-strong);
  margin-bottom: 4px;
}

.operator-dashboard-action-text {
  font-size: 13px;
  color: var(--text-muted);
}

.operator-dashboard-action-arrow {
  color: #7C7C7C;
  opacity: .9;
  transition: transform .18s ease, color .18s ease, opacity .18s ease;
}

.operator-dashboard-action-arrow svg {
  width: 18px;
  height: 18px;
  display: block;
}

.operator-dashboard-action-card:hover .operator-dashboard-action-arrow {
  color: var(--text-strong);
  opacity: 1;
  transform: translateX(3px);
}

.operator-dashboard-action-card:hover .operator-dashboard-action-icon {
  transform: scale(1.05);
  box-shadow: 0 10px 22px rgba(30, 30, 30, 0.08);
}

/* ── Scanner ── */
.scanner-shell {
  width: 100%;
  max-width: 1320px;
}

.scanner-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  border-radius: 22px;
  border: 1px solid rgba(30, 30, 30, 0.06);
  background:
    radial-gradient(circle at top right, rgba(242, 58, 36, 0.08) 0%, rgba(242, 58, 36, 0) 28%),
    linear-gradient(180deg, #FFFFFF 0%, #FCFCFC 100%);
  box-shadow: 0 12px 28px rgba(30, 30, 30, 0.05);
}

.scanner-hero-copy {
  max-width: 760px;
}

.scanner-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(242, 58, 36, 0.10);
  color: var(--brand-primary-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.scanner-heading {
  font-size: clamp(28px, 4vw, 34px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-strong);
}

.scanner-description {
  max-width: 620px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.scanner-capabilities {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.scanner-capability-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(30, 30, 30, 0.08);
  background: rgba(255, 255, 255, 0.88);
  color: #4D4D4D;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
}

.scanner-section-heading {
  display: flex;
  flex-direction: column;
}

.scanner-section-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-strong);
}

.scanner-section-text {
  color: var(--text-muted);
  font-size: 13px;
}

.scanner-panel {
  border-radius: 22px;
  border: 1px solid rgba(30, 30, 30, 0.06);
  background: linear-gradient(180deg, #FFFFFF 0%, #FCFCFC 100%);
  box-shadow: 0 12px 28px rgba(30, 30, 30, 0.05);
}

.scanner-panel-body {
  padding: 22px;
}

.scanner-stage {
  border-radius: 18px;
  background: linear-gradient(180deg, #FDFDFD 0%, #F7F7F7 100%);
  border: 1px solid rgba(30, 30, 30, 0.06);
  padding: 18px;
}

.scanner-stage-frame {
  position: relative;
  min-height: 360px;
  border-radius: 20px;
  border: 1px dashed rgba(30, 30, 30, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(247, 247, 247, 0.98) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.scanner-stage-corners {
  position: absolute;
  inset: 22px;
  pointer-events: none;
}

.scanner-corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border-color: rgba(242, 58, 36, 0.95);
  border-style: solid;
  border-width: 0;
}

.scanner-corner-tl {
  top: 0;
  left: 0;
  border-top-width: 3px;
  border-left-width: 3px;
  border-top-left-radius: 10px;
}

.scanner-corner-tr {
  top: 0;
  right: 0;
  border-top-width: 3px;
  border-right-width: 3px;
  border-top-right-radius: 10px;
}

.scanner-corner-bl {
  bottom: 0;
  left: 0;
  border-bottom-width: 3px;
  border-left-width: 3px;
  border-bottom-left-radius: 10px;
}

.scanner-corner-br {
  bottom: 0;
  right: 0;
  border-bottom-width: 3px;
  border-right-width: 3px;
  border-bottom-right-radius: 10px;
}

.scanner-placeholder {
  max-width: 560px;
  padding: 24px 18px;
  text-align: center;
}

.scanner-placeholder-icon {
  width: 76px;
  height: 76px;
  margin: 0 auto 20px;
  border-radius: 22px;
  background: linear-gradient(180deg, #FFF2EF 0%, #FFE7E2 100%);
  color: var(--brand-primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 24px rgba(242, 58, 36, 0.14);
}

.scanner-placeholder-icon svg {
  width: 34px;
  height: 34px;
  display: block;
}

.scanner-placeholder-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-strong);
}

.scanner-placeholder-text {
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
}

.scanner-placeholder-badge-wrap {
  display: flex;
  justify-content: center;
}

.scanner-placeholder-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(242, 58, 36, 0.10);
  color: var(--brand-primary-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
}

.scanner-panel-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 14px;
}

.scanner-panel-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 12px;
  border-radius: 12px;
  background: #F7F7F7;
  border: 1px solid rgba(30, 30, 30, 0.06);
}

.scanner-panel-note-label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.scanner-panel-note-value {
  color: var(--text-strong);
  font-size: 12px;
  font-weight: 600;
}

/* ── Profile ── */
.profile-shell {
  width: 100%;
  max-width: 1320px;
}

.profile-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(242, 58, 36, 0.10) 0%, rgba(242, 58, 36, 0) 28%),
    linear-gradient(180deg, #FFFFFF 0%, #FCFCFC 100%);
  border: 1px solid rgba(30, 30, 30, 0.06);
  border-radius: 22px;
  box-shadow: 0 12px 28px rgba(30, 30, 30, 0.05);
  padding: 24px 28px;
}

.profile-hero-copy {
  max-width: 720px;
}

.profile-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(242, 58, 36, 0.10);
  color: var(--brand-primary-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.profile-heading {
  font-size: clamp(28px, 4vw, 34px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-strong);
}

.profile-description {
  max-width: 620px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.profile-card,
.profile-side-card {
  border-radius: 22px;
  border: 1px solid rgba(30, 30, 30, 0.06);
  background: linear-gradient(180deg, #FFFFFF 0%, #FCFCFC 100%);
  box-shadow: 0 12px 28px rgba(30, 30, 30, 0.05);
}

.profile-card-body {
  padding: 26px;
}

.profile-side-card-body {
  padding: 22px 22px 20px;
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 18px;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(180deg, #F55A47 0%, var(--brand-primary) 100%);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 28px;
  font-weight: 700;
  box-shadow:
    0 12px 26px rgba(242, 58, 36, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.profile-identity-copy {
  min-width: 0;
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.profile-name {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-strong);
}

.profile-role-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.profile-role-badge-admin {
  background: rgba(242, 58, 36, 0.12);
  color: var(--brand-primary-dark);
}

.profile-role-badge-operator {
  background: rgba(30, 30, 30, 0.08);
  color: var(--brand-dark);
}

.profile-identity-subtext {
  color: var(--text-muted);
  font-size: 13px;
}

.profile-divider {
  height: 1px;
  background: rgba(30, 30, 30, 0.08);
  margin: 22px 0;
}

.profile-info-grid {
  display: grid;
  gap: 14px;
}

.profile-info-card {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(30, 30, 30, 0.06);
  background: rgba(255, 255, 255, 0.80);
}

.profile-info-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 6px;
}

.profile-info-value {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-strong);
  word-break: break-word;
}

.profile-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(242, 58, 36, 0.18);
  background: linear-gradient(180deg, rgba(255, 247, 246, 0.96) 0%, rgba(255, 242, 239, 0.96) 100%);
}

.profile-notice-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--brand-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-notice-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.profile-notice-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-primary-dark);
  margin-bottom: 2px;
}

.profile-notice-text {
  font-size: 13px;
  color: #8F3B30;
  line-height: 1.55;
}

.profile-side-icon {
  width: 46px;
  height: 46px;
  margin-bottom: 14px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.profile-side-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.profile-side-icon-green {
  background: #E6F6EC;
  color: #177245;
}

.profile-side-icon-amber {
  background: rgba(242, 58, 36, 0.10);
  color: var(--brand-primary-dark);
}

.profile-side-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-strong);
  margin-bottom: 6px;
}

.profile-side-text {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.65;
}

/* ── Manage Users ── */
.manage-users-shell {
  width: 100%;
  max-width: 1320px;
}

.manage-users-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 28px;
  border-radius: 22px;
  border: 1px solid rgba(30, 30, 30, 0.06);
  background:
    radial-gradient(circle at top right, rgba(242, 58, 36, 0.10) 0%, rgba(242, 58, 36, 0) 26%),
    linear-gradient(180deg, #FFFFFF 0%, #FCFCFC 100%);
  box-shadow: 0 12px 28px rgba(30, 30, 30, 0.05);
}

.manage-users-hero-copy {
  max-width: 780px;
}

.manage-users-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(242, 58, 36, 0.10);
  color: var(--brand-primary-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.manage-users-heading {
  font-size: clamp(28px, 4vw, 34px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-strong);
}

.manage-users-description {
  max-width: 640px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.manage-users-add-btn {
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid rgba(217, 47, 27, 0.32);
  border-radius: 14px;
  background: linear-gradient(180deg, #F55A47 0%, var(--brand-primary) 100%);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  box-shadow:
    0 10px 20px rgba(242, 58, 36, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease, opacity .18s ease;
}

.manage-users-add-btn:hover {
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow:
    0 14px 28px rgba(242, 58, 36, 0.20),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  filter: saturate(1.01);
}

.manage-users-add-btn:focus {
  color: #FFFFFF;
  box-shadow:
    0 0 0 3px rgba(242, 58, 36, 0.14),
    0 14px 28px rgba(242, 58, 36, 0.20);
}

.manage-users-add-btn:disabled {
  opacity: 1;
  cursor: not-allowed;
}

.manage-users-add-btn:hover:disabled {
  transform: translateY(-1px);
  box-shadow:
    0 14px 28px rgba(242, 58, 36, 0.20),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  filter: saturate(1.01);
}

.manage-users-add-btn-icon {
  font-size: 16px;
  line-height: 1;
}

.manage-users-card {
  border-radius: 22px;
  border: 1px solid rgba(30, 30, 30, 0.06);
  background: linear-gradient(180deg, #FFFFFF 0%, #FCFCFC 100%);
  box-shadow: 0 12px 28px rgba(30, 30, 30, 0.05);
  overflow: hidden;
}

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

.manage-users-table {
  min-width: 980px;
  font-size: 13px;
  color: var(--text-strong);
  vertical-align: middle;
}

.manage-users-table thead th {
  background: #F7F7F7;
  color: #505050;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  border-bottom: 1px solid rgba(30, 30, 30, 0.08);
  padding: 16px 12px;
  white-space: nowrap;
}

.manage-users-table tbody td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(30, 30, 30, 0.05);
  vertical-align: middle;
}

.manage-users-table tbody tr {
  transition: background-color .16s ease;
}

.manage-users-table tbody tr:hover {
  background: #FCFCFC;
}

.manage-users-index-cell {
  color: #707070;
  font-weight: 600;
  white-space: nowrap;
}

.manage-users-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.manage-users-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(180deg, #F55A47 0%, var(--brand-primary) 100%);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 8px 16px rgba(242, 58, 36, 0.14);
}

.manage-users-name-copy {
  min-width: 0;
}

.manage-users-full-name {
  color: var(--text-strong);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.manage-users-username-code {
  color: var(--brand-primary-dark);
  background: transparent;
  padding: 0;
  font-size: 12.5px;
  font-weight: 600;
}

.manage-users-email-cell {
  color: #4F4F4F;
}

.manage-users-branch-cell {
  color: #6C6C6C;
  font-size: 12.5px;
}

.manage-users-role-badge,
.manage-users-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .04em;
  white-space: nowrap;
}

.manage-users-role-admin {
  background: rgba(242, 58, 36, 0.12);
  color: var(--brand-primary-dark);
}

.manage-users-role-operator {
  background: rgba(30, 30, 30, 0.08);
  color: var(--brand-dark);
}

.manage-users-status-active {
  background: rgba(34, 197, 94, 0.12);
  color: #15803D;
  border: 1px solid rgba(34, 197, 94, 0.18);
}

.manage-users-status-inactive {
  background: rgba(148, 163, 184, 0.14);
  color: #64748B;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.manage-users-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.manage-users-action-btn {
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease, opacity .16s ease;
}

.manage-users-action-btn:disabled {
  opacity: 1;
  cursor: not-allowed;
}

.manage-users-action-btn-edit,
.manage-users-action-btn-edit:disabled {
  border: 1px solid #D0D0D0 !important;
  background: #FFFFFF !important;
  color: #555555 !important;
}

.manage-users-action-btn-edit:hover {
  background: #F7F7F7 !important;
  border-color: #C4C4C4 !important;
  color: #2E2E2E !important;
}

.manage-users-action-btn-edit:hover:disabled {
  background: #F7F7F7 !important;
  border-color: #C4C4C4 !important;
  color: #2E2E2E !important;
}

.manage-users-action-btn-delete,
.manage-users-action-btn-delete:disabled {
  border: 1px solid rgba(239, 68, 68, 0.52) !important;
  background: #FFFFFF !important;
  color: #DC2626 !important;
}

.manage-users-action-btn-delete:hover {
  background: #FEF2F2 !important;
  border-color: rgba(239, 68, 68, 0.62) !important;
  color: #B91C1C !important;
}

.manage-users-action-btn-delete:hover:disabled {
  background: #FEF2F2 !important;
  border-color: rgba(239, 68, 68, 0.62) !important;
  color: #B91C1C !important;
}

.manage-users-action-btn-delete {
  border: 1px solid rgba(239, 68, 68, 0.48);
  background: #FFFFFF;
  color: #DC2626;
}

.manage-users-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-top: 1px solid rgba(30, 30, 30, 0.06);
  background: rgba(247, 247, 247, 0.70);
}

.manage-users-pagination-info {
  color: #6C6C6C;
  font-size: 12px;
  font-weight: 500;
}

.manage-users-pagination {
  gap: 4px;
}

.manage-users-pagination .page-item.disabled .page-link {
  color: #9A9A9A;
  background: #F7F7F7;
  border-color: rgba(30, 30, 30, 0.08);
}

.manage-users-pagination .page-link {
  min-width: 34px;
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(30, 30, 30, 0.08);
  background: #FFFFFF;
  color: #4F4F4F;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}

.manage-users-pagination .page-link:hover {
  background: #F7F7F7;
  color: var(--text-strong);
  border-color: rgba(30, 30, 30, 0.14);
}

.manage-users-pagination .page-item.active .page-link {
  background: linear-gradient(180deg, #F55A47 0%, var(--brand-primary) 100%);
  color: #FFFFFF;
  border-color: rgba(217, 47, 27, 0.38);
}

.manage-users-page-numbers {
  gap: 4px;
}

/* ── Add User ── */
.add-user-shell {
  width: 100%;
  max-width: 960px;
}

.add-user-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 28px;
  border-radius: 22px;
  border: 1px solid rgba(30, 30, 30, 0.06);
  background:
    radial-gradient(circle at top right, rgba(242, 58, 36, 0.10) 0%, rgba(242, 58, 36, 0) 26%),
    linear-gradient(180deg, #FFFFFF 0%, #FCFCFC 100%);
  box-shadow: 0 12px 28px rgba(30, 30, 30, 0.05);
}

.add-user-hero-copy {
  max-width: 720px;
}

.add-user-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(242, 58, 36, 0.10);
  color: var(--brand-primary-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.add-user-heading {
  font-size: clamp(28px, 4vw, 34px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-strong);
}

.add-user-description {
  max-width: 620px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.add-user-card {
  border-radius: 22px;
  border: 1px solid rgba(30, 30, 30, 0.06);
  background: linear-gradient(180deg, #FFFFFF 0%, #FCFCFC 100%);
  box-shadow: 0 12px 28px rgba(30, 30, 30, 0.05);
  /* overflow visible — required so branch dropdown panel is not clipped */
}

.add-user-card-body {
  padding: 26px;
}

.add-user-section-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-strong);
  margin-bottom: 6px;
}

.add-user-section-text {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 22px;
}

.add-user-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.add-user-field-full {
  grid-column: 1 / -1;
}

.add-user-label {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-strong);
}

.add-user-input,
.add-user-select {
  min-height: 50px;
  border-radius: 13px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.98);
  color: var(--text-strong);
  font-size: 15px;
  box-shadow: inset 0 1px 2px rgba(30, 30, 30, 0.02);
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.add-user-input::placeholder {
  color: #9C9C9C;
}

.add-user-input:hover,
.add-user-select:hover {
  border-color: #CFCFCF;
}

.add-user-input:focus,
.add-user-select:focus {
  border-color: rgba(242, 58, 36, 0.62);
  background: #FFFFFF;
  box-shadow:
    0 0 0 3px rgba(242, 58, 36, 0.12),
    0 8px 18px rgba(242, 58, 36, 0.08);
}

.add-user-select {
  padding-right: 40px;
}

.add-user-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 22px;
  margin-top: 22px;
  border-top: 1px solid rgba(30, 30, 30, 0.06);
}

.add-user-cancel-btn {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid rgba(30, 30, 30, 0.10);
  background: linear-gradient(180deg, #FFFFFF 0%, #F7F7F7 100%);
  color: #3A3A3A;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, color .18s ease;
}

.add-user-cancel-btn:hover {
  color: var(--text-strong);
  border-color: rgba(30, 30, 30, 0.14);
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(30, 30, 30, 0.06);
}

.add-user-cancel-btn:focus {
  color: var(--text-strong);
  box-shadow:
    0 0 0 3px rgba(30, 30, 30, 0.08),
    0 10px 20px rgba(30, 30, 30, 0.06);
}

.add-user-submit-btn {
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(217, 47, 27, 0.32);
  border-radius: 14px;
  background: linear-gradient(180deg, #F55A47 0%, var(--brand-primary) 100%);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow:
    0 10px 20px rgba(242, 58, 36, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.add-user-submit-btn:hover {
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow:
    0 14px 28px rgba(242, 58, 36, 0.20),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  filter: saturate(1.01);
}

.add-user-submit-btn:focus {
  color: #FFFFFF;
  box-shadow:
    0 0 0 3px rgba(242, 58, 36, 0.14),
    0 14px 28px rgba(242, 58, 36, 0.20);
}

.add-user-submit-btn:active {
  transform: translateY(0) scale(0.992);
}

.add-user-helper {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px dashed #D2D2D2;
  border-radius: 14px;
  background: rgba(248, 248, 248, 0.92);
}

.add-user-helper-title {
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .14em;
}

.add-user-helper-text {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

/* ── Edit User ── */
.edit-user-shell {
  width: 100%;
  max-width: 960px;
}

.edit-user-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 28px;
  border-radius: 22px;
  border: 1px solid rgba(30, 30, 30, 0.06);
  background:
    radial-gradient(circle at top right, rgba(242, 58, 36, 0.10) 0%, rgba(242, 58, 36, 0) 26%),
    linear-gradient(180deg, #FFFFFF 0%, #FCFCFC 100%);
  box-shadow: 0 12px 28px rgba(30, 30, 30, 0.05);
}

.edit-user-hero-copy {
  max-width: 720px;
}

.edit-user-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(242, 58, 36, 0.10);
  color: var(--brand-primary-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.edit-user-heading {
  font-size: clamp(28px, 4vw, 34px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-strong);
}

.edit-user-description {
  max-width: 620px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.edit-user-card {
  border-radius: 22px;
  border: 1px solid rgba(30, 30, 30, 0.06);
  background: linear-gradient(180deg, #FFFFFF 0%, #FCFCFC 100%);
  box-shadow: 0 12px 28px rgba(30, 30, 30, 0.05);
  /* overflow visible — required so branch dropdown panel is not clipped */
}

.edit-user-card-body {
  padding: 26px;
}

.edit-user-section-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-strong);
  margin-bottom: 6px;
}

.edit-user-section-text {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 22px;
}

.edit-user-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.edit-user-field-full {
  grid-column: 1 / -1;
}

.edit-user-label {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-strong);
}

.edit-user-input,
.edit-user-select {
  min-height: 50px;
  border-radius: 13px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.98);
  color: var(--text-strong);
  font-size: 15px;
  box-shadow: inset 0 1px 2px rgba(30, 30, 30, 0.02);
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.edit-user-input::placeholder {
  color: #9C9C9C;
}

.edit-user-input:hover,
.edit-user-select:hover {
  border-color: #CFCFCF;
}

.edit-user-input:focus,
.edit-user-select:focus {
  border-color: rgba(242, 58, 36, 0.62);
  background: #FFFFFF;
  box-shadow:
    0 0 0 3px rgba(242, 58, 36, 0.12),
    0 8px 18px rgba(242, 58, 36, 0.08);
}

.edit-user-select {
  padding-right: 40px;
}

.edit-user-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 22px;
  margin-top: 22px;
  border-top: 1px solid rgba(30, 30, 30, 0.06);
}

.edit-user-cancel-btn {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid rgba(30, 30, 30, 0.10);
  background: linear-gradient(180deg, #FFFFFF 0%, #F7F7F7 100%);
  color: #3A3A3A;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, color .18s ease;
}

.edit-user-cancel-btn:hover {
  color: var(--text-strong);
  border-color: rgba(30, 30, 30, 0.14);
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(30, 30, 30, 0.06);
}

.edit-user-cancel-btn:focus {
  color: var(--text-strong);
  box-shadow:
    0 0 0 3px rgba(30, 30, 30, 0.08),
    0 10px 20px rgba(30, 30, 30, 0.06);
}

.edit-user-submit-btn {
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(217, 47, 27, 0.32);
  border-radius: 14px;
  background: linear-gradient(180deg, #F55A47 0%, var(--brand-primary) 100%);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow:
    0 10px 20px rgba(242, 58, 36, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.edit-user-submit-btn:hover {
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow:
    0 14px 28px rgba(242, 58, 36, 0.20),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  filter: saturate(1.01);
}

.edit-user-submit-btn:focus {
  color: #FFFFFF;
  box-shadow:
    0 0 0 3px rgba(242, 58, 36, 0.14),
    0 14px 28px rgba(242, 58, 36, 0.20);
}

.edit-user-submit-btn:active {
  transform: translateY(0) scale(0.992);
}

.edit-user-helper {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px dashed #D2D2D2;
  border-radius: 14px;
  background: rgba(248, 248, 248, 0.92);
}

.edit-user-helper-title {
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .14em;
}

.edit-user-helper-text {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

/* ── Remove User ── */
.remove-user-shell {
  width: 100%;
  max-width: 760px;
}

.remove-user-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 28px;
  border-radius: 22px;
  border: 1px solid rgba(239, 68, 68, 0.12);
  background:
    radial-gradient(circle at top right, rgba(239, 68, 68, 0.08) 0%, rgba(239, 68, 68, 0) 26%),
    linear-gradient(180deg, #FFFFFF 0%, #FCFCFC 100%);
  box-shadow: 0 12px 28px rgba(30, 30, 30, 0.05);
}

.remove-user-hero-copy {
  max-width: 620px;
}

.remove-user-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.10);
  color: #B91C1C;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.remove-user-heading {
  font-size: clamp(28px, 4vw, 34px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-strong);
}

.remove-user-description {
  max-width: 560px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.remove-user-card {
  border-radius: 22px;
  border: 1px solid rgba(239, 68, 68, 0.10);
  background: linear-gradient(180deg, #FFFFFF 0%, #FEFCFC 100%);
  box-shadow: 0 12px 28px rgba(30, 30, 30, 0.05);
  overflow: hidden;
}

.remove-user-card-body {
  padding: 26px;
}

.remove-user-alert {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(239, 68, 68, 0.14);
  background: linear-gradient(180deg, rgba(254, 242, 242, 0.92) 0%, rgba(255, 247, 247, 0.96) 100%);
}

.remove-user-alert-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  color: #DC2626;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.remove-user-alert-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.remove-user-alert-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-strong);
  margin-bottom: 6px;
}

.remove-user-alert-text {
  font-size: 14px;
  color: #6B2B24;
  line-height: 1.65;
  margin: 0;
}

.remove-user-username {
  color: #B91C1C;
  font-weight: 700;
}

.remove-user-meta {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.remove-user-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(30, 30, 30, 0.06);
  background: rgba(255, 255, 255, 0.84);
}

.remove-user-meta-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.remove-user-meta-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-strong);
  text-align: right;
  word-break: break-word;
}

.remove-user-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 22px;
  margin-top: 22px;
  border-top: 1px solid rgba(30, 30, 30, 0.06);
}

.remove-user-cancel-btn {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid rgba(30, 30, 30, 0.10);
  background: linear-gradient(180deg, #FFFFFF 0%, #F7F7F7 100%);
  color: #3A3A3A;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, color .18s ease;
}

.remove-user-cancel-btn:hover {
  color: var(--text-strong);
  border-color: rgba(30, 30, 30, 0.14);
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(30, 30, 30, 0.06);
}

.remove-user-cancel-btn:focus {
  color: var(--text-strong);
  box-shadow:
    0 0 0 3px rgba(30, 30, 30, 0.08),
    0 10px 20px rgba(30, 30, 30, 0.06);
}

.remove-user-submit-btn {
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(220, 38, 38, 0.24);
  border-radius: 14px;
  background: linear-gradient(180deg, #EF4444 0%, #DC2626 100%);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow:
    0 10px 20px rgba(239, 68, 68, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.remove-user-submit-btn:hover {
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow:
    0 14px 28px rgba(239, 68, 68, 0.20),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  filter: saturate(1.01);
}

.remove-user-submit-btn:focus {
  color: #FFFFFF;
  box-shadow:
    0 0 0 3px rgba(239, 68, 68, 0.14),
    0 14px 28px rgba(239, 68, 68, 0.20);
}

.remove-user-submit-btn:active {
  transform: translateY(0) scale(0.992);
}

.remove-user-helper {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px dashed rgba(239, 68, 68, 0.22);
  border-radius: 14px;
  background: rgba(254, 242, 242, 0.76);
}

.remove-user-helper-title {
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 700;
  color: #B91C1C;
  text-transform: uppercase;
  letter-spacing: .14em;
}

.remove-user-helper-text {
  font-size: 12.5px;
  color: #7F1D1D;
  line-height: 1.6;
  margin: 0;
}

/* ── Connection Test ── */
.connection-shell {
  width: 100%;
  max-width: 1320px;
}

.connection-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(242, 58, 36, 0.10) 0%, rgba(242, 58, 36, 0) 28%),
    linear-gradient(180deg, #FFFFFF 0%, #FCFCFC 100%);
  border: 1px solid rgba(30, 30, 30, 0.06);
  border-radius: 22px;
  box-shadow: 0 12px 28px rgba(30, 30, 30, 0.05);
  padding: 24px 28px;
}

.connection-hero-copy {
  max-width: 760px;
}

.connection-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(242, 58, 36, 0.10);
  color: var(--brand-primary-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.connection-heading {
  font-size: clamp(28px, 4vw, 34px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-strong);
}

.connection-description {
  max-width: 700px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.connection-summary-card {
  border-radius: 18px;
  border: 1px solid rgba(30, 30, 30, 0.06);
  background: linear-gradient(180deg, #FFFFFF 0%, #FCFCFC 100%);
  box-shadow: 0 10px 24px rgba(30, 30, 30, 0.05);
  transition: transform .18s ease, box-shadow .18s ease;
}

.connection-summary-card .card-body {
  padding: 20px 20px 18px;
}

.connection-summary-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 34px rgba(30, 30, 30, 0.08);
}

.connection-summary-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.connection-summary-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.connection-summary-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.connection-summary-icon-green {
  background: #E6F6EC;
  color: #177245;
}

.connection-summary-icon-red {
  background: #FEECEC;
  color: #DC2626;
}

.connection-summary-icon-slate {
  background: #F1F1F1;
  color: #646464;
}

.connection-summary-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.connection-summary-value {
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text-strong);
  margin-bottom: 8px;
}

.connection-summary-meta {
  font-size: 13px;
  color: var(--text-muted);
}

.connection-section-heading {
  display: flex;
  flex-direction: column;
}

.connection-section-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-strong);
}

.connection-section-text {
  color: var(--text-muted);
  font-size: 13px;
}

.connection-panel,
.connection-lib-card {
  border-radius: 22px;
  border: 1px solid rgba(30, 30, 30, 0.06);
  background: linear-gradient(180deg, #FFFFFF 0%, #FCFCFC 100%);
  box-shadow: 0 12px 28px rgba(30, 30, 30, 0.05);
  overflow: hidden;
}

.connection-service-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
}

.connection-service-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.connection-service-copy {
  min-width: 0;
}

.connection-service-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.connection-service-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.connection-service-icon-green {
  background: #E6F6EC;
  color: #177245;
}

.connection-service-icon-amber {
  background: rgba(242, 58, 36, 0.10);
  color: var(--brand-primary-dark);
}

.connection-service-icon-slate {
  background: #F1F1F1;
  color: #646464;
}

.connection-service-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-strong);
}

.connection-service-port {
  font-size: 12px;
  font-weight: 500;
  color: #9A9A9A;
}

.connection-service-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-top: 2px;
}

.connection-service-side {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.connection-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.connection-status-badge-ok {
  background: rgba(34, 197, 94, 0.12);
  color: #15803D;
  border: 1px solid rgba(34, 197, 94, 0.18);
}

.connection-status-badge-fail {
  background: rgba(239, 68, 68, 0.12);
  color: #DC2626;
  border: 1px solid rgba(239, 68, 68, 0.18);
}

.connection-status-badge-pending {
  background: rgba(148, 163, 184, 0.14);
  color: #64748B;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.connection-lib-card-body {
  padding: 20px 22px;
}

.connection-lib-header {
  margin-bottom: 14px;
}

.connection-lib-kicker {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 4px;
}

.connection-lib-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-strong);
  line-height: 1.3;
}

.connection-lib-list {
  display: grid;
  gap: 10px;
}

.connection-lib-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(30, 30, 30, 0.06);
  background: rgba(255, 255, 255, 0.80);
}

.connection-lib-row-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.connection-lib-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.connection-lib-dot.is-ok {
  background: #22C55E;
}

.connection-lib-dot.is-fail {
  background: #EF4444;
}

.connection-lib-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-strong);
  text-transform: capitalize;
}

.connection-lib-state {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.connection-lib-state.is-ok {
  color: #15803D;
}

.connection-lib-state.is-fail {
  color: #DC2626;
}

.connection-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.connection-recheck-btn {
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid rgba(30, 30, 30, 0.08);
  border-radius: 14px;
  background: linear-gradient(180deg, #FFFFFF 0%, #F7F7F7 100%);
  color: #3A3A3A;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 20px rgba(30, 30, 30, 0.05);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, color .18s ease, background-color .18s ease;
}

.connection-recheck-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(242, 58, 36, 0.24);
  color: var(--text-strong);
  box-shadow: 0 14px 28px rgba(30, 30, 30, 0.08);
}

.connection-recheck-btn:disabled {
  opacity: 1;
  cursor: not-allowed;
}

.connection-recheck-btn.is-checking {
  border-color: rgba(242, 58, 36, 0.30);
  color: var(--brand-primary-dark);
  box-shadow: 0 14px 28px rgba(242, 58, 36, 0.10);
}

.connection-recheck-btn-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.connection-recheck-btn-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.connection-recheck-btn.is-checking .connection-recheck-btn-icon {
  animation: connectionSpin .8s linear infinite;
}

@keyframes connectionSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* ── Connection indicator ── */
.conn-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.conn-dot.checking {
  background: var(--brand-primary);
  animation: blink 1s infinite;
}

.conn-dot.ok {
  background: #22C55E;
}

.conn-dot.fail {
  background: #EF4444;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}

/* ── Mobile sidebar ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 99;
}

.btn-toggle-sidebar {
  display: none;
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0, 0, 0, .3);
  }

  .sidebar-overlay.open {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }

  .btn-toggle-sidebar {
    display: flex;
  }

  .page-body {
    padding: 16px;
  }
}

/* ── Error pages ── */
.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-muted);
  padding: 40px 20px;
}

.error-code {
  font-size: 80px;
  font-weight: 700;
  color: var(--brand-primary);
  line-height: 1;
}

/* ==========================================================================
   Login page
   ========================================================================== */

body.login-page {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.88) 0%, rgba(255, 255, 255, 0) 36%),
    linear-gradient(135deg, #F6F6F6 0%, #ECECEC 52%, #E6E6E6 100%);
  color: var(--text-strong);
}

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 424px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  animation: loginCardEnter .28s ease-out;
}

.login-card-body {
  padding: 34px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.login-brand-full {
  justify-content: center;
  margin-bottom: 24px;
}

.login-brand-logo {
  width: 100%;
  max-width: 250px;
  height: auto;
  display: block;
}

.login-brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  background: #FFFFFF;
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow:
    0 12px 24px rgba(30, 30, 30, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.login-brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.login-brand-icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.login-brand-text {
  min-width: 0;
}

.login-brand-name {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--text-strong);
}

.login-brand-subtitle {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .14em;
}

.login-header {
  margin-bottom: 22px;
}

.login-title {
  margin: 0 0 6px;
  font-size: 27px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-strong);
}

.login-subtitle {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
}

.login-alerts {
  margin-bottom: 18px;
}

.login-alert {
  border-radius: 12px;
  font-size: 13px;
  border: 1px solid rgba(0, 0, 0, .04);
}

.login-form {
  margin: 0;
}

.login-label {
  margin-bottom: 7px;
  font-size: 13px;
  color: var(--text-strong);
}

.input-with-icon {
  position: relative;
}

.input-with-action .password-toggle {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
}

.input-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  color: #9C9C9C;
  pointer-events: none;
  z-index: 2;
  transition: color .16s ease;
}

.input-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.login-input {
  min-height: 50px;
  border-radius: 13px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.98);
  color: var(--text-strong);
  font-size: 16px;
  box-shadow: inset 0 1px 2px rgba(30, 30, 30, 0.02);
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease, transform .12s ease;
}

.login-input::placeholder {
  color: #9C9C9C;
}

.login-input.with-leading-icon {
  padding-left: 42px;
}

.login-input.with-trailing-action {
  padding-right: 46px;
}

.login-input:hover {
  border-color: #CFCFCF;
}

.login-input:focus {
  border-color: rgba(242, 58, 36, 0.62);
  background: #FFFFFF;
  box-shadow:
    0 0 0 3px rgba(242, 58, 36, 0.12),
    0 8px 18px rgba(242, 58, 36, 0.08);
}

.input-with-icon:focus-within .input-icon {
  color: var(--brand-primary-dark);
}

.password-toggle {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  color: #6B6B6B;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color .15s ease, color .15s ease, transform .12s ease;
}

.password-toggle:hover {
  background: rgba(30, 30, 30, 0.05);
  color: var(--text-strong);
}

.password-toggle:active {
  transform: translateY(-50%) scale(0.97);
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  display: block;
}

.login-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 18px;
  flex-wrap: wrap;
}

.remember-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
}

.remember-check .form-check-input {
  margin-top: 0;
  width: 16px;
  height: 16px;
  border-color: #CBCBCB;
  cursor: pointer;
}

.remember-check .form-check-input:checked {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.remember-check .form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(242, 58, 36, 0.14);
}

.remember-check .form-check-label {
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}

.login-help-text {
  font-size: 12px;
  color: #9C9C9C;
}

.login-submit-btn {
  min-height: 50px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(180deg, #F55A47 0%, var(--brand-primary) 100%);
  color: #FFFFFF;
  box-shadow:
    0 10px 22px rgba(242, 58, 36, 0.20),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, filter .15s ease;
}

.login-submit-btn:hover {
  background: linear-gradient(180deg, #F55A47 0%, var(--brand-primary) 100%);
  transform: translateY(-1px);
  box-shadow:
    0 14px 28px rgba(242, 58, 36, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
  filter: saturate(1.02);
}

.login-submit-btn:focus {
  background: linear-gradient(180deg, #F55A47 0%, var(--brand-primary) 100%);
  color: #FFFFFF;
  box-shadow:
    0 0 0 3px rgba(242, 58, 36, 0.14),
    0 12px 24px rgba(242, 58, 36, 0.22);
}

.login-submit-btn:active {
  background: linear-gradient(180deg, #E24430 0%, var(--brand-primary-dark) 100%) !important;
  color: #FFFFFF !important;
  transform: translateY(0) scale(0.992);
  box-shadow: 0 7px 16px rgba(242, 58, 36, 0.18);
  filter: none;
}

.login-submit-btn:disabled,
.login-submit-btn.is-loading {
  opacity: 1;
  cursor: not-allowed;
}

.login-submit-btn.is-loading {
  transform: none;
  box-shadow:
    0 9px 18px rgba(242, 58, 36, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.login-submit-btn .btn-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.login-submit-btn .spinner-border {
  width: 1rem;
  height: 1rem;
  border-width: .14em;
}

.login-dev-hint {
  padding: 14px 16px;
  border: 1px dashed #D2D2D2;
  border-radius: 14px;
  background: rgba(248, 248, 248, 0.92);
  font-size: 12px;
}

.login-dev-title {
  margin-bottom: 10px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .14em;
}

.login-dev-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-muted);
}

.login-dev-row + .login-dev-row {
  margin-top: 7px;
}

.login-dev-row span {
  color: var(--text-strong);
  font-weight: 500;
}

.login-dev-row code {
  font-size: 12px;
  color: var(--brand-primary-dark);
  background: #FFF3F1;
  padding: 4px 8px;
  border-radius: 9px;
}

@keyframes loginCardEnter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.995);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── Responsive layout ── */
@media (max-width: 576px) {
  .login-shell {
    padding: 18px;
  }

  .login-card {
    border-radius: 18px;
  }

  .login-card-body {
    padding: 24px 20px;
  }

  .login-title {
    font-size: 24px;
  }

  .login-brand {
    margin-bottom: 22px;
  }

  .login-brand-logo {
    max-width: 220px;
  }

  .login-meta-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .login-dev-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .dashboard-hero,
  .dashboard-hero-compact {
    padding: 20px 18px;
    border-radius: 18px;
  }

  .dashboard-heading {
    font-size: 26px;
  }

  .dashboard-stat-card,
  .dashboard-action-card {
    padding: 18px 16px;
  }

  .dashboard-stat-card .card-body,
  .dashboard-action-card .card-body,
  .dashboard-stat-card-compact .card-body,
  .dashboard-action-card-compact .card-body {
    padding: 18px 16px;
  }

  .dashboard-stat-top,
  .dashboard-stat-card-compact .dashboard-stat-top {
    margin-bottom: 14px;
  }

  .dashboard-action-title {
    font-size: 16px;
  }

  .operator-dashboard-hero {
    padding: 20px 18px;
    border-radius: 18px;
  }

  .operator-dashboard-heading {
    font-size: 26px;
  }

  .operator-dashboard-action-card .card-body {
    padding: 18px 16px;
  }

  .scanner-hero {
    align-items: flex-start;
    flex-direction: column;
    padding: 20px 18px;
    border-radius: 18px;
  }

  .scanner-capabilities {
    justify-content: flex-start;
  }

  .scanner-heading {
    font-size: 26px;
  }

  .scanner-panel-body {
    padding: 18px;
  }

  .scanner-stage {
    padding: 14px;
  }

  .scanner-stage-frame {
    min-height: 280px;
    border-radius: 18px;
  }

  .scanner-stage-corners {
    inset: 16px;
  }

  .scanner-placeholder {
    padding: 16px 8px;
  }

  .scanner-placeholder-title {
    font-size: 22px;
  }

  .profile-hero {
    padding: 20px 18px;
    border-radius: 18px;
  }

  .profile-heading {
    font-size: 26px;
  }

  .profile-card-body,
  .profile-side-card-body {
    padding: 20px 18px;
  }

  .profile-identity {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .profile-avatar {
    width: 64px;
    height: 64px;
    font-size: 24px;
  }

  .profile-name {
    font-size: 22px;
  }

  .profile-info-value {
    font-size: 16px;
  }

  .profile-notice {
    padding: 14px;
  }

  .manage-users-hero,
  .add-user-hero,
  .edit-user-hero,
  .remove-user-hero {
    align-items: flex-start;
    flex-direction: column;
    padding: 20px 18px;
    border-radius: 18px;
  }

  .manage-users-heading,
  .add-user-heading,
  .edit-user-heading,
  .remove-user-heading {
    font-size: 26px;
  }

  .manage-users-add-btn {
    width: 100%;
    justify-content: center;
  }

  .manage-users-footer {
    align-items: stretch;
    flex-direction: column;
    padding: 14px 16px;
  }

  .manage-users-pagination {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .add-user-card-body,
  .edit-user-card-body,
  .remove-user-card-body {
    padding: 20px 18px;
  }

  .add-user-form-grid,
  .edit-user-form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .add-user-actions,
  .edit-user-actions,
  .remove-user-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .add-user-cancel-btn,
  .add-user-submit-btn,
  .edit-user-cancel-btn,
  .edit-user-submit-btn,
  .remove-user-cancel-btn,
  .remove-user-submit-btn {
    width: 100%;
  }

  .remove-user-alert {
    flex-direction: column;
  }

  .remove-user-meta-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .remove-user-meta-value {
    text-align: left;
  }

  .connection-hero {
    padding: 20px 18px;
    border-radius: 18px;
  }

  .connection-heading {
    font-size: 26px;
  }

  .connection-service-row {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px 18px;
  }

  .connection-service-side {
    width: 100%;
    justify-content: space-between;
  }

  .connection-lib-card-body {
    padding: 18px;
  }

  .connection-lib-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .connection-recheck-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 991.98px) {
  .dashboard-action-arrow,
  .operator-dashboard-action-arrow {
    display: none;
  }
}

@media (max-height: 640px) and (orientation: landscape) {
  .login-shell {
    align-items: flex-start;
    padding-top: 18px;
    padding-bottom: 18px;
  }
}

@media (min-width: 768px) {
  .login-card {
    max-width: 460px;
  }
}
/* ==========================================================================
   Branch multiselect dropdown
   ========================================================================== */

.branch-multiselect {
  position: relative;
}

.branch-multiselect-trigger {
  /* Looks like a form-control but acts as a button */
  cursor: pointer;
  background: #fff;
  height: auto;
  min-height: 38px;
  padding: 6px 12px;
  font-size: 14px;
  color: var(--text-strong);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  transition: border-color 0.15s;
}

.branch-multiselect-trigger:hover,
.branch-multiselect-trigger:focus {
  border-color: var(--brand-primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--brand-primary-soft);
}

.branch-multiselect-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #6c757d;
  font-size: 14px;
}

.branch-multiselect-label.has-value {
  color: var(--text-strong);
}

.branch-multiselect-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  z-index: 200;
  max-height: 240px;
  overflow-y: auto;
  padding: 6px 0;
}

.branch-multiselect-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-strong);
  margin: 0;
  transition: background 0.1s;
}

.branch-multiselect-option:hover {
  background: var(--surface-muted);
}

.branch-multiselect-option input[type=checkbox] {
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--brand-primary);
}

/* ==========================================================================
   Scanner page
   ========================================================================== */

.scanner-btn-primary {
  background: var(--brand-primary);
  color: #fff;
  border: none;
}
.scanner-btn-primary:hover {
  background: var(--brand-primary-dark);
  color: #fff;
}

/* ── Viewfinder ──────────────────────────────────────────────────────────── */

.scanner-viewfinder {
  position: relative;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 4/3;
}

.scanner-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.scanner-viewfinder-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scanner-viewfinder-overlay.detected {
  background: rgba(34, 197, 94, 0.25);
  transition: background 0.2s;
}

/* Corner brackets */
.scanner-corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--brand-primary);
  border-style: solid;
}
.scanner-corner-tl { top: 14px; left: 14px; border-width: 3px 0 0 3px; }
.scanner-corner-tr { top: 14px; right: 14px; border-width: 3px 3px 0 0; }
.scanner-corner-bl { bottom: 14px; left: 14px; border-width: 0 0 3px 3px; }
.scanner-corner-br { bottom: 14px; right: 14px; border-width: 0 3px 3px 0; }

/* ── Preview image ───────────────────────────────────────────────────────── */

.scanner-preview-wrap {
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-muted);
}

.scanner-preview-img {
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  border-radius: 10px;
  display: block;
}

/* ── Status + labels ─────────────────────────────────────────────────────── */

.scanner-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.scanner-status {
  font-size: 12px;
  color: var(--text-muted);
  min-height: 18px;
}

/* ── Copy toast ──────────────────────────────────────────────────────────── */

.scanner-copy-toast {
  display: inline-block;
  font-size: 11px;
  color: var(--success);
  font-weight: 600;
  margin-top: 4px;
}

/* ── Product result card ─────────────────────────────────────────────────── */

.scanner-product-loading {
  padding: 20px;
  color: var(--text-muted);
  font-size: 14px;
  display: flex;
  align-items: center;
}

.scanner-product-card {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.scanner-product-card.scanner-product-notfound {
  border-color: #fcd34d;
  background: #fffbeb;
}

.scanner-product-card.scanner-product-error {
  border-color: #fca5a5;
  background: #fff1f2;
}

.scanner-product-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface-muted);
}

.scanner-product-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-strong);
}

.scanner-product-branch {
  font-size: 11px;
  font-weight: 600;
  background: var(--brand-primary-soft);
  color: var(--brand-primary);
  padding: 2px 8px;
  border-radius: 20px;
}

.scanner-product-body {
  padding: 8px 0;
}

.scanner-product-row {
  display: flex;
  padding: 7px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-soft);
  gap: 12px;
}

.scanner-product-row:last-child {
  border-bottom: none;
}

.scanner-product-key {
  flex: 0 0 200px;
  color: var(--text-muted);
  font-size: 12px;
  word-break: break-word;
}

.scanner-product-value {
  flex: 1;
  color: var(--text-strong);
  word-break: break-word;
}

/* ── Placeholder ─────────────────────────────────────────────────────────── */

.scanner-result-placeholder {
  height: 100%;
  min-height: 300px;
}

/* ==========================================================================
   Login page — forgot password message
   ========================================================================== */

.login-forgot-link {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
}
.login-forgot-link:hover {
  color: var(--brand-primary);
  text-decoration: underline;
}
.login-forgot-message {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.login-forgot-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--text-muted);
}
.login-forgot-text {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* ==========================================================================
   Quagga2 viewport
   Quagga2 renders its own <video> and <canvas> inside #quaggaViewport.
   These rules make both fill the viewfinder correctly.
   ========================================================================== */

/* Container fills the viewfinder */
#quaggaViewport {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Quagga2's own video element */
#quaggaViewport video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Quagga2's detection overlay canvas — sits on top of the video */
#quaggaViewport canvas.drawingBuffer {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}

/* ── Fix: center scanner placeholder content ───────────────────────── */

.scanner-result-placeholder .scanner-panel-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
}

.scanner-placeholder {
  width: 100%;
  margin: 0 auto;
}

.scanner-placeholder-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.scanner-placeholder-title,
.scanner-placeholder-text {
  text-align: center;
}

