/* ChaloAds brand palette & layout overrides */
:root {
  --chaloads-brand: #52b141;
  --chaloads-brand-dark: #2f6b28;
  --chaloads-brand-mid: #3a8230;
  --chaloads-brand-light: #e8f5e6;
  --chaloads-signal: #a9e39e;
  --chaloads-accent: #2563eb;
  --chaloads-muted: #6b7280;
  --chaloads-ink: #1c1f1d;
  --chaloads-surface: #f8faf9;
  --chaloads-border: #cedbcf;
  --chaloads-sidebar-width: 7.5rem;
  --chaloads-header-height: 5rem;
  --chaloads-danger: #9ca3af;
  --chaloads-danger-hover: #6b7280;
}

/* Wordmark — shared by the nav header and the auth screens */
.brand-wordmark {
  font-family: 'Outfit', system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--chaloads-ink);
  line-height: 1;
  white-space: nowrap;
}

.brand-wordmark-accent {
  color: var(--chaloads-brand-dark);
}

/* The brand column is 7.5rem, narrower than the wordmark's 160px minimum.
   The short C stays inside it. The wordmark moves to the top bar when that
   bar is wide enough to hold 160px. */
.nav-header .brand-logo {
  max-width: 100%;
}

.nav-header .logo-abbr {
  display: block;
  width: 2.5rem;
  height: 2.5rem;
  max-width: 2.5rem;
  max-height: 2.5rem;
  object-fit: contain;
}

@media only screen and (max-width: 575px) {
  .nav-header .logo-abbr {
    width: 2rem;
    height: 2rem;
    max-width: 2rem;
    max-height: 2rem;
  }
}

.header-wordmark-link {
  display: none;
  align-items: center;
  flex: 0 0 auto;
  margin-right: 0.75rem;
  line-height: 0;
}

.header-wordmark {
  display: block;
  width: 160px;
  height: auto;
}

@media only screen and (min-width: 1200px) {
  .header-wordmark-link {
    display: inline-flex;
  }
}

/* Auth screens — brand lockup above the form */
.auth-brand {
  padding: 2.25rem 2.5rem 0;
}

.auth-brand-logo {
  height: 2.5rem;
  width: auto;
}

.auth-brand .brand-wordmark {
  font-size: 1.25rem;
  margin-top: 0.5rem;
}

.authincation-content .auth-form {
  padding-top: 1.75rem;
}

@media only screen and (max-width: 575px) {
  .auth-brand {
    padding: 1.5rem 1.25rem 0;
  }
}

/* Brand solid button */
.btn-brand {
  color: #fff;
  background-color: var(--chaloads-brand);
  border-color: var(--chaloads-brand);
}

.btn-brand:hover,
.btn-brand:focus {
  color: #fff;
  background-color: var(--chaloads-brand-dark);
  border-color: var(--chaloads-brand-dark);
}

.opacity-50 {
  opacity: 0.5;
}

/* Sidebar compact layout — keep widths in sync */
[data-layout="vertical"][data-sidebar-style="compact"] .deznav {
  width: var(--chaloads-sidebar-width);
}

@media (min-width: 767px) {
  [data-sidebar-style="compact"] .nav-header {
    width: var(--chaloads-sidebar-width);
  }
}

[data-sidebar-style="compact"] .header {
  padding-left: var(--chaloads-sidebar-width);
}

[data-sidebar-style="compact"] .content-body {
  margin-left: var(--chaloads-sidebar-width);
}

[data-sidebar-style="compact"] .footer {
  padding-left: var(--chaloads-sidebar-width);
}

/* Slimmer app chrome — brand block, top bar and sidebar offset stay in sync */
[data-sidebar-style="compact"] .nav-header {
  height: var(--chaloads-header-height);
}

[data-sidebar-style="compact"] .header {
  height: var(--chaloads-header-height);
}

[data-sidebar-style="compact"] .deznav {
  padding-top: var(--chaloads-header-height);
}

[data-header-position="fixed"] [data-sidebar-style="compact"] .content-body {
  padding-top: var(--chaloads-header-height);
}

[data-sidebar-style="compact"] .deznav .metismenu > li > a,
[data-sidebar-style="compact"] .deznav .metismenu > li > .nav-logout {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.75rem 0.5rem;
  text-align: center;
}

[data-sidebar-style="compact"] .deznav .metismenu > li > a svg,
[data-sidebar-style="compact"] .deznav .metismenu > li > .nav-logout svg {
  display: block;
  margin: 0 auto 0.35rem;
  max-width: 1.25rem;
  max-height: 1.25rem;
}

