/**
 * Custom CSS for IntermitTracker
 * Modern, clean design with grid texture background
 */

/* Profile tiles: clip header/body to rounded frame. Info popovers use position:fixed (info_hover.html). */
.profile-tile {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border-radius: 1rem; /* Tailwind rounded-2xl */
}

.profile-tile-header {
  box-sizing: border-box;
  max-width: 100%;
}

/* Nested blocks inside a profile tile (e.g. France Travail vs Mon entreprise). */
.profile-sub-tile {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  background-color: #fafafa;
  padding: 1rem 1.25rem;
}

.profile-sub-tile + .profile-sub-tile {
  margin-top: 1rem;
}

.profile-sub-tile-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
}

.profile-sub-tile--muted {
  opacity: 0.85;
}

.profile-sub-tile--disabled .profile-sub-tile-fields {
  pointer-events: none;
  opacity: 0.55;
}

/* Declaration preview modal: France Travail / URSSAF main sections. */
.declaration-section {
  box-sizing: border-box;
  width: 100%;
}

.declaration-section + .declaration-section {
  margin-top: 1.75rem;
  padding-top: 0.25rem;
}

.declaration-section-title {
  margin: 0 0 1rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: #111827;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e5e7eb;
}

.declaration-section-lead {
  margin: -0.5rem 0 1rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: #6b7280;
}

/* Stats declaration preview modal — scoped to avoid affecting profile tiles. */
#stats-preview-modal {
  --stats-preview-col-date-w: 7.25rem;
  --stats-preview-col-num-w: 6.75rem;
  --stats-preview-col-primary-w: calc(
    100% - (2 * var(--stats-preview-col-date-w)) - (3 * var(--stats-preview-col-num-w))
  );
}

#stats-preview-modal .stats-preview-modal__dialog {
  box-shadow: var(--it-shadow-sonic-card, 0 18px 45px rgba(15, 23, 42, 0.08));
}

#stats-preview-modal .stats-preview-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1.25rem;
  background: linear-gradient(
    135deg,
    var(--it-color-primary, #8e2de2) 0%,
    var(--it-color-primary-dark, #4a00e0) 100%
  );
  color: var(--it-color-white, #fff);
}

#stats-preview-modal .stats-preview-modal__title {
  margin: 0;
  font-family: var(--it-font-display, Montserrat), system-ui, sans-serif;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.25;
  color: inherit;
}

#stats-preview-modal .stats-preview-modal__close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 0.5rem;
  background: rgb(var(--it-color-white-rgb, 255 255 255) / 0.14);
  color: inherit;
  font-size: 1.375rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

#stats-preview-modal .stats-preview-modal__close:hover {
  background: rgb(var(--it-color-white-rgb, 255 255 255) / 0.24);
}

#stats-preview-modal .stats-preview-modal__close:focus-visible {
  outline: 2px solid var(--it-color-white, #fff);
  outline-offset: 2px;
}

#stats-preview-modal .stats-preview-modal__content {
  padding: 1.25rem 1.5rem 1.5rem;
  background-color: var(--it-color-accent50, #f5f3ff);
}

#stats-preview-modal .stats-preview-landscape-hint {
  border: 1px solid var(--it-color-accent200, #ddd6fe);
  border-radius: 0.75rem;
  background-color: var(--it-color-white, #fff);
  padding: 0.625rem 0.75rem;
  font-size: 0.75rem;
  color: var(--it-color-text, #1f2937);
}

#stats-preview-modal .stats-preview-landscape-hint svg {
  color: var(--it-color-primary, #8e2de2);
}

#stats-preview-modal .stats-preview-period {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--it-color-accent200, #ddd6fe);
  border-radius: var(--it-radius-input, 12px);
  background: linear-gradient(
    135deg,
    var(--it-color-white, #fff) 0%,
    var(--it-color-accent50, #f5f3ff) 100%
  );
  box-shadow: 0 1px 3px rgb(var(--it-color-primary-rgb, 142 45 226) / 0.08);
}

#stats-preview-modal .stats-preview-period__icon {
  flex-shrink: 0;
  font-size: 1.375rem;
  line-height: 1;
  color: var(--it-color-accent600, #7b22c7);
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

#stats-preview-modal .stats-preview-period__text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

#stats-preview-modal .stats-preview-period__label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--it-color-accent600, #7b22c7);
}

#stats-preview-modal .stats-preview-period__dates {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--it-color-text, #1f2937);
}

#stats-preview-modal .stats-preview-period__mode {
  font-size: 0.8125rem;
  color: var(--it-color-text-light, #6b7280);
}

#stats-preview-modal .stats-preview-section {
  overflow: hidden;
  border-radius: var(--it-radius-input, 12px);
  border: 1px solid rgb(var(--it-color-primary-rgb, 142 45 226) / 0.12);
  background-color: var(--it-color-white, #fff);
  box-shadow: 0 4px 14px rgb(var(--it-color-primary-dark-rgb, 74 0 224) / 0.06);
}

#stats-preview-modal .stats-preview-section + .stats-preview-section {
  margin-top: 1.25rem;
  padding-top: 0;
}

#stats-preview-modal .stats-preview-section__hero {
  padding: 0.625rem 1rem;
  background: linear-gradient(
    135deg,
    var(--it-color-primary, #8e2de2) 0%,
    var(--it-color-primary-dark, #4a00e0) 100%
  );
}

#stats-preview-modal .stats-preview-section__hero .declaration-section-title {
  margin: 0;
  padding: 0;
  border: none;
  font-family: var(--it-font-display, Montserrat), system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--it-color-white, #fff);
  text-align: center;
}

#stats-preview-modal .stats-preview-section__body {
  padding: 1rem 1rem 1.125rem;
}

