:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #dde3ee;
  --text: #1f2937;
  --muted: #667085;
  --primary: #1d4ed8;
  --primary-2: #2563eb;
  --event: #dbeafe;
  --event-border: #93c5fd;
}
* { box-sizing: border-box; }
body { font-family: "Segoe UI", "Helvetica Neue", sans-serif; margin: 0; background: var(--bg); color: var(--text); }
header { background: var(--surface); border-bottom: 1px solid var(--line); padding: 12px 18px; position: sticky; top: 0; z-index: 20; }
header h1 { margin: 0; font-size: 20px; }
nav { margin-top: 6px; display: flex; gap: 12px; flex-wrap: wrap; }
nav a { color: #344054; text-decoration: none; padding: 4px 8px; border-radius: 6px; }
nav a:hover { background: #eef2ff; }
main { padding: 16px; }
.card { background: var(--surface); border-radius: 12px; padding: 14px; margin-bottom: 12px; box-shadow: 0 4px 14px rgba(16, 24, 40, 0.05); border: 1px solid #edf1f7; }
.narrow { max-width: 420px; margin: 40px auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
label { display: block; font-size: 13px; color: #344054; }
input, select, textarea, button { width: 100%; padding: 9px 10px; margin-top: 4px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
textarea { min-height: 90px; }
button { cursor: pointer; }
button:hover { filter: brightness(0.98); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-ghost { background: #fff; color: #111827; }
.nav-btn { width: 40px; min-width: 40px; text-align: center; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.full { grid-column: 1 / -1; }
.flash { list-style: none; margin: 0; padding: 8px 16px; }
.flash li { background: #dcfce7; border: 1px solid #86efac; padding: 8px; margin-bottom: 6px; border-radius: 8px; }

.calendar-shell { display: grid; gap: 12px; }
.sticky-toolbar { position: sticky; top: 74px; z-index: 15; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.toolbar-left h2 { margin: 0 0 4px 0; }
.toolbar-left p { margin: 0; color: var(--muted); font-size: 13px; }
.toolbar-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.input-compact { width: auto; min-width: 120px; }

.chip-group, .chips-select { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); padding: 4px 10px; gap: 6px; font-size: 13px; }
.chip input { width: auto; margin: 0; }

.calendar { padding: 0; overflow: hidden; }
.calendar-header { display: grid; grid-template-columns: 74px repeat(var(--days, 7), 1fr); border-bottom: 1px solid var(--line); background: #f8fafc; }
.time-col { border-right: 1px solid var(--line); }
.day-col-head { padding: 10px 8px; border-right: 1px solid var(--line); text-align: center; }
.day-col-head small { display: block; color: var(--muted); }
.day-col-head strong { font-size: 14px; }
.day-col-head.is-today { background: #e0e7ff; }

.calendar-grid { display: grid; grid-template-columns: 74px 1fr; height: 760px; }
.time-axis { border-right: 1px solid var(--line); background: #fff; }
.time-slot { height: 44px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); padding: 2px 6px; }
.days-grid { position: relative; display: grid; grid-template-columns: repeat(var(--days, 7), 1fr); }
.day-column { display: grid; grid-template-rows: repeat(var(--slots, 17), 44px); border-right: 1px solid var(--line); }
.cell { border: none; border-bottom: 1px solid var(--line); border-radius: 0; background: #fff; margin: 0; padding: 0; }
.cell:hover { background: #eff6ff; }

.event-card {
  position: absolute;
  border: 1px solid var(--event-border);
  background: var(--event);
  border-radius: 8px;
  padding: 6px 7px;
  text-align: left;
  color: #0f172a;
  overflow: hidden;
  z-index: 4;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.14);
}
.event-card strong { display: block; font-size: 12px; }
.event-card span, .event-card small { display: block; font-size: 11px; color: #334155; }
.event-card .assignee-line { margin-top: 3px; line-height: 1.25; white-space: normal; }
.event-card small { line-height: 1.3; white-space: normal; }
.event-card.done { background: #dcfce7; border-color: #86efac; }

.modal { border: none; border-radius: 14px; padding: 0; width: min(720px, 95vw); }
.modal::backdrop { background: rgba(15, 23, 42, 0.45); }
.modal-form { padding: 16px; }
.modal-form h3 { margin-top: 0; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.checkbox-inline { display: flex; align-items: center; gap: 8px; }
.checkbox-inline input { width: auto; margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.modal-form ul { margin: 6px 0 10px 18px; padding: 0; }
.modal-form li { margin-bottom: 4px; }

table { width: 100%; border-collapse: collapse; }
th, td { border: 1px solid #ddd; padding: 6px; text-align: left; }
.task, .list-event { border: 1px solid #e4e7ec; border-radius: 10px; padding: 10px; background: #fff; margin-bottom: 8px; }
.month-grid-wrap { padding: 10px; }
.month-head { display: grid; grid-template-columns: repeat(7, 1fr); font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.month-head div { text-align: center; padding: 4px; }
.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.month-cell { min-height: 130px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 6px; overflow: hidden; }
.month-cell.out-month { background: #f8fafc; opacity: 0.7; }
.month-date { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.month-event { width: 100%; border: 1px solid var(--event-border); background: var(--event); color: #0f172a; border-radius: 6px; font-size: 11px; text-align: left; padding: 4px 6px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.month-event.done { background: #dcfce7; border-color: #86efac; }
.login-inline { width: 280px; margin: 0; }
.login-inline h3 { margin: 0 0 8px 0; }

@media (max-width: 1100px) {
  .grid2, .grid3, .row-2, .row-3 { grid-template-columns: 1fr; }
  .sticky-toolbar { position: static; }
  .calendar-grid { height: 640px; }
}
@media (max-width: 820px) {
  .toolbar { flex-direction: column; align-items: flex-start; }
  .login-inline { width: 100%; }
  .calendar { overflow-x: auto; }
  .calendar-header, .calendar-grid { min-width: 900px; }
}

.login-dashboard { display: grid; gap: 12px; }
.login-top {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
}
.login-title h2 { margin: 0; font-size: 30px; line-height: 1.1; }
.login-title p { margin: 4px 0 0 0; color: var(--muted); }
.login-nav { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  text-decoration: none;
  color: #0f172a;
}
.date-input { min-width: 150px; height: 44px; margin: 0; }
.login-form-top {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
  gap: 8px;
}
.login-form-top label { min-width: 150px; }
.login-form-top input { height: 44px; }
.login-form-top button { height: 44px; min-width: 120px; }

.mobile-list { display: none; }
.mobile-day { padding: 8px 0; border-top: 1px solid var(--line); }
.mobile-day:first-of-type { border-top: 0; }
.mobile-day h4 { margin: 0 0 6px 0; font-size: 14px; }
.mobile-day ul { list-style: none; margin: 0; padding: 0; }
.mobile-day li { padding: 8px 0; border-top: 1px dashed #e5e7eb; }
.mobile-day li:first-child { border-top: 0; }
.mobile-day strong { margin-right: 6px; }
.mobile-day small { display: block; color: var(--muted); margin-top: 3px; }
.muted { color: var(--muted); }

@media (max-width: 1024px) {
  .login-top { grid-template-columns: 1fr; }
  .login-form-top { grid-template-columns: 1fr 1fr; }
  .login-form-top button { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  main { padding: 10px; }
  .card { border-radius: 10px; padding: 10px; }
  .login-title h2 { font-size: 22px; }
  .login-nav { width: 100%; justify-content: space-between; }
  .date-input { flex: 1; min-width: 0; }
  .login-form-top { grid-template-columns: 1fr; }
  .calendar { display: none; }
  .mobile-list { display: block; }
}

.gcal-shell { display: grid; grid-template-columns: 280px 1fr; gap: 14px; }
.gcal-side { align-self: start; position: sticky; top: 74px; }
.create-btn { width: 100%; height: 44px; margin-bottom: 12px; border-radius: 22px; font-weight: 600; }
.mini-month { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: #fff; }
.mini-head { margin-bottom: 8px; color: #344054; }
.mini-weekdays, .mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.mini-weekdays span { text-align: center; color: var(--muted); font-size: 11px; }
.mini-day { text-align: center; font-size: 12px; color: #111827; text-decoration: none; border-radius: 8px; padding: 5px 0; }
.mini-day:hover { background: #eef2ff; }
.mini-day.out { color: #98a2b3; }
.mini-day.today { background: #1d4ed8; color: #fff; font-weight: 700; }
.side-section { margin-top: 12px; }
.side-section h4 { margin: 0 0 8px 0; font-size: 14px; }

.gcal-main { padding: 10px; }
.gcal-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.gcal-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gcal-nav h2 { margin: 0 0 0 8px; font-size: 28px; line-height: 1.1; }
.gcal-view-switch select { min-width: 130px; height: 42px; border-radius: 22px; }
.quick-modal .modal-form { width: min(760px, 96vw); }

@media (max-width: 1100px) {
  .gcal-shell { grid-template-columns: 1fr; }
  .gcal-side { position: static; }
}
@media (max-width: 820px) {
  .gcal-top { flex-direction: column; align-items: flex-start; }
  .gcal-nav h2 { font-size: 22px; margin-left: 0; }
}
