/* ── CARDS ─────────────────────────────────────────────────── */
.card {
  background: var(--surface); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 10px;
}

/* ── BADGES ────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: .62rem; font-weight: 600; padding: 2px 7px;
  border-radius: 20px; white-space: nowrap;
}
.badge-muted   { background: var(--surface2); color: var(--text3); }
.badge-accent  { background: var(--accent-l); color: var(--accent); }
.badge-danger  { background: var(--danger-l); color: var(--danger); }
.badge-success { background: var(--success-l); color: var(--success); }
.badge-warning { background: var(--warning-l); color: var(--warning); }

/* ── BOTONES ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 11px 18px; border-radius: var(--r-sm);
  font-size: .88rem; font-weight: 600; cursor: pointer;
  border: none; font-family: inherit; transition: opacity .2s;
}
.btn:active { opacity: .82; }
.btn-primary { background: var(--accent); color: #fff; width: 100%; margin-top: 4px; }
.btn-danger  { background: var(--danger-l); color: var(--danger); padding: 5px 10px; font-size: .72rem; border-radius: 7px; }
.btn-ghost   { background: var(--surface2); color: var(--text2); }

/* ── FORMULARIOS ───────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block; font-size: .74rem; font-weight: 600;
  color: var(--text3); margin-bottom: 6px;
}
.form-control {
  width: 100%; padding: 11px 14px;
  background: var(--surface2); border: 1.5px solid transparent;
  border-radius: var(--r-sm); color: var(--text);
  font-size: .88rem; font-family: inherit; outline: none;
  transition: border-color .2s; appearance: none;
}
.form-control:focus { border-color: var(--accent); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 72px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ── MODALES ───────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(5px);
  display: none; align-items: flex-end; justify-content: center;
}
.overlay.open { display: flex; }

.modal {
  background: var(--surface); border-radius: var(--r) var(--r) 0 0;
  width: 100%; max-width: 520px; max-height: 88dvh;
  overflow-y: auto;
  animation: slideUp .26s cubic-bezier(.34,1.1,.64,1);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@media (min-width: 640px) {
  .overlay { align-items: center; }
  .modal { border-radius: var(--r); }
}

.modal-handle {
  width: 36px; height: 4px; border-radius: 2px;
  background: var(--surface3); margin: 10px auto 0;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
}
.modal-title { font-size: .98rem; font-weight: 700; }
.modal-close {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface2); border: none; cursor: pointer;
  color: var(--text3); display: flex; align-items: center; justify-content: center;
}
.modal-close svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2.5; }
.modal-body { padding: 16px 20px 32px; }

/* ── TABS ──────────────────────────────────────────────────── */
.tabs {
  display: flex; gap: 4px; background: var(--surface2);
  border-radius: var(--r-sm); padding: 3px; margin-bottom: 16px;
}
.tab {
  flex: 1; padding: 8px 6px; border-radius: 8px;
  border: none; background: none; color: var(--text3);
  font-size: .74rem; font-weight: 500; cursor: pointer;
  font-family: inherit; transition: all .2s;
}
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ── TOGGLE ────────────────────────────────────────────────── */
.toggle {
  width: 48px; height: 28px; border-radius: 14px;
  background: var(--surface3); border: none; cursor: pointer;
  position: relative; transition: background .3s; flex-shrink: 0;
}
.toggle.on { background: var(--success); }
.toggle::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2);
  transition: transform .3s;
}
.toggle.on::after { transform: translateX(20px); }

/* ── SEARCH BAR ────────────────────────────────────────────── */
.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface2); border-radius: var(--r-sm);
  padding: 10px 14px; margin-bottom: 14px;
}
.search-bar svg { width: 17px; height: 17px; stroke: var(--text3); fill: none; stroke-width: 2; flex-shrink: 0; }
.search-bar input {
  flex: 1; background: none; border: none; outline: none;
  font-size: .88rem; color: var(--text); font-family: inherit;
}
.search-bar input::placeholder { color: var(--text3); }

