:root {
  --navy: #1A3A5A;
  --navy-2: #254A6E;
  --blue: #2F6FED;
  --blue-soft: #E8F0FE;
  --green: #1F9D57;
  --green-soft: #E6F7EE;
  --red: #D64545;
  --red-soft: #FDECEC;
  --orange: #E89A2B;
  --orange-soft: #FFF4E5;
  --purple: #6B4C9A;
  --purple-soft: #F1EAF8;
  --bg: #F4F7FB;
  --surface: #FFFFFF;
  --text: #1C2430;
  --muted: #667588;
  --border: #E3E9F1;
  --shadow: 0 8px 24px rgba(26, 58, 90, 0.08);
  --radius: 16px;
  --radius-sm: 12px;
  --nav-h: 64px;
  --topbar-h: 56px;
  --sidebar-w: 260px;
  --font: "DM Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, #d9e7f8 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #e8f0fe 0%, transparent 50%),
    var(--bg);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; display: block; }

.desktop-only { display: none !important; }
.mobile-only { display: flex !important; }

@media (min-width: 960px) {
  .desktop-only { display: inline-flex !important; }
  .mobile-only { display: none !important; }
}

/* Shell */
.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
@media (min-width: 960px) {
  .app-shell { margin-left: var(--sidebar-w); }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: rgba(255,255,255,0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-brand {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  overflow: hidden;
}
.topbar-brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: block;
}
.topbar-title {
  font-weight: 700;
  font-size: 1.05rem;
  flex: 1;
  min-width: 0;
}
.topbar-user { display: inline-flex; }

.app-main {
  flex: 1;
  padding: 16px 16px calc(var(--nav-h) + 24px);
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}
.app-main--auth {
  padding: 0;
  max-width: none;
  min-height: 100dvh;
  display: grid;
  place-items: center;
}
@media (min-width: 960px) {
  .app-main { padding: 28px 32px 40px; }
}

/* Sidebar */
.sidebar {
  display: none;
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--navy);
  color: #fff;
  z-index: 60;
  flex-direction: column;
  padding: 20px 14px;
}
@media (min-width: 960px) {
  .sidebar { display: flex; }
}
.sidebar-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 10px 20px;
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
.brand-mark img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: block;
}
.brand-name { font-weight: 700; font-size: 1.05rem; }
.brand-sub { opacity: 0.7; font-size: 0.8rem; }
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  flex: 1;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  color: rgba(255,255,255,0.82);
  transition: background .15s ease;
}
.sidebar-link:hover, .sidebar-link.is-active {
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 14px;
  margin-top: 12px;
}
.sidebar-user {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  padding: 0 6px;
}
.sidebar-user strong { display: block; font-size: 0.9rem; }
.sidebar-user small { opacity: 0.65; }
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,20,35,0.45);
  z-index: 55;
}

/* Bottom nav */
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  height: var(--nav-h);
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  background: none;
  border: 0;
  padding: 8px 4px;
  cursor: pointer;
}
.bottom-nav-item.is-active { color: var(--navy); }
.bn-icon { display: grid; place-items: center; }

/* Sheet (Más) */
.sheet-overlay {
  position: fixed; inset: 0;
  background: rgba(10,20,35,0.45);
  z-index: 70;
}
.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 71;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 12px 16px 28px;
  max-height: 75dvh;
  overflow: auto;
  box-shadow: var(--shadow);
}
.sheet-handle {
  width: 40px; height: 4px;
  background: #D5DEE8;
  border-radius: 99px;
  margin: 4px auto 14px;
}
.sheet-title { margin: 0 0 12px; font-size: 1.05rem; }
.sheet-list { display: flex; flex-direction: column; }
.sheet-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 4px;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}
.sheet-link--danger { color: var(--red); border-bottom: 0; }