[data-sidebar-style="compact"] .deznav .metismenu .nav-text {
  display: block;
  font-size: 0.6875rem;
  line-height: 1.2;
  margin-top: 0;
  text-align: center;
}

.deznav .metismenu > li > .nav-logout {
  background: transparent;
  border: 0;
  color: #969ba9;
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
}

.deznav .metismenu > li > .nav-logout:hover,
.deznav .metismenu > li > .nav-logout:focus {
  color: var(--chaloads-brand);
}

.deznav .copyright {
  font-size: 0.75rem;
  padding: 0.5rem;
  text-align: center;
}

.deznav .copyright p {
  margin-bottom: 0.25rem;
}

/* Replace theme pink/red secondary with neutral slate */
.btn-secondary,
.btn-outline-secondary {
  color: var(--chaloads-muted);
  background-color: #f3f4f6;
  border-color: #d1d5db;
}

.btn-secondary:hover,
.btn-outline-secondary:hover {
  color: #374151;
  background-color: #e5e7eb;
  border-color: #9ca3af;
}

.btn-outline-secondary:not(:disabled):not(.disabled).active,
.btn-outline-secondary:not(:disabled):not(.disabled):active {
  color: #374151;
  background-color: #e5e7eb;
  border-color: #9ca3af;
}

/* Brand utility buttons (avoid red/pink accents) */
.btn-outline-brand {
  color: var(--chaloads-brand);
  border-color: var(--chaloads-brand);
  background: transparent;
}

.btn-outline-brand:hover,
.btn-outline-brand.active {
  color: #fff;
  background-color: var(--chaloads-brand);
  border-color: var(--chaloads-brand);
}

.btn-outline-muted {
  color: var(--chaloads-muted);
  border-color: #d1d5db;
  background: transparent;
}

.btn-outline-muted:hover {
  color: #374151;
  background-color: #f3f4f6;
  border-color: #9ca3af;
}

/* Softer delete — not alarm red */
.btn-outline-danger {
  color: var(--chaloads-danger);
  border-color: #d1d5db;
}

.btn-outline-danger:hover {
  color: #fff;
  background-color: var(--chaloads-danger-hover);
  border-color: var(--chaloads-danger-hover);
}

.border-brand {
  border-color: var(--chaloads-brand) !important;
  box-shadow: 0 0 0 1px var(--chaloads-brand);
}

.border-brand-light {
  border-color: var(--chaloads-border) !important;
}

.text-brand {
  color: var(--chaloads-brand) !important;
}

.badge-brand-light {
  color: var(--chaloads-brand-dark);
  background-color: var(--chaloads-brand-light);
  font-weight: 500;
}

.delivery-option.active,
.delivery-option.border-brand {
  background-color: var(--chaloads-brand-light);
}

.delivery-option-link:hover {
  border-color: var(--chaloads-brand);
  background-color: var(--chaloads-surface);
}

.playback-timeline {
  border-color: var(--chaloads-border) !important;
}

@media (min-width: 768px) {
  .right-profile .profile-sidebar {
    width: 16rem;
    padding: 1.5rem;
  }

  .right-profile .header {
    padding-right: 16rem;
  }

  .right-profile .content-body {
    margin-right: 16rem;
  }
}

/* ------------------------------------------------------------------
   Password field with show / hide toggle
   ------------------------------------------------------------------ */
.password-field {
  position: relative;
}

.password-field .form-control {
  padding-right: 2.75rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.4rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
  border: 0;
  border-radius: 0.4rem;
  background: transparent;
  color: var(--chaloads-muted);
  cursor: pointer;
  transition: color .15s ease, background-color .15s ease;
}

.password-toggle svg {
  width: 1.1rem;
  height: 1.1rem;
}

.password-toggle:hover {
  color: var(--chaloads-ink);
  background-color: #eef1f0;
}

.password-toggle:focus {
  outline: 0;
  color: var(--chaloads-brand-dark);
  background-color: var(--chaloads-brand-light);
}

.password-toggle.is-revealed {
  color: var(--chaloads-brand-dark);
}

.password-caps-hint {
  display: inline-block;
  margin-top: 0.3rem;
  color: #b45309;
  font-size: 0.75rem;
}

/* ------------------------------------------------------------------
   Top bar
   ------------------------------------------------------------------ */
.btn-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.btn-inline svg {
  width: 1rem;
  height: 1rem;
}

/* The theme ships oversized buttons — tighten the whole scale */
.btn {
  padding: 0.6rem 1.25rem;
  font-size: 0.9375rem;
}

