/* Servi-Agenda — estilos (alineados al portal Servi-Net) */
.ag-body {
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.ag-body .header {
  padding-top: env(safe-area-inset-top, 0px);
}

.ag-main.portal-main {
  padding: calc(5.25rem + env(safe-area-inset-top, 0px)) 1rem calc(3.5rem + env(safe-area-inset-bottom, 0px));
}

.ag-container {
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

.ag-hint-center {
  text-align: center;
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.ag-hint-center a {
  color: var(--accent);
}

.ag-topbar {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.ag-topbar-text {
  min-width: 0;
}

.ag-app-title {
  font-size: 1.45rem;
  font-weight: 700;
  margin: 0;
  color: var(--text);
  line-height: 1.15;
}

.ag-empresa {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Evita el .btn { width:100% } global del sitio en móvil */
.ag-topbar-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  align-items: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.15rem;
  scrollbar-width: none;
}

.ag-topbar-actions::-webkit-scrollbar {
  display: none;
}

.ag-btn-compact,
.ag-btn-icon,
#ag-app .btn.ag-btn-compact,
#ag-app .btn.ag-btn-icon,
.ag-month-nav .btn {
  width: auto !important;
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
}

.ag-btn-icon {
  min-width: 2.4rem;
  padding-left: 0.55rem;
  padding-right: 0.55rem;
  font-size: 1.15rem;
  line-height: 1;
}

.ag-toast {
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: var(--accent-dim);
  color: var(--text);
  font-size: 0.9rem;
}

.ag-panel {
  padding: 1rem 1.1rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}

.ag-panel-title {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.ag-panel-desc {
  margin: 0 0 0.85rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.ag-install-steps {
  margin: 0.5rem 0 0.75rem;
  padding-left: 1.2rem;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.45;
}

.ag-install-steps li {
  margin-bottom: 0.35rem;
}

.ag-google-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-top: 0.35rem;
}

.ag-google-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

.ag-month-nav {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.ag-month-label {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 600;
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.ag-view-tabs {
  display: flex;
  gap: 0.35rem;
  margin: -0.35rem 0 0.9rem;
  padding: 0.2rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
}

.ag-view-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  cursor: pointer;
}

.ag-view-tab.active {
  background: rgba(56, 139, 253, 0.18);
  color: #79b8ff;
}

.ag-vista {
  touch-action: pan-y;
}

.ag-cal {
  margin-bottom: 1rem;
}

.ag-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
  margin-bottom: 0.35rem;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.ag-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.2rem;
}

.ag-cal-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.12rem;
  min-height: 4.5rem;
  padding: 0.25rem 0.15rem 0.3rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

.ag-cal-cell.is-empty {
  background: transparent;
  min-height: 4.5rem;
  pointer-events: none;
}

.ag-cal-cell.has-events {
  background: rgba(255, 255, 255, 0.025);
}

.ag-cal-cell.is-today .ag-cal-num {
  background: #e11d48;
  color: #fff;
  border-radius: 999px;
  width: 1.55rem;
  height: 1.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
}

.ag-cal-cell.is-today {
  border-color: transparent;
  box-shadow: none;
}

.ag-cal-cell.is-selected {
  background: rgba(56, 139, 253, 0.12);
  border-color: rgba(56, 139, 253, 0.35);
}

.ag-cal-cell.is-past-day {
  opacity: 0.78;
}

.ag-cal-num {
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  align-self: flex-end;
  padding-right: 0.1rem;
  color: var(--text-muted);
}

.ag-cal-cell.has-events .ag-cal-num,
.ag-cal-cell.is-today .ag-cal-num {
  color: var(--text);
}

.ag-cal-emojis {
  display: none;
}

.ag-cal-chips {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  margin-top: 0.05rem;
  min-width: 0;
}

.ag-cal-chip {
  display: flex;
  align-items: flex-start;
  gap: 0.12rem;
  padding: 0.12rem 0.2rem;
  border-radius: 4px;
  background: rgba(30, 58, 95, 0.9);
  border: 1px solid rgba(88, 166, 255, 0.16);
  min-width: 0;
  max-width: 100%;
}

.ag-cal-chip.is-past {
  opacity: 0.65;
  background: rgba(55, 60, 70, 0.7);
}

.ag-cal-chip-emoji {
  flex-shrink: 0;
  font-size: 0.68rem;
  line-height: 1.15;
}

.ag-cal-chip-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font-size: 0.55rem;
  line-height: 1.15;
  font-weight: 500;
  color: #c9d7ea;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ag-cal-chip-time {
  font-size: 0.5rem;
  font-weight: 400;
  color: rgba(201, 215, 234, 0.65);
  font-variant-numeric: tabular-nums;
}

.ag-cal-more {
  font-size: 0.58rem;
  color: var(--text-muted);
  line-height: 1;
  padding-left: 0.08rem;
}

@media (max-width: 419px) {
  /* En pantallas chicas: solo emojis (como la captura densa) */
  .ag-cal-cell {
    min-height: 4.1rem;
  }

  .ag-cal-emojis {
    display: flex;
    flex-wrap: wrap;
    gap: 0.05rem 0.08rem;
    font-size: 0.85rem;
    line-height: 1.15;
  }

  .ag-cal-chips {
    display: none;
  }
}

@media (min-width: 420px) {
  .ag-cal-cell {
    min-height: 5.4rem;
    padding: 0.3rem 0.2rem 0.35rem;
  }

  .ag-cal-chip-text {
    font-size: 0.6rem;
  }
}

@media (min-width: 640px) {
  .ag-cal-cell {
    min-height: 6.2rem;
  }

  .ag-cal-chip-text {
    font-size: 0.65rem;
  }
}

.ag-cal-swipe-hint {
  text-align: center;
  margin: 0.65rem 0 0.35rem;
  font-size: 0.75rem;
}

.ag-cal-dia {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ag-cal-dia-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
}

.ag-cal-dia-titulo {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: capitalize;
  color: var(--text);
  flex: 1 1 auto;
  min-width: 0;
}

.ag-cal-dia-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
}

.ag-cal-dia-empty .ag-hint {
  margin: 0;
}

.ag-lista {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* display:flex arriba pisa el [hidden] del UA → la lista quedaba visible bajo el calendario */
.ag-lista[hidden],
.ag-cal[hidden],
.ag-cal-dia[hidden],
.ag-vacio[hidden],
.ag-recurrencia-extra[hidden],
.ag-rec-dias[hidden],
#ag-recurrencia-dias-wrap[hidden] {
  display: none !important;
}

.ag-card {
  display: grid;
  grid-template-columns: 3.75rem 1fr;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  cursor: pointer;
  text-align: left;
  width: 100%;
  max-width: 100%;
  color: inherit;
  font: inherit;
  overflow: hidden;
  transition: border-color var(--transition), transform 0.15s ease;
}

.ag-card:hover,
.ag-card:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.ag-card-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(0, 212, 170, 0.12);
  color: var(--accent);
  min-height: 3.6rem;
}

.ag-card-day-num {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1;
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
}

.ag-card-day-wd {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.2rem;
  opacity: 0.85;
}

.ag-card-body {
  min-width: 0;
  overflow: hidden;
}

.ag-card-title {
  margin: 0 0 0.2rem;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.ag-card-title-text {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ag-card-badge {
  flex: 0 0 auto;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.1rem 0.4rem;
  line-height: 1.2;
}

.ag-card.is-past {
  opacity: 0.48;
  background: transparent;
}

.ag-card.is-past .ag-card-day {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-muted);
}

.ag-card.is-past .ag-card-title {
  font-weight: 500;
  color: var(--text-muted);
}

.ag-card.is-past .ag-card-thumb {
  filter: grayscale(0.55);
  opacity: 0.75;
}

.ag-lista-sep {
  margin: 0.85rem 0 0.15rem;
  padding: 0 0.15rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.ag-det-ahora {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  background: rgba(0, 212, 170, 0.18);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  letter-spacing: 0.02em;
  animation: ag-ahora-pulse 1.2s ease-in-out 0s 4;
}

.ag-llamada {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: max(1.5rem, env(safe-area-inset-top)) 1.25rem max(2rem, env(safe-area-inset-bottom));
  background:
    radial-gradient(ellipse 120% 80% at 50% 0%, #1e4d3f 0%, transparent 55%),
    linear-gradient(180deg, #0f141a 0%, #07090c 100%);
  -webkit-user-select: none;
  user-select: none;
}

.ag-llamada[hidden] {
  display: none !important;
}

.ag-llamada.is-answered {
  background:
    radial-gradient(ellipse 100% 70% at 50% 10%, #16352c 0%, transparent 50%),
    linear-gradient(180deg, #0c1016 0%, #050608 100%);
}

.ag-llamada-inner {
  width: min(100%, 400px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: #e8ecef;
  flex: 1;
}

.ag-llamada-avatar {
  position: relative;
  width: 7.5rem;
  height: 7.5rem;
  margin: 2.5rem 0 1.25rem;
  display: grid;
  place-items: center;
}

.ag-llamada-avatar-core {
  position: relative;
  z-index: 2;
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 2.1rem;
  background: linear-gradient(145deg, #2a9d7a, #147a5c);
  box-shadow: 0 10px 40px rgba(0, 212, 170, 0.35);
}

.ag-llamada-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(0, 212, 170, 0.45);
  opacity: 0;
}

.ag-llamada.is-ringing .ag-llamada-ring-1 {
  animation: ag-call-ripple 2.2s ease-out infinite;
}

.ag-llamada.is-ringing .ag-llamada-ring-2 {
  animation: ag-call-ripple 2.2s ease-out 0.7s infinite;
}

.ag-llamada.is-ringing .ag-llamada-avatar-core {
  animation: ag-call-bob 1.1s ease-in-out infinite;
}

@keyframes ag-call-ripple {
  0% {
    transform: scale(0.72);
    opacity: 0.7;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

@keyframes ag-call-bob {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}

.ag-llamada-from {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.ag-llamada-label {
  margin: 0.55rem 0 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #00d4aa;
}

.ag-llamada.is-ringing .ag-llamada-label {
  animation: ag-llamada-pulse 1.4s ease-in-out infinite;
}

.ag-llamada-timer {
  margin: 0.35rem 0 0;
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 0.06em;
}

.ag-llamada-titulo {
  margin: 1.35rem 0 0;
  font-size: clamp(1.45rem, 5vw, 1.85rem);
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  max-width: 20ch;
}

.ag-llamada-cuando {
  margin: 0.55rem 0 0;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.68);
  max-width: 28ch;
}

.ag-llamada-script {
  margin: 1.1rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.92rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.88);
  text-align: left;
  max-width: 100%;
}

.ag-llamada-actions {
  display: flex;
  gap: 2.75rem;
  justify-content: center;
  margin-top: auto;
  padding-top: 2.5rem;
  width: 100%;
}

.ag-llamada-act {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
}

.ag-llamada-act-label {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.65);
}

.ag-llamada-btn {
  width: 4.75rem;
  height: 4.75rem;
  border: 0;
  border-radius: 50%;
  font-size: 1.55rem;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
  line-height: 1;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.ag-llamada-btn-mute {
  background: #e74c3c;
}

.ag-llamada-btn-ok {
  background: #27ae60;
  animation: ag-call-answer-glow 1.6s ease-in-out infinite;
}

.ag-llamada-btn-repeat {
  background: #2c6fad;
}

.ag-llamada.is-answered .ag-llamada-btn-ok {
  animation: none;
}

@keyframes ag-call-answer-glow {
  0%,
  100% {
    box-shadow: 0 8px 24px rgba(39, 174, 96, 0.35);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 10px 32px rgba(39, 174, 96, 0.65);
    transform: scale(1.05);
  }
}

@keyframes ag-llamada-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

@keyframes ag-ahora-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}

.ag-card-meta {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ag-card-thumb {
  margin-top: 0.45rem;
  max-height: 72px;
  border-radius: 8px;
  object-fit: cover;
  max-width: 100%;
}

.ag-vacio {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 1rem;
  font-size: 0.95rem;
}

.ag-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(0, 0, 0, 0.72);
  -webkit-overflow-scrolling: touch;
}

.ag-overlay[hidden] {
  display: none !important;
}

#ag-lote {
  z-index: 10060;
}

.ag-sheet {
  width: 100%;
  max-width: 520px;
  max-height: min(92vh, 900px);
  overflow: auto;
  background: var(--bg-card, #13161d);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.45);
}

@media (min-width: 640px) {
  .ag-overlay {
    align-items: center;
    padding: 1rem;
  }

  .ag-sheet {
    border-radius: 14px;
    max-height: min(90vh, 860px);
  }
}

.ag-modal-form {
  padding: 1.15rem 1.15rem 1.25rem;
}

.ag-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  position: sticky;
  top: 0;
  background: var(--bg-card, #13161d);
  z-index: 2;
  padding-top: 0.15rem;
}

.ag-modal-header h2 {
  margin: 0;
  font-size: 1.15rem;
}

.ag-modal-x {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.55rem;
  border-radius: 8px;
  min-width: 2.4rem;
  min-height: 2.4rem;
}

.ag-modal-x:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.ag-body.ag-modal-open {
  overflow: hidden;
}

.ag-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 520px) {
  .ag-row-2 {
    grid-template-columns: 1fr;
  }

  .ag-body .header .nav-list {
    display: none;
  }

  .ag-main.portal-main {
    padding-top: calc(5rem + env(safe-area-inset-top, 0px));
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }
}

.ag-card-badge-repeat {
  background: rgba(56, 139, 253, 0.2);
  color: #58a6ff;
  margin-left: 0.35rem;
}

.ag-det-recurrencia {
  color: #58a6ff;
  font-size: 0.9rem;
}

.ag-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.35rem 0;
  font-size: 0.92rem;
  cursor: pointer;
}

.ag-recurrencia-panel {
  margin: 0.75rem 0 0.85rem;
  border-radius: 10px;
  transition: background 0.15s, border-color 0.15s, padding 0.15s;
}

.ag-recurrencia-panel.is-active {
  padding: 0.75rem 0.85rem;
  background: rgba(56, 139, 253, 0.07);
  border: 1px solid rgba(56, 139, 253, 0.22);
}

.ag-rec-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.ag-rec-row > label {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  flex-shrink: 0;
}

.ag-rec-select {
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

.ag-recurrencia-extra {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.ag-rec-dias {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ag-rec-dias-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.ag-rec-dias-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.ag-rec-dia {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0.5rem 0.65rem;
  min-height: 2.4rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.ag-rec-dia.is-on,
.ag-rec-dia:has(input:checked) {
  border-color: rgba(56, 139, 253, 0.5);
  background: rgba(56, 139, 253, 0.2);
  color: #79b8ff;
}

.ag-rec-dia input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.ag-rec-hasta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.ag-rec-hasta label {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  flex-shrink: 0;
}

.ag-rec-hasta input[type='date'] {
  flex: 1;
  min-width: 10rem;
  max-width: 100%;
}

.ag-rec-hint {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
}

.ag-fieldset {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.85rem 0.85rem;
  margin: 0.85rem 0;
}

.ag-fieldset legend {
  padding: 0 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.ag-hint {
  margin: 0.4rem 0 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.ag-img-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.45rem;
}

.ag-img-actions .ag-hint {
  margin: 0;
}

.ag-det-imagen {
  margin-bottom: 0.75rem;
}

.ag-det-img-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  max-width: 7.5rem;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
}

.ag-det-img-btn img {
  width: 7.5rem;
  height: 7.5rem;
  max-width: 7.5rem;
  max-height: 7.5rem;
  border-radius: 10px;
  object-fit: cover;
  display: block;
  border: 1px solid var(--border);
}

.ag-det-img-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--accent);
  line-height: 1.2;
}

.ag-maps-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
}

.ag-maps-link:hover,
.ag-maps-link:focus-visible {
  color: #00f0c0;
}

.ag-lightbox {
  position: fixed;
  inset: 0;
  z-index: 11000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  padding-top: calc(1rem + env(safe-area-inset-top, 0px));
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}

.ag-lightbox[hidden] {
  display: none !important;
}

.ag-lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.ag-lightbox-x {
  position: absolute;
  top: calc(0.75rem + env(safe-area-inset-top, 0px));
  right: 0.75rem;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  border-radius: 10px;
  min-width: 2.6rem;
  min-height: 2.6rem;
  cursor: pointer;
}

.ag-img-preview img,
.ag-det-imagen img {
  max-width: 100%;
  max-height: 220px;
  border-radius: 10px;
  object-fit: cover;
  margin-top: 0.5rem;
}

.ag-sheet-lote {
  max-width: 520px;
}

.ag-lote-lista {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: min(50vh, 360px);
  overflow: auto;
  margin: 0.75rem 0;
  padding-right: 0.25rem;
}

.ag-lote-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.ag-lote-item input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.ag-lote-item-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.ag-lote-item-body strong {
  font-weight: 600;
  font-size: 0.95rem;
}

.ag-lote-item-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.ag-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.ag-modal-footer .btn {
  width: auto !important;
}

.ag-det-desc {
  margin: 0.85rem 0 0;
  white-space: pre-wrap;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ag-det-meta {
  margin: 0.25rem 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ag-google-checks {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

#ag-app .portal-container,
.ag-app {
  max-width: none;
}

@media (min-width: 700px) {
  .ag-topbar {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }

  .ag-topbar-actions {
    overflow: visible;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .ag-app-title {
    font-size: 1.65rem;
  }
}
