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

:root {
  --primary: #2c6e49;
  --primary-light: #4c956c;
  --bg: #f0f4f0;
  --card: #ffffff;
  --text: #1a1a2e;
  --text-light: #555;
  --border: #dde5dd;
  --danger: #c0392b;
  --radius: 10px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.screen { display: none; }
.screen.active { display: block; }

/* --- Login --- */
.login-box {
  max-width: 320px;
  margin: 15vh auto;
  text-align: center;
  background: var(--card);
  padding: 2.5rem 2rem;
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.login-box h1 { font-size: 1.6rem; margin-bottom: .5rem; }
.login-box p { color: var(--text-light); margin-bottom: 1.2rem; }
.login-box input {
  font-size: 2rem;
  text-align: center;
  letter-spacing: .6rem;
  width: 100%;
  padding: .6rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  outline: none;
}
.login-box input:focus { border-color: var(--primary); }
.login-box button {
  width: 100%;
  padding: .75rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1.1rem;
  cursor: pointer;
}
.login-box button:hover { background: var(--primary-light); }
.error { color: var(--danger); margin-top: .5rem; font-size: .9rem; }

/* --- Header --- */
header {
  background: var(--primary);
  color: #fff;
  padding: 1rem 1rem .5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
header h1 { font-size: 1.2rem; text-align: center; margin-bottom: .7rem; }

.parent-tabs, .section-tabs {
  display: flex;
  gap: .4rem;
  justify-content: center;
  flex-wrap: wrap;
}
.parent-tabs { margin-bottom: .5rem; }

.tab, .sec-tab {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  padding: .5rem 1.2rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: .95rem;
  transition: background .2s;
}
.tab.active { background: #fff; color: var(--primary); font-weight: 600; }
.sec-tab.active { background: rgba(255,255,255,0.35); font-weight: 600; }
.tab:hover, .sec-tab:hover { background: rgba(255,255,255,0.25); }
.tab.active:hover { background: #fff; }

/* --- Main --- */
main { max-width: 700px; margin: 1rem auto; padding: 0 1rem 2rem; }

.section { display: none; }
.section.active { display: block; }
.section h2 { font-size: 1.2rem; margin-bottom: 1rem; color: var(--primary); }

/* --- Forms --- */
.add-form {
  background: var(--card);
  padding: 1rem;
  border-radius: var(--radius);
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.add-form input, .add-form select, .add-form textarea {
  flex: 1 1 200px;
  padding: .55rem .7rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .95rem;
  font-family: inherit;
  outline: none;
}
.add-form input:focus, .add-form select:focus, .add-form textarea:focus {
  border-color: var(--primary);
}
.add-form textarea { flex: 1 1 100%; resize: vertical; }
.add-form button {
  padding: .55rem 1.4rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: .95rem;
  white-space: nowrap;
}
.add-form button:hover { background: var(--primary-light); }

/* --- Items --- */
.items-list { display: flex; flex-direction: column; gap: .6rem; }

.item-card {
  background: var(--card);
  padding: .9rem 1rem;
  border-radius: var(--radius);
  box-shadow: 0 1px 6px rgba(0,0,0,0.04);
  position: relative;
}
.item-card .label {
  font-size: .75rem;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 600;
  letter-spacing: .03em;
  margin-bottom: .2rem;
}
.item-card .value { font-size: 1rem; }
.item-card .meta {
  font-size: .8rem;
  color: var(--text-light);
  margin-top: .3rem;
}
.item-card .delete-btn {
  position: absolute;
  top: .6rem;
  right: .7rem;
  background: none;
  border: none;
  color: #ccc;
  font-size: 1.1rem;
  cursor: pointer;
  padding: .2rem;
}
.item-card .delete-btn:hover { color: var(--danger); }

.item-card.inactive { opacity: .55; }

.badge {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: 12px;
  font-size: .75rem;
  font-weight: 600;
}
.badge-upcoming { background: #d4edda; color: #155724; }
.badge-past { background: #f0f0f0; color: #666; }

.resultado-form {
  margin-top: .5rem;
  display: flex;
  gap: .4rem;
}
.resultado-form input {
  flex: 1;
  padding: .4rem .6rem;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: .85rem;
}
.resultado-form button {
  padding: .4rem .8rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: .85rem;
  cursor: pointer;
}

/* Nota card */
.nota-card .autor { font-weight: 600; color: var(--primary); }
.nota-card .mensaje { margin-top: .3rem; white-space: pre-wrap; }

/* --- Empty state --- */
.empty { text-align: center; color: var(--text-light); padding: 2rem 0; font-size: .95rem; }

/* --- Responsive --- */
@media (max-width: 480px) {
  .add-form input, .add-form select { flex: 1 1 100%; }
  .tab, .sec-tab { padding: .4rem .8rem; font-size: .85rem; }
}