#stats-preview-modal .stats-preview-section__body .declaration-section-lead {
  margin: 0 0 0.875rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  background-color: var(--it-color-accent50, #f5f3ff);
  border-left: 3px solid var(--it-color-primary, #8e2de2);
  font-size: 0.8125rem;
  color: var(--it-color-text, #1f2937);
}

#stats-preview-modal .stats-preview-sub-tile {
  border-color: var(--it-color-accent200, #ddd6fe);
  background: linear-gradient(
    180deg,
    var(--it-color-white, #fff) 0%,
    var(--it-color-accent50, #f5f3ff) 100%
  );
  box-shadow: inset 3px 0 0 var(--it-color-primary, #8e2de2);
}

#stats-preview-modal .stats-preview-sub-tile + .stats-preview-sub-tile {
  margin-top: 0.875rem;
}

#stats-preview-modal .stats-preview-sub-tile .profile-sub-tile-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.625rem;
  font-size: 0.9375rem;
  color: var(--it-color-ft-ring-worked, #6d28d9);
}

#stats-preview-modal .stats-preview-sub-tile .profile-sub-tile-title::before {
  content: '';
  flex-shrink: 0;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 9999px;
  background-color: var(--it-color-primary, #8e2de2);
}

#stats-preview-modal .stats-preview-sub-period {
  margin: -0.25rem 0 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--it-color-text-light, #6b7280);
}

#stats-preview-modal .stats-preview-sub-period__due {
  color: var(--it-color-accent600, #7b22c7);
}

#stats-preview-modal .stats-preview-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--it-color-border-subtle, #e5e7eb);
  border-radius: 0.625rem;
  background-color: var(--it-color-white, #fff);
}

#stats-preview-modal .stats-preview-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

#stats-preview-modal .stats-preview-table__col-primary {
  width: auto;
}

#stats-preview-modal .stats-preview-table--ft-aligned .stats-preview-table__col-primary {
  width: var(--stats-preview-col-primary-w);
}

#stats-preview-modal .stats-preview-table__col-date {
  width: var(--stats-preview-col-date-w);
}

#stats-preview-modal .stats-preview-table__col-num {
  width: var(--stats-preview-col-num-w);
}

#stats-preview-modal .stats-preview-table__col-spacer {
  width: var(--stats-preview-col-num-w);
}

#stats-preview-modal .stats-preview-table__cell-spacer {
  width: var(--stats-preview-col-num-w);
  padding: 0;
  border: none;
  font-size: 0;
  line-height: 0;
  overflow: hidden;
}

#stats-preview-modal .stats-preview-table__col-num-wide {
  width: 9.5rem;
}

#stats-preview-modal .stats-preview-table thead {
  background: linear-gradient(
    180deg,
    var(--it-color-accent100, #ede9fe) 0%,
    var(--it-color-accent50, #f5f3ff) 100%
  );
}

#stats-preview-modal .stats-preview-table th {
  padding: 0.625rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
  color: var(--it-color-accent600, #7b22c7);
  border-bottom: 1px solid var(--it-color-accent200, #ddd6fe);
}

#stats-preview-modal .stats-preview-table td {
  padding: 0.625rem 0.75rem;
  color: var(--it-color-text, #1f2937);
  border-top: 1px solid var(--it-color-border-subtle, #e5e7eb);
}

#stats-preview-modal .stats-preview-table tbody tr:nth-child(even) {
  background-color: rgb(var(--it-color-accent50-rgb, 245 243 255) / 0.55);
}

#stats-preview-modal .stats-preview-table tbody tr:hover {
  background-color: var(--it-color-accent50, #f5f3ff);
}

#stats-preview-modal .stats-preview-table__primary {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#stats-preview-modal .stats-preview-table__date {
  white-space: nowrap;
}

#stats-preview-modal .stats-preview-table th.stats-preview-table__num,
#stats-preview-modal .stats-preview-table td.stats-preview-table__num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#stats-preview-modal .stats-preview-table__amount {
  font-weight: 600;
  color: var(--it-color-ft-ring-worked, #6d28d9);
}

#stats-preview-modal .stats-preview-table tfoot {
  background-color: var(--it-color-accent100, #ede9fe);
  border-top: 2px solid var(--it-color-accent200, #ddd6fe);
  font-weight: 700;
  color: var(--it-color-text, #1f2937);
}

#stats-preview-modal .stats-preview-table__empty {
  padding: 1rem 0.75rem;
  text-align: center;
  color: var(--it-color-text-light, #6b7280);
}

#stats-preview-modal .stats-preview-table__hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--it-color-text-light, #6b7280);
  line-height: 1.35;
}

#stats-preview-modal .stats-preview-fields {
  display: grid;
  gap: 0.625rem;
  margin: 0;
}

@media (min-width: 640px) {
  #stats-preview-modal .stats-preview-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

#stats-preview-modal .stats-preview-field {
  margin: 0;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--it-color-border-subtle, #e5e7eb);
  border-radius: 0.5rem;
  background-color: var(--it-color-white, #fff);
}

#stats-preview-modal .stats-preview-field dt {
  margin: 0 0 0.25rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--it-color-text-light, #6b7280);
}

#stats-preview-modal .stats-preview-field dd {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--it-color-text, #1f2937);
}

#stats-preview-modal .stats-preview-field__hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--it-color-text-light, #6b7280);
}

#stats-preview-modal .stats-preview-field__amount {
  color: var(--it-color-ft-ring-worked, #6d28d9);
}

