:root {
  --work: #ffffff;
  --vacation: #4f8ef7;
  --sick: #f15152;
  --child-sick: #53b86a;
  --day-off: #bfc5cc;
  --home-office: #f3a7c5;
  --weekend: #d3d7dd;
  --holiday: #f5d44d;
  --border: #d9dee5;
  --text: #20242a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 16px;
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--text);
  background: #f7f9fc;
}

.app-shell {
  max-width: 100%;
}

header {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.page-header {
  justify-content: space-between;
  margin-bottom: 12px;
}

.page-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

h1 {
  margin: 0;
  font-size: 22px;
}

.subtitle {
  margin: 0;
  font-weight: 600;
}

.month-nav {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}

.month-nav label {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  gap: 4px;
}

.month-nav input,
.month-nav select,
.month-nav button {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.user-panel {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.user-name {
  font-weight: 700;
}

.user-email {
  font-size: 12px;
  color: #4a5565;
}

.logout-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 8px;
  background: #eef3ff;
  color: #204285;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.help {
  font-size: 13px;
  margin-bottom: 10px;
}

.status-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.employee-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.primary-action-btn {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f0f6ff;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.status-btn {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  background: #f6f7fb;
  font-size: 12px;
}

.status-btn.active {
  outline: 2px solid #222;
  background: #fff;
}

.status-btn.vacation {
  background: var(--vacation);
  color: white;
}

.status-btn.sick {
  background: var(--sick);
  color: white;
}

.status-btn.child-sick {
  background: var(--child-sick);
  color: white;
}

.status-btn.day-off {
  background: var(--day-off);
}

.status-btn.home-office {
  background: var(--home-office);
}

.status-btn.work {
  background: var(--work);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.calendar-layout {
  width: max-content;
  min-width: 100%;
}

table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
}

th,
td {
  border: 1px solid var(--border);
  min-width: 30px;
  width: 30px;
  height: 32px;
  text-align: center;
}

th {
  background: #f4f7fa;
  font-size: 12px;
}

.sticky-col {
  position: sticky;
  z-index: 3;
  background: #fafbfd;
}

.sticky-name {
  left: 0;
  min-width: 150px;
  width: 150px;
}

.sticky-base {
  left: 150px;
  min-width: 90px;
  width: 90px;
}

.sticky-total {
  left: 268px;
  min-width: 110px;
  width: 110px;
}

.sticky-left {
  left: 240px;
  min-width: 90px;
  width: 90px;
}

.sticky-used {
  left: 330px;
  min-width: 90px;
  width: 90px;
}

.sticky-family {
  left: 420px;
  min-width: 90px;
  width: 90px;
}

.sticky-sick {
  left: 510px;
  min-width: 90px;
  width: 90px;
}

.name {
  text-align: left;
  padding-left: 8px;
  font-weight: 600;
}

.employee-name-cell {
  cursor: pointer;
}

.employee-name-cell:hover {
  background: #f1f5fb;
}

.vacation-total,
.vacation-left {
  font-weight: 600;
}

.vacation-used {
  font-weight: 600;
}

.family-used,
.sick-used {
  font-weight: 600;
  font-size: 12px;
}

.vacation-input-wrap {
  padding: 2px;
}

.vacation-input-wrap input {
  font-size: 12px;
  width: 100%;
  height: 26px;
  border: none;
  border-radius: 4px;
  padding: 3px 5px;
  text-align: center;
}

.delete-employee-btn {
  border: 1px solid var(--border);
  background: #fff5f5;
  border-radius: 6px;
  width: 32px;
  height: 28px;
  display: flex;
  margin: 0 auto;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.delete-employee-btn svg {
  width: 18px;
  height: 18px;
  fill: #9b1c1c;
}

.archive-head,
.archive-cell {
  min-width: 64px;
  width: 64px;
}

.archive-cell {
  background: #fafbfd;
  padding: 0;
}

.modal.hidden {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.modal-card {
  position: relative;
  background: #fff;
  padding: 18px;
  border-radius: 10px;
  min-width: 280px;
  border: 1px solid var(--border);
  z-index: 1;
}

.modal-card h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.modal-subtitle {
  margin: 0 0 12px;
  color: #4a5565;
  font-size: 13px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.modal-actions button {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f6f7fb;
  cursor: pointer;
}

.modal-actions .danger {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
}

.calendar-note {
  margin-top: 10px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
}

.note-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.auth-page {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(79, 142, 247, 0.16), transparent 32%),
    radial-gradient(circle at bottom right, rgba(83, 184, 106, 0.16), transparent 28%),
    #f4f7fb;
}

.auth-card {
  width: min(520px, 100%);
  padding: 32px;
  border-radius: 18px;
  border: 1px solid rgba(217, 222, 229, 0.9);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 50px rgba(32, 36, 42, 0.08);
}

.auth-badge {
  display: inline-block;
  margin-bottom: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef3ff;
  color: #204285;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-copy,
.auth-note,
.auth-hint {
  color: #445065;
  line-height: 1.5;
}

.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  padding: 12px 18px;
  border-radius: 10px;
  background: #1f5eff;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}

.auth-hint {
  margin-top: 16px;
  font-size: 13px;
}

.auth-hint code {
  padding: 2px 6px;
  border-radius: 6px;
  background: #eef2f7;
}

@media (max-width: 900px) {
  .page-header {
    align-items: stretch;
  }

  .user-panel {
    margin-left: 0;
    justify-content: space-between;
    flex-wrap: wrap;
  }
}

.note-title {
  width: 100%;
  font-weight: 600;
}

.note-line {
  width: 100%;
}

.note-dot {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
  border: 1px solid var(--border);
}

.note-dot.holiday {
  background: var(--holiday);
}

.note-dot.weekend {
  background: var(--weekend);
}

.day-fields {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.employee-fields {
  display: grid;
  gap: 8px;
}

.employee-fields label,
.day-fields label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.employee-fields input,
.day-fields input {
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 6px;
}

.employee-fields input.invalid-field {
  border-color: #b42318;
  background: #fff2f0;
}

.employee-field-warning {
  min-height: 16px;
  color: #b42318;
  font-size: 12px;
  line-height: 1.3;
}

.day-summary {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.muted {
  color: #8a9099;
}

.day-head.weekend,
.cell.weekend,
.badge.weekend {
  background: var(--weekend);
}

.day-head.holiday,
.cell.holiday,
.badge.holiday {
  background: var(--holiday);
}

.day-num {
  font-size: 12px;
  line-height: 14px;
}

.day-week {
  font-size: 10px;
  color: #6a707a;
}

.day-head.today .day-num,
.day-head.today .day-week {
  color: #2f9e44;
  font-weight: 700;
}

.cell.work,
.badge.work {
  background: var(--work);
}

.cell.vacation,
.badge.vacation {
  background: var(--vacation);
  color: white;
}

.cell.sick,
.badge.sick {
  background: var(--sick);
  color: white;
}

.cell.child_sick,
.badge.child-sick {
  background: var(--child-sick);
  color: white;
}

.cell.work_home {
  background: var(--home-office);
}

.cell.partial {
  background: repeating-linear-gradient(
    45deg,
    #f2b260,
    #f2b260 6px,
    #f8d6a3 6px,
    #f8d6a3 12px
  );
}

.cell.day_off,
.badge.day-off {
  background: var(--day-off);
}

.cell[data-editable="true"] {
  cursor: pointer;
}

.cell[data-editable="true"]:hover {
  outline: 2px solid #222;
  outline-offset: -2px;
}

@media (max-width: 1000px) {
  body {
    margin: 10px;
  }

  h1 {
    width: 100%;
  }

  .sticky-name {
    min-width: 120px;
    width: 120px;
  }

  .sticky-base {
    left: 120px;
    min-width: 80px;
    width: 80px;
  }

  .sticky-left {
    left: 200px;
    min-width: 80px;
    width: 80px;
  }

  .sticky-used {
    left: 280px;
    min-width: 80px;
    width: 80px;
  }

  .sticky-family {
    left: 360px;
    min-width: 80px;
    width: 80px;
  }

  .sticky-sick {
    left: 440px;
    min-width: 80px;
    width: 80px;
  }
}
