/* CSS Variables */
:root {
  --background: hsl(230, 25%, 97%);
  --foreground: hsl(230, 25%, 14%);
  --card: hsl(0, 0%, 100%);
  --card-foreground: hsl(230, 25%, 14%);
  --popover: hsl(0, 0%, 100%);
  --popover-foreground: hsl(230, 25%, 14%);
  --primary: hsl(258, 58%, 52%);
  --primary-foreground: hsl(0, 0%, 100%);
  --secondary: hsl(230, 18%, 94%);
  --secondary-foreground: hsl(230, 25%, 14%);
  --muted: hsl(230, 15%, 94%);
  --muted-foreground: hsl(230, 12%, 50%);
  --accent: hsl(258, 40%, 94%);
  --accent-foreground: hsl(258, 58%, 40%);
  --destructive: hsl(0, 68%, 55%);
  --destructive-foreground: hsl(0, 0%, 100%);
  --border: hsl(230, 16%, 89%);
  --input: hsl(230, 16%, 89%);
  --ring: hsl(258, 58%, 52%);
  --radius: 0.625rem;

  /* Scheduler tokens */
  --scheduler-header-bg: hsl(235, 30%, 18%);
  --scheduler-header-fg: hsl(230, 20%, 96%);
  --scheduler-grid-line: hsl(230, 16%, 92%);
  --scheduler-grid-line-strong: hsl(230, 14%, 84%);
  --scheduler-slot-hover: hsl(258, 40%, 96%);
  --scheduler-unavailable: hsl(230, 10%, 88%);
  --scheduler-today: hsl(258, 50%, 96%);

  /* Event palette */
  --event-coral: hsl(4, 78%, 63%);
  --event-sky: hsl(199, 80%, 52%);
  --event-amber: hsl(38, 92%, 55%);
  --event-violet: hsl(258, 58%, 58%);
  --event-emerald: hsl(162, 63%, 41%);
  --event-rose: hsl(340, 65%, 58%);

  --slot-height: 20px;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  font-size: 14px;
  line-height: 1.5;
}

/* Layout */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Header */
.calendar-header {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  gap: 0.5rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  min-width: 0;
  flex: 1;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(123, 97, 255, 0.1);
  color: var(--primary);
  padding: 0.25rem 0.5rem;
  border-radius: 0.5rem;
  flex-shrink: 0;
}

.logo svg {
  width: 16px;
  height: 16px;
}