/* Auth */
body.auth-page {
  background:
    radial-gradient(900px 500px at 15% -5%, #c5daf5 0%, transparent 55%),
    radial-gradient(700px 420px at 100% 10%, #dce8f8 0%, transparent 50%),
    linear-gradient(165deg, #1A3A5A 0%, #254A6E 42%, #F4F7FB 42.1%);
  min-height: 100dvh;
}
.auth-hero {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  position: relative;
  padding: 24px 16px;
}
.auth-hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.12) 0%, transparent 40%),
    radial-gradient(circle at 80% 30%, rgba(47,111,237,0.18) 0%, transparent 35%);
}
.auth-wrap {
  width: min(440px, 100%);
  position: relative;
  z-index: 1;
}
.auth-card {
  background: var(--surface);
  border-radius: 24px;
  padding: 28px 22px;
  box-shadow: 0 20px 50px rgba(26,58,90,0.18);
  border: 1px solid rgba(255,255,255,0.85);
}
.auth-card--pro {
  padding: 32px 24px 28px;
}
.auth-brand { text-align: center; margin-bottom: 8px; }
.auth-brand-logo {
  display: block;
  width: min(220px, 72vw);
  height: auto;
  margin: 0 auto 10px;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
}
.auth-logo {
  width: 76px; height: 76px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--navy), #3a6ea5);
  box-shadow: 0 12px 28px rgba(26,58,90,0.28);
}
.auth-card h1 {
  text-align: center;
  margin: 0 0 4px;
  font-size: 1.55rem;
  color: var(--navy);
  letter-spacing: -0.02em;
}
.auth-parish {
  margin: 0 0 6px;
  color: var(--blue);
  font-weight: 600;
  font-size: 0.92rem;
}
.auth-sub {
  text-align: center;
  color: var(--muted);
  margin: 0 0 22px;
  font-size: 0.95rem;
}
.auth-error {
  background: var(--red-soft);
  color: #9B1C1C;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 0.9rem;
  font-weight: 500;
}
.form-control--lg { padding: 14px 16px; font-size: 1rem; }
.btn-lg { padding: 14px 18px; font-size: 1.05rem; border-radius: 14px; }
.auth-form .btn { margin-top: 8px; }

.auth-credit {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 20px auto 0;
  padding: 0;
  width: fit-content;
  max-width: 100%;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}
.auth-credit-text {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: #8A95A5;
  text-align: center;
  text-transform: none;
}
.auth-credit-logo {
  display: block;
  height: 30px;
  width: auto;
  max-height: 30px;
  max-width: 110px;
  object-fit: contain;
  object-position: center;
  aspect-ratio: auto;
  opacity: 0.78;
}

