/* === ESCUDO APP ============================================= */

:root {
  --bg:        #0d0f1a;
  --surface:   #171a2b;
  --surface-2: #1e2138;
  --surface-3: #262a47;
  --accent:    #7c6bff;
  --accent-dim: rgba(124,107,255,.15);
  --danger:    #ff4757;
  --danger-dim: rgba(255,71,87,.12);
  --warning:   #ffa502;
  --warning-dim: rgba(255,165,2,.12);
  --success:   #2ed573;
  --success-dim: rgba(46,213,115,.12);
  --text:      #f1f2f6;
  --text-muted: #74788d;
  --text-dim:  #3e4168;
  --border:    rgba(255,255,255,.07);
  --border-hover: rgba(255,255,255,.14);
  --r:  16px;
  --rs: 10px;
  --nav-h: 72px;
  --hdr-h: 60px;
}

/* RESET */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html, body { height:100%; overflow:hidden; }

body {
  font-family:'Inter',-apple-system,BlinkMacSystemFont,sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── HEADER ─────────────────────────────────────────────── */
.header {
  position: fixed; inset:0 0 auto 0;
  height: var(--hdr-h);
  background: rgba(13,15,26,.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}
.header-content {
  display:flex; align-items:center; justify-content:space-between;
  height:100%; padding:0 20px;
}
.header-logo { display:flex; align-items:center; gap:10px; }
.logo-icon { font-size:24px; }
.logo-text {
  font-size:20px; font-weight:900; letter-spacing:-0.5px;
  background:linear-gradient(135deg,#7c6bff,#a78bfa);
  -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text;
}
.btn-export {
  display:flex; align-items:center; gap:6px;
  background:var(--surface-2); border:1px solid var(--border);
  color:var(--text); padding:8px 14px; border-radius:var(--rs);
  font-size:13px; font-weight:600; cursor:pointer;
  font-family:inherit; transition:all .2s;
}
.btn-export:hover { background:var(--accent); border-color:var(--accent); }
.btn-export i { color:var(--danger); }

/* ── MAIN ───────────────────────────────────────────────── */
.main-content {
  position:fixed;
  top:var(--hdr-h); bottom:var(--nav-h);
  left:0; right:0;
  overflow-y:auto; overflow-x:hidden;
  -webkit-overflow-scrolling:touch;
  scroll-behavior:smooth;
}

/* ── TABS ───────────────────────────────────────────────── */
.tab-pane { display:none; padding:20px; min-height:100%; animation:fadeIn .2s ease; }
.tab-pane.active { display:block; }
@keyframes fadeIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }

/* ── BOTTOM NAV ─────────────────────────────────────────── */
.bottom-nav {
  position:fixed; inset:auto 0 0 0;
  height:var(--nav-h);
  background:rgba(23,26,43,.97);
  backdrop-filter:blur(20px);
  border-top:1px solid var(--border);
  display:flex; z-index:100;
  overflow-x:auto;
  padding-bottom:env(safe-area-inset-bottom);
  scrollbar-width:none;
}
.bottom-nav::-webkit-scrollbar { display:none; }
.nav-btn {
  flex:1; display:flex; flex-direction:column;
  align-items:center; justify-content:center; gap:4px;
  background:none; border:none; color:var(--text-muted);
  cursor:pointer; transition:all .2s;
  position:relative; font-family:inherit;
}
.nav-btn i   { font-size:20px; transition:transform .2s; }
.nav-btn span{ font-size:10px; font-weight:500; letter-spacing:.3px; user-select:none; }
.nav-btn.active { color:var(--accent); }
.nav-btn.active i { transform:translateY(-2px); }
.nav-badge {
  position:absolute; top:8px; right:calc(50% - 18px);
  background:var(--danger); color:#fff;
  border-radius:10px; font-size:10px; font-weight:700;
  padding:1px 5px; min-width:16px; text-align:center; display:none;
}
.nav-badge.show { display:block; }

/* ── DASHBOARD ──────────────────────────────────────────── */
.dashboard { padding-bottom:24px; }
.dashboard-greeting { margin-bottom:24px; }
.greeting-sub { color:var(--text-muted); font-size:14px; }
.greeting-name { font-size:30px; font-weight:900; letter-spacing:-0.5px; }

.stats-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-bottom:28px; }
.stat-card {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--r); padding:16px 10px; text-align:center;
  cursor:pointer; transition:all .15s; position:relative; overflow:hidden;
}
.stat-card::after {
  content:''; position:absolute; inset:0;
  background:linear-gradient(135deg,transparent 60%,rgba(255,255,255,.02));
  pointer-events:none;
}
.stat-card:hover { transform:translateY(-2px); }
.stat-card:active { transform:scale(.97); }

