:root {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.4;
  color: #0b1425;
  background: #f7f7fb;
}

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

body {
  margin: 0;
  padding: 0 0.75rem 2rem;
}

h1,
h2,
h3 {
  margin: 0;
}

p {
  margin: 0;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  padding: 1.25rem 0;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: #54617d;
  margin-bottom: 0.25rem;
}

.page-header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.generator-controls {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.form-control {
  display: flex;
  flex-direction: column;
  min-width: 140px;
  gap: 0.35rem;
  font-weight: 500;
}

select,
input,
button,
textarea {
  font: inherit;
}

select,
input {
  border: 1px solid #d7ddeb;
  background: #fff;
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
}

button {
  border: none;
  background: #1f62ff;
  color: #fff;
  border-radius: 10px;
  padding: 0.65rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button:not(:disabled):hover {
  opacity: 0.9;
}

main {
  width: 100%;
}

.panel {
  background: #fff;
  border-radius: 10px;
  padding: 1rem;
  box-shadow: none;
  border: 1px solid #e8ecfb;
}

.panel-heading {
  margin-bottom: 1rem;
}

.worker-form {
  display: grid;
  gap: 0.75rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-weight: 500;
}
.form-group.inline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.inline-fields {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.inline-fields.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.inline-fields__color {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.inline-fields__color label {
  font-weight: 600;
  font-size: 0.85rem;
  color: #475569;
}
@media (max-width: 640px) {
  .form-group.inline {
    grid-template-columns: 1fr;
  }
}

.form-checkboxes {
  display: grid;
  gap: 0.5rem;
}

.color-field input[type="color"] {
  width: 52px;
  height: 36px;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
}

.compact-color {
  width: 46px;
  height: 36px;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
}

.weekday-checkboxes {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.3rem;
  max-width: 260px;
}

.blocked-shifts-table {
  width: 100%;
  border-collapse: collapse;
  max-width: 420px;
  font-weight: 500;
}

.blocked-shifts-table th,
.blocked-shifts-table td {
  border: 1px solid #e8ecfb;
  padding: 0.4rem 0.5rem;
}

.blocked-shifts-table th {
  background: #f7f8ff;
  color: #0b1425;
}

.blocked-shifts-table td.center {
  text-align: center;
}

.blocked-shifts-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #e11d48;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.checkbox {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  font-weight: 500;
}

.checkbox input {
  width: 16px;
  height: 16px;
  accent-color: #e11d48;
}

.form-hint {
  margin: 0;
  color: #6b7280;
  font-size: 0.82rem;
  font-weight: 400;
}

.hidden-field {
  display: none;
}

.settings-row {
  grid-template-columns: 1fr;
}

#settings-modal {
  border: none;
  padding: 0;
  background: transparent;
}

#settings-modal::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.add-worker-btn {
  width: fit-content;
}

.ghost-btn {
  border: 1px solid #d7ddeb;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: transparent;
  color: #4b5ca7;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.ghost-btn.small {
  padding: 0.3rem 0.7rem;
  font-size: 0.85rem;
}
.file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.ghost-btn[hidden] {
  display: none;
}
.worker-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.worker-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0.65rem 0.75rem;
  border: 1px solid #eff2f9;
  border-radius: 12px;
  background: #fafbff;
  gap: 0.4rem;
}