/* Forms */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--navy);
}
.form-control {
  width: 100%;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus {
  border-color: #8BB0E8;
  box-shadow: 0 0 0 4px rgba(47,111,237,0.12);
}
.input-password {
  position: relative;
}
.input-password .form-control { padding-right: 44px; }
.toggle-pass {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  border: 0; background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
}
.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
  margin: 8px 0 16px;
}
.form-check input { width: 16px; height: 16px; accent-color: var(--navy); }
.form-footer-link {
  display: block;
  text-align: center;
  margin-top: 14px;
  color: var(--blue);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .1s ease, opacity .15s;
}
.btn:active { transform: scale(0.98); }
.btn-block { width: 100%; }
.btn-primary {
  background: linear-gradient(180deg, var(--navy-2), var(--navy));
  color: #fff;
  box-shadow: 0 8px 18px rgba(26,58,90,0.22);
}
.btn-secondary {
  background: var(--blue-soft);
  color: var(--navy);
}
.btn-ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
}
.btn-danger { background: var(--red); color: #fff; }
.btn-success { background: var(--green); color: #fff; }
.btn-sm { padding: 8px 12px; border-radius: 10px; font-size: 0.85rem; }

/* Cards & UI */
.page-header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 18px;
}
.page-header h1 {
  margin: 0;
  font-size: 1.45rem;
  color: var(--navy);
}
.page-header p {
  margin: 4px 0 0;
  color: var(--muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.card + .card { margin-top: 14px; }

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (min-width: 720px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}
.stat-card {
  border-radius: var(--radius);
  padding: 16px;
  color: #fff;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow);
}
.stat-card--full { grid-column: 1 / -1; }
@media (min-width: 720px) {
  .stat-card--full { grid-column: auto; }
}
.stat-card h3 {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0.9;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.stat-card .stat-value {
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.1;
}
.stat-card .stat-sub { opacity: 0.9; font-size: 0.85rem; margin-top: 4px; }
.stat-card.blue { background: linear-gradient(145deg, #2F6FED, #1A3A5A); }
.stat-card.green { background: linear-gradient(145deg, #2BB673, #1F7A4A); }
.stat-card.purple { background: linear-gradient(145deg, #8B6BBF, #6B4C9A); }
.stat-card.orange { background: linear-gradient(145deg, #F0A04B, #D9822B); }
.stat-card.navy { background: linear-gradient(145deg, #254A6E, #1A3A5A); }

.section-title {
  margin: 22px 0 12px;
  font-size: 1rem;
  color: var(--navy);
}

.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (min-width: 720px) {
  .quick-grid { grid-template-columns: repeat(3, 1fr); }
}
.quick-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-weight: 700;
  color: var(--navy);
  min-height: 92px;
}
.quick-btn span.icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--blue-soft);
  color: var(--blue);
}
.quick-btn.disabled {
  opacity: 0.55;
  pointer-events: none;
}

.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--navy);
  display: grid; place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
  font-weight: 700;
}
.avatar-sm { width: 34px; height: 34px; font-size: 0.85rem; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.badge-success { background: var(--green-soft); color: var(--green); }
.badge-danger { background: var(--red-soft); color: var(--red); }
.badge-warning { background: var(--orange-soft); color: #B86A00; }
.badge-muted { background: #EEF2F7; color: var(--muted); }

.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
table.data th, table.data td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
}
table.data th {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.empty-state {
  text-align: center;
  padding: 28px 16px;
  color: var(--muted);
}

.alert-list { display: flex; flex-direction: column; gap: 8px; }
.alert-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 12px;
  background: #FFF8E8;
  border: 1px solid #F5E2B8;
  color: #7A5A12;
  font-size: 0.92rem;
}

/* Toasts */
.toast-stack {
  position: fixed;
  left: 16px; right: 16px;
  bottom: calc(var(--nav-h) + 16px);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
@media (min-width: 960px) {
  .toast-stack {
    left: auto;
    right: 24px;
    bottom: 24px;
    width: 340px;
  }
}
.toast {
  pointer-events: auto;
  background: #123049;
  color: #fff;
  padding: 12px 14px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-weight: 600;
  font-size: 0.92rem;
  animation: toastIn .2s ease;
}
.toast.success { background: var(--green); }
.toast.danger, .toast.error { background: var(--red); }
.toast.warning { background: #C47F17; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.coming-soon {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

/* Sprint 2 — filters, entities, profile */
.filters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
@media (min-width: 720px) {
  .filters {
    grid-template-columns: 1.4fr 1fr 1fr auto auto;
    align-items: center;
  }
}
.btn-ghost-light {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--border);
}
.muted { color: var(--muted); }
.small { font-size: 0.8rem; margin: 6px 0 0; }

.entity-list { display: flex; flex-direction: column; gap: 10px; }
.entity-card {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}
.entity-card--link { cursor: pointer; transition: transform .1s ease, border-color .15s; }
.entity-card--link:active { transform: scale(0.99); }
.entity-card--link:hover { border-color: #B7CBE8; }
.entity-card-body { flex: 1; min-width: 0; }
.entity-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.entity-card-top h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--navy);
}
.entity-card-body > .muted {
  margin: 0 0 6px;
  font-size: 0.88rem;
}
.entity-card--stack {
  flex-direction: column;
  align-items: stretch;
}
.entity-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.entity-card--stack .entity-card-actions {
  margin-top: 8px;
}
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: var(--muted);
  font-size: 0.82rem;
}
.chevron {
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
}

.youth-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--navy);
  display: grid;
  place-items: center;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
}
.youth-avatar img { width: 100%; height: 100%; object-fit: cover; }
.youth-avatar--lg { width: 72px; height: 72px; font-size: 1.2rem; }
.youth-avatar--xl { width: 84px; height: 84px; font-size: 1.4rem; }

.photo-upload {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.form-card { max-width: 640px; }
.form-section {
  margin: 18px 0 12px;
  font-size: 0.95rem;
  color: var(--navy);
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 12px;
}
@media (min-width: 600px) {
  .form-row { grid-template-columns: 1fr 1fr; }
}
textarea.form-control { resize: vertical; min-height: 80px; }

.profile-hero { margin-bottom: 12px; }
.profile-hero-main {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}
.profile-hero h1 {
  margin: 0 0 6px;
  font-size: 1.25rem;
  color: var(--navy);
}
.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
@media (min-width: 600px) {
  .profile-stats { grid-template-columns: repeat(5, 1fr); }
}
.mini-stat {
  background: var(--bg);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
}
.mini-stat .label {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}
.mini-stat strong { color: var(--navy); font-size: 1.05rem; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin: 0 0 14px;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.tab {
  flex: 0 0 auto;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  white-space: nowrap;
}
.tab.is-active {
  background: var(--navy);
  color: #fff;
}

.card-title {
  margin: 0 0 14px;
  font-size: 1rem;
  color: var(--navy);
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 0;
}
@media (min-width: 600px) {
  .detail-grid { grid-template-columns: 1fr 1fr; }
}
.detail-grid dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 2px;
}
.detail-grid dd {
  margin: 0;
  font-weight: 600;
  color: var(--text);
}
.notes-block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.notes-block p { margin: 6px 0 0; color: var(--muted); }

.timeline { display: flex; flex-direction: column; gap: 12px; }
.timeline-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.timeline-item:last-child { border-bottom: 0; padding-bottom: 0; }
.timeline-date {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}
.timeline-body strong { display: block; margin-bottom: 4px; color: var(--navy); }
.timeline-body p { margin: 0 0 4px; font-size: 0.9rem; }

.modal[hidden] { display: none !important; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: end center;
  padding: 16px;
}
@media (min-width: 600px) {
  .modal { place-items: center; }
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 20, 35, 0.45);
}
.modal-card {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  width: min(420px, 100%);
  box-shadow: var(--shadow);
}
.modal-card h3 {
  margin: 0 0 8px;
  color: var(--navy);
}
.modal-card p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.92rem;
}
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Sprint 3 — Asistencia (mobile-first, centrado) */
.att-page-header { margin-bottom: 14px; }
.att-page-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
  margin: 0;
}

.att-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}
.att-filter-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.att-filter-item .form-label {
  margin: 0;
  font-size: 0.78rem;
  text-align: left;
}
.att-filter-item .form-control {
  width: 100%;
  min-height: 48px;
  font-size: 0.95rem;
}
@media (min-width: 720px) {
  .att-filters { grid-template-columns: 200px 1fr; max-width: 560px; }
}

.att-summary {
  margin-bottom: 14px;
  padding: 16px 12px 14px;
}
.att-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  text-align: center;
  align-items: start;
}
.att-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  padding: 4px 2px;
}
.att-stat .num {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.1;
}
.att-stat small {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.2;
}
.att-stat.ok .num { color: var(--green); }
.att-stat.bad .num { color: var(--red); }
.att-stat.warn .num { color: #C47F17; }
.att-stat.muted .num { color: var(--navy); }

.att-progress {
  margin-top: 12px;
  height: 8px;
  background: #E8EEF5;
  border-radius: 999px;
  overflow: hidden;
}
.att-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--green), #3ecf8e);
  border-radius: 999px;
  transition: width .25s ease;
}

.att-toolbar { margin: 0 0 16px; }
.att-toolbar-hint {
  margin: 8px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.att-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 8px;
}
.att-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  transition: border-color .15s, opacity .15s;
}
.att-card.is-saving { opacity: 0.7; }
.att-card.status-presente { border-left: 5px solid var(--green); background: linear-gradient(90deg, #f3fbf6, #fff 30%); }
.att-card.status-falta { border-left: 5px solid var(--red); background: linear-gradient(90deg, #fdf4f4, #fff 30%); }
.att-card.status-retardo { border-left: 5px solid var(--orange); background: linear-gradient(90deg, #fff8ef, #fff 30%); }
.att-card.status-justificado { border-left: 5px solid var(--purple); background: linear-gradient(90deg, #f8f4fc, #fff 30%); }

.att-card-head {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}
.att-card-info {
  flex: 1;
  min-width: 0;
}
.att-card-info h3 {
  margin: 0 0 4px;
  font-size: 1.02rem;
  color: var(--navy);
  line-height: 1.25;
}
.att-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 0.82rem;
  color: var(--muted);
}
.att-status-label { font-weight: 700; color: var(--navy); }

/* Pagos / entregas */
.fee-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.fee-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 52px;
  padding: 8px 4px;
  border: 1.5px dashed #C9D5E5;
  border-radius: 12px;
  background: #F7FAFD;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s, transform .08s;
}
.fee-chip:disabled {
  cursor: default;
  opacity: 0.95;
}
.fee-chip:not(:disabled):active { transform: scale(0.97); }
.fee-chip.is-busy { opacity: 0.6; }
.fee-chip .fee-ico { font-size: 1rem; line-height: 1; }
.fee-chip .fee-txt { text-align: center; line-height: 1.15; }
.fee-chip.is-on {
  background: var(--green-soft);
  border-style: solid;
  border-color: var(--green);
  color: var(--green);
}
.fee-chip.is-delivered {
  background: var(--blue-soft);
  border-color: var(--blue);
  color: var(--blue);
}
.fee-chip.is-mass {
  background: var(--purple-soft);
  border-color: var(--purple);
  color: var(--purple);
}

/* 2×2 asistencia — siempre equilibrado en móvil */
.att-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.att-btn {
  border: 1.5px solid var(--border);
  background: #fff;
  border-radius: 14px;
  padding: 12px 6px;
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--muted);
  cursor: pointer;
  min-height: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-align: center;
  transition: background .12s, color .12s, border-color .12s, transform .08s, box-shadow .12s;
}
.att-btn-icon { font-size: 1.05rem; line-height: 1; }
.att-btn:active { transform: scale(0.97); }
.att-btn--presente.is-active,
.att-btn--presente:hover {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  box-shadow: 0 6px 16px rgba(31,157,87,0.28);
}
.att-btn--falta.is-active,
.att-btn--falta:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 6px 16px rgba(214,69,69,0.28);
}
.att-btn--retardo.is-active,
.att-btn--retardo:hover {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
  box-shadow: 0 6px 16px rgba(232,154,43,0.28);
}
.att-btn--justificado.is-active,
.att-btn--justificado:hover {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
  box-shadow: 0 6px 16px rgba(107,76,154,0.28);
}

@media (max-width: 360px) {
  .att-stat .num { font-size: 1.15rem; }
  .att-stat small { font-size: 0.58rem; }
  .fee-chip { font-size: 0.62rem; min-height: 48px; }
  .att-btn { font-size: 0.72rem; min-height: 54px; }
}

.pct-bar-wrap { margin-top: 4px; }
.pct-bar-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.9rem;
}
.pct-bar {
  height: 10px;
  background: #E8EEF5;
  border-radius: 99px;
  overflow: hidden;
}
.pct-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--green), #2BB673);
  border-radius: 99px;
}

.badge-att--presente { background: var(--green-soft); color: var(--green); }
.badge-att--falta { background: var(--red-soft); color: var(--red); }
.badge-att--retardo { background: var(--orange-soft); color: #B86A00; }
.badge-att--justificado { background: var(--purple-soft); color: var(--purple); }

/* Sprint 4 — Controles Sí/No */
.ctrl-filters {
  grid-template-columns: 1fr 1fr;
}
@media (min-width: 720px) {
  .ctrl-filters { grid-template-columns: 160px 1fr 1fr; }
}
.ctrl-progress { margin-bottom: 12px; }
.filter-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 12px;
  -webkit-overflow-scrolling: touch;
}
.filter-tab {
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--border);
}
.filter-tab.is-active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.ctrl-list { display: flex; flex-direction: column; gap: 10px; }
.ctrl-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
}
.ctrl-card.is-saving { opacity: 0.7; }
.ctrl-card.is-yes { border-left: 4px solid var(--green); }
.ctrl-card.is-no { border-left: 4px solid var(--red); }
.ctrl-card.is-pending { border-left: 4px solid #C5D0DE; }

.ctrl-card-main {
  display: flex;
  gap: 12px;
  align-items: center;
}
.ctrl-card-main h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  color: var(--navy);
}
.ctrl-value-label { font-weight: 700; color: var(--navy); }

