/* ============================================================
   LawnTrail — Panel de plataforma
   Fondo oscuro, verde #1D6A3A primario, #16A34A de acento.
   ============================================================ */
:root {
  --bg:        #0F1613;
  --surface:   #16211C;
  --surface-2: #1D2C25;
  --border:    #27392F;
  --text:      #E8F0EB;
  --text-dim:  #8CA396;
  --green:     #1D6A3A;
  --accent:    #16A34A;
  --amber:     #D97706;
  --red:       #B91C1C;
  --radius:    12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ── Pantallas ─────────────────────────────────────────── */
.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }
.screen-center.active {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px;
}

.wrap { max-width: 980px; margin: 0 auto; padding: 20px 16px 64px; }

/* ── Login / denegado ──────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.auth-card { width: 100%; max-width: 380px; padding: 32px 28px; text-align: center; }
.auth-logo { width: 56px; height: 56px; border-radius: 14px; margin-bottom: 16px; }
.auth-title { font-size: 20px; font-weight: 700; }
.auth-sub { color: var(--text-dim); font-size: 13.5px; margin: 6px 0 22px; }
.denied-icon { font-size: 40px; margin-bottom: 12px; }

.field { display: block; text-align: left; margin-bottom: 14px; }
.field span { display: block; font-size: 12.5px; color: var(--text-dim); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 11px 13px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 9px;
  font-size: 15px; font-family: inherit;
}
.field input:focus { outline: none; border-color: var(--accent); }

.btn {
  font: inherit; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; border-radius: 9px;
  padding: 10px 16px; transition: background .15s, border-color .15s;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--accent); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--text-dim); border-color: var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--text-dim); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 11px; font-size: 13px; }

.error {
  background: rgba(185,28,28,.15); border: 1px solid rgba(185,28,28,.4);
  color: #FCA5A5; border-radius: 9px; padding: 10px 12px;
  font-size: 13px; margin-bottom: 14px; text-align: left;
}

.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { color: var(--text-dim); font-size: 13.5px; margin-top: 14px; }

/* ── Barra superior ────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.topbar-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-brand img { width: 30px; height: 30px; border-radius: 8px; }
.topbar-brand div { display: flex; flex-direction: column; line-height: 1.2; }
.topbar-brand strong { font-size: 14.5px; }
.topbar-brand span { font-size: 11.5px; color: var(--text-dim); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-user {
  font-size: 12.5px; color: var(--text-dim);
  max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Cards de stats ────────────────────────────────────── */
.stats-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; margin: 20px 0 24px;
}
@media (max-width: 620px) { .stats-grid { grid-template-columns: 1fr; } }

.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
}
.stat-label { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 30px; font-weight: 700; line-height: 1.15; margin-top: 6px; }
.stat-sub { font-size: 12.5px; color: var(--text-dim); margin-top: 4px; }
.stat-accent .stat-value { color: var(--accent); }

/* ── Secciones colapsables ─────────────────────────────── */
.section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 10px; overflow: hidden;
}
.section-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; cursor: pointer; user-select: none;
}
.section-head:hover { background: var(--surface-2); }
.section-title { flex: 1; font-size: 14.5px; font-weight: 600; }
.section-hint { font-size: 12.5px; color: var(--text-dim); }
.chevron { color: var(--text-dim); transition: transform .18s ease; font-size: 12px; }
.section.open .chevron { transform: rotate(90deg); }
.section-body { display: none; padding: 4px 16px 16px; border-top: 1px solid var(--border); }
.section.open .section-body { display: block; }

.kv { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; }
.kv + .kv { border-top: 1px solid var(--border); }
.kv-key { color: var(--text-dim); }
.kv-val { font-weight: 600; }

/* ── Lista de negocios ─────────────────────────────────── */
.list-head { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 0 12px; }
.list-head h2 { font-size: 16px; font-weight: 700; }
.muted { color: var(--text-dim); font-size: 13px; }

.company-list { display: flex; flex-direction: column; gap: 8px; }

.company {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 13px 15px;
  cursor: pointer; text-align: left; width: 100%;
  color: inherit; font: inherit;
  transition: border-color .15s, background .15s;
}
.company:hover { border-color: var(--accent); background: var(--surface-2); }

.dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dot-active  { background: var(--accent); box-shadow: 0 0 0 3px rgba(22,163,74,.16); }
.dot-trial   { background: var(--amber);  box-shadow: 0 0 0 3px rgba(217,119,6,.16); }
.dot-expired { background: var(--red);    box-shadow: 0 0 0 3px rgba(185,28,28,.16); }

