/* The salon module's own styles. The look of the application comes from the core (NextGenCore.Web). */

/* The line above a list that the server searches: the search box, a switch or two, the count. */
.list-bar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.list-bar input[type=search] { flex: 1 1 18rem; max-width: 28rem; }
.list-bar select.plain { width: auto; min-width: 12rem; }
.list-bar label.tick { display: inline-flex; align-items: center; gap: .4rem; font-size: .875rem; color: var(--slate-700); }

.pager { display: flex; align-items: center; justify-content: flex-end; gap: .75rem; margin-top: .75rem; font-size: .875rem; color: var(--muted); }
.pager button { font: inherit; padding: .3rem .8rem; border: 1px solid var(--slate-300); border-radius: var(--radius); background: var(--surface); color: var(--slate-700); cursor: pointer; }
.pager button:hover:not(:disabled) { border-color: var(--brand-500); color: var(--brand-700); }
.pager button:disabled { opacity: .45; cursor: default; }

/* A choice of a few named positions, all showing at once: one radio group to the keyboard. */
.seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: 999px; background: var(--slate-100); border: 1px solid var(--line); }
.seg button { font: inherit; font-size: .8125rem; padding: .15rem .7rem; border: 0; border-radius: 999px; background: none; color: var(--muted); cursor: pointer; }
.seg button:hover { color: var(--slate-700); }
.seg button:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 1px; }
.seg button[aria-checked=true] { background: var(--brand-600); color: #fff; box-shadow: 0 1px 2px rgb(16 24 40 / .2); }
.seg button.none[aria-checked=true] { background: var(--surface); color: var(--slate-500); }

/* The services an employee performs, in the employee's form. */
.specialties { max-height: 16rem; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.specialties table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.specialties td { padding: .35rem .6rem; border-bottom: 1px solid var(--line); }
.specialties tr:last-child td { border-bottom: 0; }
.specialties td:last-child { text-align: right; white-space: nowrap; }

.form-grid.three { grid-template-columns: 1fr 1fr 1fr; }
.form-grid .wide { grid-column: 1 / -1; }
.form-section { font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: .25rem 0 .6rem; }
.swatch { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; border: 1px solid var(--line); vertical-align: -1px; margin-right: .4rem; }
.customer-warning { color: var(--danger); }
.same-phone { margin: -.5rem 0 1rem; font-size: .8125rem; color: var(--slate-700); }

/* The working schedules' board: a bar says its hours once. */
.shift-board .shift-bar { padding: .1rem .5rem; font-size: .8125rem; font-weight: 600; line-height: 2.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The buttons and the salon list beside a page's heading keep their size; the longer (Greek) text wraps instead. */
.page-head .row-actions { flex-wrap: nowrap; flex: none; }

/* Booking: the appointment's form beside the calendar it narrows. */
.booking { display: grid; grid-template-columns: 25rem minmax(0, 1fr); gap: 1rem; align-items: start; }
/* The form put away (pin / hide): a narrow strip brings it back, and the calendar takes the room. */
.booking-form[hidden] { display: none; }
.booking.form-hidden { grid-template-columns: 2.75rem minmax(0, 1fr); }
.booking-rail { display: flex; flex-direction: column; align-items: center; gap: .75rem; width: 100%; min-height: 12rem; padding: .75rem 0;
    border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; }
.booking-rail:hover { background: var(--brand-soft); }
.booking-rail span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-size: .875rem; }
.booking-form .booking-tools { margin-left: auto; display: inline-flex; gap: .125rem; }
.booking-form .booking-tools + .booking-close { margin-left: 0; }
.booking-tool { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.booking-tool:hover { background: var(--slate-100); color: var(--ink); }
.booking-tool.on { color: var(--brand); }
.booking-tool:focus-visible, .booking-rail:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.booking-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.booking-form h2 { font-size: 1rem; margin: 0 0 .75rem; }
.booking-form .booking-title { display: flex; align-items: center; gap: .25rem; margin: 0 0 .75rem; }

/* The searchable box of customers: what matches, under the field as one types. */
.combo { position: relative; flex: 1; min-width: 0; }
.combo > input { width: 100%; }
.combo-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 2px); margin: 0; padding: .25rem 0; list-style: none;
    background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px rgb(15 23 42 / .14); max-height: 22rem; overflow-y: auto; }
.combo-list li[role=option] { display: grid; grid-template-columns: 1fr auto; gap: 0 .5rem; padding: .4rem .65rem; cursor: pointer; }
.combo-list li.active { background: var(--brand-soft); }
.combo-name { font-weight: 600; }
.combo-more { grid-column: 1 / -1; font-size: .85em; }
.combo-marks { display: inline-flex; gap: .3rem; align-items: center; }
.combo-missed { padding: 0 .4rem; border-radius: 999px; font-size: .75rem; font-weight: 700; line-height: 1.15rem; background: var(--slate-200, #e2e8f0); color: var(--ink); }
.combo-missed.level-2 { background: #b45309; color: #fff; }
.combo-missed.level-3 { background: #b91c1c; color: #fff; }
.combo-flag { display: inline-grid; place-items: center; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--danger); color: #fff; font-size: .7rem; font-weight: 700; }
.combo-note { padding: .35rem .65rem; font-size: .85em; }
.booking-form .booking-title h2 { margin: 0; }
.booking-close { margin-left: auto; display: inline-grid; place-items: center; width: 2rem; height: 2rem; border: 0; border-radius: 6px;
    background: none; color: var(--muted); cursor: pointer; }
.booking-close:hover { background: var(--danger-soft, #fee2e2); color: var(--danger); }
.booking-form .field { margin-bottom: .7rem; }
/* The minutes keep room for three digits and the arrows, however short their label ("Λεπτά"). */
.booking-form .form-grid.when { grid-template-columns: 1.35fr 1fr minmax(4.5rem, .7fr); gap: .5rem; }
.booking-form .form-grid.when .plain { min-width: 0; width: 100%; padding-left: .5rem; padding-right: .35rem; }
.with-button { display: flex; gap: .5rem; }
.with-button > .plain { flex: 1 1 auto; min-width: 0; }
.with-button > .e-btn { flex: none; }
.booking-none { margin: 0; font-size: .875rem; color: var(--muted); }
.booking-customer { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--slate-100); }
.booking-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.booking-calendar .list-bar { justify-content: space-between; }

/* An appointment on the calendar: who, then when and what. */
.booking-board .appt { padding: .1rem .35rem; font-size: .75rem; line-height: 1.25; overflow: hidden; height: 100%; }
.booking-board .appt-who { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.booking-board .appt-what { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .92; }
.booking-board .appt-flag { margin-left: .2rem; }
.booking-board .appt.cancelled { text-decoration: line-through; opacity: .6; }
/* Where an appointment stands: a bar at its left edge for who is here, faded for who is not coming. */
.booking-board .e-appointment.st-arrived { box-shadow: inset 5px 0 0 #facc15; }
.booking-board .e-appointment.st-in-progress { box-shadow: inset 5px 0 0 #4ade80; }
.booking-board .e-appointment.st-closed { background-color: #64748b !important; }
.booking-board .e-appointment.st-no-show, .booking-board .e-appointment.st-cancelled { opacity: .55; }
/* Still expected, from a customer who missed two appointments (ring to confirm) or three (should not be booked like this). */
.booking-board .e-appointment.missed-2 { background-color: #b45309 !important; }
.booking-board .e-appointment.missed-3 { background-color: #b91c1c !important; }
/* The appointment open in the form, and the place the form names (a new one, or where an open one moves). */
.booking-board .e-appointment.selected { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--brand-500) !important; z-index: 3; }
.booking-board .e-appointment.picked { background: color-mix(in srgb, var(--brand-500) 14%, transparent) !important; border: 2px dashed var(--brand-600) !important;
    color: var(--brand-800) !important; pointer-events: none; z-index: 2; }
.booking-board .e-appointment.picked .appt-who, .booking-board .e-appointment.picked .appt-what { color: var(--brand-800); }
:root[data-theme="dark"] .booking-board .e-appointment.picked, :root[data-theme="dark"] .booking-board .e-appointment.picked .appt-who,
:root[data-theme="dark"] .booking-board .e-appointment.picked .appt-what { color: var(--brand-300) !important; }

.status-buttons { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.status-buttons.compact { margin-top: 0; gap: .3rem; }

/* The day: its appointments as a list. */
.day-step { display: inline-flex; align-items: center; gap: .5rem; }
.day-step input.plain { width: auto; }
.day-step .link-btn { font-size: 1rem; }
.day-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
.day-list table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.day-list th { text-align: left; font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: .6rem .75rem; border-bottom: 1px solid var(--line); }
.day-list td { padding: .55rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.day-list tr:last-child td { border-bottom: 0; }
.day-list td.when { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
.day-list tr.done td { background: var(--slate-100); }
.day-list td.acts .row-actions { margin-top: .3rem; gap: .75rem; }
/* The core's warning colours (light and dark), with this module's own where an older core lacks them. */
.alert.warn { background: var(--warn-soft, #fffbeb); border: 1px solid var(--warn-line, #fde68a); color: var(--warn, #92400e); }

/* Checkout: the lines, the product box, and what it comes to. */
.checkout-lines { width: 100%; border-collapse: collapse; font-size: .875rem; }
.checkout-lines th { text-align: left; font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: .4rem .5rem; border-bottom: 1px solid var(--line); }
.checkout-lines td { padding: .4rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.checkout-lines .num, .day-list .num { text-align: right; }
.checkout-lines tr.unticked td { color: var(--muted); }
.checkout-lines input.plain { padding: .3rem .4rem; text-align: right; }
.checkout-lines input.qty { width: 4.5rem; }
.checkout-lines input.price, .checkout-lines input.pct { width: 6rem; }
.checkout-lines select.plain { padding: .3rem .4rem; min-width: 10rem; }
.checkout-lines .amount, .day-list .amount { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.checkout-add { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; margin-top: 1rem; }
.checkout-foot { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 2rem; margin-top: .5rem; align-items: start; }
.checkout-sums { display: grid; grid-template-columns: 1fr auto; gap: .4rem 1rem; margin: 0; padding: 1rem; background: var(--slate-100); border-radius: var(--radius); font-variant-numeric: tabular-nums; }
.checkout-sums dt { color: var(--muted); }
.checkout-sums dd { margin: 0; text-align: right; }
.checkout-sums .total { font-size: 1.25rem; font-weight: 700; color: var(--ink); padding-top: .4rem; border-top: 1px solid var(--line); }
.checkout-card { margin: 0; padding: .5rem 0; font-weight: 600; }
.sales-sums { margin: 0 0 .75rem; font-size: .875rem; color: var(--slate-700); min-height: 1.2rem; }
.day-list tr.voided td { text-decoration: line-through; text-decoration-color: var(--slate-300); }
.day-list tr.voided td .customer-warning { text-decoration: none; display: inline-block; }

/* A customer's history. */
.specialties.history { max-height: 26rem; }
.specialties.history td:last-child { text-align: left; }
.specialties.history tr.coming td { color: var(--muted); }
.specialties.history tr.said td { padding-top: 0; font-size: .8125rem; color: var(--muted); }
.history-missed { color: var(--danger); font-weight: 600; margin-top: 0; }
.history-notes { margin-top: 0; }

/* Room for a week of several employees, or a day of many: the calendar scrolls sideways. */
.booking-board.wide-week .e-vertical-view .e-date-header-wrap table col, .booking-board.wide-week .e-vertical-view .e-content-wrap table col { width: 96px; }
.booking-board.wide-day .e-vertical-view .e-date-header-wrap table col, .booking-board.wide-day .e-vertical-view .e-content-wrap table col { width: 130px; }
/* Where the employee of the column does not work. */
/* "Highlight working hours": the hours tinted, the rest hatched, and the hours under each name. */
.booking-board.hours .e-work-cells.on-hours { background-color: var(--ok-soft); }
.booking-board.hours .e-work-cells.on-hours.e-work-hours, .booking-board.hours .e-work-cells.on-hours:hover { background-color: var(--ok-soft); }
.booking-board.hours .e-work-cells.off-hours { background-color: var(--slate-100); background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgb(100 116 139 / .13) 6px 7px); }
.booking-board .column-head { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.booking-board .column-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.booking-board .column-hours { font-size: .72rem; font-weight: 500; color: var(--ok); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.booking-board .column-hours.none { color: var(--slate-500); }

@media (max-width: 1100px) {
    .booking, .booking.form-hidden { grid-template-columns: 1fr; }
    .booking-rail { flex-direction: row; justify-content: center; min-height: 0; }
    .booking-rail span { writing-mode: horizontal-tb; transform: none; }
}

@media (max-width: 700px) {
    .page-head .row-actions { flex-wrap: wrap; }
    .form-grid.three { grid-template-columns: 1fr; }
}

/* ---- Sales: the sale's number opens it; one sale in a dialog. */
.link-btn.sale-number { font-weight: 600; font-size: inherit; padding: 0; }
.sale-facts { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0 0 1rem; }
.sale-facts dt { color: var(--muted); }
.sale-facts dd { margin: 0; }
.sale-lines { width: 100%; border-collapse: collapse; }
.sale-lines th, .sale-lines td { padding: .35rem .5rem; border-bottom: 1px solid var(--line); text-align: left; }
.sale-lines th { font-weight: 600; color: var(--muted); font-size: .85em; }
.sale-lines .num { text-align: right; white-space: nowrap; }
.sale-lines tfoot td { border-bottom: 0; }
.sale-lines .sale-total td { font-weight: 700; border-top: 2px solid var(--line); }
