:root {
  --primary: rgb(93, 122, 169);
  --primary-dark: rgb(68, 97, 144);
  --primary-light: rgb(123, 152, 199);
  --secondary: #f1f1f4;
  --card: #ffffff;
  --text-main: #2b2b2b;
  --text-muted: #666;
  --highlight: rgb(123, 152, 199);
}
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; background: var(--secondary); color: var(--text-main); }
.container { max-width: 1000px; margin: auto; padding: 16px; padding-bottom: 50px; }
header { background: var(--primary); color: #fff; padding: 22px; border-radius: 16px; margin-bottom: 16px; text-align: center; }
header h1 { margin: 0; font-size: 1.5em; }

/* Tabs */
.view-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab { flex: 1; padding: 12px; border: none; background: #e0e0e6; border-radius: 10px; font-weight: 600; color: #555; cursor: pointer; transition: all 0.2s; }
.tab.active { background: var(--primary); color: #fff; box-shadow: 0 4px 6px rgba(93, 122, 169, 0.3); }

/* Shift Counter */
.shift-counter { background: #fff9c4; color: #8a6d0b; padding: 12px; border-radius: 10px; margin-bottom: 16px; text-align: center; font-weight: bold; border: 1px solid #ffeeba; }

/* Info Box */
.info-box { background: #e3f2fd; color: #0d47a1; padding: 12px; border-radius: 10px; margin-bottom: 16px; font-size: 0.95em; border: 1px solid #bbdefb; }
.info-box p { margin: 0; }

/* Search Box */
.search-box { display: flex; gap: 10px; margin: 18px 0; position: sticky; top: 10px; z-index: 100; }
.search-box input { flex: 1; padding: 12px 14px; font-size: 1em; border-radius: 10px; border: 1px solid #ccc; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.search-box button { padding: 12px 16px; font-size: 0.95em; border-radius: 10px; border: none; background: var(--primary); color: #fff; cursor: pointer; }

/* Stars */
.star-btn { cursor: pointer; font-size: 1.2em; color: #ccc; margin-left: 6px; line-height: 1; vertical-align: middle; background: none; border: none; padding: 0; }
.star-btn.active { color: #fbc02d; }
.star-btn:hover { transform: scale(1.2); }

.day { background: var(--card); border-radius: 16px; padding: 18px; margin-bottom: 22px; box-shadow: 0 8px 20px rgba(0,0,0,0.06); border: 2px solid transparent; transition: all 0.5s ease; }
.day h2 { margin-top: 0; color: var(--primary); font-size: 1.4em; display: flex; justify-content: space-between; align-items: center; }
.day.today { border-color: var(--highlight); background-color: #fff9c4; }
.day.today h2::after { content: "HOY"; font-size: 0.6em; background: var(--highlight); color: #333; padding: 4px 8px; border-radius: 12px; }
.encargado { background: #f7f6fa; border-left: 4px solid var(--primary); padding: 12px; border-radius: 10px; margin-bottom: 16px; font-size: 0.95em; line-height: 1.6; }
.encargado a { color: var(--primary); text-decoration: none; font-weight: 700; }
.schedule { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.slot { background: #f9f9fb; border-radius: 12px; padding: 14px; display: flex; flex-direction: column; }
.slot h3 { margin: 0; font-size: 1.05em; color: #444; }
.time { font-size: 0.9em; color: var(--text-muted); margin-bottom: 8px; }
ul { margin: 0; padding-left: 18px; flex-grow: 1; }
li { margin-bottom: 4px; }
.calendar-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.calendar-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; font-size: 0.8em; text-decoration: none; background: var(--primary-light); color: #1f2a44; border: 1px solid var(--primary); cursor: pointer; }
.calendar-link.ics { background: #fff; }
.calendar-icon { width: 14px; height: 14px; fill: currentColor; }

/* Cubrir Button */
.cubrir-btn {
  display: inline-block;
  background-color: #4CAF50;
  color: white;
  padding: 8px 16px;
  text-align: center;
  text-decoration: none;
  font-size: 0.9em;
  font-weight: bold;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: background-color 0.3s, transform 0.2s;
  margin-top: 4px;
}
.cubrir-btn:hover {
  background-color: #45a049;
  transform: translateY(-1px);
}
.cubrir-btn:active {
  transform: translateY(1px);
}

/* Admin Styles */
header {
  position: relative; 
  /* keep existing styles */
  background: var(--primary); color: #fff; padding: 22px; border-radius: 16px; margin-bottom: 16px; text-align: center;
}

#admin-lock-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.5em; /* Larger for better touch target */
  cursor: pointer;
  color: #fff; /* Ensure white color */
  opacity: 0.8;
  z-index: 200; /* Ensure on top */
  transition: opacity 0.3s;
}
#admin-lock-btn:hover {
  opacity: 1;
}

#admin-panel {
  margin-bottom: 16px;
  background: #fff;
  padding: 15px;
  border: 2px solid var(--primary); /* More visible border */
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  position: relative;
  z-index: 200; /* Ensure on top of sticky elements */
}
#admin-panel button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9em;
}
#admin-output textarea {
  width: 100%;
  height: 150px;
  margin-top: 10px;
  font-family: monospace;
  font-size: 0.8em;
  border: 1px solid #ccc;
  border-radius: 4px;
}
