/* ─── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── Theme Variables ────────────────────────────────────────────────────────
   Dark  = default  |  [data-theme="light"] overrides follow
   ─────────────────────────────────────────────────────────────────────────── */
:root {
  --navy:       #011F43;
  --navy-mid:   #071E3D;
  --navy-light: #0A2550;
  --blue:       #009DEB;
  --cyan:       #83EFF8;
  --purple:     #4C35A8;
  --green:      #05D773;
  --red:        #E53E3E;
  --amber:      #FFC000;
  --font:       'Arial', sans-serif;

  /* semantic tokens — dark */
  --bg:          #011F43;
  --bg-card:     #071E3D;
  --bg-input:    #0A2550;
  --bg-row-alt:  #0A2550;
  --bg-inset:    rgba(0,0,0,0.20);
  --border:      rgba(0,157,235,0.20);
  --border-input:rgba(0,157,235,0.30);
  --text-primary:  #FFFFFF;
  --text-secondary:#A0AEC0;
  --text-muted:    #4A5568;
  --text-link:     #009DEB;
  --shadow:      0 4px 24px rgba(0,0,0,0.40);
  --navbar-bg:   #071E3D;
  --navbar-border:#009DEB;

  --radius:    8px;
  --radius-lg: 14px;
}

[data-theme="light"] {
  --bg:          #F0F4F8;
  --bg-card:     #FFFFFF;
  --bg-input:    #EDF2F7;
  --bg-row-alt:  #F7FAFC;
  --bg-inset:    rgba(0,0,0,0.04);
  --border:      rgba(0,100,180,0.18);
  --border-input:rgba(0,100,180,0.30);
  --text-primary:  #011F43;
  --text-secondary:#4A5568;
  --text-muted:    #A0AEC0;
  --text-link:     #0070C0;
  --shadow:      0 4px 20px rgba(0,0,0,0.10);
  --navbar-bg:   #011F43;
  --navbar-border:#009DEB;
}

/* ─── Base ──────────────────────────────────────────────────────────────────── */
html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  transition: background 0.25s, color 0.25s;
}

/* ─── Navbar ────────────────────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 56px;
  background: var(--navbar-bg);
  border-bottom: 2px solid var(--navbar-border);
}

.nav-brand { display: flex; align-items: center; gap: 0.65rem; }

.nav-logo-img {
  height: 30px;
  width: auto;
  display: block;
  object-fit: contain;
  /* White logo works on both dark navbar states */
  filter: brightness(0) invert(1);
}

.nav-title {
  font-size: 16px; font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
  display: none;   /* wordmark now in logo image */
}

.nav-right { display: flex; align-items: center; gap: 0.25rem; }

.nav-links { display: flex; gap: 0.25rem; }

.nav-link {
  padding: 0.4rem 1rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 14px; font-weight: 500;
  color: rgba(255,255,255,0.6);
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover  { color: #fff; background: rgba(255,255,255,0.10); }
.nav-link.active { color: var(--cyan); background: rgba(131,239,248,0.12); }
button.nav-link  { background: none; border: none; cursor: pointer; }

/* ─── Theme Toggle Button ───────────────────────────────────────────────────── */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  cursor: pointer;
  color: rgba(255,255,255,0.75);
  font-size: 16px;
  transition: background 0.15s, transform 0.2s;
  flex-shrink: 0;
}
.theme-toggle:hover { background: rgba(255,255,255,0.16); color: #fff; }
.theme-toggle:active { transform: scale(0.92); }
/* icons: sun shown in dark mode, moon shown in light mode */
.icon-sun  { display: inline; }
.icon-moon { display: none; }
[data-theme="light"] .icon-sun  { display: none; }
[data-theme="light"] .icon-moon { display: inline; }

/* ─── Main Layout ───────────────────────────────────────────────────────────── */
.main-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 2rem;
}

.page-header { margin-bottom: 1.5rem; }

.page-header h1 {
  font-size: 28px; font-weight: 800;
  color: var(--text-primary);
}

.subtitle {
  margin-top: 0.3rem;
  font-size: 14px;
  color: var(--text-secondary);
}

/* ─── Cards ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  transition: background 0.25s, border-color 0.25s;
}

.card-title {
  font-size: 18px; font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--blue);
}

/* ─── Form ──────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.5rem; }

.form-group label {
  display: block;
  font-size: 13px; font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 0.45rem;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"] {
  width: 100%;
  padding: 0.7rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.25s;
}

.form-group input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,157,235,0.18);
}

.field-hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Row that holds the token input + Launch Monarch button side by side */
.jwt-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.jwt-row .token-input-wrap { flex: 1; min-width: 0; }

/* Flex wrapper styled to look like an input — button sits outside the text area */
.token-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.token-input-wrap:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,157,235,0.18);
}
.token-input-wrap input {
  flex: 1;
  min-width: 0;
  padding-right: 0.5rem !important;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  border-radius: var(--radius) 0 0 var(--radius);
}
.token-input-wrap input:focus {
  border: none !important;
  box-shadow: none !important;
}

