﻿:root {
  /* Supabase-like dark palette */
  --colors-scale1: #161616;
  --colors-scale2: #1c1c1c;
  --colors-scale3: #232323;
  --colors-scale4: #282828;
  --colors-scale5: #2e2e2e;
  --colors-scale6: #343434;
  --colors-scale7: #3e3e3e;
  --colors-scale8: #505050;
  --colors-scale9: #707070;
  --colors-scale10: #878787;
  --colors-scale11: #a0a0a0;
  --colors-scale12: #ededed;

  --colors-brand: #3ecf8e;
  --colors-brand-hover: #34b27b;
  --danger: #ef4444;
  --good: #22c55e;

  --sidebar-width: 260px;
  --header-height: 60px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  background-color: var(--colors-scale2);
  color: var(--colors-scale12);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  overflow: hidden;
}

a { text-decoration: none; color: inherit; }

/* Loader */
.page-loader {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(22, 22, 22, 0.7);
  color: #3ecf8e;
  z-index: 50;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.page-loader.visible { display: grid; opacity: 1; }
.page-loader.hidden { opacity: 0; }
.loader { width: 64px; height: 64px; }
.loader-svg { width: 100%; height: 100%; display: block; }
.loader-stroke {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-miterlimit: 10;
  stroke-dasharray: 230;
  stroke-dashoffset: 0;
  animation: w-elastic 2s ease-in-out infinite;
}
@keyframes w-elastic {
  0% { stroke-dasharray: 0, 230; stroke-dashoffset: 0; }
  50% { stroke-dasharray: 230, 230; stroke-dashoffset: 0; }
  100% { stroke-dasharray: 0, 230; stroke-dashoffset: -230; }
}

/* Layout */
.app-container { display: flex; height: 100vh; width: 100vw; overflow: hidden; }












/* Main content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--colors-scale2);
  position: relative;
}
.top-header {
  height: var(--header-height);
  border-bottom: 1px solid var(--colors-scale4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background-color: var(--colors-scale2);
  flex-shrink: 0;
}
.page-title { font-size: 16px; font-weight: 600; color: var(--colors-scale12); }

.content-scroll {
  flex: 1;
  overflow: hidden;
  padding: 20px;
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Cards */
.panel {
  background-color: var(--colors-scale3);
  border: 1px solid var(--colors-scale5);
  border-radius: 8px;
  overflow: hidden;
}
.panel-head {
  padding: 16px 24px;
  border-bottom: 1px solid var(--colors-scale5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--colors-scale3);
}
.panel-title { font-weight: 600; color: var(--colors-scale12); font-size: 14px; }
.panel-body { padding: 24px; }
.panel-body.hours-scroll {
  max-height: 330px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--colors-scale8) transparent;
}
.panel-body.hours-scroll::-webkit-scrollbar {
  width: 8px;
}
.panel-body.hours-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.panel-body.hours-scroll::-webkit-scrollbar-thumb {
  background: var(--colors-scale7);
  border-radius: 999px;
}
.panel-body.hours-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--colors-scale8);
}

/* Inputs */
.form-group { margin-bottom: 16px; }
.field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--colors-scale10);
  margin-bottom: 8px;
  text-transform: uppercase;
}
.input-select,
.input-text {
  width: 100%;
  padding: 10px 12px;
  background: var(--colors-scale1);
  border: 1px solid var(--colors-scale5);
  border-radius: 6px;
  color: var(--colors-scale12);
  font-family: inherit;
  font-size: 13px;
}
.input-select:focus,
.input-text:focus { outline: none; border-color: var(--colors-scale7); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--colors-scale5);
  background: var(--colors-scale4);
  color: var(--colors-scale11);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.btn:hover { background: var(--colors-scale5); color: var(--colors-scale12); }
.btn.primary {
  background: var(--colors-brand);
  color: var(--colors-scale1);
  border-color: var(--colors-brand);
  font-weight: 600;
}
.btn.primary:hover { background: var(--colors-brand-hover); }
.btn.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.btn-icon { padding: 6px; color: var(--colors-scale10); background: transparent; border: none; cursor: pointer; }
.btn-icon:hover { color: var(--colors-scale12); }

/* Calendar section */
.grid-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  height: 100%;
  min-height: 0;
}
.settings-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  padding-right: 4px;
}
.calendar-col {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.calendar-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.calendar-toolbar-head {
  min-height: 62px;
  gap: 12px;
  justify-content: space-between;
}
.cal-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.cal-toolbar-left { justify-content: flex-start; }
.cal-toolbar-right { justify-content: flex-end; }
.cal-current-date {
  margin: 0;
  text-align: center;
  flex: 1;
  min-width: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.cal-btn {
  padding: 6px 11px;
  font-size: 12px;
  min-height: 34px;
}
.cal-view-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--colors-scale5);
  border-radius: 7px;
  overflow: hidden;
}
.cal-view-btn {
  border: 0;
  border-radius: 0;
  min-width: 68px;
  background: var(--colors-scale3);
}
.cal-view-btn + .cal-view-btn { border-left: 1px solid var(--colors-scale5); }
.cal-view-btn.is-active {
  background: var(--colors-scale5);
  color: var(--colors-scale12);
}
.calendar-panel .panel-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 14px 14px 14px;
}