.ctrl-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ctrl-btn {
  border: 1.5px solid var(--border);
  background: #fff;
  border-radius: 12px;
  padding: 14px 10px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--muted);
  cursor: pointer;
  min-height: 52px;
  transition: background .12s, color .12s, border-color .12s, transform .08s;
}
.ctrl-btn:active { transform: scale(0.97); }
.ctrl-btn--yes.is-active,
.ctrl-btn--yes:hover {
  background: var(--green-soft);
  border-color: var(--green);
  color: var(--green);
}
.ctrl-btn--no.is-active,
.ctrl-btn--no:hover {
  background: var(--red-soft);
  border-color: var(--red);
  color: var(--red);
}

/* Sprint 5 — Promedios y notas */
.avg-list { display: flex; flex-direction: column; gap: 12px; padding-bottom: 80px; }
.avg-card { margin: 0; }
.avg-card-head {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}
.avg-card-head h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  color: var(--navy);
}
.avg-card-head .btn { margin-left: auto; }
.avg-result { font-size: 0.9rem; color: var(--muted); }
.avg-result strong { color: var(--purple); font-size: 1.1rem; }
.avg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (min-width: 720px) {
  .avg-grid { grid-template-columns: repeat(3, 1fr); }
}
.sticky-save {
  position: sticky;
  bottom: calc(var(--nav-h) + 12px);
  z-index: 30;
  padding: 8px 0;
  background: linear-gradient(transparent, var(--bg) 30%);
}
@media (min-width: 960px) {
  .sticky-save { bottom: 16px; }
}
.avg-hero {
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--purple);
  text-align: center;
  line-height: 1;
  margin: 8px 0 6px;
}