.company-main { flex: 1; min-width: 0; }
.company-name {
  display: flex; align-items: center; gap: 7px;
  font-size: 14.5px; font-weight: 600;
}
.company-name .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-addr {
  font-size: 12.5px; color: var(--text-dim); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.company-stats { font-size: 12.5px; color: var(--text-dim); margin-top: 4px; }
.company-stats b { color: var(--text); font-weight: 600; }
.chev-right { color: var(--text-dim); flex-shrink: 0; font-size: 17px; }

.badge {
  font-size: 10.5px; font-weight: 700; letter-spacing: .03em;
  padding: 2px 7px; border-radius: 20px; flex-shrink: 0; text-transform: uppercase;
}
.badge-free     { background: #2A3A32; color: #9CB3A7; }
.badge-trial    { background: #4A3410; color: #FCD34D; }
.badge-pro      { background: #16351F; color: #4ADE80; }
.badge-business { background: #16304A; color: #7DD3FC; }
.badge-expired  { background: #3F1414; color: #FCA5A5; }
.badge-readonly { background: #2A3A32; color: #9CB3A7; }

.empty { color: var(--text-dim); text-align: center; padding: 36px 12px; font-size: 14px; }
.footnote { color: var(--text-dim); font-size: 11.5px; text-align: center; margin-top: 24px; }
.warn {
  background: rgba(217,119,6,.12); border: 1px solid rgba(217,119,6,.35);
  color: #FCD34D; border-radius: 9px; padding: 9px 12px; font-size: 12.5px; margin-bottom: 12px;
}

/* ── Detalle ───────────────────────────────────────────── */
.detail-title { font-size: 21px; font-weight: 700; margin-bottom: 3px; }
.detail-sub { color: var(--text-dim); font-size: 13.5px; margin-bottom: 20px; }

.detail-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px; margin-bottom: 22px;
}
@media (max-width: 620px) { .detail-grid { grid-template-columns: repeat(2, 1fr); } }
.mini {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px;
}
.mini-label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; }
.mini-value { font-size: 21px; font-weight: 700; margin-top: 3px; }

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-size: 11.5px; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .04em;
  padding: 8px 10px; border-bottom: 1px solid var(--border); font-weight: 600;
}
.table td { padding: 9px 10px; border-bottom: 1px solid var(--border); }
.table tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }
.status-completed { color: var(--accent); }
.status-pending   { color: var(--text-dim); }

/* ── Alerta crítica ─────────────────────────────────────
   Para lo que NO se puede pasar por alto. Deliberadamente distinta de .warn
   (ámbar, avisos rutinarios): roja, más grande y con barra lateral, para que
   no se lea como "un aviso más". Hoy la usa un solo caso: el rebuild del
   índice cambia el principal de un número, o sea que alguien que hoy entra
   al portal con ese número va a ver OTRA propiedad por defecto. */
.alert-critical {
  background: rgba(185,28,28,.18); border: 1px solid rgba(248,113,113,.55);
  border-left: 5px solid #EF4444; color: #FECACA;
  border-radius: 9px; padding: 14px 16px; font-size: 14px; line-height: 1.55;
  margin: 0 0 16px;
}
.alert-critical .alert-title {
  display: block; font-size: 15px; font-weight: 700; color: #FCA5A5;
  margin-bottom: 6px; letter-spacing: .2px;
}
.alert-critical ul { margin: 8px 0 0; padding-left: 20px; }
.alert-critical li { margin: 3px 0; }

/* ── Estado del botón "Aplicar" del rebuild ─────────────
   Explica EN PANTALLA por qué está deshabilitado. Un `title` no alcanza:
   no existe en móvil y en desktop exige quedarse encima. Sin esto, un botón
   deshabilitado no da ninguna señal al tocarlo — parece que no pasó nada
   porque efectivamente no pasa nada, que fue lo que trabó el rebuild de
   M n' G dos veces (3 y 4 sep 2026). */
.rebuild-hint {
  margin: 8px 0 0; font-size: 12.5px; line-height: 1.5;
  color: #F0B559;                      /* ámbar: "falta un paso", no error */
}
.rebuild-hint.listo { color: #4ADE80; } /* verde: se puede aplicar */
.rebuild-hint.aplicado { color: var(--text-dim); }
/* Que el deshabilitado SE VEA deshabilitado, no solo se comporte así */
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ── Zelle: tabla del cupo (29 sep 2026) ────────────────────
   En pantallas angostas cada fila es una tarjeta "etiqueta · valor": con 8
   columnas, a 320 px la tabla mostraba 3 y la de Gmail quedaba escondida. */
@media (max-width: 560px) {
  .zl-usage thead { display: none; }
  .zl-usage, .zl-usage tbody, .zl-usage tr, .zl-usage td { display: block; width: 100%; }
  .zl-usage tr { padding: 10px 0; border-bottom: 1px solid var(--border); }
  .zl-usage tr:last-child { border-bottom: none; }
  .zl-usage td { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 3px 0; border: none; }
  .zl-usage td::before { content: attr(data-label); color: var(--text-dim); font-size: 11.5px; flex-shrink: 0; padding-top: 2px; }
  .zl-usage .zl-v { text-align: right; min-width: 0; overflow-wrap: anywhere; }
}