#stats-preview-modal .stats-preview-field__warning {
  color: #b45309;
}

#stats-preview-modal .stats-preview-empty-note {
  margin: 0;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background-color: var(--it-color-accent50, #f5f3ff);
  font-size: 0.875rem;
  color: var(--it-color-text-light, #6b7280);
}

#stats-preview-modal .stats-preview-disclaimer {
  margin: 0.625rem 0 0;
  padding: 0.5rem 0.625rem;
  border-radius: 0.375rem;
  background-color: var(--it-color-accent50, #f5f3ff);
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--it-color-text-light, #6b7280);
}

.it-info-popover-wrap {
  position: relative;
  z-index: 2;
}

.it-info-popover-wrap:is(:hover, :focus-within) {
  z-index: 60;
}

/* All events page: month tiles — collapsed ≈ 3 rows, expanded ≈ 12 rows + scroll */
.events-month-scroll--collapsed {
  max-height: 12.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  transition: max-height 0.2s ease-out;
}

.events-month-scroll--expanded {
  max-height: min(42rem, 70vh);
  overflow-x: auto;
  overflow-y: auto;
  transition: max-height 0.2s ease-out;
}

.events-month-scroll--expanded thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

/*
 * Brand shell fallbacks: `design-tokens.css` must load before this file.
 * Ensures sidebar / page canvas / dashboard hero stay correct if the Tailwind Play CDN
 * misses custom `theme.extend` utilities (cache, scan order, or transient 404 on token assets).
 */
body.min-h-screen.bg-it-canvas {
  background-color: var(--it-color-canvas, #d4d4d8);
}

aside.bg-it-sidebar {
  background-color: var(--it-color-sidebar, #111827) !important;
  color: #f3f4f6;
}

/* Material Symbols Rounded — loaded after Tailwind preflight (base.html order). */
.material-symbols-rounded {
  font-family: 'Material Symbols Rounded', sans-serif;
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Sidebar nav icons: Material Symbols Rounded, 22px (Flutter MainBottomNav / MainTopBar). */
aside.bg-it-sidebar .material-symbols-rounded.it-sidebar-nav-icon {
  font-size: 22px;
  line-height: 1;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  color: rgba(243, 244, 246, 0.45);
}

aside.bg-it-sidebar .it-sidebar-nav-icon--active {
  color: var(--it-color-primary, #8e2de2);
}

article.dashboard-hero.bg-gradient-to-r {
  background-color: transparent;
  background-image: linear-gradient(
    to right,
    var(--it-color-primary, #8e2de2),
    var(--it-color-primary-dark, #4a00e0)
  ) !important;
}

/* Texture optionnelle très discrète (gris) */
.bg-grid-texture {
  background-color: transparent;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 24px 24px;
  position: relative;
}

.bg-grid-texture::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 2px 2px, rgba(255, 255, 255, 0.22) 1px, transparent 0);
  background-size: 48px 48px;
  pointer-events: none;
}

/* Cartes principales plus foncées que le fond (nuances de gris) */
.sonic-card {
  border-radius: var(--it-radius-card);
  background-color: #ffffff; /* blanc pur */
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(17, 24, 39, 0.06); /* léger contour gris */
  overflow: hidden; /* clip inner fills to radius (stats cards; tooltips use fixed) */
}

.gradient-hero {
  background: linear-gradient(135deg, var(--it-color-primary) 0%, var(--it-color-primary-dark) 100%);
  color: var(--it-color-white);
  border-radius: var(--it-radius-card);
  box-shadow: var(--it-shadow-hero);
}

.gradient-hero h1,
.gradient-hero h2,
.gradient-hero h3,
.gradient-hero p {
  color: #ffffff;
}

/* Transitions on interactive / chrome elements only (avoid global * which feels sluggish). */
a,
button,
input,
select,
textarea,
.card-hover,
.btn-primary,
.btn-primary-teal,
.logo-icon {
  transition-property: color, background-color, border-color, transform, box-shadow;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 200ms;
}

/* Card hover effects */
.card-hover {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Logo animation */
.logo-icon {
  transition: transform 0.3s ease;
}

.logo-icon:hover {
  transform: scale(1.05);
}

/* Button styles - accent (purple) aligned with sidebar/branding */
.btn-primary {
  background: linear-gradient(135deg, var(--it-color-primary) 0%, var(--it-color-primary-dark) 100%);
  box-shadow: 0 4px 6px -1px rgba(142, 45, 226, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--it-color-accent600) 0%, var(--it-color-primary-dark-hover) 100%);
  box-shadow: 0 6px 8px -1px rgba(142, 45, 226, 0.4);
  transform: translateY(-1px);
}

/* Legacy teal primary (if needed elsewhere) */
.btn-primary-teal {
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
  box-shadow: 0 4px 6px -1px rgba(20, 184, 166, 0.3);
}

.btn-primary-teal:hover {
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  box-shadow: 0 6px 8px -1px rgba(20, 184, 166, 0.4);
  transform: translateY(-1px);
}

/* Glass morphism effect for cards */
.glass-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
  /* Avoid page-wide horizontal scroll when main uses overflow-visible for popovers */
  overflow-x: clip;
}

/* Focus styles - accent aligned with brand */
input:focus,
textarea:focus,
select:focus,
button:focus {
  outline: none;
  ring-width: 2px;
  ring-color: var(--it-color-primary);
}

/* Custom Calendar Styles — week grid: 24 h × 50 px; dashboard caps the scroll viewport to ~8h–20h */
.calendar-week-view {
  --cal-slot-height: 50px;
  --cal-hours-count: 24;
  display: flex;
  flex-direction: column;
  height: 600px;
  overflow: hidden;
}

/*
 * Dashboard: week view uses a fixed-height scroll viewport (08h–20h); month view still
 * fills the agenda card next to the stats column.
 */
.dashboard-page .dashboard-layout-grid {
  min-height: 0;
}

/* Override generic .calendar-week-view height:600px — fill agenda card next to stats tiles */
.dashboard-page #custom-calendar > .calendar-week-view {
  /* Must match dashboard.html scroll anchor (DAY_START_HOUR / DAY_END_HOUR). */
  --cal-default-view-start-hour: 8;
  --cal-default-view-end-hour: 20;
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: none;
}

.dashboard-page .calendar-week-body {
  flex: 1 1 auto;
  min-height: 0;
  /* Viewport ≈ 08h00–20h00; full 0h–24h remains inside this scroll area */
  max-height: calc(
    (var(--cal-default-view-end-hour) - var(--cal-default-view-start-hour)) *
      var(--cal-slot-height, 50px)
  );
}

/* Vue semaine : ne pas étirer la carte sur toute la hauteur de la colonne stats */
.dashboard-page article.card-hover:has(#calendar-week-view:not(.hidden)) {
  flex: 0 1 auto;
}

.dashboard-page article.card-hover:has(#calendar-week-view:not(.hidden)) > #custom-calendar {
  flex: 0 1 auto;
}

.dashboard-page #custom-calendar:has(#calendar-week-view:not(.hidden)) > .calendar-week-view {
  flex: 0 1 auto;
}

.dashboard-page #custom-calendar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* Agenda card: calendar fills remaining column height below the toolbar */
.dashboard-page article.card-hover > #custom-calendar {
  flex: 1 1 auto;
  min-height: 0;
}

/* Override generic .calendar-month-view min-height:500px — fill agenda card */
.dashboard-page #custom-calendar > .calendar-month-view {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

/*
 * Tailwind ``hidden`` must beat ``#custom-calendar > .calendar-month-view`` (display:flex).
 */
.dashboard-page #custom-calendar > .calendar-month-view.hidden,
.dashboard-page #custom-calendar > .calendar-week-view.hidden {
  display: none !important;
}