.stat-danger { border-color:rgba(255,71,87,.3); background:linear-gradient(135deg,var(--surface),rgba(255,71,87,.06)); }
.stat-warning { border-color:rgba(255,165,2,.3); background:linear-gradient(135deg,var(--surface),rgba(255,165,2,.06)); }
.stat-red { border-color:rgba(255,71,87,.4); background:linear-gradient(135deg,var(--surface),rgba(255,71,87,.09)); }

.stat-icon { font-size:18px; margin-bottom:8px; }
.stat-danger .stat-icon { color:var(--danger); }
.stat-warning .stat-icon { color:var(--warning); }
.stat-red .stat-icon { color:var(--danger); }

.stat-value { font-size:20px; font-weight:900; line-height:1; margin-bottom:2px; }
.stat-label { font-size:9.5px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; color:var(--text-muted); margin-bottom:3px; }
.stat-sub { font-size:10px; color:var(--text-muted); }

.section-title { font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:1.2px; color:var(--text-muted); margin-bottom:12px; margin-top:4px; }

.recent-list { margin-bottom:24px; }

.recent-item {
  display:flex; align-items:center; gap:12px;
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--rs); padding:12px 14px; margin-bottom:8px;
  cursor:pointer; transition:all .15s;
}
.recent-item:hover { background:var(--surface-2); border-color:var(--border-hover); }
.recent-icon {
  width:36px; height:36px; border-radius:10px;
  display:flex; align-items:center; justify-content:center;
  font-size:15px; flex-shrink:0;
}
.ri-danger  { background:var(--danger-dim); }
.ri-warning { background:var(--warning-dim); }
.ri-success { background:var(--success-dim); }
.ri-purple  { background:var(--accent-dim); }
.recent-info { flex:1; min-width:0; }
.recent-title { font-size:13px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.recent-meta  { font-size:11px; color:var(--text-muted); }
.recent-time  { font-size:11px; color:var(--text-dim); flex-shrink:0; }

.quick-actions { display:flex; flex-direction:column; gap:8px; }
.quick-btn {
  display:flex; align-items:center; gap:12px;
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--rs); color:var(--text);
  padding:14px 16px; font-size:14px; font-weight:500;
  cursor:pointer; transition:all .15s;
  font-family:inherit; width:100%; text-align:left;
}
.quick-btn:hover { background:var(--surface-2); border-color:var(--accent); }
.quick-btn:hover .quick-arrow { color:var(--accent); }
.quick-btn > i:first-child { color:var(--accent); width:20px; text-align:center; }
.quick-btn > span { flex:1; }
.quick-arrow { color:var(--text-dim); font-size:12px; }

/* ── SECTION HEADER ─────────────────────────────────────── */
.section-header { margin-bottom:16px; }
.section-header h2 { font-size:22px; font-weight:900; letter-spacing:-0.3px; margin-bottom:12px; }
.filter-row { display:flex; gap:6px; flex-wrap:wrap; }
.filter-select {
  flex:1; min-width:90px;
  background:var(--surface); border:1px solid var(--border);
  color:var(--text); padding:8px 10px; border-radius:var(--rs);
  font-size:12px; font-family:inherit; appearance:none; cursor:pointer;
}
.intercambio-summary-bar { display:flex; gap:8px; flex-wrap:wrap; }
.summary-chip {
  display:flex; align-items:center; gap:5px;
  background:var(--surface); border:1px solid var(--border);
  border-radius:6px; padding:5px 10px;
  font-size:11px; font-weight:600; color:var(--text-muted);
}
.chip-danger { border-color:rgba(255,71,87,.3); color:var(--danger); background:var(--danger-dim); }
.chip-warning { border-color:rgba(255,165,2,.3); color:var(--warning); background:var(--warning-dim); }