.logo span {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav-buttons {
  display: flex;
  align-items: center;
  gap: 0.125rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  font-weight: 500;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
  background: transparent;
}

.btn-icon {
  width: 28px;
  height: 28px;
  padding: 0;
}

.btn-icon:hover {
  background: var(--accent);
}

.btn-icon svg {
  width: 16px;
  height: 16px;
}

.btn-today {
  height: 28px;
  padding: 0 0.75rem;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 9999px;
}

.btn-today:hover {
  background: var(--accent);
}

.date-display {
  margin-left: 0.5rem;
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
  cursor: pointer;
  white-space: nowrap;
}

.date-display:hover {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Employee filter */
.employee-filter {
  position: relative;
}

.filter-btn {
  width: 150px;
  height: 28px;
  padding: 0 0.5rem;
  font-size: 11px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.filter-btn:hover {
  background: var(--accent);
}

.filter-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.25rem;
  width: 200px;
  background: var(--popover);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 50;
  padding: 0.5rem;
  display: none;
}

.filter-dropdown.open {
  display: block;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.375rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 12px;
  cursor: pointer;
  border: none;
  background: transparent;
  text-align: left;
}

.filter-option:hover {
  background: var(--accent);
}

.filter-option.active {
  background: var(--accent);
  font-weight: 500;
}

.checkbox {
  width: 16px;
  height: 16px;
  border: 1px solid var(--muted-foreground);
  border-radius: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.checkbox.checked {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox.checked svg {
  color: white;
}

.color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.color-dot.coral { background: var(--event-coral); }
.color-dot.sky { background: var(--event-sky); }
.color-dot.amber { background: var(--event-amber); }
.color-dot.violet { background: var(--event-violet); }
.color-dot.emerald { background: var(--event-emerald); }
.color-dot.rose { background: var(--event-rose); }

/* View mode tabs */
.view-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.75rem 0.5rem;
}

.tabs-container {
  display: flex;
  background: var(--muted);
  border-radius: 0.5rem;
  padding: 2px;
}

.tab-btn {
  padding: 0.25rem 0.75rem;
  font-size: 11px;
  font-weight: 500;
  border-radius: 0.375rem;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--muted-foreground);
}

.tab-btn:hover {
  color: var(--foreground);
}

.tab-btn.active {
  background: var(--card);
  color: var(--foreground);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Action buttons */
.action-buttons {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0.25rem;
}

.btn-action {
  height: 28px;
  padding: 0 0.625rem;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
}

.btn-action:hover {
  background: var(--accent);
}

.btn-action svg {
  width: 12px;
  height: 12px;
}

.btn-guide {
  background: var(--primary);
  color: var(--primary-foreground);
  border: none;
  font-weight: 700;
  animation: pulse 2s infinite;
}

.btn-guide:hover {
  background: var(--primary);
  opacity: 0.9;
  animation: none;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Calendar Grid */
.calendar-content {
  flex: 1;
  overflow: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.calendar-grid {
  display: flex;
  min-width: max-content;
}

/* Time Grid */
.time-grid {
  display: flex;
  flex-direction: column;
  position: sticky;
  left: 0;
  z-index: 10;
  background: var(--card);
}

.time-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 44px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.time-header span {
  font-size: 10px;
  font-weight: 500;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.time-slot {
  height: var(--slot-height);
  width: 64px;
  border-bottom: 1px solid var(--scheduler-grid-line);
  border-right: 1px solid var(--scheduler-grid-line);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding-right: 0.5rem;
  cursor: pointer;
}

.time-slot.hour-mark {
  border-bottom-color: var(--scheduler-grid-line-strong);
}

.time-slot.unavailable {
  background-image: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 3px,
    var(--scheduler-unavailable) 3px,
    var(--scheduler-unavailable) 4px
  );
  background-color: rgba(230, 230, 230, 0.25);
  opacity: 0.8;
}

.time-slot:hover:not(.unavailable) {
  background: rgba(123, 97, 255, 0.05);
}

.time-label {
  font-size: 10px;
  color: var(--muted-foreground);
  margin-top: -7px;
  font-weight: 600;
  font-feature-settings: "tnum";
}

/* Resource Column */
.resource-column {
  display: flex;
  flex-direction: column;
  min-width: 170px;
  flex: 1;
}

.resource-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 44px;
  background: var(--scheduler-header-bg);
  color: var(--scheduler-header-fg);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.625rem;
}

.resource-header.closed {
  height: 56px;
  background: rgba(239, 68, 68, 0.15);
  color: var(--destructive);
}

.resource-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.resource-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.resource-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.resource-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.resource-status {
  font-size: 8px;
  font-weight: 700;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.resource-menu {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  background: transparent;
  color: inherit;
  flex-shrink: 0;
}

.resource-menu:hover {
  background: rgba(255, 255, 255, 0.15);
}

.resource-menu svg {
  width: 12px;
  height: 12px;
}

/* Resource slots */
.resource-slots {
  position: relative;
}

.slot {
  height: var(--slot-height);
  border-bottom: 1px solid var(--scheduler-grid-line);
  border-right: 1px solid var(--scheduler-grid-line);
  cursor: pointer;
  transition: background 0.15s;
}

.slot.hour-mark {
  border-bottom-color: var(--scheduler-grid-line-strong);
}

.slot:hover:not(.unavailable) {
  background: var(--scheduler-slot-hover);
}

.slot.unavailable {
  background-image: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 3px,
    var(--scheduler-unavailable) 3px,
    var(--scheduler-unavailable) 4px
  );
  background-color: rgba(230, 230, 230, 0.25);
  opacity: 0.8;
}

.slot.drop-target {
  background: var(--scheduler-slot-hover) !important;
  outline: 2px dashed var(--primary);
  outline-offset: -2px;
}

.slot.selected {
  background: rgba(123, 97, 255, 0.3);
  box-shadow: inset 0 0 0 1px rgba(123, 97, 255, 0.5);
}

/* Event Block */
.event-block {
  position: absolute;
  left: 4px;
  right: 4px;
  border-radius: 4px;
  padding: 2px 6px;
  cursor: pointer;
  overflow: hidden;
  z-index: 5;
  transition: transform 0.1s, box-shadow 0.1s;
  color: white;
  font-size: 10px;
}

.event-block:hover {
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.event-block.coral { background: var(--event-coral); }
.event-block.sky { background: var(--event-sky); }
.event-block.amber { background: var(--event-amber); }
.event-block.violet { background: var(--event-violet); }
.event-block.emerald { background: var(--event-emerald); }
.event-block.rose { background: var(--event-rose); }

.event-title {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.event-service {
  font-size: 9px;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-time {
  font-size: 9px;
  opacity: 0.85;
}

/* Resize handle */
.resize-handle {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 12px;
  cursor: ns-resize;
  border-radius: 0 0 4px 4px;
  z-index: 10;
}

.resize-handle:hover,
.resize-handle:active {
  background: rgba(0, 0, 0, 0.15);
}

.resize-handle::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 1px;
}

/* Block marker */
.block-marker {
  position: absolute;
  left: 2px;
  right: 2px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 600;
  z-index: 3;
  opacity: 0.9;
}

.block-marker.pto {
  background: rgba(239, 68, 68, 0.2);
  border: 1px dashed rgba(239, 68, 68, 0.5);
  color: var(--destructive);
}

.block-marker.break {
  background: rgba(251, 191, 36, 0.2);
  border: 1px dashed rgba(251, 191, 36, 0.5);
  color: #b45309;
}

.block-marker.closed {
  background: rgba(107, 114, 128, 0.2);
  border: 1px dashed rgba(107, 114, 128, 0.5);
  color: #6b7280;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  width: 500px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.modal-body {
  padding: 1rem 1.25rem;
}

.modal-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Form elements */
.form-group {
  margin-bottom: 0.75rem;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 0.375rem;
  color: var(--foreground);
}

.form-input {
  width: 100%;
  height: 36px;
  padding: 0 0.75rem;
  font-size: 14px;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background: var(--background);
  color: var(--foreground);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 2px rgba(123, 97, 255, 0.2);
}

.form-input::placeholder {
  color: var(--muted-foreground);
}

.form-select {
  width: 100%;
  height: 36px;
  padding: 0 0.75rem;
  font-size: 14px;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--foreground);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

.form-select:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 2px rgba(123, 97, 255, 0.2);
}

.form-textarea {
  width: 100%;
  min-height: 60px;
  padding: 0.5rem 0.75rem;
  font-size: 14px;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background: var(--background);
  color: var(--foreground);
  resize: vertical;
  font-family: inherit;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 2px rgba(123, 97, 255, 0.2);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.form-row-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

/* Service row */
.service-row {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.625rem;
  margin-bottom: 0.5rem;
  background: rgba(0, 0, 0, 0.02);
  position: relative;
}

.service-row-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--muted-foreground);
}

.service-row-remove:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--destructive);
}

.service-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 10px;
  color: var(--muted-foreground);
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.service-meta input {
  height: 24px;
  width: 60px;
  text-align: center;
  font-size: 10px;
  padding: 0 0.25rem;
}

.btn-add-service {
  width: 100%;
  height: 28px;
  font-size: 12px;
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--muted-foreground);
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.btn-add-service:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(123, 97, 255, 0.05);
}

/* Buttons */
.btn-primary {
  height: 32px;
  padding: 0 1rem;
  font-size: 14px;
  font-weight: 500;
  background: var(--primary);
  color: var(--primary-foreground);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  height: 32px;
  padding: 0 1rem;
  font-size: 14px;
  font-weight: 500;
  background: var(--card);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
}

.btn-secondary:hover {
  background: var(--accent);
}

/* Details panel */
.details-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  max-width: 100vw;
  height: 100vh;
  background: var(--card);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  z-index: 90;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}