.notes-feed { display: flex; flex-direction: column; gap: 12px; }
.note-card h3 {
  margin: 6px 0;
  color: var(--navy);
  font-size: 1.05rem;
}
.note-card p { margin: 0 0 10px; color: var(--muted); font-size: 0.92rem; }
.note-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.note-photo {
  width: 100%;
  border-radius: 14px;
  margin-bottom: 14px;
  max-height: 280px;
  object-fit: cover;
}

/* Sprint 6 — Reportes */
.report-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 600px) {
  .report-grid { grid-template-columns: 1fr 1fr; }
}
.report-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  text-decoration: none;
  transition: border-color .15s, transform .08s;
}
.report-tile strong { color: var(--navy); font-size: 1.05rem; }
.report-tile span { color: var(--muted); font-size: 0.85rem; }
.report-tile:active { transform: scale(0.99); }
.report-tile:hover { border-color: #B7CBE8; }

.report-filters {
  grid-template-columns: 1fr 1fr;
}
@media (min-width: 800px) {
  .report-filters { grid-template-columns: repeat(4, 1fr) auto; }
}
.export-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.btn-success { background: var(--green); color: #fff; }

@media print {
  .sidebar, .bottom-nav, .topbar, .filters, .export-bar, .page-header .btn,
  .sheet, .sheet-overlay, .toast-stack { display: none !important; }
  .app-shell { margin: 0 !important; }
  .app-main { padding: 0 !important; max-width: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 0; }
}

/* Sprint 7 — Bitácora */
.audit-list { display: flex; flex-direction: column; gap: 10px; }
.audit-item { margin: 0; padding: 14px; }
.audit-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.audit-item-top time {
  font-size: 0.8rem;
  color: var(--muted);
}
.audit-desc {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 0.95rem;
}

/* Roles v2 — dashboard por grupo, usuarios, asignación */
.group-dash-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 8px;
}
@media (min-width: 700px) {
  .group-dash-grid { grid-template-columns: 1fr 1fr; }
}
.group-dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.group-dash-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.group-dash-top h3 {
  margin: 0;
  color: var(--navy);
  font-size: 1.1rem;
}
.group-dash-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
  margin-bottom: 14px;
}
.group-dash-stats .num {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy);
}
.group-dash-stats small {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}
.group-dash-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.user-card-body {
  display: flex;
  gap: 12px;
  align-items: center;
}
.user-avatar, .user-avatar-lg {
  flex-shrink: 0;
}
.user-avatar-lg {
  width: 72px;
  height: 72px;
  font-size: 1.4rem;
}
.photo-upload-row {
  display: flex;
  gap: 14px;
  align-items: center;
}
.assign-box {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 0 0 16px;
}
.assign-box legend {
  font-weight: 700;
  color: var(--navy);
  padding: 0 6px;
}
.assign-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.assign-row:last-child { border-bottom: 0; }
.form-control--sm {
  width: auto;
  min-width: 120px;
  padding: 8px 10px;
  font-size: 0.85rem;
}
.check-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
@media (min-width: 520px) {
  .check-grid { grid-template-columns: 1fr 1fr; }
}