/* ── LIST CARDS ─────────────────────────────────────────── */
.list-container { padding-bottom:90px; }

.item-card {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--r); padding:16px 16px 14px 20px;
  margin-bottom:10px; cursor:pointer; transition:all .15s;
  position:relative; overflow:hidden;
}
.item-card::before {
  content:''; position:absolute; left:0; top:0; bottom:0; width:4px; border-radius:4px 0 0 4px;
}
.item-card:hover { background:var(--surface-2); transform:translateX(2px); border-color:var(--border-hover); }
.item-card:active { transform:scale(.99); }

.card-grave-muy_grave::before  { background:var(--danger); }
.card-grave-grave::before      { background:var(--warning); }
.card-grave-leve::before       { background:#f7cd46; }
.card-late::before             { background:var(--danger); }
.card-on-time::before          { background:var(--success); }
.card-impago::before           { background:var(--danger); }
.card-parcial::before          { background:var(--warning); }
.card-pagado::before           { background:var(--success); }

.card-header { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:7px; }
.card-title { font-size:14px; font-weight:700; flex:1; margin-right:8px; line-height:1.3; }
.card-badges { display:flex; gap:4px; flex-wrap:wrap; justify-content:flex-end; flex-shrink:0; }

.badge {
  display:inline-flex; align-items:center;
  padding:3px 8px; border-radius:6px;
  font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.3px; white-space:nowrap;
}
.bd { background:var(--danger-dim); color:var(--danger); }
.bw { background:var(--warning-dim); color:var(--warning); }
.bs { background:var(--success-dim); color:var(--success); }
.bp { background:var(--accent-dim); color:var(--accent); }
.bg { background:rgba(255,255,255,.07); color:var(--text-muted); }

.card-desc {
  font-size:13px; color:var(--text-muted); line-height:1.4;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
  margin-bottom:8px;
}
.card-meta {
  display:flex; gap:10px; flex-wrap:wrap;
  font-size:11px; color:var(--text-dim);
}
.card-meta i { margin-right:3px; }
.card-photos { display:flex; gap:6px; margin-top:8px; flex-wrap:wrap; }
.card-photo-thumb { width:48px; height:48px; border-radius:8px; object-fit:cover; border:1px solid var(--border); }

/* ── EMPTY STATE ────────────────────────────────────────── */
.empty-state { text-align:center; padding:40px 20px; color:var(--text-muted); }
.empty-icon  { font-size:48px; display:block; margin-bottom:12px; opacity:.6; }
.empty-state p { font-size:14px; }

/* ── FAB ────────────────────────────────────────────────── */
.fab {
  position:fixed; bottom:calc(var(--nav-h) + 20px); right:20px;
  width:56px; height:56px; border-radius:50%;
  background:linear-gradient(135deg,#7c6bff,#a78bfa);
  border:none; color:#fff; font-size:22px; cursor:pointer;
  box-shadow:0 8px 28px rgba(124,107,255,.45);
  display:flex; align-items:center; justify-content:center;
  transition:all .2s; z-index:90;
}
.fab:hover { transform:scale(1.08); box-shadow:0 12px 36px rgba(124,107,255,.55); }
.fab:active { transform:scale(.95); }

/* ── DEBT MODULE ────────────────────────────────────────── */
.debt-total-card {
  background:linear-gradient(135deg,rgba(255,71,87,.14),rgba(255,71,87,.05));
  border:1px solid rgba(255,71,87,.3);
  border-radius:var(--r); padding:24px 20px; text-align:center; margin-bottom:16px;
}
.debt-label { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:1px; color:var(--text-muted); margin-bottom:8px; }
.debt-amount { font-size:44px; font-weight:900; color:var(--danger); letter-spacing:-2px; line-height:1; margin-bottom:16px; }
.debt-stats-row { display:flex; align-items:center; justify-content:center; gap:0; }
.debt-stat { text-align:center; padding:0 20px; }
.debt-stat-val  { display:block; font-size:16px; font-weight:800; color:var(--text); }
.debt-stat-lbl  { display:block; font-size:10px; color:var(--text-muted); margin-top:2px; }
.debt-stat-divider { width:1px; height:32px; background:var(--border); }

.chart-container {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--r); padding:16px; margin-bottom:16px; height:180px;
}

/* ── MODALS ─────────────────────────────────────────────── */
.modal-overlay {
  position:fixed; inset:0;
  background:rgba(0,0,0,.7);
  z-index:200; display:none;
  align-items:flex-end; justify-content:center;
  backdrop-filter:blur(4px);
}
.modal-overlay.open { display:flex; animation:ovIn .2s ease; }
@keyframes ovIn { from{opacity:0} to{opacity:1} }

.modal {
  background:var(--surface);
  border-radius:24px 24px 0 0;
  width:100%; max-height:92vh;
  display:flex; flex-direction:column;
  animation:slideUp .28s cubic-bezier(.25,.8,.25,1);
  border:1px solid var(--border); border-bottom:none;
  max-width:600px;
}
.modal-tall { max-height:88vh; }

@keyframes slideUp { from{transform:translateY(100%)} to{transform:translateY(0)} }

.modal-drag-handle {
  width:40px; height:4px; border-radius:2px;
  background:var(--border); margin:12px auto 0; flex-shrink:0;
}
.modal-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 20px; border-bottom:1px solid var(--border); flex-shrink:0;
}
.modal-header h3 { font-size:17px; font-weight:800; }
.modal-close {
  background:var(--surface-2); border:none; color:var(--text-muted);
  width:30px; height:30px; border-radius:50%; font-size:13px;
  cursor:pointer; display:flex; align-items:center; justify-content:center; transition:all .15s;
}
.modal-close:hover { background:var(--danger-dim); color:var(--danger); }