.toggle-visibility {
  flex-shrink: 0;
  background: none; border: none; cursor: pointer;
  color: var(--text-secondary);
  padding: 0.25rem 0.6rem;
  display: flex; align-items: center;
  transition: color 0.15s;
}
.toggle-visibility:hover { color: var(--blue); }
.toggle-visibility svg { width: 18px; height: 18px; display: block; }

/* ─── Data Sources ──────────────────────────────────────────────────────────── */

.sources-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.source-item { display: flex; align-items: center; gap: 0.75rem; }

.source-icon {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: 8px;
  font-size: 13px; font-weight: 900;
  flex-shrink: 0;
}
.source-icon.nebula    { background: rgba(0,157,235,0.15);  color: var(--blue); }
.source-icon.zendesk   { background: rgba(5,215,115,0.15);  color: var(--green); }
.source-icon.gainsight { background: rgba(76,53,168,0.20);  color: #9B8EDD; }
.source-icon.jira      { background: rgba(131,239,248,0.15);color: var(--cyan); }

.source-item strong { display: block; font-size: 13px; color: var(--text-primary); }
.source-item small  { display: block; font-size: 11px; color: var(--text-secondary); }

/* ─── Info modal ─────────────────────────────────────────────────────────────── */
.info-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: flex-start; justify-content: flex-end;
  padding: 4rem 1.5rem 0;
  z-index: 1000;
}
.info-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  width: 320px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.info-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}
.info-modal-header h3 {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-secondary);
  margin: 0;
}
.info-modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-secondary); font-size: 14px; padding: 0.1rem 0.3rem;
  border-radius: 4px; line-height: 1;
}
.info-modal-close:hover { color: var(--text-primary); background: rgba(255,255,255,0.08); }

/* ─── Buttons ───────────────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center; justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.8rem 1.5rem;
  background: var(--blue);
  color: #fff;
  font-size: 15px; font-weight: 700;
  font-family: var(--font);
  border: none; border-radius: var(--radius);
  cursor: pointer; text-decoration: none;
  transition: background 0.15s, transform 0.1s;
}
.btn-primary:hover   { background: #007FC0; }
.btn-primary:active  { transform: scale(0.99); }
.btn-primary:disabled{ background: var(--text-muted); cursor: not-allowed; }

.btn-download {
  margin-top: 1.2rem;
  font-size: 16px; padding: 0.9rem 2rem;
  background: var(--green); color: var(--navy);
}
.btn-download:hover { background: #04BC64; }

.btn-secondary {
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid var(--border-input);
  border-radius: var(--radius);
  color: var(--blue);
  font-size: 13px; font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-secondary:hover { background: rgba(0,157,235,0.10); border-color: var(--blue); }

.btn-monarch {
  flex-shrink: 0;
  padding: 0.55rem 1rem;
  background: transparent;
  border: 1px solid var(--border-input);
  border-radius: var(--radius);
  color: var(--blue);
  font-size: 13px; font-family: var(--font);
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-monarch:hover:not(:disabled) { background: rgba(0,157,235,0.10); border-color: var(--blue); }
.btn-monarch:disabled { color: var(--text-muted); border-color: var(--border); cursor: not-allowed; }
.btn-find-token { display: inline-flex; align-items: center; gap: 0.4rem; }

.find-token-sso-banner {
  margin-top: 0.5rem;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius);
  background: rgba(255, 193, 7, 0.15);
  border: 1px solid rgba(255, 193, 7, 0.5);
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.btn-danger {
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid rgba(229,62,62,0.50);
  border-radius: var(--radius);
  color: var(--red);
  font-size: 13px; font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  display: inline-flex; align-items: center; gap: 0.35rem;
}
.btn-danger:hover { background: rgba(229,62,62,0.12); border-color: var(--red); }
.btn-danger:disabled { opacity: 0.5; cursor: not-allowed; }

/* ─── Spinner ───────────────────────────────────────────────────────────────── */
.spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Result Card ───────────────────────────────────────────────────────────── */
.result-card { text-align: center; }

