/* ============================================================
   Components
   ============================================================ */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 14px;
  transition: transform var(--dur) var(--easing), box-shadow var(--dur), background var(--dur), color var(--dur);
  border: 1px solid transparent;
  white-space: nowrap;
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: 0 8px 20px rgba(108, 99, 255, .35);
}
.btn-primary:hover { box-shadow: 0 12px 28px rgba(108, 99, 255, .5); transform: translateY(-1px); }

.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--surface-3); }

.btn-secondary { background: var(--primary-soft); color: var(--primary); }
.btn-secondary:hover { background: var(--primary-softer); }

.btn-outline { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-danger { background: #FEECEC; color: var(--danger); }
[data-theme="dark"] .btn-danger { background: #3b1f22; }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-danger-outline {
  background: var(--surface);
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 45%, var(--border));
}
.btn-danger-outline:hover {
  background: #FEECEC;
  border-color: var(--danger);
  color: var(--danger);
}
[data-theme="dark"] .btn-danger-outline:hover { background: #3b1f22; }

.btn-lg { padding: 14px 22px; font-size: 15px; border-radius: var(--r-lg); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: var(--r-sm); }
.btn-block { width: 100%; }

.icon-btn {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-md);
  color: var(--text-2);
  background: transparent;
  transition: all var(--dur) var(--easing);
  position: relative;
}
.icon-btn:hover { background: var(--surface-3); color: var(--primary); }
.icon-btn.danger { color: var(--danger); }
.icon-btn.danger:hover { background: #FEECEC; color: var(--danger); }
[data-theme="dark"] .icon-btn.danger:hover { background: #3b1f22; }
.icon-btn .dot {
  position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-pink); box-shadow: 0 0 0 2px var(--surface);
}

/* ---------- Card ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur), transform var(--dur);
}
.card.hover:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 0; }
.card-title { font-weight: 700; font-size: 15px; }
.card-body { padding: 16px 20px 20px; }

/* ---------- Chip / Badge ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-size: 12px; font-weight: 600;
  background: var(--primary-soft); color: var(--primary);
  border: 1px solid transparent;
  transition: all var(--dur);
}
.chip.outline { background: transparent; border-color: var(--border-strong); color: var(--text-2); }
.chip.ghost { background: var(--surface-3); color: var(--text-2); }
.chip.pink { background: #FFE4F1; color: #C43F92; }
.chip.orange { background: #FFE8D1; color: #C0671A; }
.chip.yellow { background: #FFF1B8; color: #8A6A00; }
.chip.teal { background: #D1F4EA; color: #0F8A6B; }
.chip.blue { background: #D7EBFF; color: #1B66B9; }
.chip.lilac { background: #E7DEFF; color: #6332C2; }
.chip.green { background: #DCF6EA; color: #0E7A4F; }
.chip.red { background: #FDE4E4; color: #B42626; }
[data-theme="dark"] .chip.pink { background: #3a1f2e; color: #ff89c0; }
[data-theme="dark"] .chip.orange { background: #3a2a1a; color: #ffb37a; }
[data-theme="dark"] .chip.yellow { background: #332a10; color: #ffd76a; }
[data-theme="dark"] .chip.teal { background: #123127; color: #7ae0c9; }
[data-theme="dark"] .chip.blue { background: #132a40; color: #7bc3ff; }
[data-theme="dark"] .chip.lilac { background: #2a2058; color: #c9b8ff; }
[data-theme="dark"] .chip.green { background: #123024; color: #7fe1ac; }
[data-theme="dark"] .chip.red { background: #3a1c1c; color: #ff9a9a; }

.chip-account { width: 100%; justify-content: space-between; padding: 8px 12px; font-weight: 600; }
.chip-account em { font-style: normal; font-size: 11px; color: var(--text-3); font-weight: 500; }

/* ---------- Status dot ---------- */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-dot.planned { background: var(--accent-blue); }
.status-dot.confirmed { background: var(--accent-lilac); }
.status-dot.completed { background: var(--success); }
.status-dot.cancelled { background: var(--danger); }

/* ---------- Inputs ---------- */
.field {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; color: var(--text-2); font-weight: 600;
}
.field > input, .field > select, .field > textarea,
.input, select.input, textarea.input {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  outline: none;
  transition: border-color var(--dur), box-shadow var(--dur), background var(--dur);
  font-weight: 500;
  font-size: 14px;
}
.field > input::placeholder, .input::placeholder, textarea.input::placeholder { color: var(--text-3); }
.field > input:focus, .field > select:focus, .field > textarea:focus,
.input:focus, select.input:focus, textarea.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(108, 99, 255, .15);
  background: var(--surface);
}
.clear-search-wrap {
  position: relative;
  display: block;
  width: 100%;
}
.clear-search-wrap .input {
  padding-right: 42px;
}
.search-clear-btn {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  border-radius: var(--r-full);
  color: var(--text-3);
  background: transparent;
  transition: background var(--dur), color var(--dur);
  z-index: 2;
}
.search-clear-btn:hover {
  background: var(--surface-3);
  color: var(--text);
}
.search-clear-btn.hidden { display: none; }
.search-clear-btn svg { pointer-events: none; }
.clear-search-wrap input[type="search"]::-webkit-search-cancel-button,
.search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}
textarea.input { min-height: 90px; resize: vertical; }