.details-panel.open {
  right: 0;
}

.details-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.details-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.details-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  background: transparent;
}

.details-close:hover {
  background: var(--accent);
}

.details-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.detail-row {
  margin-bottom: 1rem;
}

.detail-label {
  font-size: 11px;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.detail-value {
  font-size: 14px;
  font-weight: 500;
}

.details-footer {
  padding: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.5rem;
}

/* Dropdown menu */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.25rem;
  background: var(--popover);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 50;
  min-width: 160px;
  padding: 0.25rem;
  display: none;
}

.dropdown-content.open {
  display: block;
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  border: none;
  background: transparent;
  border-radius: 0.25rem;
  color: var(--foreground);
}

.dropdown-item:hover {
  background: var(--accent);
}

/* Toast notifications */
.toast-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slideIn 0.3s ease;
}

.toast.success {
  border-color: var(--event-emerald);
}

.toast.error {
  border-color: var(--destructive);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scheduling mode buttons */
.scheduling-modes {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.mode-btn {
  flex: 1;
  height: 32px;
  font-size: 10px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.mode-btn:hover {
  background: var(--accent);
}

.mode-btn.active {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

.mode-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Weekly view */
.weekly-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.weekly-header {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  position: sticky;
  top: 0;
  z-index: 20;
}

.weekly-time-header {
  width: 64px;
  flex-shrink: 0;
  padding: 0.5rem;
  text-align: center;
  font-size: 10px;
  color: var(--muted-foreground);
  border-right: 1px solid var(--border);
}

.weekly-day-header {
  flex: 1;
  min-width: 120px;
  padding: 0.5rem;
  text-align: center;
  border-right: 1px solid var(--border);
}

.weekly-day-header.today {
  background: var(--scheduler-today);
}

.weekly-day-name {
  font-size: 10px;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.weekly-day-number {
  font-size: 18px;
  font-weight: 600;
}

.weekly-body {
  display: flex;
  flex: 1;
  overflow: auto;
}

.weekly-time-column {
  width: 64px;
  flex-shrink: 0;
  background: var(--card);
  position: sticky;
  left: 0;
  z-index: 10;
}

.weekly-days-container {
  display: flex;
  flex: 1;
}

.weekly-day-column {
  flex: 1;
  min-width: 120px;
  border-right: 1px solid var(--border);
  position: relative;
}

.weekly-day-column.today {
  background: var(--scheduler-today);
}

/* Monthly view */
.monthly-container {
  flex: 1;
  overflow: auto;
  padding: 1rem;
}

.monthly-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.monthly-header-cell {
  background: var(--scheduler-header-bg);
  color: var(--scheduler-header-fg);
  padding: 0.5rem;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.monthly-day-cell {
  background: var(--card);
  min-height: 100px;
  padding: 0.25rem;
  cursor: pointer;
  transition: background 0.15s;
}

.monthly-day-cell:hover {
  background: var(--scheduler-slot-hover);
}

.monthly-day-cell.today {
  background: var(--scheduler-today);
}

.monthly-day-cell.other-month {
  background: var(--muted);
  opacity: 0.5;
}

.monthly-day-number {
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.monthly-event {
  font-size: 9px;
  padding: 2px 4px;
  border-radius: 3px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: white;
  cursor: pointer;
}

/* Override event-block absolute positioning for monthly view */
.monthly-event.event-block {
  position: relative;
  left: auto;
  right: auto;
  top: auto;
}

.monthly-more {
  font-size: 10px;
  color: var(--muted-foreground);
  padding: 2px 4px;
}

/* Empty state */
.empty-state {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-foreground);
  font-size: 14px;
}

/* Calendar picker */
.calendar-picker {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.25rem;
  background: var(--popover);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 50;
  padding: 0.75rem;
  display: none;
}

.calendar-picker.open {
  display: block;
}

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.calendar-nav-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  background: transparent;
}

.calendar-nav-btn:hover {
  background: var(--accent);
}

.calendar-month-year {
  font-size: 14px;
  font-weight: 600;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  margin-bottom: 0.25rem;
}

.calendar-weekday {
  font-size: 10px;
  color: var(--muted-foreground);
  text-align: center;
  padding: 0.25rem;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  background: transparent;
}

.calendar-day:hover {
  background: var(--accent);
}

.calendar-day.today {
  background: var(--scheduler-today);
  font-weight: 600;
}

.calendar-day.selected {
  background: var(--primary);
  color: var(--primary-foreground);
}

.calendar-day.other-month {
  color: var(--muted-foreground);
  opacity: 0.5;
}

/* Details section styling */
.details-section {
  margin-bottom: 1.25rem;
}

.details-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  margin-bottom: 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.details-section-title svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.details-notes {
  font-size: 13px;
  color: var(--foreground);
  background: rgba(0, 0, 0, 0.02);
  padding: 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.details-field {
  margin-bottom: 0.75rem;
}

.details-field-label {
  font-size: 10px;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.125rem;
}

.details-field-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
}

.details-label {
  display: block;
  font-size: 10px;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.125rem;
}

.details-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
}

/* Service detail items */
.service-detail-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.625rem;
  margin-bottom: 0.375rem;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--border);
  border-radius: 0.375rem;
}

.service-detail-info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.service-detail-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
}

.service-detail-meta {
  font-size: 11px;
  color: var(--muted-foreground);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.service-detail-price {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

/* Service card (in details panel) */
.service-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.service-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.service-card-info {
  flex: 1;
}

.service-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 0.25rem;
}

.service-card-meta {
  font-size: 12px;
  color: var(--muted-foreground);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.service-card-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.service-payment-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  margin: 0.75rem 0;
  font-size: 13px;
  font-weight: 500;
}

.service-payment-status.paid {
  background: rgba(34, 197, 94, 0.1);
  color: #166534;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.service-payment-status svg {
  flex-shrink: 0;
}

.service-card-footer {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

/* Hours modal rows */
.hours-day-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.hours-day-row:last-child {
  border-bottom: none;
}

.hours-day-name {
  width: 80px;
  font-size: 13px;
  font-weight: 500;
  flex-shrink: 0;
}

.hours-day-toggle {
  display: flex;
  align-items: center;
}

.hours-toggle-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.hours-times {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.hours-times input {
  width: 90px;
  height: 32px;
  padding: 0 0.5rem;
  font-size: 13px;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background: var(--background);
}

.hours-times input:disabled {
  opacity: 0.5;
  background: var(--muted);
}

.hours-separator {
  font-size: 12px;
  color: var(--muted-foreground);
}

.hours-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 12px;
  color: var(--muted-foreground);
  min-width: 80px;
}

.hours-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.hours-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.hours-inputs input[type="time"] {
  width: 100px;
  height: 32px;
  padding: 0 0.5rem;
  font-size: 13px;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background: var(--background);
}

.hours-inputs span {
  color: var(--muted-foreground);
}

/* Status badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  font-size: 11px;
  font-weight: 600;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-badge.scheduled {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.status-badge.completed {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.status-badge.cancelled {
  background: rgba(239, 68, 68, 0.1);
  color: var(--destructive);
}

/* Total row */
.details-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  background: var(--accent);
  border-radius: var(--radius);
  margin-top: 0.5rem;
}

.details-total-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
}

.details-total-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

/* Drag preview */
.drag-preview {
  position: fixed;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.8;
  transform: rotate(2deg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Event status badges */
.event-status-badge {
  font-size: 8px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 2px;
  margin-top: 2px;
  display: inline-block;
  text-decoration: underline;
}

.event-status-badge.paid {
  background: rgba(34, 197, 94, 0.2);
  color: #166534;
}

.event-status-badge.unpaid {
  background: rgba(250, 204, 21, 0.3);
  color: #854d0e;
}

/* Custom time picker */
.time-picker-container {
  position: relative;
}

.time-picker-btn {
  width: 140px;
  height: 36px;
  padding: 0 0.75rem;
  font-size: 14px;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--foreground);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.time-picker-btn:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 2px rgba(123, 97, 255, 0.2);
}

.time-picker-btn-sm {
  width: 90px;
  height: 32px;
  font-size: 13px;
}

.time-picker-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.25rem;
  width: 140px;
  max-height: 240px;
  overflow-y: auto;
  background: var(--popover);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 60;
  display: none;
}

.time-picker-dropdown.open {
  display: block;
}

.time-picker-option {
  padding: 0.5rem 0.75rem;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}

.time-picker-option:hover {
  background: var(--accent);
}

.time-picker-option.selected {
  background: var(--primary);
  color: var(--primary-foreground);
}

/* Split payment validation */
.split-validation-error {
  color: var(--destructive);
  font-size: 12px;
}

.split-validation-success {
  color: var(--event-emerald);
  font-size: 12px;
}

/* Availability warning options */
.availability-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  margin-bottom: 0.5rem;
  transition: background 0.15s;
}