/* ── SETTINGS ROWS ─────────────────────────────────────────── */
.settings-block {
  background: var(--surface); border-radius: var(--r);
  box-shadow: var(--shadow); overflow: hidden; margin-bottom: 12px;
}
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .15s;
  gap: 12px;
}
.settings-row:last-child { border-bottom: none; }
.settings-row:active { background: var(--surface2); }
.settings-row-info { flex: 1; min-width: 0; }
.settings-row-label { font-size: .88rem; font-weight: 500; }
.settings-row-sub { font-size: .72rem; color: var(--text3); margin-top: 1px; }
.settings-chevron { color: var(--text3); display: flex; }
.settings-chevron svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2.5; }

/* ── NOTA CARD ─────────────────────────────────────────────── */
.nota-card {
  background: var(--surface); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 13px 15px; margin-bottom: 8px;
  display: flex; align-items: center; gap: 12px;
}
.nota-icon {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.nota-icon svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.nota-info { flex: 1; min-width: 0; }
.nota-titulo { font-size: .84rem; font-weight: 600; }
.nota-sub { font-size: .72rem; color: var(--text3); margin-top: 2px; }
.nota-num { font-size: 1.45rem; font-weight: 700; min-width: 44px; text-align: right; }

.calc-box {
  border-radius: var(--r); padding: 16px; margin-bottom: 14px;
  color: #fff; text-align: center;
}
.calc-box .lbl { font-size: .72rem; opacity: .8; margin-bottom: 4px; }
.calc-box .val { font-size: 2rem; font-weight: 700; }
.calc-box .sub { font-size: .72rem; opacity: .75; margin-top: 4px; line-height: 1.4; }

.obj-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface2); border-radius: var(--r-sm);
  padding: 10px 14px; margin-bottom: 14px;
}
.obj-row label { font-size: .78rem; color: var(--text3); flex: 1; }
.obj-row input {
  width: 62px; padding: 5px 8px; text-align: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: .9rem;
  font-weight: 600; font-family: inherit; outline: none;
}

/* ── FALTA CARD ────────────────────────────────────────────── */
.falta-card {
  background: var(--surface); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 12px 15px; margin-bottom: 8px;
  display: flex; align-items: center; gap: 10px;
}
.falta-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.falta-info { flex: 1; }
.falta-tit { font-size: .83rem; font-weight: 600; }
.falta-sub { font-size: .72rem; color: var(--text3); margin-top: 2px; }

/* ── CALENDARIO ────────────────────────────────────────────── */
.cal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.cal-month { font-size: 1rem; font-weight: 700; }
.cal-nav-btn {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--surface2); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text2); transition: background .15s;
}
.cal-nav-btn:active { background: var(--surface3); }
.cal-nav-btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2.5; }

.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
}
.cal-day-lbl {
  text-align: center; font-size: .62rem; font-weight: 600;
  color: var(--text3); padding: 5px 0;
}
.cal-day {
  aspect-ratio: 1; border-radius: 8px;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; cursor: pointer; position: relative;
  gap: 2px; transition: background .15s;
}
.cal-day:active { background: var(--surface2); }
.cal-day.today .cal-num {
  background: var(--accent); color: #fff; border-radius: 50%;
  width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
}
.cal-day.other .cal-num { color: var(--text3); }
.cal-num { font-size: .82rem; font-weight: 500; }
.cal-dots { display: flex; gap: 2px; }
.cal-dot { width: 5px; height: 5px; border-radius: 50%; }

.cal-events-list { margin-top: 14px; }
.cal-ev {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.cal-ev:last-child { border-bottom: none; }
.cal-ev-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.cal-ev-title { font-size: .82rem; font-weight: 500; }
.cal-ev-sub { font-size: .7rem; color: var(--text3); margin-top: 1px; }