.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field-row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.show-school-meta-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.show-school-meta-grid .input[readonly] { color: var(--text-2); background: var(--surface-3); }

.school-picker { position: relative; }
.school-picker-results {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px);
  max-height: 260px; overflow-y: auto;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); padding: 6px;
}
.school-picker-option {
  width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 10px 12px; border-radius: var(--r-sm); text-align: left;
  color: var(--text); transition: background var(--dur), color var(--dur);
}
.school-picker-option strong { font-size: 13px; font-weight: 700; }
.school-picker-option span { font-size: 12px; color: var(--text-3); }
.school-picker-option:hover,
.school-picker-option.active { background: var(--primary-soft); color: var(--primary); }
.school-picker-empty { padding: 12px; color: var(--text-3); font-size: 13px; font-weight: 600; }

@media (max-width: 900px) { .show-school-meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .field-row, .field-row-3, .show-school-meta-grid { grid-template-columns: 1fr; } }

.switch {
  --sw-w: 44px; --sw-h: 26px;
  position: relative; display: inline-block; width: var(--sw-w); height: var(--sw-h);
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0;
  background: var(--border-strong);
  border-radius: var(--r-full);
  transition: background var(--dur);
  cursor: pointer;
}
.switch .slider::before {
  content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  background: #fff; border-radius: 50%; transition: transform var(--dur);
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.switch input:checked + .slider { background: var(--grad-primary); }
.switch input:checked + .slider::before { transform: translateX(18px); }

.check {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-2);
  padding: 6px 10px; border-radius: var(--r-sm); cursor: pointer; user-select: none;
  background: var(--surface-3);
}
.check input { accent-color: var(--primary); }

/* ---------- Table ---------- */
.table-wrap {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-xl); overflow: hidden;
}
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 16px; text-align: left; font-size: 13px; }
.table th { color: var(--text-3); font-weight: 600; background: var(--surface-2); border-bottom: 1px solid var(--border); text-transform: uppercase; font-size: 11px; letter-spacing: .06em; }
.table td { border-bottom: 1px solid var(--divider); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--surface-2); }
.table .actions { display: flex; gap: 4px; justify-content: flex-end; }
.table .actions .icon-btn { width: 32px; height: 32px; }

