/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0f0f0f;
  --bg-card: #1a1a1a;
  --bg-elevated: #242424;
  --text: #f0f0f0;
  --text-muted: #a0a0a0;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --border: #333;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(0,0,0,0.4);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html {
  font-size: 16px;
  height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15,15,15,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: background 0.2s;
}

.icon-btn:hover {
  background: var(--bg-elevated);
}

/* ===== Main ===== */
.main-content {
  flex: 1;
  padding: 16px;
  padding-bottom: 100px;
}

/* ===== Bottom Nav ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: rgba(26,26,26,0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 8px 0;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 50;
}

.nav-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 16px;
  cursor: pointer;
  font-size: 0.7rem;
  transition: color 0.2s;
}

.nav-btn.active {
  color: var(--accent);
}

.nav-icon {
  font-size: 1.3rem;
}

/* ===== Cards ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  transition: border-color 0.2s;
}

.card:hover {
  border-color: #444;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.card-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-activo { background: rgba(59,130,246,0.2); color: #60a5fa; }
.badge-revision { background: rgba(245,158,11,0.2); color: #fbbf24; }
.badge-cerrado { background: rgba(160,160,160,0.2); color: #a0a0a0; }

/* ===== Empty state ===== */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state h2 {
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 8px;
}

.empty-state p {
  margin-bottom: 24px;
  font-size: 0.95rem;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: white;
  width: 100%;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: #2a2a2a;
}

.btn-danger {
  background: rgba(239,68,68,0.15);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.3);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.85rem;
}

.btn-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

/* ===== Forms ===== */
.form-step {
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-muted);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  padding: 12px 14px;
  transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.step-indicator {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
}

.step-dot {
  height: 4px;
  flex: 1;
  background: var(--border);
  border-radius: 2px;
  transition: background 0.3s;
}

.step-dot.active {
  background: var(--accent);
}

.step-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 20px;
}

/* Actions list */
.acciones-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.accion-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.accion-item input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
}

.accion-item input:focus {
  outline: none;
}

.accion-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
}

/* ===== Detail view ===== */
.detail-section {
  margin-bottom: 24px;
}

.detail-section h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.detail-section p {
  font-size: 0.95rem;
  white-space: pre-wrap;
}

.registro-item {
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
}

.registro-fecha {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.registro-texto {
  font-size: 0.9rem;
}

/* ===== Review screen ===== */
.review-question {
  margin-bottom: 20px;
}

.review-question label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 30px;
  font-size: 0.9rem;
  z-index: 100;
  box-shadow: var(--shadow);
  transition: opacity 0.3s, transform 0.3s;
}

.toast.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(10px);
}

/* ===== Utility ===== */
.hidden { display: none !important; }

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

.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-3 { margin-bottom: 12px; }

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.back-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0;
  margin-bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Area tags */
.area-tag {
  font-size: 0.75rem;
  background: var(--bg-elevated);
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--text-muted);
}