.modal-body { overflow-y:auto; padding:20px; flex:1; -webkit-overflow-scrolling:touch; }
.modal-footer {
  display:flex; gap:10px; padding:14px 20px;
  border-top:1px solid var(--border); flex-shrink:0;
  padding-bottom:calc(14px + env(safe-area-inset-bottom));
}

/* ── FORMS ──────────────────────────────────────────────── */
.form-group { margin-bottom:16px; }
.form-group label {
  display:block; font-size:11px; font-weight:700;
  text-transform:uppercase; letter-spacing:.5px; color:var(--text-muted); margin-bottom:6px;
}
.req { color:var(--danger); }
.opt { color:var(--text-dim); text-transform:none; letter-spacing:0; font-weight:400; font-size:10px; }
.rec { color:var(--accent); text-transform:none; letter-spacing:0; font-weight:500; font-size:10px; }

.form-input {
  width:100%; background:var(--surface-2); border:1px solid var(--border);
  color:var(--text); padding:11px 13px;
  border-radius:var(--rs); font-size:14px; font-family:inherit;
  transition:border-color .15s,box-shadow .15s;
  outline:none; appearance:none; -webkit-appearance:none;
}
.form-input:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(124,107,255,.18); }
.form-input option { background:var(--surface-2); color:var(--text); }
textarea.form-input { resize:vertical; min-height:80px; }

.form-row { display:grid; grid-template-columns:1fr 1fr; gap:10px; }

.checkbox-group { display:flex; gap:20px; }
.checkbox-group.vertical { flex-direction:column; gap:10px; }
.checkbox-label { display:flex; align-items:center; gap:10px; cursor:pointer; font-size:14px; position:relative; }
.checkbox-label input[type="checkbox"] { position:absolute; opacity:0; width:0; height:0; }
.checkbox-custom {
  width:20px; height:20px; border-radius:6px;
  background:var(--surface-2); border:1.5px solid var(--border);
  flex-shrink:0; transition:all .15s;
  display:flex; align-items:center; justify-content:center;
}
.checkbox-label input:checked ~ .checkbox-custom {
  background:var(--accent); border-color:var(--accent);
}
.checkbox-label input:checked ~ .checkbox-custom::after {
  content:'✓'; color:#fff; font-size:12px; font-weight:700;
}

