* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #10151c;
  color: #f2f4f7;
}
.hidden { display: none !important; }

/* Manager code entry */
.code-screen {
  max-width: 360px;
  margin: 15vh auto;
  padding: 0 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.code-screen h1 { font-size: 1.4rem; margin: 0; }
.code-screen input {
  padding: 14px;
  border-radius: 10px;
  border: 1px solid #333;
  background: #1c2530;
  color: #fff;
  font-size: 1.1rem;
  text-align: center;
}
.code-screen a { color: #9aa5b1; font-size: 0.85rem; margin-top: 8px; }

.hint { color: #9aa5b1; font-size: 0.85rem; margin: 4px 0; }
.error-text { color: #ff6b6b; font-size: 0.9rem; min-height: 1.2em; }

:focus-visible { outline: 3px solid #9cc9ff; outline-offset: 2px; }

.lang-switcher-fixed {
  position: fixed;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 8px;
  z-index: 100;
}
.pl-header .lang-switcher-fixed { position: static; }
.lang-btn {
  min-width: 48px;
  min-height: 48px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid #3a4657;
  background: #1c2530;
  color: #b4bdc9;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}
.lang-btn.active { background: #4ea1ff; color: #10151c; border-color: #4ea1ff; }

.exit-btn {
  min-height: 48px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid #3a4657;
  background: none;
  color: #dbe2ea;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}
.exit-btn:active { background: #26313f; }

.btn-primary {
  padding: 12px 16px;
  border-radius: 10px;
  border: none;
  background: #4ea1ff;
  color: #10151c;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
}
.email-btn { width: 100%; min-height: 52px; }
.check-row { flex-direction: row !important; align-items: center; gap: 12px !important; min-height: 48px; color: #f2f4f7 !important; font-size: 1rem !important; }
.check-row input { width: 24px; height: 24px; flex-shrink: 0; }
.link-btn { background: none; border: none; color: #6db3ff; font-size: 0.95rem; cursor: pointer; padding: 12px 14px; min-height: 48px; }
.link-btn.danger { color: #ff8a8a; }

/* Planner shell */
header.pl-header {
  position: sticky;
  top: 0;
  background: #1c2530;
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  z-index: 10;
  box-shadow: 0 1px 0 #2a3444;
}
header.pl-header h1 { font-size: 1.15rem; margin: 0; flex: 1 1 auto; }

.pl-controls {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pl-controls select, .pl-controls input {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #333;
  background: #1c2530;
  color: #fff;
  font-size: 1rem;
}
.pl-tabs { display: flex; gap: 8px; padding: 0 16px 8px; }
.pl-tab {
  flex: 1;
  min-height: 48px;
  padding: 10px;
  border-radius: 10px;
  border: none;
  background: #1c2530;
  color: #9aa5b1;
  font-weight: 600;
  cursor: pointer;
}
.pl-tab.active { background: #4ea1ff; color: #10151c; }

.week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 10px;
  font-weight: 600;
}
.week-nav button { background: none; border: none; color: #6db3ff; font-size: 0.95rem; cursor: pointer; padding: 12px 10px; min-height: 48px; }

.pl-loading, .pl-empty {
  padding: 40px 16px;
  text-align: center;
  color: #9aa5b1;
}

.pl-content { padding: 0 16px 40px; }

.pl-day-card {
  background: #1c2530;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.pl-day-card h3 { margin: 0 0 8px; font-size: 1rem; }
.pl-day-card .date { color: #9aa5b1; font-weight: 400; font-size: 0.85rem; }
.pl-shift-row {
  min-height: 48px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 0.9rem;
}
.pl-shift-row.role-meat { background: #3a1f1f; }
.pl-shift-row.role-register { background: #1f3a22; }
.pl-shift-row.role-both, .pl-shift-row.role-extra, .pl-shift-row.role- { background: #26313f; }
.pl-shift-row .info { flex: 1; }
.pl-add-shift-btn {
  width: 100%;
  min-height: 48px;
  padding: 12px;
  border-radius: 8px;
  border: 1px dashed #3a4657;
  background: none;
  color: #9aa5b1;
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 4px;
}

/* Availability tab */
.avail-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #26313f;
  font-size: 0.9rem;
}
.avail-row .day-label { width: 90px; flex-shrink: 0; }
.avail-row label { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; color: #c3cbd4; }
.avail-row input[type="time"] {
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #333;
  background: #10151c;
  color: #fff;
}
.timeoff-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-size: 0.85rem;
  border-bottom: 1px solid #26313f;
}
.timeoff-item .info { flex: 1; }
.timeoff-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.timeoff-form label { font-size: 0.8rem; color: #9aa5b1; display: flex; flex-direction: column; gap: 4px; }

/* Modal (add/edit shift) */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 50;
}
.modal {
  background: #1c2530;
  border-radius: 16px 16px 0 0;
  padding: 20px;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 85vh;
  overflow-y: auto;
}
.modal h2 { margin: 0 0 6px; font-size: 1.1rem; }
.modal label { display: flex; flex-direction: column; font-size: 0.85rem; gap: 4px; color: #9aa5b1; }
.modal input, .modal select, .modal textarea {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #333;
  background: #10151c;
  color: #fff;
  font-size: 0.95rem;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.modal-actions button { min-height: 48px; padding: 10px 18px; border-radius: 8px; border: none; cursor: pointer; font-size: 0.95rem; }
.modal-actions .primary { background: #4ea1ff; color: #10151c; font-weight: 600; }
.modal-actions .cancel { background: #333; color: #fff; }
.modal-actions .danger { background: #ff6b6b; color: #10151c; font-weight: 600; }

details.pl-ai { background: #1c2530; border-radius: 12px; padding: 12px 14px; margin-top: 16px; }
details.pl-ai summary { cursor: pointer; font-weight: 600; }
.pl-ai-review-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #26313f;
  font-size: 0.85rem;
}
.pl-ai-review-row .info { flex: 1; }
#pl-ai-warnings { color: #f5c26b; font-size: 0.8rem; margin-top: 8px; }
