*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #f5f5f0;
  color: #1a1a1a;
  min-height: 100vh;
}

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: #111;
}

/* Toolbar */
.toolbar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.toolbar input {
  flex: 1;
  min-width: 140px;
  padding: 0.55rem 0.85rem;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}

.toolbar input:focus { border-color: #555; }

/* Buttons */
.btn-primary {
  padding: 0.55rem 1.1rem;
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-primary:hover { background: #333; }

.btn-secondary {
  padding: 0.55rem 1.1rem;
  background: transparent;
  color: #555;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.15s;
}
.btn-secondary:hover { border-color: #999; }

/* Lista */
.lista {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.frase-card {
  background: #fff;
  border: 1.5px solid #e8e8e8;
  border-radius: 10px;
  padding: 1rem 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  transition: border-color 0.15s;
}
.frase-card:hover { border-color: #ccc; }

.frase-body { flex: 1; }

.frase-texto {
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.frase-etiquetas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.etiqueta {
  font-size: 0.75rem;
  padding: 0.15rem 0.55rem;
  background: #f0f0f0;
  border-radius: 20px;
  color: #555;
}

.frase-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 6px;
  font-size: 1rem;
  color: #888;
  transition: background 0.15s, color 0.15s;
}
.btn-icon:hover { background: #f0f0f0; color: #111; }
.btn-icon.delete:hover { background: #fee; color: #c00; }

.empty {
  text-align: center;
  padding: 3rem;
  color: #999;
  font-size: 0.95rem;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}
.modal.hidden { display: none; }

.modal-box {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.modal-box h2 { font-size: 1.1rem; font-weight: 600; }

.modal-box textarea,
.modal-box input {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  resize: vertical;
  transition: border-color 0.15s;
}
.modal-box textarea:focus,
.modal-box input:focus { border-color: #555; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a;
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-size: 0.9rem;
  z-index: 200;
  transition: opacity 0.3s;
}
.toast.hidden { display: none; }
