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

:root {
  --primary: #e67e22;
  --primary-dark: #d35400;
  --success: #27ae60;
  --danger: #e74c3c;
  --whatsapp: #25d366;
  --whatsapp-dark: #1da851;
  --bg: #f5f5f5;
  --card-bg: #ffffff;
  --text: #333333;
  --text-light: #777777;
  --border: #e0e0e0;
  --radius: 12px;
}

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

header {
  background: var(--primary);
  color: white;
  padding: 16px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

header h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

main {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
}

.hidden { display: none !important; }

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.card h2 { font-size: 1.2rem; margin-bottom: 12px; }
.card h3 { font-size: 1.05rem; margin-bottom: 12px; }

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

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

input[type="text"],
input[type="password"],
textarea,
input[type="number"],
input[type="date"],
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.datetime-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.datetime-row input[type="date"] {
  flex: 1;
  min-width: 0;
}

.datetime-row .time-inputs {
  flex-shrink: 0;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
}

.time-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.time-inputs input {
  width: 70px;
  text-align: center;
}

.time-inputs span {
  font-size: 1.2rem;
  font-weight: bold;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  text-align: center;
}

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

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

.btn-secondary {
  background: var(--border);
  color: var(--text);
  width: 100%;
  margin-top: 8px;
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  width: 100%;
  margin-top: 8px;
}

.btn-danger-filled {
  background: var(--primary);
  color: white;
  width: 100%;
}
.btn-danger-filled:hover { background: var(--primary-dark); }

.btn-whatsapp {
  background: var(--whatsapp);
  color: white;
  width: 100%;
}
.btn-whatsapp:hover { background: var(--whatsapp-dark); }

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--text-light);
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

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

/* Menu grid */
.menu-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  user-select: none;
}

.menu-item:hover {
  border-color: var(--primary);
  background: #fef5ec;
}

.menu-item.selected {
  border-color: var(--primary);
  background: #fde8d0;
}

.menu-item-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.menu-item-desc {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-left: 8px;
}

/* Badges */
.list-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-open {
  background: #d4edda;
  color: #155724;
}

.badge-closed {
  background: #f8d7da;
  color: #721c24;
}

.list-header {
  border-left: 4px solid var(--primary);
}

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

.list-header-actions {
  display: flex;
  gap: 4px;
}

/* Entries list */
.entries-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.entry-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 8px;
}

.entry-info {
  flex: 1;
}

.entry-person {
  font-weight: 600;
}

.entry-item {
  font-size: 0.85rem;
  color: var(--text-light);
}

.entry-delete {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
}

.empty-state {
  text-align: center;
  color: var(--text-light);
  padding: 24px 0;
  font-size: 0.95rem;
}

/* Actions */
.actions {
  display: flex;
  flex-direction: column;
}

/* List cards (landing) */
.list-card {
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  border: 2px solid transparent;
}

.list-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.list-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.list-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.list-card-title {
  font-weight: 700;
  font-size: 1.05rem;
}

.list-card-lock {
  font-size: 1rem;
}

.list-card-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-light);
  align-items: center;
}

.list-card-info .badge {
  font-size: 0.75rem;
  padding: 2px 8px;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-content {
  max-width: 400px;
  width: 100%;
}

.modal-content h3 {
  margin-bottom: 8px;
}

.modal-content p {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 16px;
}

.error-text {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 8px;
  text-align: center;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.9rem;
  z-index: 1001;
  transition: opacity 0.3s;
}

.toast.hidden { opacity: 0; pointer-events: none; }

.hint {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 12px;
}

.countdown {
  font-size: 0.85rem;
  color: var(--danger);
  font-weight: 600;
}

/* Menú */
header { position: relative; }

.nav-toggle {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
}
.nav-toggle:hover { background: rgba(255,255,255,0.15); }

.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 900;
}

.nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 260px;
  max-width: 80vw;
  background: var(--card-bg);
  box-shadow: 2px 0 12px rgba(0,0,0,0.2);
  transform: translateX(-100%);
  transition: transform 0.25s, visibility 0.25s;
  visibility: hidden;
  z-index: 950;
  display: flex;
  flex-direction: column;
}
.nav-drawer.open { transform: none; visibility: visible; }

.nav-title {
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 1.2rem;
  padding: 20px 16px;
}

.nav-drawer a {
  padding: 14px 16px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.nav-drawer a:hover { background: #fef5ec; }
.nav-drawer a.active { color: var(--primary); }

/* Botón Ko-fi */
.kofi-btn {
  position: fixed;
  left: 16px;
  bottom: 16px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--card-bg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  text-decoration: none;
  z-index: 800;
  transition: transform 0.15s;
}
.kofi-btn:hover { transform: scale(1.1); }

body { padding-bottom: 72px; }
