/* ============================================================================
   Beauty Salon Theme  (magenta)
   ----------------------------------------------------------------------------
   Overrides the app's Tailwind v4 theme tokens. These declarations are
   UNLAYERED on :root, so they win over the bundled `@layer theme` definitions
   regardless of stylesheet order (also when inlined by index.php).
   ============================================================================ */

:root {
  /* --- Brand / primary palette (magenta) ---------------------------------- */
  --color-ink: #431032;          /* deep magenta — main text        */
  --color-ink-soft: #a35b8f;     /* muted magenta — secondary text  */
  --color-mist: #fdf0fb;         /* light magenta — page background */
  --color-fog: #f2cdea;          /* magenta — borders / dividers    */
  --color-leaf: #d4008f;         /* magenta — primary brand         */
  --color-leaf-deep: #a8006f;    /* deep magenta — hover/active     */
  --color-coral: #e5178f;        /* magenta-red — danger / delete   */
  --color-sky: #c17ad8;          /* orchid — accent                 */

  /* --- Extra salon tokens (optional for future styling) ------------------ */
  --color-blush: #fbd0f4;
  --color-gold: #e6b04c;         /* gold accent */
  --color-cream: #fff4fb;

  /* --- Typography: elegant serif for headings ---------------------------- */
  --font-display: "Playfair Display", "IBM Plex Sans", ui-serif, Georgia, serif;
}

/* Selection in a soft magenta */
::selection {
  background-color: rgba(212, 0, 143, 0.22);
  color: inherit;
}

/* Rose focus ring */
:focus-visible {
  outline-color: var(--color-leaf);
}

/* Soft magenta ambience behind the app */
body {
  background:
    radial-gradient(1100px 560px at 100% -10%, rgba(212, 0, 143, 0.08), transparent 60%),
    radial-gradient(900px 520px at -12% 112%, rgba(193, 120, 224, 0.10), transparent 55%),
    var(--color-mist);
  background-attachment: fixed;
}

/* Primary buttons & links: magenta gradient with a soft glow */
button.bg-leaf,
a.bg-leaf {
  background-image: linear-gradient(135deg, #f04fbe 0%, var(--color-leaf-deep) 100%);
  box-shadow: 0 6px 16px -6px rgba(212, 0, 143, 0.55);
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

button.bg-leaf:hover,
a.bg-leaf:hover {
  box-shadow: 0 8px 20px -6px rgba(212, 0, 143, 0.7);
  transform: translateY(-1px);
}

button.bg-leaf:active,
a.bg-leaf:active {
  transform: translateY(0);
}

/* Elegant heading touch */
.font-display {
  letter-spacing: 0.01em;
}

/* Brand row: round the logo so it feels boutique */
aside img[alt],
aside svg[data-logo] {
  border-radius: 9999px;
}

/* Scrollbar in salon tones (WebKit / Chromium) */
::-webkit-scrollbar {
  width: 18px;
  height: 18px;
}
::-webkit-scrollbar-track {
  background: #f6d7ef;
}
::-webkit-scrollbar-thumb {
  background: #c45aa8;
  border-radius: 9999px;
  border: 2px solid #f6d7ef;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-leaf);
}

/* Dashboard: type size reduced by 25% from the previous 2× scale */
.dashboard-page .text-\[11px\] { font-size: 1.03125rem; line-height: 1.3; }
.dashboard-page .text-xs   { font-size: 1.125rem;   line-height: 1.3; }
.dashboard-page .text-sm   { font-size: 1.3125rem;  line-height: 1.3; }
.dashboard-page .text-base { font-size: 1.5rem;     line-height: 1.3; }
.dashboard-page .text-lg   { font-size: 1.6875rem;  line-height: 1.25; }
.dashboard-page .text-2xl  { font-size: 2.25rem;    line-height: 1.15; }
.dashboard-page .text-3xl  { font-size: 2.8125rem;  line-height: 1.1; }

/* ============================================================================
   POS layout: tiles | checkout card (same structure as pos-demo, salon theme).
   The checkout card sizes to its content so the rounded end stays visible.
   ============================================================================ */
.pos-page {
  display: flex;
  flex-direction: column;
}
.pos-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 1rem !important;
}
.pos-grid-main {
  min-width: 0 !important;
}
.pos-checkout {
  min-width: 0 !important;
  width: 100%;
  height: auto !important;
  max-height: none !important;
  align-self: start !important;
}
.pos-checkout > div {
  height: auto !important;
  max-height: none !important;
  border-radius: 1rem;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 12px 32px -14px rgba(67, 16, 50, 0.28);
}
.pos-cart-scroll {
  max-height: 42vh;
  overflow: auto;
}
.pos-checkout-foot {
  flex-shrink: 0;
  margin-top: 0 !important;
  padding: 1rem !important;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px)) !important;
}
.pos-btn-clear {
  background: var(--color-coral) !important;
  color: #fff !important;
}
.pos-btn-clear:hover:not(:disabled) {
  filter: brightness(0.88);
}
.pos-btn-clear:disabled {
  opacity: 0.45;
}
.pos-cats {
  flex-wrap: nowrap;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  padding-top: 0.2rem;
  padding-bottom: 0.35rem;
}
.pos-cats > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 0;
  flex: 0 0 auto;
  box-sizing: border-box;
  overflow: visible;
  white-space: nowrap;
  padding: 0.5rem 0.95rem;
  min-height: 2.4rem;
  line-height: 1.35;
  font-size: 0.8125rem;
}
.pos-tiles {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 0.75rem !important;
  align-content: start;
}
.pos-tile-media {
  aspect-ratio: 1 / 1;
  width: 100%;
}
.pos-tile-img,
.pos-tile-ph {
  width: 100%;
  height: 100%;
}
.pos-tiles,
.pos-grid-main,
.pos-cart-scroll {
  scrollbar-width: auto;
  scrollbar-color: #c45aa8 #f6d7ef;
}
.pos-tiles::-webkit-scrollbar,
.pos-grid-main::-webkit-scrollbar,
.pos-cart-scroll::-webkit-scrollbar {
  width: 18px;
  height: 18px;
}
.pos-tiles::-webkit-scrollbar-thumb,
.pos-grid-main::-webkit-scrollbar-thumb,
.pos-cart-scroll::-webkit-scrollbar-thumb {
  background: #c45aa8;
  border-radius: 9999px;
  border: 2px solid #f6d7ef;
}

