/* ============================================================================
   iRendity — Bootstrap brand remap (Rendita green over default blue)
   Loaded AFTER the Bootstrap CDN on every surface that uses Bootstrap classes.
   Purpose: standalone dashboards (admin / super-admin / CEO / agency / seller /
   fund / investor) load only the Bootstrap CDN and never main.css/tokens.css,
   so their .btn-primary, links, focus rings, badges, nav and form controls
   render in Bootstrap's default electric blue. This file forces the official
   iRendity palette everywhere Bootstrap would otherwise be blue.

   Brand: verde dominante (Rendita), Ink per aree scure, nessun blu/navy.
   ============================================================================ */

/* POST logout controls share the visual behavior of the links they replace. */
.logout-form { display: inline; margin: 0; }
.logout-form__button:not(.btn) {
  appearance: none;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  line-height: inherit;
  margin: 0;
  padding: 0;
  text-align: inherit;
}

/* Palette (self-contained: standalone templates don't load tokens.css) */
:root {
  --color-ink:          #0A1512;
  --color-beacon:       #5CE6A6;
  --color-rendita:      #3ECF8E;
  --color-rendita-mid:  #34A574;
  --color-rendita-deep: #1E7A57;
  --color-paper:        #F2F1EA;
  --color-muted:        #6B6659;
  --color-gold:         #C9A24B;

  /* Bootstrap core theme variables → green, not blue */
  --bs-primary:              #1E7A57;
  --bs-primary-rgb:          30, 122, 87;
  --bs-primary-text-emphasis:#1E7A57;
  --bs-primary-bg-subtle:    #DCF5E9;
  --bs-primary-border-subtle:#A7E6C8;

  --bs-link-color:           #1E7A57;
  --bs-link-color-rgb:       30, 122, 87;
  --bs-link-hover-color:     #34A574;
  --bs-link-hover-color-rgb: 52, 165, 116;

  --bs-focus-ring-color:     rgba(62, 207, 142, 0.35);
}

/* ---- Primary button: green fill, Ink label (Brand Guidelines) ------------ */
.btn-primary {
  --bs-btn-color: #0A1512;
  --bs-btn-bg: #3ECF8E;
  --bs-btn-border-color: #3ECF8E;
  --bs-btn-hover-color: #0A1512;
  --bs-btn-hover-bg: #34A574;
  --bs-btn-hover-border-color: #34A574;
  --bs-btn-active-color: #0A1512;
  --bs-btn-active-bg: #1E7A57;
  --bs-btn-active-border-color: #1E7A57;
  --bs-btn-disabled-color: #0A1512;
  --bs-btn-disabled-bg: #A7E6C8;
  --bs-btn-disabled-border-color: #A7E6C8;
}

.btn-outline-primary {
  --bs-btn-color: #1E7A57;
  --bs-btn-border-color: #34A574;
  --bs-btn-hover-color: #0A1512;
  --bs-btn-hover-bg: #3ECF8E;
  --bs-btn-hover-border-color: #3ECF8E;
  --bs-btn-active-color: #0A1512;
  --bs-btn-active-bg: #3ECF8E;
  --bs-btn-active-border-color: #3ECF8E;
  --bs-btn-focus-shadow-rgb: 62, 207, 142;
}

/* ---- Text / background / border utilities -------------------------------- */
.text-primary { color: #1E7A57 !important; }
.bg-primary   { background-color: #1E7A57 !important; color: #fff !important; }
.border-primary { border-color: #34A574 !important; }
.link-primary { color: #1E7A57 !important; }
.link-primary:hover, .link-primary:focus { color: #34A574 !important; }
.text-bg-primary { background-color: #1E7A57 !important; color: #fff !important; }

/* ---- Info family: Bootstrap cyan (#0dcaf0) → brand green -------------------- */
.text-info { color: #1E7A57 !important; }
.bg-info, .text-bg-info { background-color: #1E7A57 !important; color: #fff !important; }
.border-info { border-color: #34A574 !important; }
.badge.bg-info, .badge.text-bg-info { background-color: #1E7A57 !important; color: #fff !important; }
.btn-info {
  --bs-btn-color: #0A1512;
  --bs-btn-bg: #5CE6A6;
  --bs-btn-border-color: #5CE6A6;
  --bs-btn-hover-color: #0A1512;
  --bs-btn-hover-bg: #3ECF8E;
  --bs-btn-hover-border-color: #3ECF8E;
  --bs-btn-active-color: #0A1512;
  --bs-btn-active-bg: #34A574;
  --bs-btn-active-border-color: #34A574;
}
.alert-info {
  --bs-alert-color: #124A34;
  --bs-alert-bg: #DCF5E9;
  --bs-alert-border-color: #A7E6C8;
  --bs-alert-link-color: #1E7A57;
}
.spinner-border.text-info, .spinner-grow.text-info { color: #3ECF8E !important; }

/* ---- Badges & alerts ----------------------------------------------------- */
.badge.bg-primary, .badge.text-bg-primary { background-color: #1E7A57 !important; color: #fff !important; }
.alert-primary {
  --bs-alert-color: #124A34;
  --bs-alert-bg: #DCF5E9;
  --bs-alert-border-color: #A7E6C8;
  --bs-alert-link-color: #1E7A57;
}

/* ---- Nav pills / tabs / list-group active -------------------------------- */
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link { background-color: #1E7A57; color: #fff; }
.nav-link { color: #1E7A57; }
.nav-link:hover, .nav-link:focus { color: #34A574; }
.nav-tabs .nav-link.active { color: #1E7A57; border-bottom-color: #3ECF8E; }
.list-group-item.active { background-color: #1E7A57; border-color: #1E7A57; }

/* ---- Pagination ---------------------------------------------------------- */
.page-link { color: #1E7A57; }
.page-item.active .page-link { background-color: #1E7A57; border-color: #1E7A57; }

/* ---- Progress ------------------------------------------------------------ */
.progress-bar { background-color: #3ECF8E; }

/* ---- Forms: green focus instead of blue ---------------------------------- */
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: #3ECF8E;
  box-shadow: 0 0 0 0.25rem rgba(62, 207, 142, 0.30);
}
.form-check-input:checked {
  background-color: #3ECF8E;
  border-color: #3ECF8E;
}
.form-switch .form-check-input:checked { background-color: #3ECF8E; border-color: #3ECF8E; }

/* ---- Spinners / accents inheriting text-primary -------------------------- */
.spinner-border.text-primary, .spinner-grow.text-primary { color: #3ECF8E !important; }

/* ============================================================================
   Mobile guard — standalone dashboards (agency & co.)
   These pages load only Bootstrap + this file (never main.css), so they miss
   the global ≤992px overflow-x guard that protects the rest of the site from
   the "shrunken page" effect (any element wider than the viewport forces the
   phone to zoom out). Same pattern as main.css: scoped ≤992px so desktop
   sticky/positioned elements are untouched.
   ============================================================================ */
@media (max-width: 992px) {
  html, body {
    overflow-x: hidden;
    max-width: 100%;
  }
}

/* Sidebar identity block: long emails/agency names must wrap, never widen
   the layout (flex children need min-width:0 to be allowed to shrink). */
.sidebar .user-profile { min-width: 0; }
.sidebar .user-info { min-width: 0; }
.sidebar .user-info h5,
.sidebar .user-info p {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Tighter dashboard spacing on phones */
@media (max-width: 576px) {
  .dashboard-card { padding: 14px 12px; }
  .dashboard-container { margin-top: 16px; }
  .dashboard-card-header { flex-wrap: wrap; gap: 8px; }
}