/* Dashboard calendar widget: lighter chrome inspired by Google Calendar (light theme). */
.dashboard-page #custom-calendar {
  border-color: #dadce0;
  background: #fff;
}

.dashboard-page .calendar-week-header,
.dashboard-page .calendar-month-header {
  background-color: #fff;
  border-bottom-color: #dadce0;
}

.dashboard-page .calendar-day-header {
  border-right-color: #dadce0;
  background-color: #fff;
}

.dashboard-page .calendar-day-header .day-name {
  color: #70757a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
  font-weight: 600;
}

.dashboard-page .calendar-day-header .day-number {
  color: #3c4043;
  font-size: 22px;
  font-weight: 400;
}

.dashboard-page .calendar-day-header.today {
  background-color: #e8f0fe;
}

.dashboard-page .calendar-day-header.today .day-name,
.dashboard-page .calendar-day-header.today .day-number {
  color: #1967d2;
}

.dashboard-page .calendar-time-column {
  border-right-color: #dadce0;
  background-color: #fff;
}

.dashboard-page .calendar-time-slot {
  border-top-color: #e8eaed;
  color: #70757a;
  font-size: 11px;
}

.dashboard-page .calendar-day-column {
  border-right-color: #dadce0;
}

.dashboard-page .calendar-day-slot {
  border-top-color: #e8eaed;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 11.5px,
    rgba(60, 64, 67, 0.06) 11.5px,
    rgba(60, 64, 67, 0.06) 12.5px
  );
}

.dashboard-page .calendar-month-day {
  border-right-color: #dadce0;
  border-bottom-color: #dadce0;
  overflow: visible;
  min-height: 0;
}

/* Month grid: row height follows the tallest day so every event row can be shown (no clipping). */
.dashboard-page #custom-calendar .calendar-month-grid {
  grid-auto-rows: minmax(100px, auto);
}

.dashboard-page #custom-calendar .calendar-month-events {
  overflow: visible;
}

.dashboard-page .calendar-month-day.other-month {
  background-color: #f8f9fa;
}

.dashboard-page .calendar-month-day.today {
  background-color: #e8f0fe;
}

.dashboard-page .calendar-month-day.today .calendar-month-day-number {
  color: #1967d2;
}

.dashboard-page .calendar-weekday {
  border-right-color: #dadce0;
  color: #70757a;
}

.dashboard-page .calendar-month-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.calendar-week-header {
  display: flex;
  border-bottom: 2px solid #e5e7eb;
  background-color: #f9fafb;
  position: relative;
  /* Account for scrollbar width to keep alignment */
  /* padding-right will be set dynamically by JavaScript to match scrollbar width */
  box-sizing: border-box;
}

.calendar-time-column {
  width: 60px;
  flex-shrink: 0;
  border-right: 1px solid #e5e7eb;
}

.calendar-days-container {
  flex: 1;
  display: flex;
  min-width: 0; /* Prevent flex overflow */
}

