/* ============================================================
   assets/style.css — Guaima Clientes
   ============================================================ */

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

:root {
  --bg:       #0f0c1a;
  --bg2:      #1a1025;
  --gold:     #d4af37;
  --gold2:    #b8962e;
  --gold-dim: rgba(212,175,55,0.15);
  --gold-bdr: rgba(212,175,55,0.25);
  --text:     #e8dcc8;
  --text2:    #a89060;
  --text3:    #7a6a4a;
  --card-bg:  rgba(255,255,255,0.03);
  --input-bg: rgba(255,255,255,0.06);
  --radius:   10px;
}

body {
  font-family: Georgia, 'Times New Roman', serif;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg2) 50%, #0d1220 100%);
  color: var(--text);
  min-height: 100vh;
}

/* ── HEADER ───────────────────────────────────────────────── */
#header {
  background: linear-gradient(90deg, #1a0f2e, #2d1b4e 50%, #1a0f2e);
  border-bottom: 1px solid var(--gold-bdr);
  padding: 13px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0,0,0,.5);
}
#header .brand { display: flex; align-items: center; gap: 10px; }
#header .brand-name { font-weight: bold; font-size: 14px; color: var(--gold); letter-spacing: .05em; }
#header .brand-sub  { font-size: 10px; color: var(--text2); letter-spacing: .08em; }
#header .header-actions { display: flex; align-items: center; gap: 8px; }
#sync-msg { font-size: 10px; color: var(--text2); max-width: 110px; text-align: right; line-height: 1.3; }
#sync-msg.ok { color: #10b981; }

