/* Karam Al Arab — как на https://karam-alarab.com/ru */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

.theme-karam {
  --bg: #f0f4fa;
  --bg-elevated: #ffffff;
  --panel: #ffffff;
  --panel-hover: #f8fafc;
  --border: rgba(23, 105, 255, 0.14);
  --border-strong: rgba(20, 50, 198, 0.35);
  --copper: #1769ff;
  --copper-light: #1432c6;
  --copper-dim: rgba(23, 105, 255, 0.08);
  --text: #1e293b;
  --text-muted: #64748b;
  --ok: #16a34a;
  --warn: #d97706;
  --info: #1769ff;
  --danger: #dc2626;
  --shadow: 0 8px 32px rgba(20, 50, 198, 0.08);
  --font-display: 'Montserrat', system-ui, sans-serif;
  --font-ui: 'Montserrat', system-ui, sans-serif;
}

.theme-karam body {
  background: var(--bg);
  color: var(--text);
}

.theme-karam body::before {
  background:
    radial-gradient(ellipse 80% 60% at 100% 0%, rgba(148, 192, 255, 0.35), transparent 55%),
    radial-gradient(ellipse 60% 50% at 0% 100%, rgba(23, 105, 255, 0.08), transparent 50%);
}

.theme-karam .login-page {
  background: linear-gradient(160deg, #ecf1f8 0%, #f8fafc 45%, #e8f0fe 100%);
}

.theme-karam .login-card {
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.theme-karam .login-brand h1 {
  display: none;
}

.theme-karam .brand-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.theme-karam .brand-logo img {
  height: 42px;
  width: auto;
  max-width: 280px;
}

.theme-karam .login-brand .brand-tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.theme-karam .login-badge {
  background: var(--copper-dim);
  border-color: var(--border);
  color: var(--copper-light);
}

.theme-karam .field input,
.theme-karam .field select,
.theme-karam .admin-toolbar input,
.theme-karam .admin-toolbar select {
  background: #f8fafc;
  border: 1px solid #dbe4f0;
  color: var(--text);
}

.theme-karam .field input::placeholder,
.theme-karam .admin-toolbar input::placeholder {
  color: #94a3b8;
}

.theme-karam .field input:focus,
.theme-karam .admin-toolbar input:focus,
.theme-karam .admin-toolbar select:focus {
  border-color: var(--copper);
  box-shadow: 0 0 0 3px rgba(23, 105, 255, 0.12);
}

.theme-karam .btn-primary {
  background: linear-gradient(135deg, #1769ff 0%, #1432c6 100%);
  color: #fff;
  font-weight: 600;
}

.theme-karam .btn-ghost {
  border-color: #dbe4f0;
  color: var(--text-muted);
  background: #fff;
}

.theme-karam .btn-ghost:hover {
  border-color: var(--copper);
  color: var(--copper-light);
}

.theme-karam .login-hint {
  background: #f0f6ff;
  border: 1px solid var(--border);
}

.theme-karam .login-hint strong {
  color: var(--copper-light);
}

.theme-karam .portal-header {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 2px 12px rgba(20, 50, 198, 0.06);
}

.theme-karam .portal-header .brand-logo img {
  height: 36px;
}

.theme-karam .portal-logo {
  display: none;
}

.theme-karam .portal-sub {
  color: var(--text-muted);
  font-weight: 600;
}

.theme-karam .source-tag.sheets {
  background: rgba(23, 105, 255, 0.1);
  color: #1432c6;
  border: 1px solid rgba(23, 105, 255, 0.2);
}

.theme-karam .source-tag.onec {
  background: rgba(22, 163, 74, 0.1);
  color: #16a34a;
}

.theme-karam .stat-card {
  background: #fff;
  border: 1px solid #e8eef5;
  box-shadow: 0 2px 8px rgba(20, 50, 198, 0.04);
}

.theme-karam .stat-card .value {
  color: var(--copper-light);
  font-weight: 700;
}

.theme-karam .section-head h2 {
  color: #0f172a;
  font-weight: 700;
}

.theme-karam .sheet-table-wrap--compact {
  background: #fff;
  border: 1px solid #e2e8f0;
}

.theme-karam .sheet-table--compact th {
  background: #f1f5f9;
  color: #475569;
  border-bottom: 1px solid #e2e8f0;
}

.theme-karam .sheet-table--compact td {
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}

.theme-karam .sheet-row:hover td {
  background: #f8fbff;
}

.theme-karam .sheet-row.is-open td {
  background: #eff6ff;
}

.theme-karam .cell-empty {
  color: #cbd5e1;
}

.theme-karam .cell-num {
  color: #0f172a;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.theme-karam .cell-date {
  color: #334155;
}

.theme-karam .cell-inv {
  color: #1432c6;
}

.theme-karam .expand-icon {
  color: #1769ff;
}

.theme-karam .badge-delivered {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
}

.theme-karam .badge-transit {
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
}

.theme-karam .badge-customs {
  background: rgba(23, 105, 255, 0.12);
  color: #1432c6;
}

.theme-karam .badge-departed {
  background: rgba(148, 192, 255, 0.25);
  color: #1432c6;
}

.theme-karam .row-detail td {
  background: #f8fafc;
}

.theme-karam .row-detail-panel {
  border-top: 1px solid #e2e8f0;
}

.theme-karam .integration-note {
  background: #fff;
  border: 1px solid #e2e8f0;
  color: var(--text-muted);
}

.theme-karam .integration-note a {
  color: #1769ff;
}

.theme-karam .integration-note h4 {
  color: #0f172a;
}

.theme-karam .sheet-table tr.row-delivered td { background: rgba(22, 163, 74, 0.04); }
.theme-karam .sheet-table tr.row-customs td { background: rgba(23, 105, 255, 0.04); }
.theme-karam .sheet-table tr.row-in_transit td { background: rgba(217, 119, 6, 0.04); }

/* —— Mobile / Web App —— */
.theme-karam {
  -webkit-tap-highlight-color: transparent;
}

.theme-karam .field input,
.theme-karam .admin-toolbar input,
.theme-karam .admin-toolbar select {
  font-size: 16px;
}

.theme-karam .btn-icon {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  font-size: 1.2rem;
  line-height: 1;
}

.theme-karam .btn-logout {
  font-size: 1rem;
}

.mobile-cards {
  display: none;
  flex-direction: column;
  gap: 10px;
}

.mobile-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 14px 12px;
  box-shadow: 0 2px 8px rgba(20, 50, 198, 0.05);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.mobile-card:active {
  transform: scale(0.99);
}

.mobile-card.is-open {
  border-color: rgba(23, 105, 255, 0.35);
  box-shadow: 0 4px 16px rgba(23, 105, 255, 0.1);
}

.mobile-card-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.mobile-card-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.mobile-inv {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1432c6;
}

.mobile-date {
  font-size: 0.75rem;
  color: #64748b;
  white-space: nowrap;
}

.mobile-badge {
  align-self: flex-start;
  max-width: 100%;
  white-space: normal;
  line-height: 1.35;
  font-size: 0.72rem;
}

.mobile-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin: 0;
}

.mobile-card-grid > div {
  min-width: 0;
}

.mobile-card-grid dt {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-bottom: 2px;
}

.mobile-card-grid dd {
  margin: 0;
  font-size: 0.82rem;
  color: #334155;
  word-break: break-word;
}

.mobile-card-hint {
  margin: 10px 0 0;
  font-size: 0.72rem;
  color: #94a3b8;
  text-align: center;
}

.mobile-card-detail {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.mobile-card-detail .row-detail-panel {
  padding: 0;
  border: none;
}

.mobile-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: #64748b;
}

.hidden-mobile {
  display: none !important;
}

.is-mobile .mobile-cards {
  display: flex;
}

.is-mobile .sheet-table-wrap--desktop {
  display: none !important;
}

.is-mobile .portal-main {
  padding: 12px 12px calc(20px + env(safe-area-inset-bottom));
  max-width: none;
}

.is-mobile .portal-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 10px 12px;
  padding-top: calc(10px + env(safe-area-inset-top));
  flex-wrap: wrap;
  gap: 8px;
}

.is-mobile .portal-header-left {
  flex: 1;
  min-width: 0;
  gap: 8px;
}

.is-mobile .portal-header-left .brand-logo img {
  height: 28px;
  max-width: 160px;
}

.is-mobile .portal-sub {
  display: none;
}

.is-mobile .source-tags--desktop {
  display: none;
}

.is-mobile .portal-header-right {
  gap: 6px;
}

.is-mobile .stats-row {
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.is-mobile .stat-card {
  padding: 0.85rem 0.9rem;
}

.is-mobile .stat-card .value {
  font-size: 1.45rem;
}

.is-mobile .section-head {
  margin-bottom: 0.75rem;
}

.is-mobile .section-head h2 {
  font-size: 1.1rem;
}

.is-mobile .section-head p {
  font-size: 0.75rem;
}

.is-mobile .admin-toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.is-mobile .admin-toolbar input[type="search"] {
  grid-column: 1 / -1;
}

.is-mobile .integration-note {
  font-size: 0.75rem;
  padding: 12px;
  margin-top: 8px;
}

.is-mobile .login-page {
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

.is-mobile .login-card {
  padding: 1.75rem 1.25rem;
  max-width: none;
}

.is-mobile .brand-logo img {
  height: 36px;
}

@media (max-width: 768px) {
  .theme-karam .portal-main {
    padding: 12px 12px calc(20px + env(safe-area-inset-bottom));
  }
}

@media (min-width: 769px) {
  .mobile-cards {
    display: none !important;
  }

  .theme-karam .btn-icon#refreshBtn::after {
    content: ' Обновить';
    font-size: 0.8rem;
  }

  .theme-karam .btn-icon#logoutBtn::after {
    content: ' Выйти';
    font-size: 0.8rem;
  }

  .theme-karam .btn-icon {
    min-width: auto;
    padding: 0.65rem 1rem;
    gap: 0.35rem;
  }
}

/* Admin tabs + readable tables */
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.admin-tab {
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  border: 1px solid #dbe4f0;
  background: #fff;
  color: #475569;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.admin-tab.is-active {
  background: linear-gradient(135deg, #1769ff 0%, #1432c6 100%);
  border-color: #1432c6;
  color: #fff;
}

.admin-tab[hidden] {
  display: none !important;
}

.admin-panel.hidden {
  display: none !important;
}

#partnersPanel .partner-table-wrap.hidden,
.sheet-table-wrap--desktop.hidden,
#partnerMobileCards.hidden,
#mobileCards.hidden,
#mainToolbar.hidden {
  display: none !important;
}

.col-check {
  width: 42px;
  text-align: center;
}

.col-actions {
  white-space: nowrap;
}

.btn-sm {
  padding: 0.35rem 0.65rem !important;
  font-size: 0.72rem !important;
  min-height: auto;
}

.access-pass {
  font-size: 0.85rem;
  background: #f1f5f9;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  margin-right: 0.35rem;
}

.access-pass-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.access-pass-row input {
  flex: 1;
}

.air-toolbar {
  margin-top: 0.25rem;
}

.air-mobile-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.air-mobile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.partner-table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(20, 50, 198, 0.04);
}

