/* vacation.css — estilos do fluxo "Férias" (calendário de férias da unidade).
   Classes prefixadas com vac-. Usa as variáveis globais de tema do app:
   --surface, --surface2, --text, --text-secondary, --border, --accent,
   --accent-hover, --accent-light, --green, --red, --orange, --radius, --shadow. */

.vac-root {
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: var(--text);
}

/* ---------- cabeçalho ---------- */

.vac-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius, 12px);
  box-shadow: var(--shadow);
  padding: 16px 20px;
}

.vac-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.vac-yearnav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vac-year-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}

.vac-year-btn:hover {
  background: var(--accent-light);
  border-color: var(--accent);
}

.vac-year-select {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
}

/* ---------- cartões de seção ---------- */

.vac-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius, 12px);
  box-shadow: var(--shadow);
  padding: 16px 20px;
}

.vac-card-title {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 700;
}

.vac-muted {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin: 6px 0;
}

.vac-empty {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin: 8px 0 0;
  font-style: italic;
}

/* ---------- meu saldo ---------- */

.vac-balance-line {
  margin: 0 0 10px;
  font-size: 1rem;
}

.vac-progress {
  height: 10px;
  border-radius: 999px;
  background: var(--surface2);
  border: 1px solid var(--border);
  overflow: hidden;
}

.vac-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width .35s ease;
}

/* ---------- períodos ---------- */

.vac-periods {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.vac-period {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 190px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface2);
}

.vac-period-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.vac-period-dates {
  font-weight: 700;
  font-size: 0.98rem;
}

.vac-period-days {
  color: var(--text-secondary);
  font-size: 0.82rem;
  white-space: nowrap;
}

/* destaque visual para períodos confirmados */
.vac-period--confirmado {
  border-color: var(--green);
  border-left-width: 4px;
  background: color-mix(in srgb, var(--green) 7%, var(--surface));
}

.vac-period--pendente {
  border-left: 4px solid var(--orange);
}

.vac-period--recusado {
  opacity: .65;
  border-left: 4px solid var(--red);
}

.vac-period-actions {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

/* ---------- pills de status ---------- */

.vac-pill {
  align-self: flex-start;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.vac-pill--pendente {
  color: var(--orange);
  background: color-mix(in srgb, var(--orange) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--orange) 35%, transparent);
}

.vac-pill--confirmado {
  color: var(--green);
  background: color-mix(in srgb, var(--green) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--green) 35%, transparent);
}

.vac-pill--recusado {
  color: var(--red);
  background: color-mix(in srgb, var(--red) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--red) 30%, transparent);
}

/* ---------- equipe ---------- */

.vac-person {
  padding: 12px 0;
  border-top: 1px dashed var(--border);
}

.vac-person:first-of-type {
  border-top: none;
  padding-top: 4px;
}

.vac-person-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- formulário ---------- */

.vac-form {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.vac-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.88rem;
  font-weight: 600;
}

.vac-field input[type="date"] {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  color-scheme: light dark;
}

.vac-error {
  width: 100%;
  margin: 4px 0 0;
  color: var(--red);
  font-size: 0.88rem;
  font-weight: 600;
}

/* ---------- botões ---------- */

.vac-btn {
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .1s ease;
}

.vac-btn:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.vac-btn:active {
  transform: translateY(1px);
}

.vac-btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.vac-btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.vac-btn-confirm {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  height: 32px;
}

.vac-btn-confirm:hover {
  background: var(--green-hover, var(--green));
  border-color: var(--green-hover, var(--green));
}

.vac-btn-refuse {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 45%, transparent);
  height: 32px;
}

.vac-btn-refuse:hover {
  background: color-mix(in srgb, var(--red) 10%, var(--surface));
  border-color: var(--red);
}

/* ---------- quotas ---------- */

.vac-quota-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vac-quota-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 0;
  border-top: 1px dashed var(--border);
}

.vac-quota-row:first-child {
  border-top: none;
}

.vac-quota-name {
  flex: 1 1 160px;
  font-weight: 600;
}

.vac-quota-input {
  width: 84px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.92rem;
}