.result-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px;
  border-radius: 50%;
  font-size: 26px; font-weight: 700;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.result-title-row {
  display: flex; align-items: center; justify-content: center;
  gap: 0.75rem; margin-bottom: 0.75rem;
}
.result-title-row .result-icon { margin-bottom: 0; }
.result-title-row h2 { margin-bottom: 0; }
.result-icon.success { background: rgba(5,215,115,0.15); color: var(--green); }
.result-icon.error   { background: rgba(229,62,62,0.15);  color: var(--red); }

.result-card h2 { font-size: 22px; margin-bottom: 0.5rem; color: var(--text-primary); }

.result-filename {
  font-size: 13px; color: var(--text-secondary);
  margin-bottom: 1.2rem; word-break: break-all;
}

.source-status-grid {
  display: flex; justify-content: center;
  gap: 0.6rem; flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.source-badge {
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  font-size: 11.5px; font-weight: 600;
}
.source-badge.ok  { background: rgba(5,215,115,0.12); color: var(--green); border: 1px solid rgba(5,215,115,0.30); }
.source-badge.err { background: rgba(229,62,62,0.12);  color: #FC8181;     border: 1px solid rgba(229,62,62,0.30); }

.result-meta  { margin-top: 0.75rem; font-size: 11.5px; color: var(--text-muted); }
.error-message{ color: #FC8181; font-size: 14px; margin-top: 0.5rem; }

/* ─── History Page ──────────────────────────────────────────────────────────── */
.history-toolbar {
  display: flex; gap: 0.75rem;
  margin-bottom: 1.5rem; align-items: center;
}

.search-input {
  flex: 1;
  padding: 0.6rem 0.9rem;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 13.5px; font-family: var(--font);
  outline: none;
  transition: border-color 0.15s;
}
.search-input:focus { border-color: var(--blue); }

.history-table { width: 100%; border-collapse: collapse; }

.history-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.history-table td {
  padding: 0.8rem 0.75rem;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-primary);
}

.history-table tr:nth-child(even) td { background: var(--bg-row-alt); }
.history-table tr:hover td { background: rgba(0,157,235,0.06); }

.history-table .date-cell     { color: var(--text-secondary); font-size: 12px; }
.history-table .duration-cell { color: var(--text-muted);     font-size: 12px; }

.sources-mini { display: flex; gap: 4px; flex-wrap: wrap; }

.src-dot {
  width: 8px; height: 8px;
  border-radius: 50%; flex-shrink: 0;
}
.src-dot.ok  { background: var(--green); }
.src-dot.err { background: var(--red); }

.download-btn {
  padding: 0.35rem 0.8rem;
  background: transparent;
  border: 1px solid var(--border-input);
  border-radius: 6px;
  color: var(--blue);
  font-size: 12px; font-family: var(--font);
  cursor: pointer; text-decoration: none;
  transition: background 0.15s;
  white-space: nowrap;
}
.download-btn:hover { background: rgba(0,157,235,0.10); }

.empty-state, .loading-state {
  text-align: center; padding: 3rem 1rem;
  color: var(--text-secondary);
}

.loading-state .spinner {
  margin: 0 auto 1rem;
  width: 28px; height: 28px; border-width: 3px;
  border-color: rgba(0,157,235,0.3);
  border-top-color: var(--blue);
}

.empty-icon { font-size: 40px; margin-bottom: 0.75rem; }

/* ─── Light mode adjustments ────────────────────────────────────────────────── */
[data-theme="light"] .loading-state .spinner {
  border-color: rgba(0,100,180,0.2);
  border-top-color: var(--blue);
}

[data-theme="light"] .btn-download { color: #011F43; }

/* ─── MFA modal ─────────────────────────────────────────────────────────────── */
.mfa-modal-overlay {
  align-items: center;
  justify-content: center;
  padding: 0;
}

.mfa-modal {
  width: 360px;
  max-width: calc(100vw - 2rem);
}

.mfa-modal-hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.mfa-modal-actions {
  margin-top: 0.25rem;
  margin-bottom: 0.75rem;
}

.mfa-modal-actions .btn-primary {
  padding: 0.7rem 1.5rem;
  font-size: 14px;
}

/* ─── OneView auth steps ────────────────────────────────────────────────────── */
.ov-section-header {
  margin-bottom: 1rem;
}

.ov-step-block {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  margin-top: 1rem;
}

/* ─── User Impersonation box ────────────────────────────────────────────────── */
#ovStep3 {
  border: 1px solid var(--border-input);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.25rem 0.5rem;
  margin-top: 1.25rem;
  background: var(--bg-inset);
}

.ov-action-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 0.25rem;
  margin-bottom: 1rem;
}

.ov-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 140px;
  justify-content: center;
}