.availability-option:hover {
  background: var(--accent);
}

.availability-option-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.availability-option-text {
  flex: 1;
}

.availability-option-title {
  font-size: 14px;
  font-weight: 500;
}

.availability-option-desc {
  font-size: 12px;
  color: var(--muted-foreground);
}

/* Employee checkbox list */
.employee-checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  cursor: pointer;
  border-radius: 0.25rem;
  transition: background 0.15s;
}

.employee-checkbox-item:hover {
  background: var(--accent);
}

.employee-checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* User guide sections */
.guide-section {
  border-radius: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
}

.guide-section.accent {
  background: rgba(123, 97, 255, 0.1);
  border-color: rgba(123, 97, 255, 0.3);
}

.guide-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.guide-step {
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
  margin-left: 0.25rem;
  margin-top: 0.5rem;
}

.guide-step-number {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.guide-bullet {
  margin-left: 0.5rem;
  margin-top: 0.5rem;
  font-size: 13px;
}

.guide-bullet::before {
  content: '✦ ';
  color: var(--primary);
  font-weight: bold;
}

.guide-tip {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(123, 97, 255, 0.1);
  border: 1px solid rgba(123, 97, 255, 0.2);
  border-radius: 0.5rem;
  font-size: 13px;
}

/* Dragging state */
.event-block.dragging {
  opacity: 0.5;
  transform: scale(0.95);
}

/* Service payment row in details panel */
.service-payment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  gap: 0.5rem;
}

