/* Ray Connect — Sponsored Ads Portal (shared brand) */
:root {
  --rc-primary: #1a74e4;
  --rc-primary-dark: #1259b5;
  --rc-primary-soft: #e8f1fd;
  --rc-bg: #f0f2f5;
  --rc-card: #ffffff;
  --rc-text: #424242;
  --rc-text-muted: #616161;
  --rc-border: #e2e8f0;
  --rc-success: #059669;
  --rc-warn: #d97706;
  --rc-danger: #dc2626;
  --rc-radius: 16px;
  --rc-shadow: 0 12px 40px rgba(26, 116, 228, 0.08);
  --rc-font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--rc-font);
  background: var(--rc-bg);
  color: var(--rc-text);
  min-height: 100vh;
}

.rc-logo {
  display: block;
  height: auto;
  max-width: 100%;
}

.rc-logo--auth {
  width: min(220px, 72vw);
  margin: 0 auto 20px;
}

.rc-logo--header {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.rc-logo--loader {
  width: 88px;
  animation: rc-pulse 1.2s ease-in-out infinite;
}

@keyframes rc-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.03);
  }
}

#pageLoader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
}

#pageLoader.hidden {
  display: none !important;
}

.rc-brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rc-brand-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--rc-text);
  line-height: 1.2;
}

.rc-brand-title span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--rc-primary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding: 14px 18px;
  background: var(--rc-card);
  border: 1px solid var(--rc-border);
  border-radius: var(--rc-radius);
  box-shadow: var(--rc-shadow);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.card {
  background: var(--rc-card);
  border: 1px solid var(--rc-border);
  border-radius: var(--rc-radius);
  box-shadow: var(--rc-shadow);
  padding: 22px;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background: linear-gradient(160deg, #f0f5fc 0%, var(--rc-bg) 45%, #ffffff 100%);
}

.auth-card {
  width: min(440px, 100%);
}

.auth-tagline {
  text-align: center;
  color: var(--rc-text-muted);
  font-size: 15px;
  margin: 0 0 24px;
  line-height: 1.5;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 960px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--rc-text-muted);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--rc-border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 14px;
  font-family: inherit;
  color: var(--rc-text);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(26, 116, 228, 0.25);
  border-color: var(--rc-primary);
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--rc-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--rc-primary-dark);
}

.btn-ghost {
  background: var(--rc-primary-soft);
  color: var(--rc-primary);
}

.btn-danger {
  background: #fee2e2;
  color: var(--rc-danger);
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.tab {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--rc-border);
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: var(--rc-text-muted);
}

.tab.active {
  background: var(--rc-primary);
  color: #fff;
  border-color: var(--rc-primary);
}

.metric {
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fafcff 0%, #f4f8fe 100%);
  border: 1px solid var(--rc-border);
}

.metric .value {
  font-size: 26px;
  font-weight: 800;
  color: var(--rc-text);
  letter-spacing: -0.02em;
}

.metric .label {
  font-size: 12px;
  color: var(--rc-text-muted);
  font-weight: 600;
  margin-top: 4px;
}

.status {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status.active,
.status.approved {
  background: #dcfce7;
  color: var(--rc-success);
}

.status.pending {
  background: #fef3c7;
  color: var(--rc-warn);
}

.status.paused,
.status.budget_exhausted {
  background: #e2e8f0;
  color: var(--rc-text-muted);
}

.status.rejected {
  background: #fee2e2;
  color: var(--rc-danger);
}

.hidden {
  display: none !important;
}

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

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th,
.table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--rc-border);
}

.table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--rc-text-muted);
}

.section-title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.placement-pill {
  display: inline-block;
  padding: 4px 8px;
  margin: 2px 4px 2px 0;
  border-radius: 8px;
  background: var(--rc-primary-soft);
  color: var(--rc-primary);
  font-size: 11px;
  font-weight: 600;
}

.check-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  margin-bottom: 8px;
}

.check-grid input {
  width: auto;
  margin: 0;
}

.billing-banner {
  margin-bottom: 18px;
  border-left: 4px solid var(--rc-warning, #e6a700);
}
.billing-banner--past_due,
.billing-banner--payment_required {
  border-left-color: var(--rc-danger, #c62828);
  background: rgba(198, 40, 40, 0.06);
}
.billing-banner--suspended,
.billing-banner--canceled {
  border-left-color: #666;
}

.footer-note {
  text-align: center;
  margin-top: 20px;
  font-size: 12px;
  color: var(--rc-text-muted);
}
