/* ===== Reset ===== */
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:#0f172a;
  background:
    radial-gradient(900px 500px at 20% 10%, rgba(42,171,238,.35), transparent 55%),
    radial-gradient(900px 500px at 80% 0%, rgba(34,158,217,.25), transparent 60%),
    radial-gradient(900px 700px at 70% 80%, rgba(0,136,204,.20), transparent 55%),
    linear-gradient(180deg, #eaf4ff 0%, #f6f8fb 55%, #f3f6fb 100%);
}

/* ===== Layout ===== */
.container{max-width:1200px;margin:0 auto;padding:18px}
.row{display:flex;gap:16px;flex-wrap:wrap}

/* ===== “Glass” cards ===== */
.card, .topbar{
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(0,136,204,.14);
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(2, 33, 69, .08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.card{
  padding: 16px;
  margin-bottom: 16px;
}

/* Cards internas (los cuadritos) con blur MÁS fuerte */
.card .card{
  background: rgba(255,255,255,.45);
  border: 1px solid rgba(0,136,204,.12);
  box-shadow: 0 10px 24px rgba(2, 33, 69, .07);
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
}

/* ===== Topbar ===== */
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
}

.logo{
  width:40px;
  height:40px;
  border-radius: 12px;
  object-fit: cover;
  background: rgba(0,136,204,.10);
  border: 1px solid rgba(0,136,204,.20);
}

.brand .title{
  font-size: 18px;
  font-weight: 800;
  color:#0b2440;
  letter-spacing:.2px;
}
.brand .sub{
  font-size: 13px;
  color: rgba(15, 23, 42, .70);
  margin-top: 2px;
}

/* ===== Nav ===== */
.nav{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.nav a{
  text-decoration:none;
  font-size:14px;
  color:#0b5fa5; /* telegram-ish */
  padding:8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
}
.nav a:hover{
  border-color: rgba(0,136,204,.18);
  background: rgba(0,136,204,.06);
}

/* ===== Text ===== */
h2{font-size:20px;margin-bottom:8px;color:#0b2440}
h3{font-size:16px;margin-bottom:6px;color:#0b2440}
.muted{color: rgba(15, 23, 42, .65); font-size:14px}

/* ===== Buttons (Telegram style) ===== */
.btn, button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid rgba(0,136,204,.35);
  background: linear-gradient(180deg, rgba(0,136,204,.95), rgba(0,119,188,.95));
  color: #fff;
  font-size: 14px;
  cursor:pointer;
  text-decoration:none;
  box-shadow: 0 10px 18px rgba(0,136,204,.18);
}
.btn:hover, button:hover{
  filter: brightness(1.03);
}
.btn:active, button:active{
  transform: translateY(1px);
}

.btn.secondary{
  background: rgba(0,136,204,.10);
  color:#0b5fa5;
  border-color: rgba(0,136,204,.22);
  box-shadow:none;
}

/* ===== Badges ===== */
.badge{
  display:inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(0,136,204,.18);
  background: rgba(0,136,204,.08);
  color:#0b5fa5;
}
.badge.warn{
  background: rgba(255, 214, 102, .55);
  border-color: rgba(255, 214, 102, .65);
  color: #7a5200;
}

/* ===== Tables ===== */
table{
  width:100%;
  border-collapse: collapse;
  background: rgba(255,255,255,.55);
  border:1px solid rgba(0,136,204,.14);
  border-radius: 14px;
  overflow:hidden;
}
th,td{
  padding: 9px 10px;
  border-bottom: 1px solid rgba(2, 33, 69, .08);
  font-size: 13px;
}
th{
  text-align:left;
  background: rgba(0,136,204,.06);
  color: rgba(15,23,42,.70);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
tr:hover td{background: rgba(0,136,204,.04)}
tr:last-child td{border-bottom:none}

/* ===== Forms ===== */
input, select, textarea{
  padding: 8px 10px;
  border: 1px solid rgba(2,33,69,.18);
  border-radius: 10px;
  background: rgba(255,255,255,.65);
  font-size: 13px;
  outline:none;
}
input:focus, select:focus, textarea:focus{
  border-color: rgba(0,136,204,.40);
  box-shadow: 0 0 0 3px rgba(0,136,204,.12);
}

/* ===== Alerts ===== */
.alert-ok{
  padding:10px 12px;
  border-radius: 12px;
  border:1px solid rgba(46, 204, 113, .25);
  background: rgba(46, 204, 113, .10);
  color:#167d46;
  margin: 10px 0;
}
.alert-err{
  padding:10px 12px;
  border-radius: 12px;
  border:1px solid rgba(255, 93, 93, .25);
  background: rgba(255, 93, 93, .10);
  color:#a61b1b;
  margin: 10px 0;
}

/* ===== Footer ===== */
.footer{
  text-align:center;
  font-size: 12px;
  color: rgba(15, 23, 42, .55);
  margin-top: 22px;
}

/* ===== Responsive ===== */
@media (max-width: 768px){
  .topbar{flex-direction:column;align-items:flex-start;gap:10px}
  .nav{justify-content:flex-start}
  .logo{width:36px;height:36px;border-radius: 10px}
}
/* ===== Badges por estado (Notificaciones) ===== */
.badge.st-ENVIADO{
  background: rgba(46, 204, 113, .16);
  border-color: rgba(46, 204, 113, .35);
  color:#167d46;
}

.badge.st-PENDIENTE{
  background: rgba(0, 136, 204, .14);
  border-color: rgba(0, 136, 204, .35);
  color:#0b5fa5;
}

.badge.st-ENVIANDO{
  background: rgba(156, 89, 182, .16);
  border-color: rgba(156, 89, 182, .35);
  color:#6d2a86;
}

.badge.st-ERROR_REINTENTANDO{
  background: rgba(255, 193, 7, .18);
  border-color: rgba(255, 193, 7, .40);
  color:#7a5200;
}

.badge.st-FALLIDO_FINAL{
  background: rgba(255, 93, 93, .14);
  border-color: rgba(255, 93, 93, .35);
  color:#a61b1b;
}

.badge.st-OMITIDO{
  background: rgba(148, 163, 184, .22);
  border-color: rgba(148, 163, 184, .40);
  color:#334155;
}

.badge.st-CANCELADO{
  background: rgba(30, 41, 59, .16);
  border-color: rgba(30, 41, 59, .30);
  color:#0f172a;
}
/* ===== Botón danger ===== */
.btn.danger,
button.btn.danger{
  background: linear-gradient(180deg, rgba(220, 38, 38, .95), rgba(185, 28, 28, .95));
  border-color: rgba(220, 38, 38, .40);
  box-shadow: 0 10px 18px rgba(220, 38, 38, .16);
}
.btn.danger:hover,
button.btn.danger:hover{
  filter: brightness(1.03);
}

/* ===== Ajustes chicos para select largos ===== */
select{ width: 100%; }

/* ===== Tabla: no cortar texto raro ===== */
td{ vertical-align: top; }
/* ===== Tabla:  ===== */
textarea {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.16);
  color: inherit;
  border-radius: 12px;
  padding: 10px 12px;
}
textarea:focus { outline: none; border-color: rgba(34,158,217,.7); }

.alert-err-strong{
  background:#5a0f0f;
  border:1px solid #ffb3b3;
  color:#fff;
  padding:12px 14px;
  border-radius:12px;
  font-weight:700;
}
.form-disabled{
  opacity:.55;
  pointer-events:none;
  filter:grayscale(0.2);
}
/* === Fix: bordes más visibles en inputs/textarea/select === */
input, textarea, select {
  border: 1px solid rgba(0,0,0,.25) !important;   /* más marcado */
  background: #fff !important;
}

textarea {
  min-height: 110px; /* opcional: ayuda a que “se vea” el campo */
}

/* foco accesible */
input:focus, textarea:focus, select:focus {
  outline: none !important;
  border-color: rgba(0,0,0,.45) !important;
  box-shadow: 0 0 0 3px rgba(0,0,0,.08) !important;
}

.gallery-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-top: 8px;
}

.gallery-scroll img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.gallery-scroll img:hover {
  transform: scale(1.05);
}

/* Modal */
.img-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.img-modal img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 10px;
}
