* { box-sizing: border-box; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; margin: 0; background: #f5f6f8; color: #222; }
header { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; background: #fff; border-bottom: 1px solid #e5e7eb; }
header h1 { font-size: 20px; margin: 0; }
header a, header button { margin-left: 12px; }
a { color: #2563eb; text-decoration: none; }
button { padding: 8px 14px; border: none; background: #2563eb; color: #fff; border-radius: 6px; cursor: pointer; font-size: 14px; }
button:hover { background: #1d4ed8; }
input, select { padding: 8px; border: 1px solid #d1d5db; border-radius: 6px; width: 100%; font-size: 14px; }
input[type="checkbox"] { width: auto; }

.layout { display: grid; grid-template-columns: 1fr; gap: 20px; padding: 24px; max-width: 1000px; margin: 0 auto; }
.layout:has(#chatPanel:not(.hidden)) { grid-template-columns: 1fr 380px; }

.event-list { display: flex; flex-direction: column; gap: 12px; }
.event-card { display: flex; align-items: center; gap: 16px; padding: 16px; background: #fff; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.event-card.holiday { background: #fff7ed; border-left: 4px solid #f59e0b; }
.event-date { text-align: center; min-width: 130px; padding: 8px; background: #eef2ff; border-radius: 8px; }
.event-date .primary { font-weight: 700; color: #3730a3; font-size: 14px; }
.event-date .secondary { font-size: 12px; color: #6b7280; }
.event-info { flex: 1; }
.event-info h3 { margin: 0 0 4px; font-size: 16px; }
.event-info p { margin: 0; color: #666; font-size: 14px; }
.override-tag { font-size: 11px !important; color: #d97706 !important; margin-top: 4px !important; }
.note { font-size: 12px !important; color: #9ca3af !important; margin-top: 4px !important; }

.chat-btn { display: inline-flex; align-items: center; gap: 6px; }
.badge { background: #ef4444; color: #fff; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 10px; line-height: 1.4; }

.chat-panel { background: #fff; border-radius: 10px; display: flex; flex-direction: column; height: 70vh; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.chat-header { display: flex; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid #eee; }
.chat-header h2 { margin: 0; font-size: 16px; }
.chat-header small { color: #666; }
.chat-header button { background: transparent; color: #666; padding: 4px 8px; }
.messages { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.message { background: #f3f4f6; padding: 8px 12px; border-radius: 8px; font-size: 14px; }
.msg-head { display: flex; justify-content: space-between; font-size: 12px; color: #6b7280; margin-bottom: 3px; }
.msg-text { white-space: pre-wrap; word-break: break-word; }
.chat-form { display: grid; grid-template-columns: 1fr 2fr auto; gap: 6px; padding: 12px; border-top: 1px solid #eee; }

.admin-layout { display: grid; grid-template-columns: 380px 1fr; gap: 20px; padding: 24px; max-width: 1100px; margin: 0 auto; }
.form-card { background: #fff; padding: 20px; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.form-card label { display: block; margin-bottom: 12px; font-size: 14px; color: #444; }
.form-card input, .form-card select { margin-top: 4px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid #eee; vertical-align: top; }
.actions { white-space: nowrap; }
.actions button { margin-right: 4px; }
.override-btn { background: #6366f1; }
.override-btn:hover { background: #4f46e5; }
.delete { background: #ef4444; padding: 4px 10px; font-size: 12px; }
.del-ov { background: transparent; color: #dc2626; padding: 0 6px; font-size: 12px; }
.overrides { margin-top: 6px; font-size: 12px; color: #6b7280; }
.overrides small { color: #9ca3af; }
.ov-row { display: flex; gap: 4px; align-items: center; padding: 2px 0; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 10; }
.modal-box { background: #fff; padding: 24px; border-radius: 10px; width: min(420px, 90vw); }
.modal-box h2 { margin-top: 0; font-size: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.modal-actions #overrideCancel { background: #e5e7eb; color: #333; }

.login-box { max-width: 340px; margin: 80px auto; background: #fff; padding: 28px; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.login-box input { margin-bottom: 12px; }
.login-box button { width: 100%; }
.error { color: #dc2626; font-size: 13px; min-height: 16px; }
.hidden { display: none !important; }
.empty { color: #666; text-align: center; padding: 40px; }
.time24 { font-variant-numeric: tabular-nums; letter-spacing: 0.5px; }
.room-counts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.room-chip {
  display: inline-block;
  background: #eef2ff;
  color: #3730a3;
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 11px;
  white-space: nowrap;
}