/* PWA Encargado — mobile-first, Chatello brand */
:root {
  --chatello-charcoal: #121619;
  --chatello-beige: #F5F1ED;
  --chatello-cream: #DBD2CB;
  --chatello-orange: #E08A4C;
  --bg: #F5F1ED;
  --surface: #FFFFFF;
  --text: #121619;
  --text-2: #3a3f44;
  --muted: #8a8782;
  --border: #e7e2dd;
  --info: #2563eb;
  --info-bg: #e0ecff;
  --ok: #16a34a;
  --ok-bg: #dcfce7;
  --warn: #d97706;
  --warn-bg: #fef3c7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --radius: 10px;
  --shadow: 0 2px 8px rgba(0,0,0,0.05);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  font-family: 'Fira Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Layout PWA mobile-first --- */
.app-shell {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--bg);
}

.app-header {
  background: var(--chatello-charcoal);
  color: var(--chatello-beige);
  padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 100;
}
.app-header .brand-logo {
  height: 28px; width: 28px;
  background: var(--chatello-orange);
  border-radius: 50%;
}
.app-header h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  flex: 1;
}
.app-header .user-nombre {
  font-size: 12px;
  opacity: 0.75;
}

.main {
  flex: 1;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0));
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 10px; font-size: 16px; }
.card p { margin: 4px 0; }

/* --- Botones grandes táctiles --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.06s ease, box-shadow 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-block { width: 100%; }
.btn-primary { background: var(--chatello-orange); color: #fff; border-color: var(--chatello-orange); }
.btn-dark { background: var(--chatello-charcoal); color: var(--chatello-beige); border-color: var(--chatello-charcoal); }
.btn-success { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-ghost { background: transparent; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* --- Tarea / accion grande --- */
.tarea {
  display: block;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  color: var(--text);
  border-left: 4px solid var(--chatello-orange);
  text-decoration: none;
}
.tarea:hover { text-decoration: none; }
.tarea-titulo {
  font-size: 17px;
  font-weight: 600;
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 4px;
}
.tarea-desc {
  font-size: 13px;
  color: var(--muted);
}
.tarea-emoji { font-size: 22px; }
.tarea-pendiente { border-left-color: var(--warn); background: var(--warn-bg); }
.tarea-hecho { border-left-color: var(--ok); opacity: 0.65; }

/* --- Form --- */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 500;
}
.form-control, select, input[type="text"], input[type="number"], input[type="date"], input[type="email"], input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
}
select { appearance: none; background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23666'%3e%3cpath d='M5 8l5 5 5-5z'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 36px; }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.foto-preview {
  width: 100%; max-height: 60vh;
  object-fit: contain;
  border-radius: var(--radius);
  background: var(--chatello-cream);
  margin: 10px 0;
}

.alert {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 12px;
}
.alert-info { background: var(--info-bg); color: var(--info); }
.alert-ok { background: var(--ok-bg); color: var(--ok); }
.alert-warn { background: var(--warn-bg); color: var(--warn); }
.alert-danger { background: var(--danger-bg); color: var(--danger); }

.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(0,0,0,0.15);
  border-top-color: var(--chatello-orange);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.muted { color: var(--muted); }
.right { text-align: right; }
.center { text-align: center; }

/* Login específico */
.login-bg {
  min-height: 100dvh;
  background: var(--chatello-charcoal);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.login-card {
  background: var(--surface);
  border-radius: 14px;
  padding: 30px 24px;
  width: 100%; max-width: 360px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.login-card h1 { margin: 0 0 6px; font-size: 22px; text-align: center; }
.login-card .subtitle { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 22px; }

/* Banner instalación PWA */
.install-banner {
  position: fixed;
  bottom: env(safe-area-inset-bottom, 0);
  left: 0; right: 0;
  background: var(--chatello-orange);
  color: #fff;
  padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  font-size: 14px;
  z-index: 200;
}
.install-banner .btn-close {
  background: transparent;
  color: inherit;
  border: 1px solid rgba(255,255,255,0.4);
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
}
