* { box-sizing: border-box; margin: 0; padding: 0; }

body { font-family: 'Segoe UI', Arial, sans-serif; background: #eef1f5; color: #1a1a1a; }

header { background: #1a2940; color: #fff; padding: 14px 20px; text-align: center; }
header h2 { font-size: 20px; letter-spacing: 0.5px; }

.tabs { display: flex; background: #243550; position: sticky; top: 0; z-index: 100; }
.tabs button { flex: 1; padding: 14px 8px; background: none; border: none; color: #aec6e8; font-size: 14px; cursor: pointer; font-weight: 600; transition: background 0.2s; }
.tabs button.active { background: #1abc9c; color: #000; }
.tabs button:hover:not(.active) { background: #2e4568; color: #fff; }

.container { padding: 14px; max-width: 900px; margin: 0 auto; }
.section { display: none; }
.section.active { display: block; }

.card { background: #fff; border-radius: 12px; padding: 18px; box-shadow: 0 2px 10px rgba(0,0,0,.10); margin-bottom: 14px; }
.card h3 { font-size: 17px; color: #1a2940; margin-bottom: 6px; }
.card h4 { font-size: 15px; color: #2c3e50; margin: 18px 0 6px; }

label { display: block; font-weight: 600; color: #2c3e50; margin-top: 14px; font-size: 14px; }
input, select { width: 100%; padding: 11px 13px; margin-top: 5px; font-size: 15px; border-radius: 8px; border: 1.5px solid #c5cdd8; color: #1a1a1a; background: #f9fafc; transition: border 0.2s; }
input:focus, select:focus { outline: none; border-color: #1abc9c; background: #fff; }
input[type=date] { cursor: pointer; }

button { cursor: pointer; border-radius: 8px; font-weight: 600; font-size: 14px; transition: background 0.2s, transform 0.1s; }
button:active { transform: scale(0.98); }

.btn-primary { display: block; width: 100%; padding: 13px; background: #1abc9c; border: none; color: #000; margin-top: 20px; font-size: 15px; }
.btn-primary:hover { background: #17a589; }
.btn-secondary { display: block; width: 100%; padding: 11px; background: #2c3e50; border: none; color: #fff; margin-top: 8px; }
.btn-secondary:hover { background: #1a2940; }
.btn-danger { background: #e74c3c; color: #fff; border: none; padding: 6px 10px; font-size: 12px; }
.btn-danger:hover { background: #c0392b; }
.btn-confirm { background: #27ae60; color: #fff; border: none; padding: 6px 10px; font-size: 12px; }
.btn-confirm:hover { background: #1e8449; }
.btn-excel { background: #1e7e45; color: #fff; border: none; padding: 11px 14px; font-size: 14px; margin-bottom: 12px; width: 100%; }
.btn-excel:hover { background: #166134; }
.btn-move { background: #e67e22; color: #fff; border: none; padding: 6px 10px; font-size: 12px; }
.btn-move:hover { background: #ca6f1e; }

.search-wrap { display: flex; gap: 8px; margin-bottom: 10px; }
.search-wrap input { flex: 1; margin-top: 0; }
.search-wrap button { padding: 11px 16px; background: #1abc9c; border: none; color: #000; border-radius: 8px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { border: 1px solid #d0d7e2; padding: 8px 6px; text-align: center; color: #1a1a1a; }
th { background: #dde3ed; font-weight: 700; font-size: 12px; text-transform: uppercase; }
tr:nth-child(even) td { background: #f5f7fb; }
.td-actions { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }

.badge { display: inline-block; padding: 3px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge-active   { background: #d4efdf; color: #1e7e44; }
.badge-done     { background: #d6eaf8; color: #1a5276; }
.badge-canceled { background: #fadbd8; color: #922b21; }
.badge-moved    { background: #fef9e7; color: #9a7d0a; border: 1px solid #f0c040; }

.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-nav button { background: #1a2940; color: #fff; border: none; padding: 8px 16px; border-radius: 8px; font-size: 14px; width: auto; }
.cal-nav button:hover { background: #243550; }
.cal-title { font-size: 17px; font-weight: 700; color: #1a2940; }

.cal-weekdays { display: grid; grid-template-columns: repeat(7,1fr); gap: 4px; margin-bottom: 4px; }
.cal-weekday { text-align: center; font-size: 12px; font-weight: 700; color: #666; padding: 4px 0; }

.calendar { display: grid; grid-template-columns: repeat(7,1fr); gap: 5px; }
.day { padding: 10px 4px; border-radius: 8px; text-align: center; font-size: 14px; font-weight: 600; cursor: pointer; color: #1a1a1a; transition: transform 0.1s, box-shadow 0.1s; }
.day:hover { transform: scale(1.08); box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.day.empty { background: transparent; cursor: default; pointer-events: none; }
.day.free { background: #a9dfbf; }
.day.busy { background: #f1948a; }
.day.partial { background: #f9e79f; }
.day.today { outline: 3px solid #1abc9c; }

.cal-legend { display: flex; gap: 14px; margin-top: 10px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #444; }
.legend-dot { width: 14px; height: 14px; border-radius: 4px; }

#calResultados { margin-top: 14px; }

.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { background: #fff; border-radius: 14px; padding: 22px; width: 90%; max-width: 420px; box-shadow: 0 8px 30px rgba(0,0,0,.2); }
.modal h3 { margin-bottom: 14px; color: #1a2940; }
.modal-btns { display: flex; gap: 8px; margin-top: 18px; }
.modal-btns button { flex: 1; padding: 12px; border: none; }

.empty { text-align: center; color: #888; padding: 20px; font-style: italic; }

@media (max-width: 600px) {
  th, td { font-size: 11px; padding: 5px 3px; }
  .td-actions { flex-direction: column; }
  .tabs button { font-size: 12px; padding: 12px 4px; }
}

/* YEAR NAV */
.year-nav { margin-bottom: 6px; }
.year-nav button { background: #0e1f35; }
.year-nav button:hover { background: #1a2940; }
.cal-year-title { font-size: 22px; font-weight: 800; color: #0e1f35; letter-spacing: 1px; }

/* EXPORT GRID */
.export-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 10px; }
.export-box { background: #f4f7fb; border-radius: 10px; padding: 14px; border: 1.5px solid #dde3ed; }
.export-label { font-weight: 700; font-size: 14px; color: #1a2940; margin-bottom: 4px; }
.export-desc { font-size: 12px; color: #666; margin-bottom: 6px; min-height: 18px; }
.export-box .btn-excel { margin-top: 6px; padding: 10px; font-size: 13px; }
