/* ═══════════════════════════════════════════════
   VacaKey España — Estilos principales
   Mobile-first | Mediterranean design
   ═══════════════════════════════════════════════ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { font-family: var(--vk-font); color: var(--vk-text); background: var(--vk-bg); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--vk-primary); text-decoration: none; }
img { max-width: 100%; height: auto; }
button { font-family: inherit; }

/* ── APP CONTAINER ── */
.vk-app {
  position: relative;
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--vk-bg);
}

/* ── HEADER ── */
.vk-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--vk-header-h);
  background: linear-gradient(135deg, var(--vk-primary-dark), var(--vk-primary));
  color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--vk-sp-md);
  z-index: var(--vk-z-header);
  box-shadow: var(--vk-shadow);
}
.vk-header__left { display: flex; align-items: center; gap: var(--vk-sp-sm); }
.vk-header__logo { font-size: 24px; cursor: pointer; }
.vk-header__title { font-weight: 700; font-size: 18px; letter-spacing: -0.3px; }
.vk-header__right { display: flex; align-items: center; gap: var(--vk-sp-xs); }
.vk-header__btn {
  width: var(--vk-touch-min); height: var(--vk-touch-min);
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; color: #fff;
  font-size: 20px; cursor: pointer; border-radius: var(--vk-radius-full);
  transition: background var(--vk-trans-fast);
  position: relative;
}
.vk-header__btn:hover { background: rgba(255,255,255,0.15); }
.vk-badge {
  position: absolute; top: 4px; right: 4px;
  background: var(--vk-danger); color: #fff;
  font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* ── LOADING ── */
.vk-loading {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #fff; z-index: 50;
}
.vk-loading__spinner {
  width: 40px; height: 40px;
  border: 4px solid var(--vk-border);
  border-top-color: var(--vk-primary);
  border-radius: 50%;
  animation: vk-spin 0.8s linear infinite;
}
@keyframes vk-spin { to { transform: rotate(360deg); } }
.vk-loading__text { margin-top: var(--vk-sp-md); color: var(--vk-text-light); font-size: 14px; }

/* ── LOGIN ── */
.vk-login {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--vk-primary-dark) 0%, var(--vk-primary) 50%, var(--vk-primary-light) 100%);
  z-index: 60; padding: var(--vk-sp-md);
}
.vk-login__container {
  background: var(--vk-bg-card); border-radius: var(--vk-radius-lg);
  padding: var(--vk-sp-xl); width: 100%; max-width: 400px;
  box-shadow: var(--vk-shadow-lg);
}
.vk-login__logo { text-align: center; font-size: 64px; margin-bottom: var(--vk-sp-sm); }
.vk-login__title { text-align: center; font-size: 24px; font-weight: 700; color: var(--vk-text); margin-bottom: var(--vk-sp-xs); }
.vk-login__subtitle { text-align: center; font-size: 14px; color: var(--vk-text-light); margin-bottom: var(--vk-sp-lg); }
.vk-login__links { text-align: center; margin-top: var(--vk-sp-md); display: flex; flex-direction: column; gap: var(--vk-sp-sm); }
.vk-login__links a { font-size: 14px; color: var(--vk-primary); }

/* ── FORMS ── */
.vk-form__group { margin-bottom: var(--vk-sp-md); }
.vk-form__group label { display: block; font-size: 14px; font-weight: 500; color: var(--vk-text-light); margin-bottom: var(--vk-sp-xs); }
.vk-form__group input,
.vk-form__group select,
.vk-form__group textarea {
  width: 100%; padding: 12px 16px;
  border: 1px solid var(--vk-border); border-radius: var(--vk-radius-sm);
  font-size: 16px; font-family: var(--vk-font);
  color: var(--vk-text); background: #fff;
  transition: border-color var(--vk-trans-fast), box-shadow var(--vk-trans-fast);
  -webkit-appearance: none;
}
.vk-form__group input:focus,
.vk-form__group select:focus,
.vk-form__group textarea:focus {
  border-color: var(--vk-primary); outline: none;
  box-shadow: 0 0 0 3px rgba(0,119,182,0.15);
}
.vk-form__error {
  color: var(--vk-danger); font-size: 14px; padding: var(--vk-sp-sm) var(--vk-sp-md);
  background: rgba(239,71,111,0.08); border-radius: var(--vk-radius-sm);
  margin-bottom: var(--vk-sp-md);
}