.ov-error {
  font-size: 12px;
  color: var(--red);
}

.ov-error.ov-warn {
  color: var(--amber);
  font-weight: 600;
}

/* ─── OneView auth banner ───────────────────────────────────────────────────── */
.ov-auth-banner {
  display: flex; align-items: center; gap: 0.5rem;
  margin-bottom: 1rem; padding: 0.4rem 0.75rem;
  background: rgba(5,215,115,0.10);
  border: 1px solid rgba(5,215,115,0.30);
  border-radius: 6px; font-size: 13px;
}

.ov-reauth-btn {
  margin-left: auto;
  background: none; border: none;
  color: var(--text-secondary); font-size: 12px;
  cursor: pointer; padding: 0;
  text-decoration: underline;
  white-space: nowrap;
}
.ov-reauth-btn:hover { color: var(--text-primary); }

.ov-contact-search { margin-bottom: 0.5rem; }

/* ─── OneView contact picker ────────────────────────────────────────────────── */
.ov-contacts-list {
  border: 1px solid var(--border-input);
  border-radius: var(--radius);
  max-height: 260px;
  overflow-y: auto;
  margin-top: 0.3rem;
}

.ov-contact-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.9rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.ov-contact-item:last-child  { border-bottom: none; }
.ov-contact-item:hover       { background: rgba(0,157,235,0.08); }
.ov-contact-item.selected    { background: rgba(0,157,235,0.15); }

.ov-contact-info { flex: 1; min-width: 0; }

.ov-contact-name {
  font-size: 13px; font-weight: 600;
  color: var(--text-primary);
}
.ov-contact-email {
  font-size: 11.5px; color: var(--text-secondary);
  margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ov-contact-account {
  font-size: 11px; color: var(--text-muted);
  margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.ov-role-badge {
  flex-shrink: 0;
  font-size: 10.5px; font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 10px;
  background: rgba(76,53,168,0.20);
  color: #9B8EDD;
  white-space: nowrap;
  letter-spacing: 0.2px;
}
.ov-role-badge.admin {
  background: rgba(0,157,235,0.15);
  color: var(--blue);
}

/* Scrollbar for contact list */
.ov-contacts-list::-webkit-scrollbar { width: 5px; }
.ov-contacts-list::-webkit-scrollbar-track { background: transparent; }
.ov-contacts-list::-webkit-scrollbar-thumb {
  background: rgba(0,157,235,0.35);
  border-radius: 3px;
}

/* ─── Nav user badge ────────────────────────────────────────────────────────── */
.nav-user {
  display: flex; align-items: center; gap: 0.6rem;
  margin-right: 0.5rem;
}

.nav-user-name {
  font-size: 13px; font-weight: 500;
  color: rgba(255,255,255,0.65);
  white-space: nowrap;
  max-width: 160px; overflow: hidden; text-overflow: ellipsis;
}

.nav-logout-btn {
  padding: 0.3rem 0.75rem;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.20);
  border-radius: var(--radius);
  color: rgba(255,255,255,0.55);
  font-size: 12px; font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.nav-logout-btn:hover {
  background: rgba(229,62,62,0.15);
  border-color: rgba(229,62,62,0.45);
  color: #FC8181;
}

/* ─── Utilities ─────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

@media (max-width: 540px) {
  .main-content { padding: 1.5rem 1rem 3rem; }
  .history-table th:nth-child(3),
  .history-table td:nth-child(3) { display: none; }
}

/* ─── Combo / Searchable Picklist ─────────────────────────────────────────── */
.combo-wrap {
  position: relative;
}

.combo-input-row {
  display: flex;
  align-items: center;
  position: relative;
}

.combo-input {
  width: 100%;
  padding: 0.7rem 3.2rem 0.7rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.25s;
}
.combo-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,157,235,0.18);
}
.combo-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.combo-status {
  position: absolute;
  right: 2.4rem;
  font-size: 10px;
  color: var(--text-muted);
  pointer-events: none;
  white-space: nowrap;
}

