:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface2: #f0f2f7;
  --border: #dde1ec;
  --accent: #4f8ef7;
  --accent2: #f7634f;
  --accent3: #4fc98e;
  --text: #1a1f36;
  --text-muted: #8892aa;
  --dayoff-color: #f7634f18;
  --dayoff-border: #f7634f;
  --holiday-color: #4f8ef718;
  --holiday-border: #4f8ef7;
  --radius: 12px;
  --tab-active: #4f8ef7;
}

body {
  background: var(--bg);
  color: var(--text);
}

/* MODAL */
.btn-close-modal {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.btn-close-modal:hover {
  border-color: var(--accent2);
  color: var(--accent2);
}

/* ========== CALENDAR ========== */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.cal-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cal-month-label {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
  min-width: 160px;
  text-align: center;
}
.cal-nav-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-size: 12px;
}
.cal-nav-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.cal-legend {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-muted);
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.legend-dot.dayoff {
  background: var(--accent2);
  opacity: 0.8;
}
.legend-dot.holiday {
  background: var(--accent);
  opacity: 0.8;
}

/* DAY NAMES */
.cal-daynames {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 6px;
}
.cal-dayname {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 0;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* GRID */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-cell {
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1.5px solid transparent;
  background: var(--surface2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  font-size: 13px;
  font-weight: 500;
  user-select: none;
}
.cal-cell:hover:not(.empty) {
  border-color: var(--border);
  background: #ffffff08;
}
.cal-cell.empty {
  cursor: default;
  background: transparent;
  border-color: transparent;
}
.cal-cell.today {
  border-color: var(--accent3) !important;
}
.cal-cell.dayoff {
  background: var(--dayoff-color);
  border-color: var(--dayoff-border) !important;
  color: var(--accent2);
}
.cal-cell.holiday {
  background: var(--holiday-color);
  border-color: var(--holiday-border) !important;
}
.cal-cell.dayoff.holiday {
  background: linear-gradient(
    135deg,
    var(--dayoff-color),
    var(--holiday-color)
  );
}
.cal-cell .holiday-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  position: absolute;
  bottom: 5px;
}
.cal-cell.dayoff.holiday .holiday-dot {
  background: var(--accent);
}

/* WEEK DAY HEADER highlight */
.cal-dayname.dayoff-head {
  color: var(--accent2);
}

/* ---- DAYS OFF TOGGLE ---- */
.dow-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 20px;
}
.dow-chip {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  text-align: center;
  padding: 8px 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}
.dow-chip:hover {
  border-color: var(--accent2);
  color: var(--accent2);
}
.dow-chip.selected {
  background: #f7634f1a;
  border-color: var(--accent2);
  color: var(--accent2);
}

/* ---- HOLIDAY PANEL ---- */
.holiday-panel {
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}
.holiday-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.holiday-panel-header h6 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.btn-add-holiday {
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}
.btn-add-holiday:hover {
  background: var(--accent);
  color: #fff;
}

/* Holiday list */
.holiday-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
}
.holiday-list::-webkit-scrollbar {
  width: 4px;
}
.holiday-list::-webkit-scrollbar-track {
  background: transparent;
}
.holiday-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
.holiday-item {
  display: grid;
  grid-template-columns: 130px 80px 1fr auto;
  gap: 8px;
  align-items: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  animation: slideIn 0.2s ease;
}
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.holiday-item input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 4px 8px;
  font-size: 12px;
  width: 100%;
}
.holiday-item input:focus {
  outline: none;
  border-color: var(--accent);
}
.holiday-item input[type="number"] {
  -moz-appearance: textfield;
}
.holiday-item input[type="number"]::-webkit-inner-spin-button {
  display: none;
}
.btn-remove-holiday {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: all 0.2s;
  font-size: 13px;
}
.btn-remove-holiday:hover {
  color: var(--accent2);
  background: #f7634f15;
}
.holiday-item-hint {
  font-size: 10px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ---- TIMELINE / COST TABS ---- */
.setting-row {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(2, 1fr);
}
.setting-card {
  flex: 1;
  min-width: 220px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.setting-card label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 12px;
}
.switch-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 24px;
  cursor: pointer;
  transition: 0.3s;
}
.slider:before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}
input:checked + .slider {
  background: var(--accent);
}
input:checked + .slider:before {
  transform: translateX(18px);
}
.switch-label {
  font-size: 13px;
  color: var(--text-muted);
}
.form-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 8px 12px;
  font-size: 13px;
  width: 100%;
}
.form-input:focus {
  outline: none;
  border-color: var(--accent);
}
/* Selected date badge on calendar */
.cal-cell .dur-badge {
  font-size: 9px;
  background: var(--accent);
  color: #fff;
  border-radius: 3px;
  padding: 0 3px;
  position: absolute;
  top: 4px;
  right: 4px;
}

/* Tooltip */
.cal-cell[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(80%);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 999;
}
