/* ========================================================================== 
   RCH OS DESIGN SYSTEM v2.1 — Territory refinements
   Branding, browser icon and responsive two-row command bar.
   ========================================================================== */

.topbar {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  min-height: 116px !important;
  padding: 10px 18px 9px !important;
  gap: 8px !important;
}

.topbar-primary,
.topbar-secondary {
  min-width: 0;
  display: flex;
  align-items: center;
}

.topbar-primary {
  min-height: 56px;
  justify-content: space-between;
  gap: 18px;
}

.topbar-secondary {
  min-height: 40px;
  gap: 9px;
  padding-top: 7px;
  border-top: 1px solid rgba(255,255,255,.09);
}

.brand-block {
  min-width: 246px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 12px !important;
  flex: 0 0 auto;
  color: inherit;
  text-decoration: none;
}

.brand-logo {
  width: 54px;
  height: 54px;
  display: block;
  flex: 0 0 54px;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0, 111, 255, .25));
}

.brand-copy { min-width: 0; }
.brand-copy h1 { line-height: 1.02 !important; }
.brand-copy p { white-space: nowrap; }

.topbar-middle {
  min-width: 0 !important;
  display: flex !important;
  justify-content: flex-end !important;
  flex: 1 1 auto !important;
}

.auth-box {
  width: auto !important;
  max-width: min(820px, 68vw);
  min-width: 0;
  justify-content: flex-end;
  flex-wrap: nowrap !important;
}

#authStatus {
  max-width: 390px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-status-group,
.topbar-module-nav,
.topbar-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.topbar-status-group { flex: 0 1 auto; }
.topbar-module-nav { flex: 0 0 auto; }
.topbar-actions {
  margin-left: auto;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.topbar .module-button {
  color: #e9fbff !important;
  border-color: rgba(92, 226, 239, .33) !important;
  background: linear-gradient(135deg, rgba(20,184,199,.24), rgba(35,135,255,.19)) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08) !important;
}

.topbar .module-button:hover {
  border-color: rgba(92,226,239,.58) !important;
  background: linear-gradient(135deg, rgba(20,184,199,.34), rgba(35,135,255,.27)) !important;
}

.detail-empty-card {
  min-height: 146px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  background:
    radial-gradient(circle at 95% 0%, rgba(35,135,255,.10), transparent 42%),
    #fff !important;
}

.detail-empty-icon {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  color: #0d6efd;
  border: 1px solid #cfe0fb;
  border-radius: 12px;
  background: #f1f7ff;
}

.detail-empty-icon svg { width: 19px; height: 19px; }
.section-kicker {
  margin: 0 0 5px !important;
  color: #0d6efd !important;
  font-size: 9px !important;
  font-weight: 900 !important;
  letter-spacing: .105em !important;
}

@media (max-width: 1500px) {
  .topbar { padding-inline: 14px !important; }
  .topbar .btn {
    min-height: 36px !important;
    padding: 7px 9px !important;
    font-size: 12px !important;
  }
  .topbar .btn span { display: inline !important; }
  .status-pill { padding-inline: 9px !important; }
  #authStatus { max-width: 300px; }
}

@media (max-width: 1220px) {
  .topbar-secondary {
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 3px;
    scrollbar-width: thin;
  }
  .topbar-secondary > * { flex: 0 0 auto; }
  .topbar-actions { margin-left: 0; flex-wrap: nowrap; }
  .topbar-primary { align-items: flex-start; }
  .auth-box { max-width: calc(100vw - 330px); }
  #authStatus { max-width: 230px; }
}

@media (max-width: 860px) {
  .topbar { min-height: 0 !important; }
  .topbar-primary {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .brand-block { min-width: 0 !important; }
  .brand-logo { width: 48px; height: 48px; flex-basis: 48px; }
  .topbar-middle,
  .auth-box { width: 100% !important; max-width: none; justify-content: flex-start !important; }
  .auth-box { overflow-x: auto; }
  #authStatus { max-width: 52vw; }
}

@media (max-width: 560px) {
  .brand-logo { width: 44px; height: 44px; flex-basis: 44px; }
  .brand-copy h1 { font-size: 18px !important; }
  .brand-copy p { max-width: 250px; }
  .topbar .btn span { display: none !important; }
  .topbar .module-button span,
  .topbar .btn.primary span { display: inline !important; }
  .auth-box input { width: 132px !important; flex: 0 0 132px; }
}