.calendar-day-header {
  flex: 1;
  padding: 12px 8px;
  text-align: center;
  border-right: 1px solid #e5e7eb;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}

.calendar-day-header.today {
  background-color: var(--it-color-accent100);
  color: var(--it-color-ft-ring-worked);
}

.calendar-day-header .day-name {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 4px;
}

.calendar-day-header .day-number {
  display: block;
  font-size: 16px;
  font-weight: 700;
}

.calendar-week-body {
  display: flex;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

/* Fix alignment: ensure header and body have same width calculation */
.calendar-week-view {
  display: flex;
  flex-direction: column;
  position: relative;
}

.calendar-week-header .calendar-days-container,
.calendar-week-body .calendar-days-container {
  width: 100%;
  box-sizing: border-box;
}

.calendar-time-slots {
  width: 60px;
  padding: 0 8px;
}

.calendar-time-slot {
  height: var(--cal-slot-height, 50px);
  min-height: var(--cal-slot-height, 50px);
  border-top: 1px solid #d1d5db;
  font-size: 11px;
  color: #6b7280;
  padding-top: 4px;
  text-align: right;
  box-sizing: border-box;
  margin: 0;
}

.calendar-day-columns {
  flex: 1;
  display: flex;
  position: relative;
}

.calendar-day-column {
  flex: 1;
  border-right: 1px solid #e5e7eb;
  position: relative;
  /* Full day height must match 24 × slot (scroll container clips; events use absolute Y) */
  min-height: calc(var(--cal-hours-count, 24) * var(--cal-slot-height, 50px));
  height: auto;
  overflow: visible;
  box-sizing: border-box;
}

.calendar-day-slot {
  height: var(--cal-slot-height, 50px);
  min-height: var(--cal-slot-height, 50px);
  max-height: var(--cal-slot-height, 50px);
  border-top: 1px solid #d1d5db;
  /* Quarter-hour guides (50px hour row → 12.5px step; matches SLOT_HEIGHT_PX in dashboard) */
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 11.5px,
    rgba(209, 213, 219, 0.55) 11.5px,
    rgba(209, 213, 219, 0.55) 12.5px
  );
  position: relative;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Busy layers under Google events (dashboard week view — pro / hold / overlay freebusy). */
.calendar-day-layer {
  position: absolute;
  left: 2px;
  right: 2px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 2;
  opacity: 0.38;
  box-sizing: border-box;
  overflow: hidden;
}

.calendar-day-layer--pro {
  background: #7c3aed;
}

.calendar-day-layer--hold {
  background: #059669;
}

.calendar-day-layer--other {
  background: #9ca3af;
}

/* Google overlay colors: rgba is set inline; avoid double-fading with base layer opacity. */
.calendar-day-layer.calendar-day-layer--other-api {
  opacity: 1;
}

.calendar-day-layer-label {
  position: absolute;
  left: 4px;
  right: 4px;
  top: 2px;
  z-index: 1;
  max-width: calc(100% - 8px);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  color: #111827;
  text-shadow: 0 0 4px #fff, 0 0 8px #fff, 0 1px 0 #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.calendar-event {
  position: absolute;
  left: 2px;
  right: 2px;
  background: linear-gradient(135deg, var(--it-color-primary) 0%, var(--it-color-primary-dark) 100%);
  color: white;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  overflow: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  z-index: 10;
  transition: all 0.2s ease;
  max-width: calc(100% - 4px);
  box-sizing: border-box;
  user-select: none;
}

.calendar-event:hover {
  z-index: 20;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.calendar-event.dragging {
  opacity: 0.9;
  cursor: grabbing;
  z-index: 40;
}

.calendar-event.resizing {
  opacity: 0.95;
  z-index: 40;
}

.calendar-event-resize-handle {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 45;
}

.calendar-event-resize-handle--top {
  top: 0;
  height: 8px;
  cursor: ns-resize;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0));
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
}

.calendar-event-resize-handle--bottom {
  bottom: 0;
  height: 8px;
  cursor: ns-resize;
  background: linear-gradient(to top, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0));
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
}

.calendar-event-time {
  font-size: 9px;
  opacity: 0.9;
  margin-bottom: 2px;
  line-height: 1.1;
}

.calendar-event-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
  line-height: 1.2;
  width: 100%;
  box-sizing: border-box;
  padding-top: 6px;
  padding-bottom: 8px;
}

/* Employer public week: same week grid as dashboard; blocks are read-only (no drag). */
.calendar-event--employer-busy {
  cursor: default;
  pointer-events: none;
  z-index: 5;
}

.calendar-event--employer-interactive,
.employer-calendar-interactive {
  pointer-events: auto;
  cursor: pointer;
}

.employer-event--slot_request {
  background: #d97706 !important;
  border-color: #b45309 !important;
}

.employer-slot-request--pending {
  opacity: 0.5;
}

.calendar-event--employer-busy:hover {
  transform: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Access-level coloring for employer week view events */
.employer-event--own {
  background: #059669 !important;
  border-color: #047857 !important;
  pointer-events: auto;
}

.employer-event--same_company {
  background: #3b82f6 !important;
  border-color: #2563eb !important;
}

.employer-event--foreign {
  background: #7c3aed !important;
  border-color: #6d28d9 !important;
}

.employer-event--foreign-option {
  background: #8B4513 !important;
  border-color: #723710 !important;
}

.calendar-event-content--employer-compact {
  padding-top: 2px;
  padding-bottom: 2px;
  gap: 0;
}

.calendar-event-employer {
  font-weight: 600;
  font-size: 10px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  line-height: 1.2;
  max-width: 100%;
}

.calendar-event-title {
  font-weight: 500;
  font-size: 9px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  opacity: 0.95;
  line-height: 1.2;
  max-width: 100%;
}

.calendar-event-location {
  font-weight: 400;
  font-size: 8px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  opacity: 0.85;
  line-height: 1.2;
  max-width: 100%;
}

/* Month View */
.calendar-month-view {
  min-height: 500px;
}

.calendar-month-header {
  border-bottom: 2px solid #e5e7eb;
  background-color: #f9fafb;
}

.calendar-weekday-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid #e5e7eb;
}