/* Saludo + código de grupo */
.topbar-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  line-height: 1.2;
}
.topbar-hello {
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-group {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 0.04em;
}
.dash-welcome h1 { margin-bottom: 6px; }
.dash-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
  color: var(--muted);
  margin: 0;
}
.dash-sep { margin: 0 6px; opacity: 0.5; }
.group-chip {
  display: inline-flex;
  align-items: center;
  background: var(--blue-soft);
  color: var(--navy);
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.88rem;
  letter-spacing: 0.03em;
}
.group-code {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: 0.04em;
  line-height: 1.1;
}
.group-dash-top h3 {
  margin: 4px 0 0;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
}
.group-code-inline {
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--navy);
}
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ============================================================
   UX PRO — mobile banking-inspired (iPhone first)
   ============================================================ */
:root {
  --ux-navy: #173B63;
  --ux-blue: #2F6FED;
  --ux-bg: #F3F6FA;
  --ux-card: #FFFFFF;
  --ux-line: #E6ECF3;
  --ux-muted: #7A8798;
  --ux-radius: 14px;
  --ux-shadow: 0 4px 18px rgba(23, 59, 99, 0.07);
}

@media (max-width: 959px) {
  body {
    background: var(--ux-bg);
  }
  .app-main {
    padding: 12px 16px calc(var(--nav-h) + 20px);
  }
  .topbar {
    height: 52px;
    padding: 0 16px;
    background: rgba(255,255,255,0.94);
    border-bottom: 1px solid var(--ux-line);
  }
  .topbar-hello {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ux-navy);
  }
  .topbar-group {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--ux-blue);
    letter-spacing: 0.04em;
  }
  .bottom-nav {
    border-top: 1px solid var(--ux-line);
    box-shadow: 0 -4px 20px rgba(23,59,99,0.05);
  }
}

.ux-page { max-width: 520px; margin: 0 auto; }
.ux-page-head { margin: 4px 0 16px; }
.ux-page-head h1 {
  margin: 0 0 10px;
  font-size: 1.55rem;
  font-weight: 750;
  color: var(--ux-navy);
  letter-spacing: -0.02em;
}

.ux-hero {
  margin: 2px 0 18px;
  padding: 4px 2px 2px;
}
.ux-hero-kicker {
  margin: 0 0 2px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ux-muted);
}
.ux-hero h1 {
  margin: 0 0 12px;
  font-size: 1.7rem;
  font-weight: 750;
  color: var(--ux-navy);
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.ux-hero-meta,
.ux-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ux-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #EEF3F9;
  color: var(--ux-navy);
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1;
}
.ux-pill--accent {
  background: var(--blue-soft);
  color: var(--ux-blue);
}
.ux-pill .ui-icon { flex-shrink: 0; }