.worker-row__topline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.worker-row__color {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.worker-row__info h3 {
  font-size: 1rem;
}

.worker-row__info p {
  color: #5f6c8f;
  font-size: 0.9rem;
}

.worker-row__actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.edit-btn {
  background: #ffffff;
  border: 1px solid #d6e0ff;
  color: #1f62ff;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
}

.tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.tag {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  background: #e5edff;
  color: #2a4adf;
  border-radius: 999px;
}

.delete-btn {
  background: transparent;
  color: #df2a57;
  border: 1px solid #ffd4de;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  font-size: 0.85rem;
}

.schedule-panel {
  min-height: 0;
  display: grid;
  gap: 1rem;
}

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

.schedule-actions {
  display: flex;
  gap: 0.4rem;
}

.action-group {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.action-group + .action-group {
  padding-left: 0.6rem;
  border-left: 1px solid #e2e8f0;
}

.schedule-period {
  font-size: 1rem;
  color: #475569;
  font-weight: 500;
  margin-left: 0.4rem;
}

.schedule-output {
  border: none;
  border-radius: 0;
  min-height: 0;
  padding: 0;
  overflow-x: auto;
}

.schedule-output.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5f6c8f;
}

.schedule-table {
  width: auto;
  min-width: 1100px;
  border-collapse: collapse;
  text-align: center;
  table-layout: auto;
}

.schedule-table thead th {
  background: #f5f7ff;
  position: sticky;
  top: 0;
  z-index: 1;
}

.day-name {
  display: block;
  font-size: 0.72rem;
  color: #64748b;
  margin-bottom: 0.15rem;
}

.day-number {
  display: block;
  font-size: 0.85rem;
  color: #0b1425;
  font-weight: 700;
}

.schedule-table th,
.schedule-table td {
  border: 1px solid #e8ecfb;
  padding: 0.25rem;
  min-width: 64px;
  font-size: 0.8rem;
}

.schedule-table th:nth-child(1),
.schedule-table td:nth-child(1) {
  min-width: 180px;
  text-align: left;
  font-weight: 600;
  background: #fff;
  position: sticky;
  left: 0;
  z-index: 8;
}
.schedule-table thead th:nth-child(1) {
  z-index: 9;
}
.summary-card__metrics {
  font-size: 0.78rem;
  color: #5b6578;
  display: flex;
  gap: 0.75rem;
}

.shift-day {
  color: #0c6b2c;
  font-weight: 700;
  background: #e6f7eb;
}

.shift-night {
  color: #4b2ca1;
  font-weight: 700;
  background: #efe7ff;
}

.shift-holiday {
  color: #0f4c81;
  font-weight: 700;
  background: #e6f2ff;
}

.shift-off {
  color: #c3cadf;
}

.schedule-table th.day-saturday-header {
  background: #d4f1df;
  color: #0f5132;
}

.schedule-table th.day-sunday-header {
  background: #ffe0e5;
  color: #7a1023;
}

.schedule-table td.day-saturday {
  background: #f2fbf6;
}

.schedule-table td.day-sunday {
  background: #fff3f5;
}

.schedule-table td.shift-day {
  background: #e6f7eb !important;
}

.schedule-table td.shift-night {
  background: #efe7ff !important;
}

.schedule-table td.shift-holiday {
  background: #e6f2ff !important;
}

.slot-select {
  border: none;
  background: transparent;
  text-align: center;
  font-weight: 700;
  color: inherit;
  padding: 0.1rem 0;
  border-radius: 6px;
}

.slot-select:focus {
  outline: none;
  background: rgba(31, 98, 255, 0.08);
}

.day-warning {
  box-shadow: inset 0 0 0 2px #fdbf92;
}

.cell-wrapper {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.lock-btn {
  background: transparent;
  color: #475569;
  border: none;
  padding: 0.15rem 0.3rem;
  cursor: pointer;
  font-size: 0.75rem;
  line-height: 1;
  opacity: 0.15;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lock-btn:hover {
  background: transparent;
  opacity: 0.75;
}

.lock-btn.locked {
  color: #475569;
  opacity: 1;
}

.header-lock-btn {
  opacity: 0.15;
  padding: 0.2rem 0.35rem;
  min-width: 28px;
  min-height: 28px;
  border: none;
  background: transparent;
  color: #0b1425;
}

.header-lock-btn.locked {
  opacity: 1;
}

.day-header,
.row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.row-header__title {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  color: #3b4256;
  font-size: 1.25rem;
  line-height: 1;
  cursor: grab;
  opacity: 0.35;
  transition: opacity 0.12s ease;
}

.drag-handle:active {
  cursor: grabbing;
}

.drag-handle:hover {
  opacity: 1;
}

.schedule-table tr.dragging {
  opacity: 0.65;
}

.schedule-table tr.drop-target-before th,
.schedule-table tr.drop-target-before td {
  box-shadow: inset 0 3px 0 #1f62ff;
}

.schedule-table tr.drop-target-after th,
.schedule-table tr.drop-target-after td {
  box-shadow: inset 0 -3px 0 #1f62ff;
}

.schedule-table tr.row-colored td {
  position: relative;
  z-index: 2;
}

.schedule-table tr.row-colored th {
  position: sticky !important;
  left: 0;
  z-index: 12;
  background: #fff;
}

.schedule-table tr.row-colored th::after,
.schedule-table tr.row-colored td::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-top: 0;
  border-left: 0;
  border-right: 0;
  border-bottom: 3px solid var(--worker-color, transparent);
  border-radius: 0;
  z-index: 1;
}

.cell-locked {
  border-color: #cbd5e1;
  box-shadow: inset 0 0 0 1px #cbd5e1;
}

.summary-sections {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.75rem;
  align-items: start;
}

.panel-block {
  border: 1px solid #e8ecfb;
  border-radius: 10px;
  padding: 0.75rem;
  background: #fff;
}

.notes-textarea {
  width: 100%;
  min-height: 150px;
  border: 1px solid #e8ecfb;
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  resize: vertical;
  background: #f8fafc;
}

.notes-textarea:focus {
  outline: 2px solid #1f62ff;
  outline-offset: 1px;
  background: #fff;
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.summary-table th,
.summary-table td {
  border: 1px solid #e8ecfb;
  padding: 0.4rem 0.5rem;
  text-align: left;
}

.summary-table th {
  background: #f5f7ff;
  font-weight: 700;
}

.summary-table td:nth-child(2),
.summary-table td:nth-child(3),
.summary-table td:nth-child(4),
.summary-table td:nth-child(5) {
  text-align: center;
}

#warnings-list {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
  display: grid;
  gap: 0.5rem;
}

#warnings-list li {
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  border: 1px solid #fbd38d;
  background: #fff6eb;
  color: #9c4221;
  font-size: 0.85rem;
  line-height: 1.35;
}

#worker-modal {
  border: none;
  padding: 0;
  background: transparent;
}

#worker-modal::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.modal-card {
  background: #fff;
  border-radius: 12px;
  max-width: 880px;
  width: min(880px, 98vw);
  max-height: 78vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  border-bottom: 1px solid #edf0ff;
  padding: 1rem 0.9rem 0.8rem;
}

.modal-body {
  padding: 0 0.9rem 0.9rem;
  overflow-y: auto;
}

.modal-card--narrow {
  max-width: 520px;
}

.modal-columns {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0.9rem;
  align-items: start;
}

@media (max-width: 720px) {
  .modal-columns {
    grid-template-columns: 1fr;
  }
}

.modal-worker-list {
  border: 1px solid #e8ecfb;
  border-radius: 10px;
  padding: 0.75rem;
  background: #f9fbff;
  max-height: 65vh;
  overflow-y: auto;
}

.modal-worker-list h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.modal-eyebrow {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: #97a0c3;
  margin-bottom: 0.15rem;
}

.close-btn {
  border: none;
  background: transparent;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.05rem;
  cursor: pointer;
  color: #475569;
}

.close-btn:hover {
  color: #1f2937;
}