.partner-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.partner-table th {
  text-align: left;
  padding: 11px 12px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.partner-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: top;
}

.partner-table tr:hover td {
  background: #f8fbff;
}

.sheet-table-wrap--readable,
.partner-table-wrap {
  overflow-x: auto;
}

.sheet-table--readable th,
.sheet-table--readable td {
  white-space: normal;
  vertical-align: top;
  line-height: 1.45;
}

.sheet-table--readable .col-date {
  width: 88px;
  min-width: 88px;
  white-space: nowrap;
}

.sheet-table--readable .col-inv {
  min-width: 88px;
}

.sheet-table--readable .col-supplier {
  min-width: 140px;
  max-width: 220px;
}

.sheet-table--readable .col-cont {
  min-width: 120px;
  max-width: 200px;
}

.sheet-table--readable .col-status-full {
  min-width: 200px;
  max-width: 360px;
}

.sheet-table--readable .col-info {
  min-width: 120px;
  max-width: 240px;
}

.sheet-table--readable .col-driver {
  min-width: 110px;
  max-width: 180px;
}

.col-brand {
  font-weight: 700;
  color: #1432c6;
  white-space: nowrap;
}

.col-stage {
  min-width: 110px;
  white-space: nowrap;
}

.col-stage--editable {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  white-space: normal;
}