.ux-section { margin-bottom: 22px; }
.ux-section-title {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ux-muted);
}

.ux-group-stack { display: flex; flex-direction: column; gap: 12px; }
.ux-group-card {
  background: var(--ux-card);
  border: 1px solid var(--ux-line);
  border-radius: 18px;
  box-shadow: var(--ux-shadow);
  padding: 16px;
}
.ux-group-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}
.ux-group-code {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ux-navy);
  letter-spacing: 0.02em;
  line-height: 1.1;
}
.ux-group-name {
  margin: 4px 0 0;
  font-size: 0.88rem;
  color: var(--ux-muted);
  font-weight: 500;
}
.ux-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 700;
}
.ux-group-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
  padding: 12px 4px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: #F7FAFD;
}
.ux-group-metrics strong {
  display: block;
  font-size: 1.1rem;
  color: var(--ux-navy);
  font-weight: 800;
}
.ux-group-metrics span {
  font-size: 0.68rem;
  color: var(--ux-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.ux-group-actions {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 8px;
}

.ux-btn-primary,
.ux-btn-ghost,
.ux-btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-weight: 700;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  min-height: 44px;
  padding: 0 14px;
  font-size: 0.9rem;
}
.ux-btn-primary {
  background: var(--ux-navy);
  color: #fff;
}
.ux-btn-ghost {
  background: #EEF3F9;
  color: var(--ux-navy);
}
.ux-btn-sm { min-height: 42px; font-size: 0.85rem; width: 100%; }

.ux-summary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--ux-card);
  border: 1px solid var(--ux-line);
  border-radius: 18px;
  box-shadow: var(--ux-shadow);
  padding: 16px;
  margin-bottom: 10px;
}
.ux-summary-label {
  display: block;
  font-size: 0.75rem;
  color: var(--ux-muted);
  font-weight: 650;
  margin-bottom: 4px;
}
.ux-summary-value {
  font-size: 1.6rem;
  color: var(--ux-navy);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.ux-summary-side {
  min-width: 88px;
  text-align: right;
  font-weight: 750;
  color: var(--ux-blue);
  font-size: 0.95rem;
}
.ux-summary-side .ux-kpi-bar { margin-top: 8px; }

.ux-mini-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.ux-mini-stat {
  background: var(--ux-card);
  border: 1px solid var(--ux-line);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
  box-shadow: var(--ux-shadow);
}
.ux-mini-stat strong {
  display: block;
  font-size: 1.35rem;
  color: var(--ux-navy);
  font-weight: 800;
}
.ux-mini-stat span {
  font-size: 0.72rem;
  color: var(--ux-muted);
  font-weight: 600;
}

.ux-alert-stack { display: flex; flex-direction: column; gap: 8px; }
.ux-alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #FFF8EB;
  border: 1px solid #F0E0C0;
  color: #8A6A2A;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.88rem;
  font-weight: 550;
}
.ux-alert .ui-icon { flex-shrink: 0; margin-top: 1px; }

.ux-menu-list {
  background: var(--ux-card);
  border: 1px solid var(--ux-line);
  border-radius: 18px;
  box-shadow: var(--ux-shadow);
  overflow: hidden;
}
.ux-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  border-bottom: 1px solid var(--ux-line);
  color: inherit;
}
.ux-menu-item:last-child { border-bottom: 0; }
.ux-menu-item:active { background: #F7FAFD; }
.ux-menu-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: #EEF3F9;
  color: var(--ux-navy);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.ux-menu-text { flex: 1; min-width: 0; }
.ux-menu-text strong {
  display: block;
  font-size: 0.95rem;
  color: var(--ux-navy);
  font-weight: 700;
}
.ux-menu-text small {
  color: var(--ux-muted);
  font-size: 0.78rem;
}
.ux-menu-chevron { color: #B0BBC8; }

/* Asistencia UX */
.ux-filters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
@media (min-width: 420px) {
  .ux-filters { grid-template-columns: 1fr 1.2fr; }
}
.ux-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ux-field label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ux-muted);
  letter-spacing: 0.02em;
}
.ux-input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--ux-line);
  border-radius: 12px;
  background: #fff;
  padding: 0 14px;
  color: var(--ux-navy);
  font-weight: 600;
  outline: none;
}
.ux-input:focus {
  border-color: #9BB8E8;
  box-shadow: 0 0 0 4px rgba(47,111,237,0.12);
}