/* ── MAIN CONTENT ── */
.vk-main {
  flex: 1; overflow-y: auto;
  padding: calc(var(--vk-header-h) + var(--vk-sp-md)) var(--vk-sp-md) calc(var(--vk-navbar-h) + var(--vk-sp-md));
  -webkit-overflow-scrolling: touch;
}

/* ── BUTTONS ── */
.vk-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--vk-sp-sm);
  padding: 12px 24px; border-radius: var(--vk-radius-sm);
  font-size: 16px; font-weight: 500; cursor: pointer;
  transition: all var(--vk-trans-fast); border: none;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  min-height: var(--vk-touch-min);
}
.vk-btn--primary { background: var(--vk-accent); color: #fff; }
.vk-btn--primary:hover { background: #e55a28; }
.vk-btn--primary:active { transform: scale(0.97); }
.vk-btn--secondary { background: var(--vk-primary); color: #fff; }
.vk-btn--ghost { background: transparent; color: var(--vk-primary); border: 1px solid var(--vk-primary); }
.vk-btn--danger { background: var(--vk-danger); color: #fff; }
.vk-btn--full { width: 100%; }
.vk-btn--sm { padding: 8px 16px; font-size: 14px; min-height: 36px; }
.vk-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── NAVBAR ── */
.vk-navbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--vk-navbar-h);
  background: var(--vk-bg-card);
  border-top: 1px solid var(--vk-border);
  display: flex; align-items: center; justify-content: space-around;
  z-index: var(--vk-z-navbar);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.vk-navbar__item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-decoration: none; color: var(--vk-text-light); font-size: 10px;
  padding: 6px 0; flex: 1; min-width: var(--vk-touch-min); min-height: var(--vk-touch-min);
  transition: color var(--vk-trans-fast);
  -webkit-tap-highlight-color: transparent;
}
.vk-navbar__item--active { color: var(--vk-primary); font-weight: 600; }
.vk-navbar__icon { font-size: 22px; line-height: 1; margin-bottom: 2px; }
.vk-navbar__label { line-height: 1; }
.vk-navbar__fab {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--vk-accent); color: #fff; font-size: 28px; font-weight: 300;
  border: none; margin-top: -20px; cursor: pointer;
  box-shadow: 0 4px 12px rgba(255,107,53,0.4);
  transition: transform var(--vk-trans-fast), box-shadow var(--vk-trans-fast);
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.vk-navbar__fab:active { transform: scale(0.9) rotate(45deg); }

/* ── FAB MENU ── */
.vk-fab-menu { position: fixed; inset: 0; z-index: var(--vk-z-fab); }
.vk-fab-menu__overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.4); }
.vk-fab-menu__items {
  position: absolute; bottom: 90px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: var(--vk-sp-sm);
  animation: vk-slideUp 0.25s ease;
}
.vk-fab-menu__item {
  display: flex; align-items: center; gap: var(--vk-sp-sm);
  background: var(--vk-bg-card); padding: 14px 24px;
  border-radius: var(--vk-radius); box-shadow: var(--vk-shadow-lg);
  font-size: 16px; font-weight: 500; border: none; cursor: pointer;
  white-space: nowrap; transition: transform var(--vk-trans-fast);
}
.vk-fab-menu__item:active { transform: scale(0.96); }
.vk-fab-menu__icon { font-size: 20px; }
@keyframes vk-slideUp { from { opacity:0; transform: translateX(-50%) translateY(20px); } to { opacity:1; transform: translateX(-50%) translateY(0); } }

/* ── CARDS ── */
.vk-card {
  background: var(--vk-bg-card); border-radius: var(--vk-radius);
  box-shadow: var(--vk-shadow-sm); padding: var(--vk-sp-md);
  margin-bottom: var(--vk-sp-sm);
}
.vk-card__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--vk-sp-sm); }
.vk-card__title { font-weight: 600; font-size: 16px; }
.vk-card__subtitle { font-size: 13px; color: var(--vk-text-light); }