.vac-quota-error {
  width: 100%;
}

/* ---------- responsivo ---------- */

@media (max-width: 640px) {
  .vac-head {
    flex-direction: column;
    align-items: stretch;
  }

  .vac-yearnav {
    justify-content: center;
  }

  .vac-period {
    flex: 1 1 100%;
  }
}

/* ---------- agenda: seletor de modo ---------- */

.vac-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.vac-view-toggle {
  display: inline-flex;
  background: var(--surface-2, var(--surface));
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.vac-view-btn {
  border: 0;
  background: transparent;
  color: var(--text-muted, inherit);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.vac-view-btn.is-active {
  background: var(--accent, #2f6fed);
  color: #fff;
}

/* ---------- agenda: calendário do ano ---------- */

.vac-cal-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin: 4px 0 14px;
  font-size: 13px;
}

.vac-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.vac-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
}

.vac-dot--confirmado { background: var(--green); }
.vac-dot--pendente { background: var(--orange); }

.vac-cal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.vac-month {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: var(--surface);
}

.vac-month-title {
  margin: 0 0 8px;
  font-size: 14px;
  text-align: center;
}

.vac-weekdays,
.vac-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.vac-weekdays span {
  font-size: 10px;
  text-align: center;
  color: var(--text-muted, #888);
  font-weight: 700;
  padding: 2px 0;
}

.vac-day {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 6px;
  min-height: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 12px;
  cursor: pointer;
  color: inherit;
  padding: 2px 1px;
}

.vac-day:hover {
  border-color: var(--border);
  background: var(--surface-2, rgba(127, 127, 127, 0.08));
}

.vac-day--blank {
  cursor: default;
}

.vac-day--blank:hover {
  border-color: transparent;
  background: transparent;
}

.vac-day.has-events {
  background: color-mix(in srgb, var(--accent, #2f6fed) 8%, transparent);
}

.vac-day.is-selected {
  border-color: var(--accent, #2f6fed);
  box-shadow: 0 0 0 1px var(--accent, #2f6fed);
}

.vac-day-num {
  line-height: 1;
}

.vac-dots {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 9px;
}

.vac-more {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted, #888);
}

.vac-day-detail {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--surface);
}

.vac-day-detail-title {
  margin: 0 0 10px;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.vac-day-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px dashed var(--border);
  font-size: 13px;
}

/* ---------- agenda: lista ---------- */

.vac-list {
  display: flex;
  flex-direction: column;
}

.vac-list-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 12px 4px;
  border-top: 1px solid var(--border);
}

.vac-list-row:first-child {
  border-top: 0;
}

.vac-list-row--recusado,
.vac-list-row--cancelado {
  opacity: 0.65;
}

.vac-list-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 200px;
  flex: 1;
}

.vac-list-main span {
  font-size: 13px;
  color: var(--text-muted, #888);
}

.vac-list-actions {
  flex-basis: 100%;
}

.vac-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vac-btn-cancel {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 40%, transparent);
}

.vac-btn-small {
  padding: 4px 10px;
  font-size: 12px;
}

.vac-edit-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  flex-basis: 100%;
  background: var(--surface-2, rgba(127, 127, 127, 0.08));
  border-radius: 8px;
  padding: 10px;
}

.vac-edit-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
}

.vac-edit-btns {
  display: flex;
  gap: 8px;
}

.vac-confirm-box {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.vac-pill--cancelado {
  color: var(--text-muted, #888);
  background: color-mix(in srgb, #888 12%, var(--surface));
  border-color: color-mix(in srgb, #888 35%, transparent);
}

.vac-form--inline {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.vac-form--inline .vac-field {
  min-width: 150px;
}

.vac-field select {
  font: inherit;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
  max-width: 220px;
}

/* ---------- domingos e feriados ---------- */

.vac-day.is-sunday .vac-day-num {
  font-weight: 800;
}

.vac-day.is-holiday .vac-day-num {
  color: var(--red);
  font-weight: 800;
}

.vac-day.is-holiday {
  cursor: help;
}

.vac-legend-holiday {
  color: var(--red);
  font-weight: 700;
}