/* ── PHOTO UPLOAD ───────────────────────────────────────── */
.photo-upload-area { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.photo-add-btn {
  display:flex; align-items:center; gap:8px;
  background:var(--surface-2); border:1.5px dashed var(--border);
  color:var(--text-muted); padding:10px 16px;
  border-radius:var(--rs); font-size:13px; cursor:pointer;
  transition:all .15s; font-family:inherit;
}
.photo-add-btn:hover { border-color:var(--accent); color:var(--accent); }
.photo-preview { display:flex; gap:8px; flex-wrap:wrap; }
.photo-thumb-wrap { position:relative; }
.photo-thumb { width:64px; height:64px; border-radius:10px; object-fit:cover; border:1px solid var(--border); }
.photo-remove {
  position:absolute; top:-6px; right:-6px;
  width:20px; height:20px; background:var(--danger);
  border:none; border-radius:50%; color:#fff; font-size:10px;
  cursor:pointer; display:flex; align-items:center; justify-content:center;
}

/* ── BUTTONS ────────────────────────────────────────────── */
.btn-primary, .btn-secondary {
  flex:1; padding:12px; border-radius:var(--rs);
  font-size:14px; font-weight:700; cursor:pointer; border:none;
  font-family:inherit; transition:all .15s;
  display:flex; align-items:center; justify-content:center; gap:6px;
}
.btn-primary { background:linear-gradient(135deg,var(--accent),#a78bfa); color:#fff; }
.btn-primary:hover { opacity:.9; transform:translateY(-1px); }
.btn-primary:active { transform:scale(.98); }

.btn-secondary { background:var(--surface-2); color:var(--text-muted); border:1px solid var(--border); }
.btn-secondary:hover { background:var(--surface-3); }

.btn-danger-sm {
  padding:12px 16px; border-radius:var(--rs);
  font-size:13px; font-weight:700; cursor:pointer;
  font-family:inherit; transition:all .15s;
  display:flex; align-items:center; gap:6px;
  background:var(--danger-dim); color:var(--danger);
  border:1px solid rgba(255,71,87,.25);
}
.btn-danger-sm:hover { background:rgba(255,71,87,.2); }

/* ── DETAIL VIEW ────────────────────────────────────────── */
.detail-section { margin-bottom:16px; padding-bottom:16px; border-bottom:1px solid var(--border); }
.detail-section:last-child { border-bottom:none; }
.detail-label { font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.5px; color:var(--text-muted); margin-bottom:4px; }
.detail-value { font-size:14px; line-height:1.55; }
.detail-photos { display:flex; gap:8px; flex-wrap:wrap; margin-top:8px; }
.detail-photo { width:80px; height:80px; border-radius:10px; object-fit:cover; border:1px solid var(--border); cursor:pointer; }
.detail-badges { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:14px; }
.detail-highlight { font-size:28px; font-weight:900; line-height:1; }

/* ── PDF INFO ───────────────────────────────────────────── */
.pdf-info {
  background:var(--accent-dim); border:1px solid rgba(124,107,255,.2);
  border-radius:var(--rs); padding:12px 14px; font-size:13px;
  color:var(--text-muted); margin-bottom:20px; line-height:1.5;
}
.field-hint {
  font-size:11px; color:var(--accent); margin-top:5px;
  min-height:14px; font-weight:500;
}


/* ── TOAST ──────────────────────────────────────────────── */
.toast {
  position:fixed; bottom:calc(var(--nav-h) + 16px); left:50%;
  transform:translateX(-50%) translateY(20px);
  background:var(--surface-2); border:1px solid var(--border-hover);
  color:var(--text); padding:11px 20px; border-radius:12px;
  font-size:13px; font-weight:600;
  opacity:0; transition:all .25s; pointer-events:none;
  white-space:nowrap; z-index:400;
  box-shadow:0 8px 24px rgba(0,0,0,.5);
}
.toast.show { opacity:1; transform:translateX(-50%) translateY(0); }

/* ── CONFIRM DIALOG ─────────────────────────────────────── */
.confirm-overlay {
  position:fixed; inset:0; background:rgba(0,0,0,.75);
  z-index:500; display:none; align-items:center; justify-content:center;
  backdrop-filter:blur(6px); padding:20px;
}
.confirm-overlay.open { display:flex; animation:ovIn .2s ease; }
.confirm-box {
  background:var(--surface-2); border:1px solid var(--border);
  border-radius:20px; padding:28px 24px; text-align:center;
  max-width:320px; width:100;
  animation:fadeIn .2s ease;
}
.confirm-icon { font-size:36px; margin-bottom:12px; }
.confirm-box h4 { font-size:17px; font-weight:800; margin-bottom:8px; }
.confirm-box p { font-size:13px; color:var(--text-muted); margin-bottom:24px; }
.confirm-actions { display:flex; gap:10px; }
.confirm-delete-btn {
  flex:1; padding:12px; border-radius:var(--rs);
  background:var(--danger); color:#fff; border:none;
  font-size:14px; font-weight:700; cursor:pointer; font-family:inherit; transition:opacity .15s;
}
.confirm-delete-btn:hover { opacity:.85; }

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (min-width:768px) {
  .modal {
    border-radius:var(--r); max-width:480px;
    margin:auto; max-height:88vh; border-bottom:1px solid var(--border);
  }
  .modal-overlay { align-items:center; }
  .confirm-overlay { padding:0; }
}

/* ── CALENDARIO ─────────────────────────────────────────── */
#tab-calendario { padding:16px; }

.cal-header { margin-bottom:16px; }

.cal-month-nav {
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom:12px;
}
.cal-month-title {
  font-size:20px; font-weight:900; letter-spacing:-0.3px;
}
.cal-nav-btn {
  background:var(--surface-2); border:1px solid var(--border);
  color:var(--text); width:36px; height:36px; border-radius:10px;
  cursor:pointer; display:flex; align-items:center; justify-content:center;
  font-size:13px; transition:all .15s;
}
.cal-nav-btn:hover { background:var(--accent-dim); border-color:var(--accent); color:var(--accent); }

.cal-legend {
  display:flex; gap:14px; margin-bottom:10px; flex-wrap:wrap;
}
.cal-legend-item {
  display:flex; align-items:center; gap:6px;
  font-size:12px; color:var(--text-muted); font-weight:500;
}
.cal-dot {
  width:10px; height:10px; border-radius:50%; flex-shrink:0;
}
.cal-dot-merche { background:#7c6bff; }
.cal-dot-isaac  { background:#ff4757; }
.cal-dot-cambio { background:#ffa502; }
.cal-dot-juicio { background:#f7cd46; }

.cal-stats-row {
  display:flex; gap:8px; flex-wrap:wrap; margin-bottom:4px;
}
.cal-stat-chip {
  display:flex; align-items:center; gap:5px;
  background:var(--surface); border:1px solid var(--border);
  border-radius:8px; padding:6px 12px;
  font-size:12px; font-weight:600;
}
.cal-stat-chip-m { border-color:rgba(124,107,255,.3); color:#a78bfa; }
.cal-stat-chip-i { border-color:rgba(255,71,87,.3); color:var(--danger); }
.cal-stat-chip-c { border-color:rgba(255,165,2,.3); color:var(--warning); }

.cal-grid-wrap {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--r); overflow:hidden;
}

.cal-weekdays {
  display:grid; grid-template-columns:repeat(7,1fr);
  border-bottom:1px solid var(--border);
}
.cal-weekdays > div {
  text-align:center; padding:8px 0;
  font-size:11px; font-weight:700; text-transform:uppercase;
  letter-spacing:.5px; color:var(--text-dim);
}

.cal-grid {
  display:grid; grid-template-columns:repeat(7,1fr);
}
.cal-cell {
  aspect-ratio:1;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  border-right:1px solid var(--border); border-bottom:1px solid var(--border);
  cursor:pointer; transition:all .15s; position:relative;
  min-height:44px; user-select:none;
}
.cal-cell:nth-child(7n)  { border-right:none; }
.cal-cell:hover { background:var(--surface-2); }
.cal-cell:active { transform:scale(.9); }

.cal-cell.empty { cursor:default; background:transparent; }
.cal-cell.today .cal-day { color:var(--accent); font-weight:800; }
.cal-cell.today::after {
  content:''; position:absolute; bottom:4px;
  width:4px; height:4px; border-radius:50%; background:var(--accent);
}

.cal-day {
  font-size:13px; font-weight:500; color:var(--text);
  line-height:1; margin-bottom:3px;
}

/* Estado de cada día */
.cal-cell.cs-merche { background:rgba(124,107,255,.18); }
.cal-cell.cs-merche .cal-day { color:#c4b5fd; font-weight:700; }
.cal-cell.cs-isaac  { background:rgba(255,71,87,.15); }
.cal-cell.cs-isaac  .cal-day { color:#ff6b78; font-weight:700; }
.cal-cell.cs-cambio { background:rgba(255,165,2,.15); }
.cal-cell.cs-cambio .cal-day { color:#ffc246; font-weight:700; }
.cal-cell.cs-juicio { background:rgba(247,205,70,.15); border:1px solid rgba(247,205,70,.4); }
.cal-cell.cs-juicio .cal-day { color:#f7cd46; font-weight:900; }

.cal-cell-indicator {
  width:6px; height:6px; border-radius:50%; flex-shrink:0;
}
.cs-merche .cal-cell-indicator { background:#7c6bff; }
.cs-isaac  .cal-cell-indicator { background:#ff4757; }
.cs-cambio .cal-cell-indicator { background:#ffa502; }
.cs-juicio .cal-cell-indicator { background:#f7cd46; }

.cal-juicio-icon {
  font-size:11px; line-height:1;
}
.cal-juicio-label {
  font-size:8px; color:#f7cd46; font-weight:700;
  text-align:center; line-height:1.2; max-width:100%;
  overflow:hidden; display:block; padding:0 2px;
  white-space:nowrap; text-overflow:ellipsis;
}

/* Dot for incidents on that day */
.cal-inc-dot {
  position:absolute; top:3px; right:4px;
  width:5px; height:5px; border-radius:50%;
  background:var(--danger); opacity:.8;
}

.cal-tip {
  font-size:11px; color:var(--text-dim); text-align:center;
  margin-top:12px; display:flex; align-items:center; justify-content:center; gap:6px;
}

.cal-fill-row {
  display:flex; gap:8px; margin-top:12px;
}
.cal-fill-btn {
  flex:1; display:flex; align-items:center; justify-content:center; gap:6px;
  background:var(--accent-dim); border:1px solid rgba(124,107,255,.3);
  color:var(--accent); padding:10px 14px; border-radius:var(--rs);
  font-size:12px; font-weight:700; cursor:pointer; font-family:inherit;
  transition:all .15s;
}
.cal-fill-btn:hover { background:rgba(124,107,255,.25); }
.cal-fill-btn-clear {
  background:var(--danger-dim); border-color:rgba(255,71,87,.25);
  color:var(--danger); flex:0 0 auto;
}
.cal-fill-btn-clear:hover { background:rgba(255,71,87,.2); }

/* ── TIMELINE ──────────────────────────────────────────── */
.timeline-container { padding:0 0 24px; }
.tl-year {
  font-size:20px; font-weight:900; color:var(--accent);
  padding:20px 0 10px; letter-spacing:-0.5px;
}
.tl-item {
  display:flex; gap:0; margin-bottom:2px;
  position:relative;
}
.tl-item::before {
  content:''; position:absolute; left:11px; top:24px; bottom:-2px;
  width:2px; background:rgba(255,255,255,.06);
}
.tl-item:last-child::before { display:none; }
.tl-dot {
  width:24px; height:24px; border-radius:50%;
  flex-shrink:0; margin-top:12px;
  box-shadow:0 0 10px currentColor;
  position:relative; z-index:1;
}
.tl-content {
  display:flex; align-items:flex-start; gap:10px;
  padding:10px 0 10px 12px; flex:1;
}
.tl-date {
  font-size:10px; color:var(--text-muted); white-space:nowrap;
  padding-top:3px; min-width:72px; flex-shrink:0;
}
.tl-icon { font-size:18px; flex-shrink:0; padding-top:1px; }
.tl-body { flex:1; }
.tl-title { font-size:13px; color:var(--text-primary); font-weight:500; line-height:1.4; }
.tl-sub { font-size:11px; color:var(--text-muted); margin-top:3px; }
.tl-item:hover .tl-body { opacity:.85; }

/* ── NAV BTN MIN WIDTH FOR 6 ITEMS ── */
.nav-btn { min-width:60px; }

