/* HVS Calendar — Dark Navy + Teal Brand */
:root {
  --navy: #0C131D;
  --navy-2: #111E2E;
  --navy-3: #16263A;
  --surface: #152233;
  --surface-2: #1B2D42;
  --teal: #0CEDDF;
  --purple: #6E5AFF;
  --lavender: #B28CFF;
  --ink: #EAF2F7;
  --muted: #A9BBC9;
  --line: rgba(12,237,223,.18);
  --radius: 12px;
  --grad: linear-gradient(90deg, #0CEDDF, #6E5AFF);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Segoe UI", system-ui, sans-serif; background: var(--navy); color: var(--ink); line-height: 1.5; }

/* Layout */
.app { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }

/* Sidebar */
.sidebar {
  width: 280px; background: var(--navy-2); border-right: 1px solid var(--line);
  padding: 20px; overflow-y: auto; flex-shrink: 0;
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.brand-logo {
  width: 44px; height: 44px; background: var(--grad); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 1rem; color: #fff;
}
.brand-name { font-weight: 800; font-size: 1.1rem; }
.brand-tag { font-size: 0.8rem; color: var(--muted); }

.btn-create {
  width: 100%; padding: 12px; background: var(--grad); color: #fff;
  border: none; border-radius: var(--radius); font-weight: 700; font-size: 1rem;
  cursor: pointer; margin-bottom: 20px;
}
.btn-create:hover { opacity: 0.9; }

.mini-cal { background: var(--surface); border-radius: var(--radius); padding: 12px; margin-bottom: 16px; }
.mini-cal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-weight: 700; }
.mini-cal-header button { background: none; border: none; color: var(--teal); font-size: 1.2rem; cursor: pointer; padding: 2px 8px; }
.mini-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; font-size: 0.8rem; }
.mini-cal-grid .dow { color: var(--muted); font-weight: 600; padding: 4px 0; }
.mini-cal-grid .day { padding: 5px 0; cursor: pointer; border-radius: 6px; }
.mini-cal-grid .day:hover { background: var(--surface-2); }
.mini-cal-grid .day.today { background: var(--teal); color: #000; font-weight: 700; }
.mini-cal-grid .day.selected { background: var(--purple); color: #fff; font-weight: 700; }
.mini-cal-grid .day.other { color: #555; }

.cal-list { margin-bottom: 16px; }
.cal-list h3 { font-size: 0.9rem; color: var(--muted); margin-bottom: 8px; }
.cal-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 0.9rem; }
.cal-item input[type="checkbox"] { accent-color: var(--teal); }
.cal-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.cal-item .cal-name { flex: 1; }
.cal-item button { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 0.8rem; }

.search-box { margin-bottom: 16px; }
.search-box input {
  width: 100%; padding: 10px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--ink); font-size: 0.9rem;
}
.search-box input::placeholder { color: var(--muted); }

.sidebar-footer { border-top: 1px solid var(--line); padding-top: 12px; }
.btn-small {
  padding: 8px 12px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; color: var(--ink); cursor: pointer; font-size: 0.85rem; margin-right: 6px; margin-bottom: 6px;
}
.btn-small:hover { border-color: var(--teal); }
.no-bullshit { font-size: 0.75rem; color: var(--muted); margin-top: 12px; text-align: center; line-height: 1.6; }

/* Main */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.toolbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--navy-2);
}
.toolbar-left { display: flex; align-items: center; gap: 12px; }
.toolbar-left h2 { font-size: 1.3rem; }
.btn-nav {
  padding: 8px 14px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; color: var(--ink); cursor: pointer; font-size: 0.9rem;
}
.btn-nav:hover { border-color: var(--teal); }
.view-switch { display: flex; gap: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.view-switch button {
  padding: 8px 16px; background: var(--surface); border: none;
  color: var(--muted); cursor: pointer; font-size: 0.9rem;
}
.view-switch button.active { background: var(--teal); color: #000; font-weight: 700; }

/* Views */
.view { display: none; flex: 1; overflow: auto; padding: 16px 20px; }
.view.active { display: block; }

/* Month View */
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.month-dow { background: var(--navy-2); padding: 10px; text-align: center; font-weight: 700; font-size: 0.85rem; color: var(--muted); }
.month-cell {
  background: var(--surface); min-height: 110px; padding: 6px; cursor: pointer;
  position: relative; overflow: hidden;
}
.month-cell:hover { background: var(--surface-2); }
.month-cell.other-month { opacity: 0.35; }
.month-cell.today { outline: 2px solid var(--teal); outline-offset: -2px; }
.month-cell .day-num { font-weight: 700; font-size: 0.9rem; margin-bottom: 4px; }
.month-cell .day-num.today-num { color: var(--teal); }
.month-event {
  font-size: 0.75rem; padding: 2px 6px; border-radius: 4px; margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; color: #000;
}
.month-event:hover { opacity: 0.85; }
.month-event.all-day { font-weight: 700; }

/* Week / Day Views */
.time-grid { display: grid; grid-template-columns: 60px 1fr; gap: 0; }
.time-labels { display: flex; flex-direction: column; }
.time-label { height: 60px; text-align: right; padding-right: 8px; font-size: 0.75rem; color: var(--muted); border-bottom: 1px solid var(--line); }
.time-columns { display: grid; gap: 0; position: relative; }
.week-col-header { text-align: center; padding: 8px; font-weight: 700; border-bottom: 1px solid var(--line); background: var(--navy-2); }
.week-col-header.today-col { color: var(--teal); }
.time-slot { height: 60px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); position: relative; cursor: pointer; }
.time-slot:hover { background: rgba(12,237,223,0.05); }
.time-event {
  position: absolute; left: 2px; right: 2px; padding: 4px 6px; border-radius: 6px;
  font-size: 0.8rem; cursor: pointer; overflow: hidden; color: #000; z-index: 2;
}
.time-event:hover { opacity: 0.9; }

/* Agenda View */
.agenda-day { margin-bottom: 20px; }
.agenda-day h3 { color: var(--teal); margin-bottom: 8px; font-size: 1rem; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.agenda-item {
  display: flex; gap: 12px; padding: 10px; background: var(--surface);
  border-radius: var(--radius); margin-bottom: 6px; cursor: pointer; border-left: 4px solid var(--teal);
}
.agenda-item:hover { background: var(--surface-2); }
.agenda-time { font-weight: 700; min-width: 100px; font-size: 0.9rem; }
.agenda-details { flex: 1; }
.agenda-details .agenda-title { font-weight: 700; }
.agenda-details .agenda-meta { font-size: 0.85rem; color: var(--muted); }
.agenda-empty { text-align: center; color: var(--muted); padding: 40px; }

/* Modal */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 100; align-items: center; justify-content: center; }
.modal.open { display: flex; }
.modal-content {
  background: var(--navy-2); border-radius: 16px; width: 90%; max-width: 560px;
  max-height: 90vh; overflow-y: auto; border: 1px solid var(--line);
}
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px 0; }
.modal-header h3 { font-size: 1.2rem; }
.modal-close { background: none; border: none; color: var(--muted); font-size: 1.8rem; cursor: pointer; line-height: 1; }
.modal-content form { padding: 20px 24px 24px; }
.modal-content label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--muted); margin: 12px 0 4px; }
.modal-content input, .modal-content select, .modal-content textarea {
  width: 100%; padding: 10px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; color: var(--ink); font-size: 0.95rem;
}
.modal-content input:focus, .modal-content select:focus, .modal-content textarea:focus { outline: 2px solid var(--teal); border-color: transparent; }
.form-row { display: flex; gap: 12px; }
.form-row > div { flex: 1; }
.checkbox-label { display: flex !important; align-items: center; gap: 8px; cursor: pointer; }
.checkbox-label input { width: auto !important; accent-color: var(--teal); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.btn-primary { padding: 10px 20px; background: var(--grad); color: #fff; border: none; border-radius: 8px; font-weight: 700; cursor: pointer; }
.btn-secondary { padding: 10px 20px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.btn-danger { padding: 10px 20px; background: #FF2D2D; color: #fff; border: none; border-radius: 8px; cursor: pointer; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .toolbar { flex-wrap: wrap; gap: 8px; }
  .view-switch button { padding: 6px 10px; font-size: 0.8rem; }
  .month-cell { min-height: 70px; }
  .month-event { font-size: 0.65rem; }
}

/* HVS Logo */
.brand-logo-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
  flex-shrink: 0;
}