.btn-sm {
  padding: 0.3rem 0.7rem;
  font-size: 0.8125rem;
  border-radius: 0.4rem;
}

.btn-lg {
  padding: 0.8rem 1.6rem;
  font-size: 1.0625rem;
}

@media only screen and (max-width: 1400px) {
  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
}

.header-left {
  gap: 0.5rem;
}

.header-workspace {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  font-weight: 600;
  color: var(--chaloads-ink);
}

.header-workspace svg {
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 auto;
  color: var(--chaloads-brand);
}

.header-workspace-name {
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-role {
  font-weight: 500;
}

.header-right {
  align-items: center;
  gap: 0.25rem;
}

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 0.5rem;
}

.header-cta svg {
  width: 0.95rem;
  height: 0.95rem;
}

.header-profile-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-right: 0.6rem;
  border-radius: 50%;
  background-color: var(--chaloads-brand-light);
  color: var(--chaloads-brand-dark);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Keep the compact chrome usable on small screens */
@media only screen and (max-width: 767px) {
  .header-role {
    display: none;
  }

  .header-workspace-name {
    max-width: 9rem;
  }
}

@media only screen and (max-width: 575px) {
  .header-workspace-name {
    max-width: 7rem;
  }

  .header-profile-avatar {
    margin-right: 0;
  }
}

/* ------------------------------------------------------------------
   Status badges — use the brand palette instead of the theme defaults
   ------------------------------------------------------------------ */
.badge-success {
  color: var(--chaloads-brand-dark);
  background-color: var(--chaloads-brand-light);
}

.badge-info {
  color: #1e40af;
  background-color: #dbeafe;
}

.badge-warning {
  color: #92400e;
  background-color: #fef3c7;
}

.badge-danger {
  color: #b91c1c;
  background-color: #fee2e2;
}

.badge-secondary {
  color: #374151;
  background-color: #f3f4f6;
}

.badge-light {
  color: var(--chaloads-ink);
  background-color: #eef1f0;
}

.badge-dark {
  color: #f3f4f6;
  background-color: #4b5563;
}

/* ------------------------------------------------------------------
   Alerts — calmer tones that sit with the brand palette
   ------------------------------------------------------------------ */
.alert-light {
  color: var(--chaloads-ink);
  background-color: var(--chaloads-surface);
  border-color: var(--chaloads-border);
}

.alert-info {
  color: #1e3a8a;
  background-color: #eff6ff;
  border-color: #dbeafe;
}

.alert-warning {
  color: #92400e;
  background-color: #fef3c7;
  border-color: #fde68a;
}

.alert-info .alert-link,
.alert-warning .alert-link {
  color: inherit;
  font-weight: 600;
}

/* ------------------------------------------------------------------
   Dashboard stat cards
   ------------------------------------------------------------------ */
.alert > svg {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  margin-top: 0.1rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 100%;
}

.stat-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  background-color: var(--chaloads-brand-light);
  color: var(--chaloads-brand-dark);
}

.stat-card-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.stat-card-label {
  margin-bottom: 0.15rem;
  color: var(--chaloads-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-card-value {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--chaloads-ink);
}

/* ------------------------------------------------------------------
   Campaign list rows
   ------------------------------------------------------------------ */
.campaign-list-item + .campaign-list-item {
  border-top: 1px solid #eef1f0;
}

.campaign-list-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--chaloads-ink);
}

.campaign-list-meta {
  color: var(--chaloads-muted);
  font-size: 0.8125rem;
}

.analytics-label {
  width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-count {
  width: 5.5rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.analytics-bar {
  min-width: 2px;
  height: 0.85rem;
  background-color: var(--chaloads-brand);
}

.hour-strip {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 4.5rem;
}

.hour-strip span {
  flex: 1 1 0;
  min-height: 2px;
  border-radius: 2px 2px 0 0;
  background-color: var(--chaloads-brand);
}

.hour-strip span.is-empty,
.day-bar i.is-empty {
  background-color: var(--chaloads-border);
}

.day-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 6rem;
  overflow-x: auto;
}

.day-bar {
  flex: 1 0 0.7rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
  min-width: 0.7rem;
}

.day-bar i {
  display: block;
  width: 100%;
  min-height: 2px;
  border-radius: 2px 2px 0 0;
  background-color: var(--chaloads-brand);
}

.day-bar span {
  margin-top: 0.25rem;
  color: var(--chaloads-muted);
  font-size: 0.7rem;
  white-space: nowrap;
}

.flight-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