/* ---------- Avatar ---------- */
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--grad-primary);
  color: #fff;
  font-weight: 700; font-size: 13px;
  letter-spacing: .02em;
  flex-shrink: 0;
}
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 48px; height: 48px; font-size: 16px; }
.avatar.xl { width: 64px; height: 64px; font-size: 20px; }
.avatar.pink { background: linear-gradient(135deg, #FF89C0, #C43F92); }
.avatar.orange { background: linear-gradient(135deg, #FFB37A, #E58B3D); }
.avatar.teal { background: linear-gradient(135deg, #7AE0C9, #2FB99A); }
.avatar.blue { background: linear-gradient(135deg, #7BC3FF, #3A8BD9); }
.avatar.yellow { background: linear-gradient(135deg, #FFD76A, #D9A82A); color: #5c4200; }
.avatar.lilac { background: linear-gradient(135deg, #C9B8FF, #8B6DF0); }
.avatar.green { background: linear-gradient(135deg, #7FE1AC, #10B981); }
.avatar.red { background: linear-gradient(135deg, #FF9A9A, #EF4444); }

.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { border: 2px solid var(--card); margin-left: -10px; }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar-stack .more {
  width: 28px; height: 28px; border-radius: 50%; background: var(--surface-3); color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700;
  margin-left: -10px; border: 2px solid var(--card);
}

/* ---------- Kbd ---------- */
.kbd {
  display: inline-flex; align-items: center; padding: 2px 6px;
  font-size: 11px; font-family: inherit; font-weight: 600;
  background: var(--surface-3); color: var(--text-3);
  border: 1px solid var(--border); border-radius: 6px;
}

/* ---------- Modal ---------- */
.modal-scrim {
  position: fixed; inset: 0; background: rgba(15, 12, 36, .5);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  animation: fadeIn .2s var(--easing) both;
  padding: 16px;
}
.modal {
  width: 100%; max-width: 560px;
  background: var(--surface); border-radius: var(--r-2xl);
  box-shadow: var(--shadow-xl);
  max-height: 90vh; overflow: hidden;
  display: flex; flex-direction: column;
  animation: pop .25s var(--easing) both;
}
.modal.lg { max-width: 760px; }
.modal.xl { max-width: 960px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-title { font-weight: 700; font-size: 17px; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2); }

/* ---------- Toast ---------- */
.toast-root {
  position: fixed; right: 16px; bottom: 16px; z-index: 2000;
  display: flex; flex-direction: column; gap: 8px; max-width: 360px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--card); color: var(--text);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--r-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: flex-start; gap: 10px;
  animation: slideInRight .3s var(--easing) both;
}
.toast.success { border-left-color: var(--success); }
.toast.warn { border-left-color: var(--warning); }
.toast.err { border-left-color: var(--danger); }
.toast .t-title { font-weight: 700; font-size: 13px; }
.toast .t-msg { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* ---------- Drawer (show details) ---------- */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw);
  background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  transform: translateX(110%);
  transition: transform .35s var(--easing);
  z-index: 900;
  overflow-y: auto;
}
.drawer.open { transform: translateX(0); }
.drawer-scrim {
  position: fixed; inset: 0; background: rgba(15, 12, 36, .4);
  backdrop-filter: blur(3px);
  z-index: 880;
  animation: fadeIn .2s var(--easing) both;
}

/* ---------- View toggle (grid/list) ---------- */
.view-toggle {
  display: inline-flex; padding: 3px;
  background: var(--surface-3);
  border-radius: var(--r-md);
  gap: 2px;
}
.view-toggle .view-btn {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  color: var(--text-3);
  transition: all var(--dur);
}
.view-toggle .view-btn:hover { color: var(--primary); }
.view-toggle .view-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* ---------- Notifications panel ---------- */
.notif-panel {
  position: absolute; top: 58px; right: 14px;
  width: min(380px, calc(100vw - 28px));
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  z-index: 400;
  animation: pop .2s var(--easing) both;
  overflow: hidden;
}
.notif-head {
  padding: 14px 16px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--divider);
}
.notif-head strong { font-size: 14px; }
.notif-body { max-height: 70vh; overflow-y: auto; padding: 6px; }
.notif-section { padding: 10px 10px 4px; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.notif-item {
  display: flex; gap: 10px; padding: 10px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--dur);
}
.notif-item:hover { background: var(--surface-3); }
.notif-item .icon-wrap {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.notif-item .ttl { font-size: 13px; font-weight: 600; line-height: 1.35; }
.notif-item .sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.notif-empty { padding: 24px 16px; text-align: center; color: var(--text-3); font-size: 13px; }

/* ---------- Empty state ---------- */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 24px; text-align: center; color: var(--text-2);
}
.empty-state .illus {
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--primary-soft), var(--bg-3));
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.empty-state h3 { color: var(--text); margin-bottom: 4px; }

/* ---------- Tabs ---------- */
.tabs {
  display: inline-flex; gap: 4px;
  padding: 4px;
  background: var(--surface-3);
  border-radius: var(--r-full);
}
.tab {
  padding: 8px 14px;
  border-radius: var(--r-full);
  font-size: 13px; font-weight: 600; color: var(--text-2);
  transition: all var(--dur) var(--easing);
}
.tab.active { background: var(--grad-primary); color: #fff; box-shadow: 0 4px 12px rgba(108, 99, 255, .35); }
.tab:not(.active):hover { color: var(--primary); }

/* ---------- Progress ring ---------- */
.ring {
  width: 56px; height: 56px; position: relative;
}
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .bg { stroke: var(--border); }
.ring .fg { stroke: url(#ring-grad); stroke-linecap: round; transition: stroke-dashoffset .6s var(--easing); }
.ring .val {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; color: var(--text);
}

/* ---------- Progress bar ---------- */
.pbar {
  height: 8px; border-radius: var(--r-full); background: var(--surface-3);
  overflow: hidden; position: relative;
}
.pbar > span { display: block; height: 100%; background: var(--grad-primary); border-radius: var(--r-full); transition: width .6s var(--easing); }

/* ---------- Dropdown menu ---------- */
.menu {
  position: absolute; min-width: 180px; padding: 6px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); z-index: 500;
  animation: pop .18s var(--easing) both;
}
.menu button { display: flex; width: 100%; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--r-sm); font-size: 13px; font-weight: 600; color: var(--text-2); text-align: left; }
.menu button:hover { background: var(--surface-3); color: var(--primary); }
.menu .sep { height: 1px; background: var(--divider); margin: 4px 2px; }

/* ---------- Gallery ---------- */
.media-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.media-tile {
  position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-md);
  overflow: hidden; background: var(--surface-3); cursor: pointer;
  border: 1px solid var(--border);
}
.media-tile img, .media-tile video { width: 100%; height: 100%; object-fit: cover; }
.media-tile .tag {
  position: absolute; bottom: 6px; left: 6px;
  background: rgba(15, 12, 36, .6); color: #fff;
  font-size: 11px; padding: 2px 8px; border-radius: var(--r-full); font-weight: 600;
}
.media-tile .del {
  position: absolute; top: 6px; right: 6px;
  background: rgba(239, 68, 68, .9); color: #fff;
  width: 28px; height: 28px; border-radius: 50%;
  display: none; align-items: center; justify-content: center;
}
.media-tile:hover .del { display: inline-flex; }

/* ---------- Upload dropzone ---------- */
.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--r-lg);
  padding: 20px; text-align: center; color: var(--text-3);
  background: var(--surface-2); cursor: pointer; transition: all var(--dur);
}
.dropzone:hover, .dropzone.drag { border-color: var(--primary); background: var(--primary-softer); color: var(--primary); }

/* ---------- Calendar — custom skin matching reference ---------- */
.calendar-wrap {
  background: linear-gradient(135deg, #FFFBFB 0%, #FDF5F5 40%, #F9EFF5 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .calendar-wrap {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
}

.calendar-header {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.calendar-title {
  font-size: 26px; font-weight: 800; letter-spacing: -0.02em;
  color: var(--text); margin: 0;
}
.calendar-controls {
  display: flex; gap: 18px; align-items: center; flex-wrap: wrap;
}
.calendar-legend {
  display: flex; gap: 12px; font-size: 12px; color: var(--text-2); font-weight: 600;
  flex-wrap: wrap;
}
.calendar-legend .leg { display: inline-flex; align-items: center; gap: 6px; }
.calendar-legend i {
  width: 10px; height: 10px; border-radius: 3px; display: inline-block;
}
.calendar-nav { display: inline-flex; gap: 6px; align-items: center; }
.calendar-nav .icon-btn {
  width: 34px; height: 34px; border: 1px solid var(--border); background: var(--surface);
}
.calendar-nav .icon-btn:hover { border-color: var(--primary); }

/* FullCalendar overrides */
.fc {
  --fc-border-color: transparent;
  --fc-page-bg-color: transparent;
  --fc-neutral-bg-color: transparent;
  --fc-today-bg-color: transparent;
  color: var(--text);
}
.fc-theme-standard td, .fc-theme-standard th,
.fc-theme-standard .fc-scrollgrid { border-color: transparent !important; }
.fc .fc-scrollgrid { border: none !important; }

.fc .fc-col-header-cell { padding: 10px 4px; background: transparent; border: none !important; }
.fc .fc-col-header-cell-cushion {
  color: var(--text-3);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 8px;
}

.fc .fc-daygrid-day {
  background: var(--surface);
  border: 1px solid var(--border) !important;
  border-radius: var(--r-md);
  transition: transform var(--dur) var(--easing), box-shadow var(--dur), border-color var(--dur);
  min-height: 108px;
  overflow: hidden;
}
.fc .fc-daygrid-day-frame { padding: 0; }
.fc .fc-daygrid-day:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(108, 99, 255, .12);
  border-color: var(--primary) !important;
  cursor: pointer;
  z-index: 2; position: relative;
}

.fc .fc-daygrid-day.fc-day-other {
  background: transparent;
  border-color: transparent !important;
  opacity: .45;
}
.fc .fc-daygrid-day.fc-day-other:hover {
  transform: none; box-shadow: none; border-color: transparent !important;
  cursor: default;
}

.fc .fc-daygrid-day.fc-day-today {
  background: var(--primary-softer);
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 1px var(--primary) inset;
}

.fc .fc-daygrid-day-top {
  padding: 10px 12px 4px;
  display: flex; justify-content: space-between; align-items: center;
  flex-direction: row;
}
.fc .fc-daygrid-day-number {
  color: var(--text-3);
  font-weight: 700;
  font-size: 13px;
  padding: 0;
  text-decoration: none;
}
.fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-number {
  color: var(--primary);
  font-weight: 800;
  font-size: 15px;
}
.fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-top::after {
  content: 'Today';
  font-size: 10px; font-weight: 700;
  background: var(--primary); color: #fff;
  padding: 2px 8px; border-radius: var(--r-full);
  letter-spacing: .04em;
}

/* Make each day table cell have spacing */
.fc table, .fc tbody, .fc tr { border-collapse: separate !important; border-spacing: 4px !important; }

/* Event pills */
.fc-daygrid-event-harness { margin: 2px 6px 2px !important; }
.fc .fc-daygrid-event { padding: 0 !important; background: transparent !important; border: none !important; box-shadow: none !important; margin: 0 !important; }
.fc .fc-daygrid-day-events { padding: 0 0 6px !important; min-height: 0; }
.fc .fc-daygrid-event-dot { display: none !important; }

.cal-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  transition: all var(--dur) var(--easing);
  max-width: 100%;
  cursor: pointer;
  white-space: nowrap;
}
.cal-pill[data-status="completed"] { background: #E8F8F1; border-color: #CAE9DA; color: #0e7a4f; }
.cal-pill[data-status="cancelled"] { background: #FDEBEB; border-color: #F6CCCC; color: #b42626; }
[data-theme="dark"] .cal-pill[data-status="completed"] { background: rgba(16,185,129,.15); border-color: rgba(16,185,129,.3); color: #7fe1ac; }
[data-theme="dark"] .cal-pill[data-status="cancelled"] { background: rgba(239,68,68,.15); border-color: rgba(239,68,68,.3); color: #ff9a9a; }
.cal-pill:hover { border-color: var(--primary); transform: translateY(-1px); }
.cal-pill .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.cal-pill .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; max-width: 140px; }

/* "+ more" link */
.fc .fc-daygrid-more-link {
  color: var(--primary);
  font-size: 11px; font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--r-full);
  background: var(--primary-soft);
  margin-left: 8px;
}
.fc .fc-popover {
  background: var(--card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--r-lg) !important;
  box-shadow: var(--shadow-lg) !important;
}
.fc .fc-popover-header { background: transparent !important; padding: 10px 12px; border-bottom: 1px solid var(--divider); }

/* ---------- Auth view ---------- */
.auth-view {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; position: relative;
  background: radial-gradient(at 20% 10%, #EEECFF 0%, transparent 40%),
              radial-gradient(at 80% 90%, #FFE4F1 0%, transparent 40%),
              radial-gradient(at 80% 10%, #FFF1B8 0%, transparent 35%),
              radial-gradient(at 10% 90%, #D1F4EA 0%, transparent 40%),
              var(--bg);
}
[data-theme="dark"] .auth-view {
  background: radial-gradient(at 20% 10%, #2A2558 0%, transparent 40%),
              radial-gradient(at 80% 90%, #3a1f2e 0%, transparent 40%),
              radial-gradient(at 80% 10%, #332a10 0%, transparent 35%),
              radial-gradient(at 10% 90%, #123127 0%, transparent 40%),
              var(--bg);
}
.auth-bg-orbs .orb {
  position: absolute; border-radius: 50%; filter: blur(60px); opacity: .6; pointer-events: none;
}
.orb-1 { width: 280px; height: 280px; background: #C9B8FF; top: -80px; left: -60px; }
.orb-2 { width: 220px; height: 220px; background: #FFB37A; bottom: 10%; left: 15%; }
.orb-3 { width: 320px; height: 320px; background: #7AE0C9; top: 20%; right: -80px; }
.orb-4 { width: 260px; height: 260px; background: #FF89C0; bottom: -60px; right: 20%; }

.auth-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 460px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  padding: 32px;
  box-shadow: var(--shadow-xl);
  animation: pop .4s var(--easing) both;
}
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.auth-title { font-size: 24px; font-weight: 800; }
.auth-subtitle { font-size: 13px; color: var(--text-3); margin-top: 2px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-hint { font-size: 12px; color: var(--text-3); margin-top: 8px; }
.auth-accounts { display: grid; gap: 6px; }

.logo-mark svg { width: 48px; height: 48px; }
.logo-mark.sm svg { width: 36px; height: 36px; }