.service-payment-row .btn-action {
  font-size: 10px;
  height: 24px;
  padding: 0 0.5rem;
}

/* Monthly view drop target */
.monthly-day-cell.drop-target {
  background: var(--primary) !important;
  opacity: 0.3;
}

/* Slot selection overlay */
.slot-selection-overlay {
  position: absolute;
  left: 0;
  right: 0;
  background: rgba(123, 97, 255, 0.25);
  border: 2px solid var(--primary);
  border-radius: 4px;
  pointer-events: none;
  z-index: 15;
}

/* Slot action modal options */
.slot-action-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.slot-action-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  text-align: left;
}

.slot-action-btn:hover {
  background: var(--accent);
  border-color: var(--primary);
}

.slot-action-btn .action-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}

.slot-action-btn .action-icon.booking {
  background: rgba(123, 97, 255, 0.15);
}

.slot-action-btn .action-icon.break {
  background: rgba(251, 191, 36, 0.15);
}

.slot-action-btn .action-icon.pto {
  background: rgba(59, 130, 246, 0.15);
}

.slot-action-btn .action-icon.closed {
  background: rgba(239, 68, 68, 0.15);
}

.slot-action-btn .action-text {
  flex: 1;
}

.slot-action-btn .action-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
}

.slot-action-btn .action-desc {
  font-size: 12px;
  color: var(--muted-foreground);
}

/* Responsive */
@media (max-width: 640px) {
  .logo span {
    display: none;
  }

  .date-display {
    font-size: 10px;
  }

  .filter-btn {
    width: 100px;
  }

  .action-buttons {
    display: none;
  }

  .resource-column {
    min-width: 140px;
  }

  .modal {
    width: 100%;
    max-width: 100vw;
    border-radius: 0;
    height: 100vh;
    max-height: 100vh;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .form-row-2 {
    grid-template-columns: 1fr;
  }

  .details-panel {
    width: 100%;
    right: -100%;
  }
}