/* ── BOTONES ──────────────────────────────────────────────── */
.btn { cursor: pointer; font-family: inherit; border: none; border-radius: 8px; padding: 7px 14px; font-size: 13px; transition: opacity .15s; }
.btn:hover { opacity: .85; }
.btn-gold  { background: linear-gradient(135deg, var(--gold), var(--gold2)); color: #1a0f2e; font-weight: bold; }
.btn-outline{ background: var(--gold-dim); border: 1px solid rgba(212,175,55,.4); color: var(--gold); }
.btn-red   { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.3); color: #f87171; }
.btn-blue  { background: rgba(100,180,255,.1); border: 1px solid rgba(100,180,255,.3); color: #7ec8f7; }
.btn-back  { background: none; border: none; color: var(--gold); font-size: 20px; padding: 0 6px 0 0; }
.btn-brown { background: linear-gradient(135deg,rgba(159,125,97,.25),rgba(159,125,97,.15)); border: 1px solid rgba(159,125,97,.5); color: #e8c88a; font-weight: bold; font-size: 14px; width: 100%; padding: 13px; border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.btn-brown:hover { background: linear-gradient(135deg,rgba(159,125,97,.4),rgba(159,125,97,.25)); }

/* ── PÁGINAS ──────────────────────────────────────────────── */
.page { display: none; padding: 16px 16px 80px; max-width: 700px; margin: 0 auto; }
.page.active { display: block; }
.ftab-content { display: none; }
.ftab-content.active { display: block; }

/* ── STATS GRID ───────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.stat-box { background: var(--card-bg); border: 1px solid var(--gold-bdr); border-radius: var(--radius); padding: 12px 8px; text-align: center; }
.stat-box .stat-icon { font-size: 18px; }
.stat-box .stat-val  { font-size: 20px; font-weight: bold; color: var(--gold); }
.stat-box .stat-lbl  { font-size: 10px; color: var(--text3); margin-top: 2px; }

/* ── TABS ─────────────────────────────────────────────────── */
.tabs-row { display: flex; gap: 0; margin-bottom: 16px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--gold-bdr); }
.tabs-row .tab-btn { flex: 1; padding: 9px; border: none; cursor: pointer; font-size: 13px; font-family: inherit; background: var(--card-bg); color: var(--text3); transition: all .15s; border-right: 1px solid var(--gold-bdr); }
.tabs-row .tab-btn:last-child { border-right: none; }
.tabs-row .tab-btn.active { background: var(--gold-dim); color: var(--gold); font-weight: bold; }

/* ── BUSCADOR ─────────────────────────────────────────────── */
.search-row { display: flex; gap: 8px; margin-bottom: 14px; }

/* ── INPUTS ───────────────────────────────────────────────── */
input, select, textarea {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--gold-bdr);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); }
select option { background: #1a0f2e; }
textarea { resize: vertical; line-height: 1.6; }

label.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text2);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.field { margin-bottom: 13px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── TARJETA CLIENTE ──────────────────────────────────────── */
.cliente-card {
  background: var(--card-bg);
  border: 1px solid rgba(212,175,55,.12);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  transition: border-color .15s;
}
.cliente-card:hover { border-color: rgba(212,175,55,.35); }
.cliente-card .cn  { font-weight: bold; font-size: 14px; color: var(--text); }
.cliente-card .cm  { font-size: 11px; color: var(--text3); display: flex; gap: 10px; flex-wrap: wrap; margin-top: 3px; }
.cliente-card .arr { color: var(--gold); font-size: 16px; }

/* ── BADGES DE ESTADO ─────────────────────────────────────── */
.badge { font-size: 10px; padding: 2px 7px; border-radius: 20px; font-weight: bold; }
.badge-Pendiente  { background: #fef3c7; color: #92400e; }
.badge-Confirmado { background: #d1fae5; color: #065f46; }
.badge-Completado { background: #e0e7ff; color: #3730a3; }
.badge-Cancelado  { background: #fee2e2; color: #991b1b; }

/* ── DETALLE ──────────────────────────────────────────────── */
.detalle-header { background: linear-gradient(135deg,rgba(212,175,55,.1),rgba(212,175,55,.04)); border: 1px solid var(--gold-bdr); border-radius: 14px; padding: 18px; margin-bottom: 14px; }
.detalle-nombre { font-size: 20px; color: var(--text); margin-bottom: 4px; }
.detalle-meta   { font-size: 12px; color: var(--text3); display: flex; gap: 10px; flex-wrap: wrap; }
.detalle-section { background: var(--card-bg); border: 1px solid rgba(212,175,55,.15); border-radius: 12px; padding: 16px; margin-bottom: 11px; }
.detalle-section h3 { font-size: 14px; color: var(--gold); margin-bottom: 12px; }
.detalle-row { display: flex; gap: 10px; margin-bottom: 7px; }
.detalle-key  { font-size: 12px; color: var(--text3); min-width: 85px; }
.detalle-val  { font-size: 13px; color: #c8bea8; }
.pago-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.pago-box  { background: var(--card-bg); border-radius: 8px; padding: 10px; text-align: center; }
.pago-box.highlight { background: rgba(212,175,55,.1); border: 1px solid rgba(212,175,55,.3); }
.pago-box .pago-lbl { font-size: 11px; color: var(--text3); margin-bottom: 3px; }
.pago-box .pago-val { font-size: 15px; font-weight: bold; color: var(--text); }
.pago-box.highlight .pago-val { color: var(--gold); }

/* ── FORMULARIO TABS ──────────────────────────────────────── */
.form-tabs { display: flex; gap: 0; margin-bottom: 18px; overflow-x: auto; border-bottom: 1px solid var(--gold-bdr); }
.form-tabs .ftab { background: none; border: none; border-bottom: 2px solid transparent; color: var(--text3); padding: 8px 11px; cursor: pointer; font-size: 12px; white-space: nowrap; font-family: inherit; }
.form-tabs .ftab.active { border-bottom-color: var(--gold); color: var(--gold); background: var(--gold-dim); }

/* ── CHECKLIST EQUIPO ─────────────────────────────────────── */
.equipo-list { background: var(--card-bg); border: 1px solid rgba(212,175,55,.15); border-radius: 10px; overflow: hidden; }
.equipo-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; cursor: pointer; border-bottom: 1px solid rgba(255,255,255,.04); transition: background .15s; }
.equipo-item:last-child { border-bottom: none; }
.equipo-item:hover { background: rgba(212,175,55,.04); }
.equipo-item input[type=checkbox] { accent-color: var(--gold); width: 16px; height: 16px; flex-shrink: 0; }
.equipo-item.checked span { color: var(--gold); text-decoration: line-through; }
.equipo-count { text-align: right; margin-top: 6px; font-size: 11px; color: var(--text3); }

/* ── SALDO BOX ────────────────────────────────────────────── */
.saldo-box { background: rgba(212,175,55,.08); border: 1px solid rgba(212,175,55,.25); border-radius: 10px; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 13px; }
.saldo-box .saldo-lbl { color: var(--text2); font-size: 14px; }
.saldo-box .saldo-val { color: var(--gold); font-size: 20px; font-weight: bold; }

/* ── FORM NAV ─────────────────────────────────────────────── */
.form-nav { display: flex; justify-content: space-between; margin-top: 22px; gap: 10px; }
.form-nav-right { display: flex; gap: 8px; }

/* ── ESTADO SELECT ────────────────────────────────────────── */
select.estado-select { width: auto; border: none; border-radius: 20px; padding: 4px 11px; font-weight: bold; font-size: 11px; cursor: pointer; }

/* ── MAPAS ────────────────────────────────────────────────── */
.maps-row { display: flex; gap: 8px; align-items: center; }
.maps-row input { flex: 1; }
.maps-btn { background: rgba(66,183,100,.15); border: 1px solid rgba(66,183,100,.35); border-radius: 6px; padding: 9px 13px; font-size: 11px; color: #4ade80; text-decoration: none; white-space: nowrap; flex-shrink: 0; }

/* ── TIPO CEREMONIA ───────────────────────────────────────── */
.ceremonia-row { display: flex; gap: 7px; }
.cer-btn { flex: 1; padding: 9px 6px; border-radius: 8px; cursor: pointer; font-size: 12px; font-family: inherit; border: 1px solid var(--gold-bdr); background: rgba(255,255,255,.04); color: var(--text3); transition: all .15s; }
.cer-btn.active { border: 2px solid var(--gold); background: var(--gold-dim); color: var(--gold); font-weight: bold; }

/* ── CALENDARIO ───────────────────────────────────────────── */
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-nav { background: none; border: none; color: var(--gold); font-size: 22px; cursor: pointer; padding: 0 4px; }
.cal-titulo { color: var(--text); font-weight: bold; font-size: 14px; min-width: 150px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-dow  { text-align: center; font-size: 10px; color: var(--text3); padding: 3px 0; }
.cal-day  { min-height: 46px; border-radius: 7px; padding: 4px; background: rgba(255,255,255,.02); border: 1px solid rgba(255,255,255,.04); }
.cal-day.hoy  { background: rgba(212,175,55,.1); border-color: rgba(212,175,55,.5); }
.cal-day .cal-num { font-size: 11px; color: var(--text3); line-height: 1.4; }
.cal-day.hoy .cal-num { color: var(--gold); font-weight: bold; }
.cal-ev { margin-top: 2px; border-radius: 3px; padding: 1px 3px; font-size: 8px; color: #fff; cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; line-height: 1.6; }
.cal-legend { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.cal-legend-item { display: flex; align-items: center; gap: 4px; font-size: 10px; color: var(--text3); }
.cal-dot { width: 9px; height: 9px; border-radius: 2px; }

/* ── PRÓXIMOS EVENTOS ─────────────────────────────────────── */
.prox-ev { background: var(--card-bg); border-radius: 8px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; margin-bottom: 8px; cursor: pointer; }
.prox-fecha { font-size: 11px; color: var(--gold); min-width: 70px; }
.prox-nombre { font-size: 13px; color: var(--text); }
.prox-lugar  { font-size: 11px; color: var(--text3); }

/* ── LOADING ──────────────────────────────────────────────── */
#loading { display: none; position: fixed; inset: 0; background: rgba(15,12,26,.92); z-index: 200; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
#loading.active { display: flex; }
.spinner { width: 40px; height: 40px; border: 3px solid rgba(212,175,55,.2); border-top-color: var(--gold); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#loading p { color: var(--gold); font-size: 16px; }

/* ── EMPTY STATE ──────────────────────────────────────────── */
.empty-state { text-align: center; padding: 50px 20px; color: var(--text3); }
.empty-state .es-icon { font-size: 44px; margin-bottom: 10px; }
.empty-state p { font-size: 15px; color: var(--text3); }

/* ── TOAST ────────────────────────────────────────────────── */
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #1e1530; border: 1px solid var(--gold-bdr); border-radius: 10px; padding: 10px 20px; font-size: 13px; color: var(--text); display: none; z-index: 300; box-shadow: 0 4px 20px rgba(0,0,0,.5); }
#toast.show { display: block; animation: fadeIn .2s; }
@keyframes fadeIn { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .pago-grid  { grid-template-columns: 1fr 1fr; }
}