/* ── SECTION TITLES ── */
.vk-section__title {
  font-size: 13px; font-weight: 600; text-transform: uppercase;
  color: var(--vk-text-light); letter-spacing: 0.5px;
  margin-bottom: var(--vk-sp-sm); padding-left: var(--vk-sp-xs);
}

/* ── STATUS BADGES ── */
.vk-status {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.vk-status--pendiente  { background: rgba(255,209,102,0.2); color: #b8860b; }
.vk-status--confirmada { background: rgba(0,119,182,0.1); color: var(--vk-primary); }
.vk-status--checkin    { background: rgba(6,214,160,0.15); color: #048a65; }
.vk-status--checkout   { background: rgba(99,110,114,0.1); color: var(--vk-text-light); }
.vk-status--cancelada  { background: rgba(239,71,111,0.1); color: var(--vk-danger); }
.vk-status--abierta    { background: rgba(239,71,111,0.1); color: var(--vk-danger); }
.vk-status--en_progreso { background: rgba(255,209,102,0.2); color: #b8860b; }
.vk-status--resuelta   { background: rgba(6,214,160,0.15); color: #048a65; }
.vk-status--completada { background: rgba(6,214,160,0.15); color: #048a65; }
.vk-status--urgente    { background: var(--vk-danger); color: #fff; }
.vk-status--alta       { background: rgba(239,71,111,0.15); color: var(--vk-danger); }

/* ── PUSH BANNER ── */
.vk-push-banner {
  position: fixed; bottom: calc(var(--vk-navbar-h) + 12px); left: 12px; right: 12px;
  background: var(--vk-bg-card); border-radius: var(--vk-radius-lg);
  box-shadow: var(--vk-shadow-lg); padding: 20px;
  z-index: 105; animation: vk-slideUp 0.3s ease;
}
.vk-push-banner__content { display: flex; align-items: flex-start; gap: var(--vk-sp-sm); margin-bottom: var(--vk-sp-md); }
.vk-push-banner__icon { font-size: 28px; flex-shrink: 0; }
.vk-push-banner__text strong { display: block; margin-bottom: 4px; }
.vk-push-banner__text p { font-size: 14px; color: var(--vk-text-light); margin: 0; }
.vk-push-banner__actions { display: flex; justify-content: flex-end; gap: var(--vk-sp-sm); }

/* ── MAINTENANCE ── */
.vk-maintenance { text-align: center; padding: 60px 20px; }
.vk-maintenance h2 { font-size: 24px; margin-bottom: var(--vk-sp-md); }

/* ── EMPTY STATE ── */
.vk-empty { text-align: center; padding: 40px 20px; }
.vk-empty__icon { font-size: 48px; margin-bottom: var(--vk-sp-md); }
.vk-empty__text { color: var(--vk-text-light); font-size: 16px; }

/* ── LIST ITEMS ── */
.vk-list-item {
  display: flex; align-items: center; gap: var(--vk-sp-sm);
  padding: var(--vk-sp-sm) 0; border-bottom: 1px solid var(--vk-border);
  cursor: pointer; transition: background var(--vk-trans-fast);
  -webkit-tap-highlight-color: transparent;
}
.vk-list-item:last-child { border-bottom: none; }
.vk-list-item:active { background: rgba(0,119,182,0.04); }
.vk-list-item__icon { font-size: 20px; width: 36px; text-align: center; flex-shrink: 0; }
.vk-list-item__content { flex: 1; min-width: 0; }
.vk-list-item__title { font-weight: 500; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vk-list-item__desc { font-size: 13px; color: var(--vk-text-light); }
.vk-list-item__action { flex-shrink: 0; color: var(--vk-text-light); font-size: 18px; }

/* ── SCROLLBAR ── */
.vk-main::-webkit-scrollbar { width: 4px; }
.vk-main::-webkit-scrollbar-thumb { background: var(--vk-border); border-radius: 2px; }

/* ── TABLET+ ── */
@media (min-width: 768px) {
  .vk-app { max-width: 480px; margin: 0 auto; box-shadow: var(--vk-shadow-lg); }
  .vk-header, .vk-navbar { max-width: 480px; left: 50%; transform: translateX(-50%); }
}
