:root{
  /* Base */
  --bg0:#070A0F;
  --bg1:#0B1020;
  --panel:rgba(255,255,255,.04);
  --panel2:rgba(255,255,255,.06);
  --stroke:rgba(255,255,255,.10);
  --stroke2:rgba(255,255,255,.14);

  --text:#F3F4F6;
  --muted:rgba(243,244,246,.70);
  --muted2:rgba(243,244,246,.48);

  --radius:20px;
  --radius2:16px;

  --shadow: 0 16px 50px rgba(0,0,0,.45);
  --shadow2: 0 10px 24px rgba(0,0,0,.32);

  --focus: rgba(99,102,241,.55);

  /* Accent general (solo para botones, no cards) */
  --accentA:#6366F1;
  --accentB:#22D3EE;
}

*{ -webkit-tap-highlight-color: transparent; }

html,body{ height:100%; }

body{
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:
    radial-gradient(1200px 700px at 15% -12%, rgba(99,102,241,.18), transparent 55%),
    radial-gradient(900px 600px at 90% 10%, rgba(34,211,238,.12), transparent 50%),
    radial-gradient(1000px 800px at 70% 120%, rgba(244,114,182,.08), transparent 55%),
    linear-gradient(180deg, var(--bg1), var(--bg0));
  color: var(--text);
  padding-bottom: 86px; /* más compacto */
}

/* Layout */
.app-wrap{
  max-width: 560px;
  margin: 0 auto;
  padding: 18px 14px 0;
}

/* Header */
.topbar{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 12px;
}

.title{
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.02;
  margin: 6px 0 0;
}

.sub{
  color: var(--muted2);
  font-size: 13px;
  margin-top: 8px;
}

/* Pills / tabs / buttons */
.pill-btn{
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.03);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  gap:8px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 18px rgba(0,0,0,.18);
}

.pill-btn:hover{ color: var(--text); }
.pill-btn:active{ transform: scale(.985); }
.pill-btn:focus{ outline: none; box-shadow: 0 0 0 4px rgba(99,102,241,.22); }

/* Bootstrap nav-pills compatibility (si usas tabs) */
.nav-pills .pill-btn{
  opacity: .9;
}
.nav-pills .pill-btn.active{
  opacity: 1;
  border-color: rgba(99,102,241,.45);
  background: rgba(99,102,241,.12);
}

/* Cards */
.event-card{
  border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--radius);
  background: rgba(255,255,255,.035); /* se mezcla con el bg del inline style */
  box-shadow: var(--shadow2);
  overflow:hidden;
  margin-bottom: 10px; /* más eventos */
}

.event-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 12px; /* más compacto */
  cursor:pointer;
  user-select:none;
}

/* Icon container */
.avatar{
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  display:flex;
  align-items:center;
  justify-content:center;
  flex: 0 0 auto;
  font-size: 18px;
}

/* Main */
.event-main{ flex: 1 1 auto; min-width: 0; }

.event-name{
  font-weight: 900;
  font-size: 17px;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.12;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-date{
  margin-top: 7px;
  display:flex;
  align-items:center;
  gap: 8px;
  flex-wrap: nowrap; /* clave: compact */
  overflow: hidden;
  color: var(--muted);
}

.note{
  margin-top: 5px;
  font-size: 12px;
  color: rgba(255,255,255,.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Chips */
.chip{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.14);
  font-size: 12px;
  color: rgba(255,255,255,.78);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 62vw;
}

/* Days (right) */
.days{
  flex: 0 0 auto;
  min-width: 72px;
  display:flex;
  flex-direction: column;
  align-items:flex-end;
  justify-content:center;
  gap: 2px;
  pointer-events:none;
}

.days-num{
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -0.04em;
  line-height: 1;
}

.days-lbl{
  font-size: 11px;
  color: rgba(255,255,255,.62);
}

/* Collapsible actions */
.actions-wrap{
  padding: 0 12px 12px;
  display:none;
}
.event-card.is-open .actions-wrap{ display:block; }

.actions{
  display:flex;
  gap: 10px;
  margin-top: 8px;
}

/* Action buttons */
.icon-btn{
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 800;
  text-decoration:none;
  box-shadow: 0 10px 20px rgba(0,0,0,.18);
}
.icon-btn:active{ transform: scale(.985); }

/* FAB */
.fab{
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(560px, calc(100% - 28px));
  z-index: 999;
}

.fab button{
  width: 100%;
  border: 0;
  border-radius: 18px;
  padding: 12px 14px; /* más compacto */
  font-weight: 900;
  letter-spacing: -0.01em;
  box-shadow: var(--shadow);
  background: linear-gradient(135deg, var(--accentA), var(--accentB));
  color: #061018;
}

/* Empty */
.empty{
  border: 1px dashed rgba(255,255,255,.16);
  border-radius: 18px;
  padding: 16px;
  color: rgba(255,255,255,.68);
  background: rgba(255,255,255,.03);
}

/* Modal */
.modal-content{
  background: rgba(10,14,24,.92);
  color: var(--text);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(12px);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.form-control,.form-select{
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--text);
  border-radius: 14px;
}
.form-control::placeholder{ color: rgba(255,255,255,.42); }
.form-control:focus,.form-select:focus{
  box-shadow: none;
  border-color: rgba(99,102,241,.60);
}

/* Soft button (modal footer) */
.btn-soft{
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--text);
  border-radius: 14px;
  padding: 10px 12px;
  font-weight: 900;
}

/* Swatches */
.swatches{
  display:flex;
  flex-wrap:wrap;
  gap: 10px;
}

.swatch{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  position: relative;
  overflow:hidden;
  box-shadow: 0 10px 20px rgba(0,0,0,.20);
}

.swatch input{ display:none; }

.swatch .dot{
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.20);
}

.swatch.is-selected{
  outline: 3px solid rgba(99,102,241,.45);
  outline-offset: 2px;
}

/* =========================
   MOBILE TWEAKS
========================= */
@media (max-width: 480px){
  .app-wrap{ padding: 14px 12px 0; }
  .title{ font-size: 32px; }
  .sub{ margin-top: 6px; }

  .event-card{ margin-bottom: 9px; }
  .event-inner{ padding: 11px; }

  .chip{ max-width: 58vw; }
  body{ padding-bottom: 82px; }

  .fab button{
    padding: 11px 14px;
    border-radius: 16px;
  }
}

/* iPhone/Safari: evita bordes blancos (safe-area + bounce) */
html, body {
  background: var(--bg0) !important;
  min-height: 100%;
}

body{
  overflow-x: hidden;
}

/* Para iOS: que el fondo cubra el "rebote" */
@supports (-webkit-touch-callout: none) {
  body {
    background-attachment: fixed;
  }
}

/* (opcional) si usas notch, ajusta padding del contenido */
.app-wrap{
  padding-top: calc(18px + env(safe-area-inset-top));
  padding-left: calc(14px + env(safe-area-inset-left));
  padding-right: calc(14px + env(safe-area-inset-right));
}
.fab{
  bottom: calc(18px + env(safe-area-inset-bottom));
}