@media (min-width: 1024px) {
  .min-h-screen.lg\:grid:has(.pos-page) {
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
    align-items: stretch !important;
  }
  .min-h-screen.lg\:grid:has(.pos-page) > main {
    min-height: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
  }
  .pos-page {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }
  .pos-page > :first-child {
    flex-shrink: 0;
  }
  .pos-grid {
    position: relative;
    grid-template-columns: minmax(0, 1.45fr) minmax(20rem, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    align-items: stretch !important;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }
  .pos-grid-main {
    grid-column: 1 / -1;
    grid-row: 1;
    min-width: 0 !important;
    min-height: 0 !important;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-behavior: auto;
    overscroll-behavior: contain;
  }
  .pos-grid-head {
    position: sticky;
    top: 0;
    z-index: 4;
    width: calc((100% - 1rem) * 1.45 / 2.45);
    max-width: calc((100% - 1rem) * 1.45 / 2.45);
    background: var(--color-mist);
  }
  .pos-search,
  .pos-search-hint,
  .pos-cats {
    background: var(--color-mist);
  }
  .pos-tiles {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-behavior: auto;
    padding-right: calc((100% - 1rem) * 1 / 2.45 + 1rem);
    box-sizing: border-box;
  }
  .pos-checkout {
    grid-column: 2;
    grid-row: 1;
    z-index: 5;
    align-self: start !important;
    position: sticky !important;
    top: 0 !important;
    max-height: 100% !important;
    min-height: 0 !important;
    overflow: hidden;
    pointer-events: none;
  }
  .pos-checkout > div {
    pointer-events: auto;
  }
}
@media (min-width: 768px) {
  .pos-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (min-width: 1280px) {
  .pos-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* Checkboxes / radio controls in magenta (overrides Tailwind accent-teal) */
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--color-leaf) !important;
}

/* Bookings calendar */
.booking-cal-weekdays,
.booking-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
}
.booking-cal-wd {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-ink-soft);
  padding: 0.25rem 0;
}
.booking-cal-cell {
  min-height: 5.5rem;
  border: 1px solid var(--color-fog);
  border-radius: 0.65rem;
  padding: 0.35rem;
  background: #fff;
}
.booking-cal-daynum {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: 0.25rem;
}
.booking-cal-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.5rem;
}
.booking-cal-week-col {
  min-height: 12rem;
  border: 1px solid var(--color-fog);
  border-radius: 0.75rem;
  padding: 0.5rem;
  background: #fff;
}

/* Booking create form: category / service / staff on one row */
.booking-service-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 0.5rem !important;
  align-items: flex-start !important;
  width: 100%;
}
.booking-service-row > * {
  flex: 1 1 0 !important;
  min-width: 0 !important;
}
@media (max-width: 640px) {
  .booking-service-row {
    flex-direction: column !important;
    flex-wrap: wrap !important;
  }
}