.combo-clear {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 12px;
  padding: 0.25rem 0.4rem;
  line-height: 1;
  border-radius: 4px;
  transition: background 0.12s, color 0.12s;
}
.combo-clear:hover { background: rgba(229,62,62,0.15); color: var(--red); }

/* Dropdown */
.combo-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 200;
  list-style: none;
  background: var(--bg-card);
  border: 1px solid var(--blue);
  border-radius: var(--radius);
  max-height: 280px;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
  padding: 0.25rem 0;
}

.combo-option {
  padding: 0.55rem 1rem;
  font-size: 13.5px;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: 4px;
  margin: 0 0.25rem;
  transition: background 0.1s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.combo-option:hover,
.combo-option.active {
  background: rgba(0,157,235,0.18);
  color: var(--white);
}
.combo-option mark {
  background: #009DEB;
  color: #FFFFFF;
  font-weight: 700;
  border-radius: 2px;
  padding: 0 2px;
}
[data-theme="light"] .combo-option mark {
  background: #005f8e;
  color: #FFFFFF;
}

.combo-no-results,
.combo-hint {
  padding: 0.55rem 1rem;
  font-size: 12px;
  color: var(--text-muted);
  cursor: default;
  pointer-events: none;
  font-style: italic;
}

.combo-hint {
  border-top: 1px solid var(--border);
  margin-top: 0.25rem;
  padding-top: 0.4rem;
}

/* Loading & error inline states */
.combo-loading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
}

.combo-error {
  padding: 0.4rem 0;
  font-size: 12px;
  color: var(--red);
}

.spinner-sm {
  width: 14px;
  height: 14px;
  border-width: 2px;
  flex-shrink: 0;
}

/* Selected company badge (below input after selection) */
.combo-selected {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.45rem;
  padding: 0.4rem 0.75rem;
  background: rgba(5,215,115,0.10);
  border: 1px solid rgba(5,215,115,0.30);
  border-radius: 6px;
  font-size: 13px;
}

.selected-icon {
  color: var(--green);
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.combo-selected > span:nth-child(2) {
  color: var(--text-primary);
  font-weight: 600;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-gsid {
  font-size: 10.5px !important;
  color: var(--text-muted) !important;
  font-weight: normal !important;
  flex-shrink: 0;
}

/* Scrollbar styling for dropdown */
.combo-dropdown::-webkit-scrollbar { width: 5px; }
.combo-dropdown::-webkit-scrollbar-track { background: transparent; }
.combo-dropdown::-webkit-scrollbar-thumb {
  background: rgba(0,157,235,0.35);
  border-radius: 3px;
}

/* ─── Combo name + territory badge ──────────────────────────────────────── */
.combo-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combo-territory {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 10px;
  background: #009DEB;
  color: #FFFFFF;
  white-space: nowrap;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
[data-theme="light"] .combo-territory {
  background: #005f8e;
  color: #FFFFFF;
}

/* ── Language selector ─────────────────────────────────────────────────────── */
.language-select-wrap {
  position: relative;
  display: inline-block;
  width: 100%;
}

.language-select {
  width: 100%;
  padding: 0.65rem 2.4rem 0.65rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23009DEB' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.language-select:hover {
  border-color: var(--accent);
}

.language-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 157, 235, 0.18);
}

.language-select option {
  background: var(--surface);
  color: var(--text);
  padding: 0.4rem;
}
