:root {
  --bg: linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 50%, #0d0d0d 100%);
  --card-bg: linear-gradient(135deg, rgba(30, 30, 30, 0.95) 0%, rgba(25, 25, 25, 0.95) 100%);
  --muted: rgba(255, 255, 255, 0.6);
  --text: #f5f5f5;
  --button-bg: rgba(60, 60, 60, 0.6);
  --button-hover: rgba(70, 70, 70, 0.8);
  --ok: #00e676;
  --warn: #ffd700;
  --bad: #ff4c4c;
  --holiday: #ffb74d;
  --vacation: #3fa7ff;
}

/* ---------- Base Reset ---------- */
* { box-sizing: border-box; }
html, body { height:100%; margin:0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
  background: var(--bg);
  background-attachment: fixed;
  background-size: 100% 100%;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Centered Main Container ---------- */
.index {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  padding: 60px 16px;
  text-align: center;
}

/* ---------- Header ---------- */
.logo-title-container h1 {
  margin: 0 0 8px 0;
  color: #fff;
  font-size: 2.2rem;
}

.date-info {
  color: #9acd32;
  font-weight: bold;
  font-size: 1.1rem;
  margin-bottom: 16px;
}

/* ---------- Form Card ---------- */
form {
  background: var(--card-bg);
  padding: 36px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(30px);
  max-width: 680px;
  width: 100%;
  text-align: left;
}

/* ---------- Compact Date + Buttons Row ---------- */
.controls-row {
  margin-bottom: 10px;
  text-align: left;
}

.controls-row label {
  color: var(--muted);
  font-weight: bold;
  display: block;
  margin-bottom: 4px;
}

.controls-inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.controls-inline input[type="date"] {
  flex: 0 0 200px;
  padding: 10px;
  background: #2c2c2c;
  color: var(--text);
  border: none;
  border-radius: 5px;
  font-size: 1em;
}

.controls-inline input[type="date"]:focus {
  outline: none;
}

.controls-inline button {
  flex: 0 0 130px;
  margin: 0;
  padding: 8px 16px;
  height: 40px;
  background: var(--button-bg);
  color: #f5f5f5;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  font-size: 0.9em;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.controls-inline button:hover {
  background: var(--button-hover);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
.controls-inline button:active { transform: scale(0.98); }

/* ---------- Home Button ---------- */
.back-to-index {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
}

.back-button {
  width: 50px;
  height: 50px;
  border: none;
  cursor: pointer;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(40, 40, 40, 0.7) 0%, rgba(30, 30, 30, 0.7) 100%);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  text-decoration: none;
}

.back-button svg {
  width: 24px;
  height: 24px;
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.3s ease;
}

.back-button:hover {
  background: linear-gradient(135deg, rgba(50, 50, 50, 0.8) 0%, rgba(40, 40, 40, 0.8) 100%);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.back-button:hover svg {
  color: rgba(255, 255, 255, 0.95);
}

/* ---------- Week Range Label ---------- */
.week-range {
  margin-top: 10px;
  margin-bottom: 18px;
  font-weight: bold;
  color: #9acd32;
  text-align: left;
}

/* ---------- Time Inputs Grid ---------- */
.times-grid {
  display: grid;
  grid-template-columns: 160px 80px 1fr 1fr;
  align-items: center;
  gap: 8px 10px;
  margin-top: 10px;
}

.day-col {
  color: #fff;
  font-weight: bold;
}

.ferias-label {
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.time-input {
  width: 100%;
  text-align: center;
  background: #2c2c2c;
  color: var(--text);
  border: none;
  border-radius: 5px;
  padding: 10px;
  height: 38px;
  font-size: 1em;
  transition: border-color .15s, background .15s;
}
.time-input::placeholder { color: #777; }
.time-input:focus {
  outline: none;
  border-color: #4c8dff;
  background: #2e2e2e;
}
.time-input.invalid { border: 1px solid var(--bad); }

/* ---------- Disabled (Holiday / Vacation) ---------- */
.disabled-holiday,
.disabled-vacation {
  opacity: 0.5;
  background-color: #1a1a1a !important;
  cursor: not-allowed;
}

/* ---------- Holiday / Vacation Indicators ---------- */
.holiday-day { color: var(--holiday); font-weight: 700; }
.vacation-day { color: var(--vacation); font-weight: 700; }
.holiday-label { color: var(--holiday); margin-left: 4px; }

/* ---------- Results Section ---------- */
#results {
  margin-top: 24px;
  background: var(--card-bg);
  padding: 36px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(30px);
  max-width: 860px;
  width: 100%;
  text-align: left;
}

.results-row {
  display: flex;
  gap: 16px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.result-box {
  flex: 1 1 280px;
  background: linear-gradient(135deg, rgba(45, 45, 45, 0.7) 0%, rgba(35, 35, 35, 0.7) 100%);
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.result-box h4 {
  color: #9acd32;
  margin: 0 0 8px 0;
}

/* ---------- Thresholds & Colors ---------- */
.thresholds {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 14px;
  margin: 6px 0 2px;
  font-weight: bold;
}
.thresholds .sep { color: #777; font-weight: normal; }

.compliance-red { color: var(--bad); font-weight: bold; }
.compliance-yellow { color: var(--warn); font-weight: bold; }
.compliance-green { color: var(--ok); font-weight: bold; }

/* ---------- Footer note ---------- */
small {
  display: block;
  margin-top: 12px;
  color: #999;
  font-size: 0.85rem;
}

/* ---------- Responsive Adjustments ---------- */
@media (max-width: 720px) {
  .controls-inline { flex-wrap: wrap; }
  .controls-inline input[type="date"] { flex: 1 1 100%; }
  .controls-inline button { flex: 1 1 100%; }
  .times-grid { grid-template-columns: 1fr 1fr 1fr; }
}

.holiday-row {
  background-color: rgba(255, 183, 77, 0.1);
  border-radius: 6px;
  padding: 4px 6px;
}

.vacation-row {
  background: rgba(63, 167, 255, 0.12);
  border-radius: 6px;
  padding: 4px 6px;
}