/* ============================================================================
   Themed date picker (replaces native type=date)
   ============================================================================ */
.salon-date {
  position: relative;
  width: 100%;
  min-width: 9.5rem;
}
.salon-date-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  min-height: 2.5rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--color-fog);
  border-radius: 0.75rem;
  background: #fff;
  color: var(--color-ink);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 550;
  text-align: start;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.salon-date-trigger:hover,
.salon-date-trigger[aria-expanded="true"] {
  border-color: var(--color-leaf);
  box-shadow: 0 0 0 3px rgba(212, 0, 143, 0.16);
}
.salon-date-trigger.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.salon-date-value.is-placeholder {
  color: var(--color-ink-soft);
  font-weight: 500;
}
.salon-date-icon {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
  color: var(--color-leaf);
}
.salon-date-portal,
.salon-date-panel {
  z-index: 2147483646;
}
.salon-date-panel {
  position: fixed;
  padding: 0.65rem 0.7rem 0.55rem;
  border: 1px solid var(--color-fog);
  border-radius: 0.9rem;
  background: #fff;
  box-shadow: 0 14px 32px -12px rgba(67, 16, 50, 0.38), 0 0 0 1px rgba(212, 0, 143, 0.06);
}
.salon-date-head {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
}
.salon-date-nav {
  width: 1.85rem;
  height: 1.85rem;
  border: 0;
  border-radius: 0.55rem;
  background: var(--color-mist);
  color: var(--color-ink);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.salon-date-nav:hover {
  background: var(--color-fog);
  color: var(--color-leaf);
}
.salon-date-selects {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.3rem;
  min-width: 0;
}
.salon-date-select {
  min-width: 0;
  height: 1.85rem;
  padding: 0 0.35rem;
  border: 1px solid var(--color-fog);
  border-radius: 0.5rem;
  background: #fff;
  color: var(--color-ink);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 650;
}
.salon-date-weekdays,
.salon-date-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.12rem;
}
.salon-date-weekdays {
  margin-bottom: 0.15rem;
}
.salon-date-weekdays span {
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--color-ink-soft);
  padding: 0.1rem 0;
}
.salon-date-day {
  height: 1.85rem;
  border: 0;
  border-radius: 0.45rem;
  background: transparent;
  color: var(--color-ink);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.salon-date-day:hover:not(:disabled) {
  background: var(--color-blush);
  color: var(--color-leaf-deep);
}
.salon-date-day.is-out {
  color: #d7a8c8;
  font-weight: 500;
}
.salon-date-day.is-today:not(.is-selected) {
  box-shadow: inset 0 0 0 1.5px var(--color-leaf);
  color: var(--color-leaf);
}
.salon-date-day.is-selected {
  background: linear-gradient(135deg, #f04fbe 0%, var(--color-leaf-deep) 100%);
  color: #fff;
  box-shadow: 0 6px 12px -8px rgba(212, 0, 143, 0.7);
}
.salon-date-day.is-off,
.salon-date-day:disabled {
  opacity: 0.28;
  cursor: not-allowed;
  text-decoration: line-through;
}
.salon-date-foot {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.45rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--color-fog);
}
.salon-date-link {
  border: 0;
  background: none;
  color: var(--color-leaf);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.1rem 0;
}
.salon-date-link.is-muted {
  color: var(--color-ink-soft);
  font-weight: 600;
}
.salon-date-link:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Login page: Instagram handle, full-screen bottom-left (not in the card). */
.login-ig {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  left: calc(1rem + env(safe-area-inset-left, 0px));
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  z-index: 10;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.4em;
  direction: ltr !important;
  text-decoration: none;
  color: var(--color-ink);
  line-height: 1;
}
.login-ig-logo {
  display: inline-block;
  width: 1em;
  height: 1em;
  flex: 0 0 1em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cdefs%3E%3CradialGradient id='g' cx='30%25' cy='107%25' r='150%25'%3E%3Cstop offset='0%25' stop-color='%23fdf497'/%3E%3Cstop offset='45%25' stop-color='%23fd5949'/%3E%3Cstop offset='60%25' stop-color='%23d6249f'/%3E%3Cstop offset='90%25' stop-color='%23285AEB'/%3E%3C/radialGradient%3E%3C/defs%3E%3Crect width='24' height='24' rx='6' fill='url(%23g)'/%3E%3Crect x='6.4' y='6.4' width='11.2' height='11.2' rx='3.2' fill='none' stroke='%23fff' stroke-width='1.7'/%3E%3Ccircle cx='12' cy='12' r='2.7' fill='none' stroke='%23fff' stroke-width='1.7'/%3E%3Ccircle cx='16.15' cy='8.85' r='0.85' fill='%23fff'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
