/* CRM-ul clientilor (app.leapr.co.uk): DOAR ce are in plus fata de admin.css (care se incarca inainte si da tokenurile,
   bara laterala .side/.nav-item, bara de jos .dock, foaia .sheet, cardurile, butoanele, notificarile). Foaia firmei
   (#firm-theme) vine ultima si schimba doar tokenurile culorii (docs/crm-theme.md); aici nu se redefineste niciunul.
   "Powered by Leapr" apare mereu, cu un token care nu e al firmei (--side-text pe bara, --text-3 pe suprafete). */

/* Pornirea: nimic nu se vede pana nu se incarca foaia firmei (fara albastrul Leapr clipind). */
body.is-booting .app, body.is-booting .dock, body.is-booting .gate-wrap { visibility: hidden; }
.noscript { padding: 24px; }

/* FIRMA, sus in bara laterala */
.tenant { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 4px 8px 16px; margin-bottom: 8px; border-bottom: 1px solid var(--side-line); }
.tenant:empty { display: none; }
.tenant__mark {
  display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: var(--r); background: var(--accent);
  color: var(--on-accent); font-size: 13px; line-height: 16px; font-weight: 700; letter-spacing: 0.02em;
}
/* Logo-urile sunt de obicei cerneala inchisa pe transparent: stau pe o placa deschisa, fixa, si in contrast ridicat. */
.tenant__logo {
  flex: none; width: auto; max-width: 120px; height: 36px; object-fit: contain; padding: 4px; border-radius: var(--r-sm);
  background: #FFFFFF; forced-color-adjust: none;
}
.tenant__name { min-width: 0; color: var(--side-text-strong); font-weight: 600; line-height: 20px; overflow-wrap: anywhere; }
.side__nav { display: grid; gap: 2px; }

/* OMUL, jos in bara laterala */
.user { display: flex; align-items: center; gap: 8px; padding: 8px 4px 8px 12px; }
.user .avatar { background: var(--navy-3); color: #FFFFFF; }
.user__text { flex: 1; min-width: 0; display: grid; }
.user__name { color: var(--side-text-strong); font-size: 12px; line-height: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user__role { font-size: 12px; line-height: 16px; color: var(--side-text); }
.nav-item--button { width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.sheet__sep { margin: 8px 0; border: 0; border-top: 1px solid var(--border); }
.powered { padding: 8px 12px 0; font-size: 12px; line-height: 16px; color: var(--side-text); }
.powered b { color: var(--side-text-strong); font-weight: 600; }

/* BARA DE SUS PE TELEFON (firma si tema); pe ecrane mari nu exista */
.mtop { display: none; }
.mtop:empty { display: none !important; }

@media (max-width: 1100px) {
  .tenant { justify-content: center; padding: 4px 0 16px; }
  .side .tenant__name, .side .user__text, .side .user .avatar { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .side .tenant__logo { max-width: 48px; height: 32px; }
  .user { justify-content: center; padding: 8px 0; }
  .side .powered { padding: 8px 0 0; font-size: 10px; line-height: 12px; text-align: center; }
}
@media (max-width: 760px) {
  .mtop {
    position: sticky; top: 0; z-index: 25; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 16px;
    padding-top: max(8px, env(safe-area-inset-top)); background: var(--side-bg); color: var(--side-text-strong); --focus: var(--sky);
  }
  .mtop .tenant__mark { width: 32px; height: 32px; }
  .mtop .tenant__logo { height: 32px; max-width: 96px; }
  .mtop .tenant__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mtop .powered { padding: 0; font-size: 10px; }
  .mtop .btn--ghost { color: var(--side-text); }
  .mtop .btn--ghost:hover { background: var(--side-hover); color: var(--side-text-strong); }
}
.mtop__text { flex: 1; min-width: 0; display: grid; }

/* LOGAREA SI ALEGEREA FIRMEI (inainte de shell) */
.gate-wrap { display: grid; place-items: center; min-height: 100vh; padding: 24px 16px; }
.gate { display: grid; gap: 16px; width: min(440px, 100%); padding: 32px 24px; }
.gate h1 { font-size: 24px; line-height: 32px; letter-spacing: -0.02em; }
.gate h1:focus { outline: none; }
.gate__action { width: 100%; }
.gate__alt { width: 100%; }
.gate__form { display: grid; gap: 12px; }
.gate__error { color: var(--danger); }
.gate__error:empty { display: none; }
.gate__note { color: var(--text-2); }
.gate__foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.gate .powered { padding: 0; color: var(--text-3); text-align: center; }
.gate .powered b { color: var(--text-2); }
.firm-choices { display: grid; gap: 8px; }
.firm-choice {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 12px 16px; border: 1px solid var(--border);
  border-radius: var(--r); background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, transform 140ms var(--ease-out);
}
.firm-choice:hover:not(:disabled) { border-color: var(--border-strong); background: var(--surface-hover); }
.firm-choice:active:not(:disabled) { transform: scale(0.98); }
.firm-choice:disabled { opacity: 0.6; cursor: progress; }
.firm-choice__name { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.firm-choice__role { color: var(--text-3); font-size: 12px; line-height: 16px; }

/* "COMING SOON" (sectiunile fara API inca) */
.soon .empty { padding: 64px 24px; }
.soon .empty p:not(.empty__title) { max-width: 52ch; }

/* COMUNE ECRANELOR CRM-ului */
.notice { margin-bottom: 16px; padding: 12px 16px; border-radius: var(--r-lg); background: var(--warning-tint); color: var(--warning); font-weight: 600; }
.select--sm { min-height: 32px; padding: 4px 32px 4px 8px; font-size: 12px; line-height: 16px; }
.view .toolbar .input[type="search"] { max-width: 360px; }