.calendar-weekday {
  padding: 12px 8px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: #6b7280;
  border-right: 1px solid #e5e7eb;
}

.calendar-weekday:last-child {
  border-right: none;
}

.calendar-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 100px;
}

.calendar-month-day {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border-right: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  padding: 4px;
  min-height: 100px;
  position: relative;
  background-color: white;
  overflow: hidden;
}

.calendar-month-day.other-month {
  background-color: #f9fafb;
  color: #9ca3af;
}

.calendar-month-day.today {
  background-color: #fef3c7;
}

.calendar-month-day-number {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 2px;
}

.calendar-month-day.today .calendar-month-day-number {
  color: var(--it-color-ft-ring-worked);
  font-weight: 700;
}

.calendar-month-day.other-month .calendar-month-day-number {
  color: #9ca3af;
}

.calendar-month-events {
  position: relative;
  flex: 1 1 auto;
  min-height: 2.5rem;
  width: 100%;
  overflow: hidden;
}

.calendar-month-event {
  font-size: 10px;
  cursor: pointer;
  overflow: hidden;
  box-sizing: border-box;
  max-width: 100%;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  width: auto;
}

/* Pill chrome only — month agenda rows use ``--gcal-list`` (dot + title, no band) */
.calendar-month-event:not(.calendar-month-event--gcal-list) {
  background: linear-gradient(
    145deg,
    var(--it-color-accent50) 0%,
    var(--it-color-accent100) 55%,
    var(--it-color-accent200) 100%
  );
  color: var(--it-color-text);
  border: 1px solid rgb(var(--it-color-primary-rgb) / 0.2);
  border-radius: 4px;
  padding: 2px 5px 2px 4px;
}

.calendar-month-event-summary {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  min-width: 0;
  height: 100%;
}

.calendar-month-event-dot {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  margin-top: 4px;
  border-radius: 9999px;
  background-color: var(--it-color-primary-dark);
  box-shadow: 0 0 0 1px rgb(var(--it-color-white-rgb) / 0.85);
}

.calendar-month-event-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  line-height: 1.15;
}