.ux-kpi {
  background: var(--ux-card);
  border: 1px solid var(--ux-line);
  border-radius: 18px;
  box-shadow: var(--ux-shadow);
  padding: 14px 10px 12px;
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px 2px;
}
.ux-kpi-item {
  text-align: center;
  padding: 4px 2px;
}
.ux-kpi-item strong {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ux-navy);
  line-height: 1.1;
}
.ux-kpi-item span {
  display: block;
  margin-top: 3px;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--ux-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.ux-kpi-item.is-ok strong { color: var(--green); }
.ux-kpi-item.is-bad strong { color: var(--red); }
.ux-kpi-item.is-warn strong { color: #C47F17; }
.ux-kpi-bar {
  grid-column: 1 / -1;
  height: 6px;
  background: #E8EEF5;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}
.ux-kpi-bar i,
.ux-kpi-bar .att-progress-bar {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2F6FED, #5B8DEF);
  border-radius: 999px;
}

.ux-toolbar { margin-bottom: 14px; text-align: center; }
.ux-toolbar .ux-btn-primary { width: 100%; min-height: 48px; border-radius: 14px; }
.ux-toolbar p {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: var(--ux-muted);
}

.ux-empty {
  background: var(--ux-card);
  border: 1px solid var(--ux-line);
  border-radius: 16px;
  padding: 28px 18px;
  text-align: center;
  color: var(--ux-muted);
}

/* Attendance cards override — clean PRO */
.att-list { gap: 10px; }
.att-card {
  border-radius: 16px;
  border: 1px solid var(--ux-line);
  box-shadow: var(--ux-shadow);
  padding: 14px;
  background: #fff;
}
.att-card.status-presente,
.att-card.status-falta,
.att-card.status-retardo,
.att-card.status-justificado {
  background: #fff;
}
.att-card.status-presente { border-left: 4px solid var(--green); }
.att-card.status-falta { border-left: 4px solid var(--red); }
.att-card.status-retardo { border-left: 4px solid var(--orange); }
.att-card.status-justificado { border-left: 4px solid var(--purple); }

.att-card-head { margin-bottom: 12px; }
.att-card-info h3 {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--ux-navy);
}
.att-status-label {
  display: inline-block;
  margin-top: 2px;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--ux-muted);
}

.att-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.att-btn {
  min-height: 52px;
  border-radius: 12px;
  border: 1.5px solid var(--ux-line);
  background: #F8FAFC;
  color: var(--ux-muted);
  font-size: 0.78rem;
  font-weight: 700;
  gap: 4px;
  padding: 10px 6px;
  box-shadow: none;
}
.att-btn .ui-icon { opacity: 0.85; }
.att-btn--presente.is-active,
.att-btn--presente:hover {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  box-shadow: none;
}
.att-btn--falta.is-active,
.att-btn--falta:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  box-shadow: none;
}
.att-btn--retardo.is-active,
.att-btn--retardo:hover {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
  box-shadow: none;
}
.att-btn--justificado.is-active,
.att-btn--justificado:hover {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
  box-shadow: none;
}

/* Hide old fee chips if any leftover */
.fee-row { display: none !important; }

/* Iconos SVG */
.ui-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Tabs filtro (misa / libros) */
.ux-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 14px;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}
.ux-tab {
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: 999px;
  background: #EEF3F9;
  color: var(--ux-navy);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.ux-tab.is-active {
  background: var(--ux-navy);
  color: #fff;
}

/* Controles diarios — cards PRO */
.ctrl-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ctrl-card {
  background: #fff;
  border: 1px solid var(--ux-line);
  border-radius: 16px;
  box-shadow: var(--ux-shadow);
  padding: 14px;
}
.ctrl-card.is-yes { border-left: 4px solid var(--green); }
.ctrl-card.is-no { border-left: 4px solid var(--red); }
.ctrl-card.is-pending { border-left: 4px solid #C5D0DC; }
.ctrl-card-main {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.ctrl-card-main h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--ux-navy);
}
.ctrl-value-label {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--ux-muted);
}
.ctrl-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.ctrl-btn {
  min-height: 46px;
  border-radius: 12px;
  border: 1.5px solid var(--ux-line);
  background: #F8FAFC;
  color: var(--ux-muted);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}
.ctrl-btn--yes.is-active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.ctrl-btn--no.is-active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

/* Pagos en módulos Libros / Misa */
.fee-toggles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 2px;
}
.fee-toggles:has(> :only-child) {
  grid-template-columns: 1fr;
}
.fee-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1.5px solid var(--ux-line);
  background: #F8FAFC;
  color: var(--ux-muted);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.fee-toggle.is-on {
  background: #E8F1FF;
  border-color: #9BB8E8;
  color: var(--ux-blue);
}
.fee-toggle.is-busy { opacity: 0.6; }
.fee-toggle:disabled {
  cursor: default;
  opacity: 0.85;
}

@media (max-width: 380px) {
  .ux-kpi-item span { font-size: 0.58rem; }
  .ux-kpi-item strong { font-size: 1.1rem; }
  .att-btn { font-size: 0.72rem; min-height: 50px; }
}