.day-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: var(--colors-scale2);
  border: 1px solid var(--colors-scale5);
  border-radius: 6px;
  margin-bottom: 8px;
  gap: 4px;
}
.day-check { display: flex; align-items: center; gap: 6px; flex: 1; }
.day-label { font-size: 13px; font-weight: 500; color: var(--colors-scale10); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-active .day-label { color: var(--colors-scale12); }
.day-summary { font-size: 11px; color: var(--colors-scale9); margin-right: 10px; }

/* Slot modal rows */
.slots-container { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; }
.slot-row { display: flex; align-items: center; gap: 8px; }
.slot-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: var(--colors-scale1);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--colors-scale9) 50%),
    linear-gradient(135deg, var(--colors-scale9) 50%, transparent 50%);
  background-position:
    calc(100% - 14px) calc(50% - 2px),
    calc(100% - 9px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  border: 1px solid var(--colors-scale5);
  color: var(--colors-scale12);
  padding: 6px 26px 6px 8px;
  border-radius: 4px;
  font-size: 13px;
  width: 100px;
  text-align: center;
}
.slot-input option {
  background: var(--colors-scale2);
  color: var(--colors-scale12);
}
.btn-remove-slot {
  background: transparent;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 4px;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.btn-remove-slot:hover { opacity: 1; }
.btn.dashed {
  background: transparent;
  border: 1px dashed var(--colors-scale6);
  color: var(--colors-scale10);
}
.btn.dashed:hover {
  border-color: var(--colors-scale8);
  color: var(--colors-scale12);
  background: var(--colors-scale3);
}

/* FullCalendar */
#calendar {
  height: 100%;
  background: var(--colors-scale2);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  flex: 1;
  border: 1px solid var(--colors-scale5);
  border-radius: 8px;
  padding: 12px 12px 10px;
  overflow: hidden;
}

.fc .fc-header-toolbar { display: none !important; }

.fc {
  --fc-page-bg-color: var(--colors-scale2);
  --fc-neutral-bg-color: var(--colors-scale3);
  --fc-neutral-text-color: var(--colors-scale11);
  --fc-border-color: var(--colors-scale5);
  --fc-button-text-color: var(--colors-scale12);
  --fc-button-bg-color: var(--colors-scale4);
  --fc-button-border-color: var(--colors-scale5);
  --fc-button-hover-bg-color: var(--colors-scale5);
  --fc-button-hover-border-color: var(--colors-scale6);
  --fc-button-active-bg-color: var(--colors-scale6);
  --fc-button-active-border-color: var(--colors-scale7);
  --fc-event-bg-color: rgba(62, 207, 142, 0.2);
  --fc-event-border-color: var(--colors-brand);
  --fc-event-text-color: var(--colors-brand);
  --fc-today-bg-color: rgba(255, 255, 255, 0.03);
  --fc-now-indicator-color: var(--danger);
}

.fc-non-business { background-color: rgba(0, 0, 0, 0.3); }
.fc-theme-standard td,
.fc-theme-standard th { border-color: var(--colors-scale5); }
.fc-col-header-cell { background: var(--colors-scale3); padding: 8px 0; font-weight: 600; color: var(--colors-scale12); }
.fc-timegrid-slot-label { color: var(--colors-scale10); font-size: 11px; }
.fc-timegrid-axis { color: var(--colors-scale10); }
.fc-toolbar-title {
  font-size: 16px !important;
  font-weight: 650;
  color: var(--colors-scale12);
}

