* { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, "Segoe UI", Arial, sans-serif;
  background: #F4F6FA; color: #0B1B3A;
}
.muted { color: #6B7280; }
button {
  font-family: inherit; cursor: pointer; border: 1px solid #E2E5EA; background: #fff;
  border-radius: 8px; padding: 8px 14px; font-size: 13.5px; color: #0B1B3A;
}
button:hover { background: #F4F6FA; }
.btn-accent { background: #2F5FEA; color: #fff; border-color: #2F5FEA; }
.btn-accent:hover { background: #244BBC; }
.icon-btn { width: 34px; height: 34px; padding: 0; font-size: 16px; display: flex; align-items: center; justify-content: center; }
input, textarea { font-family: inherit; padding: 8px 10px; border: 1px solid #E2E5EA; border-radius: 6px; font-size: 13.5px; width: 100%; }
label { font-size: 12px; color: #6B7280; display: block; margin: 10px 0 4px; }

/* Login */
.login-page { display: flex; align-items: center; justify-content: center; height: 100vh; background: #0B1B3A; }
.login-box { background: #fff; padding: 40px; border-radius: 12px; width: 320px; text-align: center; }
.login-box h1 { margin-bottom: 0; }
.login-box form { display: flex; flex-direction: column; text-align: left; margin-top: 20px; }
.login-box button { margin-top: 16px; }
.error { color: #D85A30; font-size: 13px; min-height: 18px; }

/* Topbar */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; background: #fff; border-bottom: 1px solid #E2E5EA; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 8px; }
.mail-link { font-size: 13.5px; color: #6B7280; text-decoration: none; padding: 8px 10px; }
.mail-link:hover { color: #2F5FEA; }
.topbar h2 { font-size: 16px; margin: 0 0 0 8px; }

/* Grid semanal */
.calendar-grid { display: flex; margin: 20px 24px; background: #fff; border: 1px solid #E2E5EA; border-radius: 12px; height: 620px; overflow-y: auto; }
.loading { padding: 60px; text-align: center; color: #6B7280; width: 100%; }
.time-col { width: 56px; flex-shrink: 0; position: relative; }
.time-col .day-header { height: 44px; border-bottom: 1px solid #E2E5EA; position: sticky; top: 0; background: #fff; z-index: 2; }
.time-col .hour-label { position: relative; }
.day-col { flex: 1; position: relative; }
.day-header { height: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-bottom: 1px solid #E2E5EA; border-right: 1px solid #E2E5EA; position: sticky; top: 0; background: #fff; z-index: 2; }
.day-header .dow { font-size: 11px; color: #6B7280; }
.day-header .dom { font-size: 13px; margin-top: 2px; }
.day-header .dom.today { width: 22px; height: 22px; border-radius: 50%; background: #2F5FEA; color: #fff; display: flex; align-items: center; justify-content: center; }
.day-body { position: relative; }
.hour-row { height: 48px; border-bottom: 1px solid #E2E5EA; border-right: 1px solid #E2E5EA; }
.event-block { position: absolute; left: 4px; right: 4px; border-radius: 6px; padding: 5px 7px; overflow: hidden; cursor: pointer; font-size: 12px; }
.event-block .ev-title { font-weight: 600; }
.event-block .ev-time { font-size: 11px; opacity: .85; }
.color-blue { background: #E6EDFD; border-left: 3px solid #2F5FEA; color: #1E41A3; }
.color-purple { background: #F1EBFB; border-left: 3px solid #7C4DDA; color: #4B2E86; }
.color-success { background: #EAF3DE; border-left: 3px solid #639922; color: #27500A; }
.color-warning { background: #FAEEDA; border-left: 3px solid #BA7517; color: #633806; }
.color-danger { background: #FCEBEB; border-left: 3px solid #E24B4A; color: #791F1F; }

/* Panels laterales */
.overlay { position: fixed; inset: 0; background: rgba(11,27,58,.3); z-index: 40; }
.side-panel { position: fixed; top: 0; right: 0; height: 100vh; width: 420px; background: #fff; z-index: 50; box-shadow: -8px 0 24px rgba(11,27,58,.15); overflow-y: auto; }
.side-panel-inner { padding: 20px; }
.side-panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.hidden { display: none !important; }
.row { display: flex; gap: 8px; }
.row .col { flex: 1; min-width: 0; }
.row .col input { width: 100%; min-width: 0; }
.form-actions { display: flex; align-items: center; gap: 10px; margin-top: 20px; }
.btn-danger { background: #FCEBEB; color: #791F1F; border-color: #F09595; }
.btn-danger:hover { background: #F7C1C1; }
.hint { font-size: 12px; color: #6B7280; margin-top: 6px; }

.attendees-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.attendee-chip { display: flex; align-items: center; gap: 6px; background: #F4F6FA; border-radius: 999px; padding: 4px 10px; font-size: 12.5px; }
.attendee-chip .remove { cursor: pointer; color: #6B7280; }
.attendee-chip.busy { background: #FAEEDA; }
.attendee-chip.free { background: #EAF3DE; }

.subscribed-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #E2E5EA; }
.subscribed-item .dot { width: 10px; height: 10px; border-radius: 50%; }
.subscribed-item .name { flex: 1; font-size: 14px; }

.suggestions {
  position: absolute; top: 100%; left: 0; right: 0; background: #fff;
  border: 1px solid #E2E5EA; border-radius: 8px; box-shadow: 0 8px 20px rgba(11,27,58,.12);
  z-index: 10; max-height: 180px; overflow-y: auto; margin-top: 2px;
}
.suggestion-item { padding: 8px 12px; font-size: 13px; cursor: pointer; }
.suggestion-item:hover { background: #F4F6FA; }