.calendar-month-event-times {
  font-size: 10px;
  font-weight: 600;
  color: var(--it-color-primary-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-month-event-employer {
  font-size: 9px;
  font-weight: 600;
  color: var(--it-color-accent600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Plain text chips (e.g. employer availability month view) */
.calendar-month-event--plain {
  display: flex;
  align-items: center;
  gap: 6px;
}

.calendar-month-event-plain-text {
  flex: 1;
  min-width: 0;
  font-size: 9px;
  font-weight: 600;
  color: var(--it-color-primary-dark);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-month-event--plain .calendar-month-event-dot {
  margin-top: 0;
}

/* Pro availability owner view: layered chips (pro / hold / other calendars) */
.calendar-month-event--layer-pro {
  background: linear-gradient(145deg, #ede9fe 0%, #ddd6fe 55%, #c4b5fd 100%);
  border-color: rgba(91, 33, 182, 0.35);
  z-index: 3;
}
.calendar-month-event--layer-pro .calendar-month-event-dot {
  background-color: #5b21b2;
}
.calendar-month-event--layer-hold {
  background: linear-gradient(145deg, #d1fae5 0%, #a7f3d0 55%, #6ee7b7 100%);
  border-color: rgba(5, 122, 85, 0.35);
  z-index: 2;
}
.calendar-month-event--layer-hold .calendar-month-event-dot {
  background-color: #047857;
}
.calendar-month-event--layer-other {
  opacity: 0.55;
  background: linear-gradient(145deg, #f3f4f6 0%, #e5e7eb 60%, #d1d5db 100%);
  border-color: #9ca3af;
  z-index: 1;
}
.calendar-month-event--layer-other .calendar-month-event-dot {
  background-color: #6b7280;
}

/* Legacy class names kept for any cached HTML; map to new layout */
.calendar-month-event-time {
  font-size: 10px;
  font-weight: 600;
  color: var(--it-color-primary-dark);
}

.calendar-month-event-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--it-color-accent600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-month-event.resizing,
.calendar-month-event.dragging {
  opacity: 0.95;
  z-index: 40;
  cursor: ns-resize;
}

.calendar-month-event:not(.calendar-month-event--gcal-list):hover {
  background: linear-gradient(
    145deg,
    var(--it-color-accent100) 0%,
    var(--it-color-accent200) 50%,
    rgb(var(--it-color-accent200-rgb) / 0.92) 100%
  );
  border-color: rgb(var(--it-color-primary-rgb) / 0.35);
  box-shadow: 0 2px 10px rgb(var(--it-color-primary-dark-rgb) / 0.12);
}

.calendar-month-event--overflow {
  background: #6b7280 !important;
  color: var(--it-color-white) !important;
  border-color: #4b5563 !important;
}

.calendar-month-event--overflow:hover {
  background: #575e6a !important;
  border-color: #374151 !important;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}

/* Responsive */
@media (max-width: 768px) {
  .calendar-week-view {
    height: 400px;
  }
  
  .calendar-time-column {
    width: 45px;
  }
  
  .calendar-time-slot {
    height: 50px;
    font-size: 9px;
    padding-top: 2px;
  }
  
  .calendar-day-slot {
    height: 50px;
  }
  
  .calendar-event {
    font-size: 9px;
    padding: 3px 5px;
  }
  
  .calendar-event-time {
    font-size: 8px;
  }
  
  .calendar-event-employer {
    font-size: 9px;
  }
  
  .calendar-event-title {
    font-size: 8px;
  }
  
  .calendar-event-location {
    font-size: 7px;
  }
  
  .calendar-day-header {
    padding: 8px 4px;
    font-size: 11px;
  }
  
  .calendar-day-header .day-name {
    font-size: 9px;
  }
  
  .calendar-day-header .day-number {
    font-size: 14px;
  }
  
  .calendar-month-day {
    min-height: 70px;
    padding: 4px;
  }
  
  .calendar-month-day-number {
    font-size: 11px;
  }
  
  .calendar-month-event:not(.calendar-month-event--gcal-list) {
    font-size: 9px;
    padding: 2px 4px;
  }

  .calendar-month-event-times {
    font-size: 9px;
  }

  .calendar-month-event-employer {
    font-size: 8px;
  }

  .calendar-month-event--gcal-list .calendar-month-event-gcal-title {
    font-size: 10px;
  }

  .calendar-month-event--gcal-list[class*="employer-event--"] .calendar-month-event-gcal-title {
    font-size: 12px;
    padding: 1px 6px;
  }

  .calendar-month-event--gcal-list .calendar-month-event-gcal-dot {
    width: 5px;
    height: 5px;
  }

  .dashboard-page #custom-calendar .calendar-event--gcal-week .calendar-event-time {
    font-size: 9px;
  }
  
  .dashboard-page .calendar-toolbar-today-btn {
    font-size: 0.75rem;
    padding: 0.3125rem 0.5rem;
  }

  .dashboard-page .calendar-view-segment {
    min-width: 2.75rem;
    padding: 0.3125rem 0.5625rem;
    font-size: 0.625rem;
  }

  .dashboard-page .calendar-view-segment-check {
    width: 0.75rem;
    height: 0.75rem;
  }
}

/* Dashboard calendar toolbar — Material 3 parity with Flutter SegmentedButton */
.dashboard-page .calendar-toolbar {
  min-height: 2.25rem;
}

.dashboard-page .calendar-toolbar-nav {
  gap: 0.125rem;
}

.dashboard-page .calendar-toolbar-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 9999px;
  background: transparent;
  color: var(--it-color-text-light, #6b7280);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.dashboard-page .calendar-toolbar-nav-btn:hover {
  background-color: var(--it-color-accent50, #f5f3ff);
  color: var(--it-color-accent600, #7b22c7);
}

.dashboard-page .calendar-toolbar-nav-icon {
  width: 1.125rem;
  height: 1.125rem;
}

.dashboard-page .calendar-toolbar-today-btn {
  border: none;
  background: transparent;
  padding: 0.375rem 0.625rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--it-color-accent600, #7b22c7);
  border-radius: 9999px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.dashboard-page .calendar-toolbar-today-btn:hover {
  background-color: var(--it-color-accent50, #f5f3ff);
  color: var(--it-color-primary, #8e2de2);
}

.dashboard-page .calendar-view-segmented {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 0.25rem;
  padding: 0.1875rem;
  border: 1px solid var(--it-color-border-muted, #d1d5db);
  border-radius: 9999px;
  background-color: #fff;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05);
}

.dashboard-page .calendar-view-segment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-width: 3.25rem;
  padding: 0.375rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 9999px;
  background: transparent;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--it-color-text-light, #6b7280);
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.dashboard-page .calendar-view-segment-label {
  white-space: nowrap;
}

.dashboard-page .calendar-view-segment-check {
  display: none;
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
}

.dashboard-page .calendar-view-segment:not(.is-active):hover {
  background-color: var(--it-color-accent50, #f5f3ff);
  color: var(--it-color-text, #1f2937);
}

.dashboard-page .calendar-view-segment.is-active {
  background-color: var(--it-color-accent50, #f5f3ff);
  border-color: var(--it-color-accent200, #ddd6fe);
  color: var(--it-color-accent600, #7b22c7);
  box-shadow: 0 1px 2px rgba(123, 34, 199, 0.12);
}

.dashboard-page .calendar-view-segment.is-active .calendar-view-segment-check {
  display: block;
}

.dashboard-page .calendar-view-segment:focus-visible {
  outline: 2px solid var(--it-color-primary, #8e2de2);
  outline-offset: 1px;
}

/* Dashboard: calmer calendar chrome inside white card */
.dashboard-page .calendar-week-header {
  background-color: #fafafa;
  border-bottom-color: #e5e7eb;
}

/* Dashboard: slightly tighter week-day headers than default calendar (still readable) */
.dashboard-page .calendar-week-header .calendar-day-header {
  padding: 6px 5px;
}

.dashboard-page .calendar-day-header .day-name {
  margin-bottom: 2px;
  font-size: 10px;
}

.dashboard-page .calendar-day-header .day-number {
  font-size: 13px;
  line-height: 1.15;
}

.dashboard-page #custom-calendar {
  background-color: #fff;
}

/* Month view (Google list): dot + title — global so it does not inherit pill gradient */
.calendar-month-event--gcal-list {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  border-radius: 2px;
  padding: 0 2px 0 0;
  background: transparent !important;
  background-image: none !important;
  border: none !important;
  box-shadow: none !important;
  font-weight: 500;
  line-height: 1.15;
  color: #3c4043;
}

.calendar-month-event--gcal-list:hover {
  background-color: #f1f3f4 !important;
  box-shadow: none !important;
  border: none !important;
}

.calendar-month-event--gcal-list .calendar-month-event-gcal {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.calendar-month-event--gcal-list .calendar-month-event-gcal-dot {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background-color: #9aa0a6;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.9);
}

.calendar-month-event--gcal-list .calendar-month-event-gcal-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  color: #3c4043;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Employer month view: larger title + access-colored pill (legend parity) */
.calendar-month-event--gcal-list[class*="employer-event--"] {
  align-items: flex-start;
}

.calendar-month-event--gcal-list[class*="employer-event--"]:hover {
  background-color: transparent !important;
}

.calendar-month-event--gcal-list[class*="employer-event--"] .calendar-month-event-gcal {
  align-items: center;
  gap: 0;
}

.calendar-month-event--gcal-list[class*="employer-event--"] .calendar-month-event-gcal-dot {
  display: none;
}

.calendar-month-event--gcal-list[class*="employer-event--"] .calendar-month-event-gcal-title {
  display: inline-block;
  flex: 1 1 auto;
  max-width: 100%;
  padding: 2px 7px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.35);
}

.calendar-month-event--gcal-list.employer-event--own .calendar-month-event-gcal-title {
  background-color: #059669;
}

.calendar-month-event--gcal-list.employer-event--same_company .calendar-month-event-gcal-title {
  background-color: #3b82f6;
}

.calendar-month-event--gcal-list.employer-event--foreign .calendar-month-event-gcal-title {
  background-color: #7c3aed;
}

.calendar-month-event--gcal-list.employer-event--foreign-option .calendar-month-event-gcal-title {
  background-color: #8b4513;
}

.calendar-month-event--gcal-list.employer-event--slot_request .calendar-month-event-gcal-title {
  background-color: #d97706;
}

/* Week grid: flatter blocks closer to Google Calendar time grid */
.dashboard-page #custom-calendar .calendar-event--gcal-week {
  border-radius: 2px;
  border: 1px solid rgba(32, 33, 36, 0.12);
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.22);
  padding: 2px 5px 3px 6px;
}

.dashboard-page #custom-calendar .calendar-event--gcal-week:hover {
  transform: none;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.32);
  z-index: 25;
}

.dashboard-page #custom-calendar .calendar-event--gcal-week .calendar-event-content {
  padding-top: 4px;
  padding-bottom: 6px;
  gap: 2px;
}

.dashboard-page #custom-calendar .calendar-event--gcal-week .calendar-event-time {
  margin-bottom: 0;
  font-size: 10px;
  font-weight: 600;
  opacity: 1;
}

.dashboard-page #custom-calendar .calendar-event--gcal-week .calendar-event-resize-handle--top {
  border-top-left-radius: 2px;
  border-top-right-radius: 2px;
}

.dashboard-page #custom-calendar .calendar-event--gcal-week .calendar-event-resize-handle--bottom {
  border-bottom-left-radius: 2px;
  border-bottom-right-radius: 2px;
}

/* Profile page - readonly fields */
.tile-field[readonly] {
  background-color: #f3f4f6 !important;
  cursor: not-allowed;
}

.tile-field.tile-readonly {
  pointer-events: none;
  opacity: 0.6;
  cursor: not-allowed;
}

/* Event form — clickable history combobox (modal + full page) */
.it-combobox {
  position: relative;
}

.it-combobox-field {
  display: flex;
  align-items: stretch;
  gap: 0.25rem;
}

.it-combobox-input {
  flex: 1 1 auto;
  min-width: 0;
}

.it-combobox-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  background: #fff;
  color: #4b5563;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.it-combobox-toggle:hover,
.it-combobox-toggle:focus {
  border-color: var(--it-color-accent-500, #14b8a6);
  color: var(--it-color-accent-700, #0f766e);
  outline: none;
}

.it-combobox-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 0.25rem);
  z-index: 80;
  max-height: 12rem;
  overflow-y: auto;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  background: #fff;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
}

.it-combobox-option {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: #1f2937;
  cursor: pointer;
}

.it-combobox-option:hover,
.it-combobox-option:focus {
  background: #f0fdfa;
  color: #0f766e;
}

/* Event form — recurrence multi-date mini-calendar (brand violet selection) */
.it-recurrence-cal .day-cell {
  color: var(--it-color-text, #1f2937);
  background-color: var(--it-color-white, #fff);
  font-weight: 500;
}

.it-recurrence-cal .day-cell:hover {
  background-color: var(--it-color-accent50, #f5f3ff);
}

.it-recurrence-cal button.day-cell--selected {
  background-color: var(--it-color-primary, #8e2de2) !important;
  color: var(--it-color-white, #fff) !important;
  font-weight: 600;
  box-shadow: 0 1px 2px rgb(74 0 224 / 0.25);
}

.it-recurrence-cal button.day-cell--selected:hover {
  background-color: var(--it-color-accent600, #7b22c7) !important;
}

.it-recurrence-cal .day-cell:focus-visible {
  outline: 2px solid var(--it-color-primary, #8e2de2);
  outline-offset: 2px;
}

.it-recurrence-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  line-height: 1.25;
  background-color: var(--it-color-accent100, #ede9fe);
  color: var(--it-color-primary-dark, #4a00e0);
}

.it-recurrence-chip-remove {
  border: none;
  background: transparent;
  padding: 0;
  line-height: 1;
  cursor: pointer;
  color: var(--it-color-accent600, #7b22c7);
}

.it-recurrence-chip-remove:hover {
  color: var(--it-color-primary-dark, #4a00e0);
}

.it-recurrence-chip-remove:focus-visible {
  outline: 2px solid var(--it-color-primary, #8e2de2);
  outline-offset: 1px;
  border-radius: 2px;
}