.fc-header-toolbar {
  margin: 10px 0 16px !important;
  padding: 6px 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--colors-scale5);
  gap: 14px;
}
.fc-toolbar-chunk {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.fc-toolbar-chunk:nth-child(2) { justify-content: center; flex: 1; }
.fc .fc-toolbar.fc-header-toolbar { flex-wrap: wrap; }

.fc .fc-button {
  background-color: var(--colors-scale3);
  border: 1px solid var(--colors-scale5);
  color: var(--colors-scale11);
  font-size: 12px;
  font-weight: 500;
  text-transform: capitalize;
  padding: 6px 12px;
  border-radius: 6px;
  box-shadow: none;
  outline: none;
}
.fc .fc-button:hover {
  background-color: var(--colors-scale4);
  color: var(--colors-scale12);
  border-color: var(--colors-scale6);
}
.fc .fc-button:not(:disabled).fc-button-active,
.fc .fc-button:not(:disabled):active {
  background-color: var(--colors-scale5);
  border-color: var(--colors-scale7);
  color: var(--colors-scale12);
  box-shadow: none;
}
.fc .fc-button:disabled {
  background-color: var(--colors-scale2);
  border-color: var(--colors-scale4);
  color: var(--colors-scale8);
}
.fc .fc-button-group > .fc-button { border-radius: 0; }
.fc .fc-button-group > .fc-button:first-child {
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
}
.fc .fc-button-group > .fc-button:last-child {
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
}
.fc .fc-daygrid-day-number,
.fc .fc-col-header-cell-cushion {
  color: var(--colors-scale12);
  text-decoration: none;
}
.fc .fc-day-other .fc-daygrid-day-number { color: var(--colors-scale9); }
.fc .fc-scrollgrid,
.fc .fc-scrollgrid-section > td,
.fc .fc-scrollgrid-section > th { border-color: var(--colors-scale5); }
.fc .fc-popover {
  background: var(--colors-scale3);
  border: 1px solid var(--colors-scale6);
  color: var(--colors-scale12);
}
.fc .fc-popover-header {
  background: var(--colors-scale4);
  color: var(--colors-scale12);
  border-bottom: 1px solid var(--colors-scale6);
}
.fc .fc-list,
.fc .fc-list-table { border-color: var(--colors-scale5); }

/* Events */
.evt-blocked {
  background-image: repeating-linear-gradient(
    45deg,
    rgba(239, 68, 68, 0.1),
    rgba(239, 68, 68, 0.1) 10px,
    rgba(239, 68, 68, 0.2) 10px,
    rgba(239, 68, 68, 0.2) 20px
  );
  border: 1px solid var(--danger) !important;
  cursor: not-allowed !important;
}

.evt-buffer {
  background: rgba(148, 163, 184, 0.09) !important;
  border-top: 1px dashed rgba(148, 163, 184, 0.35) !important;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.35) !important;
  border-left: 0 !important;
  border-right: 0 !important;
  pointer-events: none;
}
.fc-bg-event.evt-buffer { opacity: 0.55; }

.fc-event { border-radius: 4px; padding: 2px 4px; cursor: pointer; transition: opacity 0.2s; }
.fc-event:hover { opacity: 0.8; }

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}
.modal-overlay[hidden] { display: none; }
.modal-card {
  width: 400px;
  background: var(--colors-scale3);
  border: 1px solid var(--colors-scale6);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}
.modal-card.modal-card-sm { width: 360px; }
#eventDetailsModal .modal-card.modal-card-sm {
  width: 620px;
  max-width: calc(100vw - 32px);
}
.modal-title { margin: 0 0 16px; font-size: 16px; font-weight: 600; color: var(--colors-scale12); }
.modal-text {
  margin: -6px 0 0;
  color: var(--colors-scale10);
  font-size: 13px;
  line-height: 1.5;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.event-details-grid {
  border: 1px solid var(--colors-scale5);
  border-radius: 8px;
  overflow: hidden;
}
.event-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--colors-scale2);
  border-bottom: 1px solid var(--colors-scale5);
}
.event-detail-row:nth-child(even) { background: var(--colors-scale1); }
.event-detail-row:last-child { border-bottom: 0; }
.event-detail-label {
  color: var(--colors-scale10);
  font-size: 12px;
  font-weight: 600;
}
.event-detail-value {
  color: var(--colors-scale12);
  font-size: 12px;
  font-weight: 500;
  text-align: right;
}

.goto-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.goto-cal-month {
  font-weight: 600;
  color: var(--colors-scale12);
  font-size: 14px;
}
.goto-cal-weekdays,
.goto-cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.goto-cal-weekdays {
  margin-bottom: 6px;
  color: var(--colors-scale9);
  font-size: 11px;
  text-align: center;
  text-transform: uppercase;
}
.goto-cal-days { min-height: 232px; }
.goto-day-btn,
.goto-day-empty {
  min-height: 30px;
  border-radius: 7px;
}
.goto-day-empty { opacity: 0; pointer-events: none; }
.goto-day-btn {
  border: 1px solid var(--colors-scale5);
  background: var(--colors-scale2);
  color: var(--colors-scale12);
  font-size: 12px;
  cursor: pointer;
}
.goto-day-btn:hover { border-color: var(--colors-scale7); }
.goto-day-btn.today { border-color: var(--colors-brand); }
.goto-day-btn.selected {
  border-color: var(--colors-brand);
  background: rgba(62, 207, 142, 0.18);
  color: #d1fae5;
}

/* Status colors */
.evt-confirmed {
  background-color: rgba(34, 197, 94, 0.15) !important;
  border-color: #22c55e !important;
  color: #4ade80 !important;
}
.evt-pending {
  background-color: rgba(234, 179, 8, 0.15) !important;
  border-color: #eab308 !important;
  color: #facc15 !important;
}
.evt-canceled {
  background-color: rgba(239, 68, 68, 0.15) !important;
  border-color: #ef4444 !important;
  color: #f87171 !important;
  text-decoration: line-through;
  opacity: 0.6;
}

/* Mobile */
@media (max-width: 1000px) {
  .app-container { flex-direction: column; }
  