.stage-edit-btn {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 1px solid rgba(23, 105, 255, 0.25);
  border-radius: 6px;
  background: #fff;
  color: #1769ff;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
}

.stage-edit-btn:hover {
  background: rgba(23, 105, 255, 0.08);
}

.stage-edit-btn--mobile {
  margin-top: 0.35rem;
}

.badge-edited {
  box-shadow: inset 0 0 0 1px rgba(23, 105, 255, 0.45);
}

.stage-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.stage-modal.hidden {
  display: none !important;
}

.stage-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.stage-modal__card {
  position: relative;
  width: min(520px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
  padding: 1.25rem 1.35rem 1.35rem;
}

.stage-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.stage-modal__head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.stage-modal__meta {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
}

.stage-modal__hint {
  margin: 0 0 1rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: #f1f5f9;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #334155;
  white-space: pre-wrap;
}

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

.stage-modal__note {
  margin: 0.75rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
  line-height: 1.45;
}

.stage-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

.stage-modal textarea {
  width: 100%;
  min-height: 4.5rem;
  resize: vertical;
  font-family: inherit;
}

@media (max-width: 560px) {
  .stage-modal__row {
    grid-template-columns: 1fr;
  }
}

.cell-wrap {
  display: block;
  white-space: normal;
  word-break: break-word;
  line-height: 1.4;
}

.cell-date {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.view-toggle.hidden {
  display: none !important;
}

.is-mobile .partner-table-wrap {
  display: none !important;
}

.is-mobile #partnerMobileCards:not(.hidden) {
  display: flex;
}

.hidden-mobile {
  display: none !important;
}

/* ——— Admin: широкая таблица на весь экран ——— */
.theme-karam.theme-admin .portal-main {
  max-width: none;
  width: 100%;
  padding: 20px 20px 28px;
}

@media (min-width: 1200px) {
  .theme-karam.theme-admin .portal-main {
    padding-left: 28px;
    padding-right: 28px;
  }
}

.theme-karam.theme-admin .section-head p {
  max-width: none;
}

.theme-karam.theme-admin .admin-toolbar input[type="search"] {
  flex: 1 1 220px;
  min-width: 180px;
}

.theme-karam.theme-admin .sheet-table-wrap--compact,
.theme-karam.theme-admin .partner-table-wrap {
  border-radius: 14px;
  max-height: calc(100vh - 250px);
  -webkit-overflow-scrolling: touch;
}

.theme-karam.theme-admin .sheet-table--compact.sheet-table--readable {
  table-layout: auto;
  width: 100%;
  min-width: 1100px;
  font-size: 0.875rem;
}

.theme-karam.theme-admin .sheet-table--compact th {
  padding: 11px 14px;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.theme-karam.theme-admin .sheet-table--compact td {
  padding: 10px 14px;
  overflow: visible;
  vertical-align: top;
  line-height: 1.5;
}

.theme-karam.theme-admin .sheet-table--compact .col-expand {
  width: 36px;
  min-width: 36px;
}

.theme-karam.theme-admin .sheet-table--readable .col-num {
  min-width: 76px;
  white-space: nowrap;
  text-align: right;
}

.theme-karam.theme-admin .sheet-table--readable .col-date {
  min-width: 92px;
  width: auto;
}

.theme-karam.theme-admin .sheet-table--readable .col-inv {
  min-width: 96px;
  max-width: none;
}

.theme-karam.theme-admin .sheet-table--readable .col-cont {
  min-width: 150px;
  max-width: none;
}

.theme-karam.theme-admin .sheet-table--readable .col-supplier {
  min-width: 110px;
  max-width: none;
}

.theme-karam.theme-admin .sheet-table--readable .col-info {
  min-width: 140px;
  max-width: 300px;
}

.theme-karam.theme-admin .sheet-table--readable .col-status-full,
.theme-karam.theme-admin .sheet-table--readable .col-status {
  min-width: 160px;
  max-width: none;
}

.theme-karam.theme-admin .sheet-table--readable .col-supplier,
.theme-karam.theme-admin .sheet-table--readable .col-cont,
.theme-karam.theme-admin .sheet-table--readable .col-info,
.theme-karam.theme-admin .sheet-table--readable .col-status-full {
  max-width: none;
}

.theme-karam.theme-admin .sheet-table--compact .badge {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  display: inline-block;
  line-height: 1.35;
  max-width: 280px;
}

.theme-karam.theme-admin .cell-status {
  line-height: 1.35;
}

.theme-karam.theme-admin .cell-wrap {
  word-break: break-word;
  hyphens: auto;
}

.theme-karam.theme-admin .col-info .cell-wrap {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.theme-karam.theme-admin .partner-table {
  font-size: 0.875rem;
  min-width: 1000px;
}

.theme-karam.theme-admin .partner-table th,
.theme-karam.theme-admin .partner-table td {
  padding: 11px 14px;
}

.theme-karam.theme-admin .integration-note {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.theme-karam.theme-admin .cell-link {
  color: #1432c6;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px dashed rgba(20, 50, 198, 0.35);
}

.theme-karam.theme-admin .cell-link:hover {
  color: #1769ff;
  border-bottom-color: #1769ff;
}

.theme-karam.theme-admin .partners-loading {
  opacity: 0.65;
  pointer-events: none;
}

.theme-karam.theme-admin .partner-row--active td {
  background: rgba(23, 105, 255, 0.04);
}

.theme-karam.theme-admin .partner-row--empty td {
  color: var(--text-muted);
}

.theme-karam.theme-admin .col-onec {
  width: 56px;
  text-align: center;
}

.theme-karam.theme-admin .cell-muted {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.theme-karam.theme-admin .badge-muted {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-muted);
}

.theme-karam.theme-admin .loading-note {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.35rem;
}

.theme-container-detail .container-hero {
  margin-bottom: 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(23, 105, 255, 0.08), rgba(20, 50, 198, 0.04));
  border: 1px solid rgba(23, 105, 255, 0.15);
}

.theme-container-detail .container-hero__label {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.theme-container-detail .container-hero__title {
  margin: 0.25rem 0 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
  color: #1432c6;
}

.theme-container-detail .container-hero__sub {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.theme-container-detail .container-loading {
  color: var(--text-muted);
}

.theme-container-detail .brand-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.theme-container-detail .brand-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(23, 105, 255, 0.1);
  color: #1432c6;
  font-weight: 600;
  font-size: 0.85rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.theme-container-detail .brand-chip:hover {
  background: rgba(23, 105, 255, 0.18);
  transform: translateY(-1px);
}

.theme-container-detail .brand-chip.is-active {
  background: #1769ff;
  color: #fff;
  border-color: #1432c6;
}

.theme-container-detail .brand-chip--hint {
  background: rgba(245, 158, 11, 0.12);
  color: #92400e;
  border: 1px dashed rgba(245, 158, 11, 0.45);
}

.theme-container-detail .brand-chips--inline {
  margin-bottom: 0;
  gap: 0.35rem;
}

.theme-container-detail .brand-chip--inline {
  padding: 0.2rem 0.5rem;
  font-size: 0.78rem;
  cursor: default;
}

.theme-container-detail .brand-chip--inline:hover {
  transform: none;
}

.theme-container-detail .badge-hint {
  background: rgba(245, 158, 11, 0.15);
  color: #92400e;
  font-size: 0.65rem;
  margin-left: 0.25rem;
  vertical-align: middle;
}

.theme-container-detail .section-head--with-action {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.theme-container-detail .col-stage--editable {
  white-space: nowrap;
}

.theme-container-detail .partner-row--empty td.table-empty {
  color: var(--text-muted);
  font-size: 0.88rem;
  padding: 0.65rem 0.75rem;
}

.theme-container-detail .brand-detail-panel {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 14px;
  border: 1px solid rgba(23, 105, 255, 0.18);
  background: rgba(255, 255, 255, 0.75);
}

.theme-container-detail .brand-detail-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.theme-container-detail .brand-detail-panel__head h3 {
  margin: 0;
  font-size: 1.15rem;
  color: #1432c6;
}

.theme-container-detail .brand-detail-panel__head p {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.theme-container-detail .stats-row--compact {
  margin-bottom: 0.75rem;
}

.theme-container-detail .stats-row--compact .stat-card {
  padding: 0.65rem 0.85rem;
}

.theme-container-detail .brand-sheet-rows {
  margin-top: 1rem;
}

.theme-container-detail .brand-sheet-rows h4 {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.theme-staff .login-badge--readonly,
.theme-staff .staff-view-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.theme-staff .staff-view-badge {
  margin-left: 0.5rem;
  vertical-align: middle;
}

.theme-staff .login-hint--muted {
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}

.theme-staff-readonly .stage-edit-btn {
  display: none !important;
}
