/* XBARBER SHOP — clean black & white design with clear status colors. */

:root {
    color-scheme: light;
    --bg: #f3f3f0;
    --surface: #ffffff;
    --surface-2: #f8f8f6;
    --surface-3: #efeee9;
    --lane: #e9e8e3;
    --ink: #0b0b0b;
    --ink-2: #52514e;
    --muted: #706f6a;
    --line: #e6e5df;
    --line-2: #d6d5ce;

    --waiting: #fab219;
    --waiting-bg: #fff4da;
    --waiting-ink: #7a5000;
    --done: #0ca30c;
    --done-bg: #e6f5e6;
    --done-ink: #0a6b0a;
    --danger: #c43333;
    --danger-bg: #fdecec;
    --danger-ink: #b42323;
    --info-bg: #e9f2fc;
    --info-ink: #164a8a;

    --services: #2a78d6;
    --products: #eb6834;

    --radius-xl: 22px;
    --radius-lg: 18px;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(16, 16, 16, 0.06);
    --shadow: 0 1px 2px rgba(16, 16, 16, 0.04), 0 8px 24px rgba(16, 16, 16, 0.06);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.22);
    --font: system-ui, -apple-system, "Segoe UI", "Noto Sans Arabic", "Noto Sans", Tahoma, Arial, sans-serif;
    --nav-width: 96px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overflow: hidden;
}

[dir="rtl"] body * {
    letter-spacing: normal !important;
}

h1, h2, h3, p {
    margin: 0;
}

button {
    font: inherit;
    color: inherit;
}

img {
    display: block;
}

:focus-visible {
    outline: 3px solid #2a78d6;
    outline-offset: 2px;
}

.icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

[dir="rtl"] .flip-rtl {
    transform: scaleX(-1);
}

.money {
    white-space: nowrap;
}

.money small {
    font-size: 0.72em;
    font-weight: 700;
    margin-inline-start: 0.3em;
    opacity: 0.7;
}

.muted {
    color: var(--muted);
}

.spacer {
    flex: 1;
}

/* ---------------- Buttons ---------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 18px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: var(--surface);
    color: var(--ink);
    font-weight: 700;
    font-size: 15px;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
}

.btn:active:not(:disabled) {
    transform: translateY(1px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.btn-primary {
    background: var(--ink);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: #2b2b2a;
}

.btn-light {
    background: #fff;
    color: var(--ink);
}

.btn-light:hover:not(:disabled) {
    background: #ecebe6;
}

.btn-outline {
    background: var(--surface);
    border-color: var(--line-2);
}

.btn-outline:hover:not(:disabled) {
    border-color: var(--ink);
}

.btn-ghost {
    background: transparent;
    color: var(--ink-2);
}

.btn-ghost:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.05);
    color: var(--ink);
}

.btn-ghost-danger {
    background: transparent;
    color: var(--danger-ink);
}

.btn-ghost-danger:hover:not(:disabled) {
    background: var(--danger-bg);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover:not(:disabled) {
    background: #a82828;
}

.btn-sm {
    height: 38px;
    padding: 0 12px;
    font-size: 14px;
    border-radius: 10px;
}

.btn-sm .icon {
    width: 18px;
    height: 18px;
}

.btn-lg {
    height: 52px;
    padding: 0 22px;
    font-size: 16px;
    border-radius: 14px;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    transition: background-color 0.15s;
}

.btn-icon:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.06);
}

.btn-icon:disabled {
    opacity: 0.45;
}

.link {
    padding: 0;
    border: 0;
    background: none;
    color: #1c5cab;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

/* ---------------- Fields ---------------- */

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ink-2);
}

.field em,
.section-title em {
    font-style: normal;
    font-weight: 500;
    font-size: 12px;
    color: var(--muted);
}

input,
select,
textarea {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--line-2);
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    transition: border-color 0.15s, box-shadow 0.15s;
}

textarea {
    height: auto;
    padding: 10px 14px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(11, 11, 11, 0.12);
}

input[dir="ltr"] {
    text-align: start;
}

[dir="rtl"] input[dir="ltr"] {
    text-align: right;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    gap: 12px;
}

.inline-form {
    display: flex;
    gap: 8px;
}

.inline-form input {
    flex: 1;
    min-width: 0;
}

/* ---------------- Segmented controls & language switch ---------------- */

.segmented {
    display: inline-flex;
    gap: 2px;
    padding: 4px;
    border-radius: 14px;
    background: #e6e5e0;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}

.segmented::-webkit-scrollbar {
    display: none;
}

.segmented button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--ink-2);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.segmented button .icon {
    width: 18px;
    height: 18px;
}

.segmented button.active {
    background: #fff;
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}

.segmented-lg {
    display: flex;
}

.segmented-lg button {
    flex: 1;
    height: 50px;
    font-size: 15.5px;
}

.segmented .count {
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.07);
    font-size: 12px;
    line-height: 20px;
}

.lang-switch {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    border-radius: 12px;
    background: #e6e5e0;
}

.lang-option {
    height: 32px;
    padding: 0 12px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.lang-option.active {
    background: #fff;
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}

.lang-short {
    display: none;
}

/* ---------------- Login ---------------- */

.login-screen {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 24px;
    background: radial-gradient(1200px 640px at 50% -12%, #2d2d2b 0%, #0b0b0b 62%);
    overflow-y: auto;
}

.login-lang {
    position: absolute;
    top: max(16px, env(safe-area-inset-top));
    inset-inline-end: 16px;
    background: rgba(255, 255, 255, 0.1);
}

.login-lang .lang-option {
    color: rgba(255, 255, 255, 0.78);
}

.login-lang .lang-option.active {
    background: #fff;
    color: var(--ink);
}

.login-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 400px;
    padding: 32px 28px;
    border-radius: 28px;
    background: #fff;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.login-logo {
    display: grid;
    place-items: center;
    width: 84px;
    height: 84px;
    margin: 0 auto;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: #fff;
}

.login-logo img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.login-card h1 {
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-align: center;
}

.login-subtitle {
    margin: -10px 0 6px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

/* ---------------- App shell ---------------- */

.app-shell {
    display: grid;
    grid-template-columns: var(--nav-width) minmax(0, 1fr);
    height: 100vh;
    height: 100dvh;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: max(16px, env(safe-area-inset-top)) 10px calc(16px + env(safe-area-inset-bottom));
    background: var(--ink);
    color: #fff;
    overflow-y: auto;
    scrollbar-width: none;
}

.nav-brand {
    display: grid;
    place-items: center;
    margin-bottom: 8px;
}

.nav-brand img {
    width: 52px;
    height: 52px;
    padding: 6px;
    border-radius: 16px;
    background: #fff;
    object-fit: contain;
}

.nav-links {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 4px;
}

.nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px 4px;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: rgba(255, 255, 255, 0.62);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.nav-link .icon {
    width: 22px;
    height: 22px;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.nav-link.active {
    background: #fff;
    color: var(--ink);
}

.nav-signout {
    margin-top: auto;
}

.main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    padding: max(20px, env(safe-area-inset-top)) 28px 16px;
}

.topbar-title {
    flex: 1 1 260px;
    min-width: 0;
}

.topbar-title h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.topbar-title p {
    margin-top: 3px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
}

.topbar-actions {
    order: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.topbar-actions:empty {
    display: none;
}

.topbar-lang {
    order: 3;
}

.page {
    flex: 1;
    min-height: 0;
    padding: 0 28px 28px;
    overflow: auto;
}

.page-cashier,
.page-history {
    display: flex;
    flex-direction: column;
}

.page-cashier > .board,
.page-history > .board {
    flex: 1 0 380px;
    min-height: 380px;
}

/* ---------------- Cashier: header controls ---------------- */

.date-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.date-nav .btn-icon {
    width: 44px;
    height: 44px;
    border: 1px solid var(--line-2);
    border-radius: 12px;
    background: #fff;
}

.date-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--line-2);
    border-radius: 12px;
    background: #fff;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.date-pill input[type="date"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    opacity: 0;
    cursor: pointer;
}

.date-pill-sm {
    height: 44px;
    font-size: 14px;
}

.date-pill.active {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
}

.day-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.day-stat {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--ink-2);
    font-size: 14px;
    font-weight: 600;
}

.day-stat strong {
    color: var(--ink);
    font-size: 15px;
    font-weight: 800;
}

.day-stat-money {
    margin-inline-start: auto;
    border-color: var(--ink);
    background: var(--ink);
    color: rgba(255, 255, 255, 0.75);
}

.day-stat-money strong {
    color: #fff;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-dot-waiting {
    background: var(--waiting);
}

.status-dot-active {
    background: var(--ink);
}

.status-dot-done {
    background: var(--done);
}

/* ---------------- Cashier: board & columns ---------------- */

.board {
    display: flex;
    align-items: stretch;
    gap: 14px;
    padding-bottom: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
}

.col {
    display: flex;
    flex: 1 0 300px;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    min-width: 0;
    min-height: 0;
    padding: 12px;
    border-radius: var(--radius-xl);
    background: var(--lane);
    scroll-snap-align: start;
}

.col-unassigned {
    border: 1.5px dashed #d6cbab;
    background: #f2eee2;
}

.col-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 2px 2px 0;
}

.col-id {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.avatar {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--ink);
    color: #fff;
    font-size: 17px;
    font-weight: 800;
}

.avatar .icon {
    width: 20px;
    height: 20px;
}

.avatar-muted {
    background: #d8d3c3;
    color: var(--ink-2);
}

.avatar-lg {
    width: 52px;
    height: 52px;
    font-size: 22px;
}

.col-name {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.col-name h3 {
    overflow: hidden;
    font-size: 16.5px;
    font-weight: 800;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.col-note {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.tag {
    align-self: flex-start;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--danger-bg);
    color: var(--danger-ink);
    font-size: 11px;
    font-weight: 800;
}

.col-money {
    padding: 6px 10px;
    border-radius: 12px;
    background: #fff;
    font-size: 15px;
    font-weight: 800;
    white-space: nowrap;
}

.col-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.col-stats div {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 4px 5px;
    border-radius: 12px;
    background: #fff;
    text-align: center;
}

.col-stats div:nth-child(1) {
    box-shadow: inset 0 3px 0 var(--waiting);
}

.col-stats div:nth-child(2) {
    box-shadow: inset 0 3px 0 var(--ink);
}

.col-stats div:nth-child(3) {
    box-shadow: inset 0 3px 0 var(--done);
}

.col-stats strong {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.2;
}

.col-stats span {
    overflow: hidden;
    max-width: 100%;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-add-client {
    width: 100%;
    height: 48px;
    flex-shrink: 0;
    border: 1.5px dashed #c4c3bb;
    border-radius: var(--radius);
    background: #fff;
    font-size: 15.5px;
}

.btn-add-client:hover:not(:disabled) {
    border-style: solid;
    border-color: var(--ink);
}

.col-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    margin: 0 -4px;
    padding: 2px 4px 6px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.col-empty {
    padding: 18px 12px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.col-ghost {
    display: flex;
    flex: 0 0 170px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 2px dashed #cfcec7;
    background: transparent;
    color: var(--ink-2);
    font-weight: 800;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.col-ghost:hover {
    border-color: var(--ink);
    color: var(--ink);
}

.col-ghost-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fff;
}

.done-group {
    flex-shrink: 0;
}

.done-group summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.65);
    color: var(--done-ink);
    font-weight: 800;
    list-style: none;
    cursor: pointer;
}

.done-group summary::-webkit-details-marker {
    display: none;
}

.summary-chevron {
    width: 18px;
    height: 18px;
    margin-inline-start: auto;
    transition: transform 0.15s;
}

[dir="rtl"] .summary-chevron {
    transform: scaleX(-1);
}

.done-group[open] .summary-chevron {
    transform: rotate(90deg);
}

.done-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

/* ---------------- Cashier: client tickets ---------------- */

.ticket {
    display: flex;
    flex-shrink: 0;
    flex-direction: column;
    gap: 8px;
    padding: 12px 12px 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.ticket.is-waiting {
    border-inline-start: 4px solid var(--waiting);
}

.ticket.is-active {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.2);
}

.ticket.is-done {
    background: var(--surface-2);
    box-shadow: none;
}

.ticket-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 8px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 800;
    white-space: nowrap;
}

.badge .icon {
    width: 14px;
    height: 14px;
    stroke-width: 2.5;
}

.badge-waiting {
    background: var(--waiting-bg);
    color: var(--waiting-ink);
}

.badge-active {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.badge-done {
    background: var(--done-bg);
    color: var(--done-ink);
}

.pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    animation: pulse 1.6s ease-out infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
    70% { box-shadow: 0 0 0 7px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.ticket-time {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.ticket-time .icon {
    width: 15px;
    height: 15px;
}

.is-active .ticket-time {
    color: rgba(255, 255, 255, 0.7);
}

.ticket-who {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ticket-who strong {
    overflow: hidden;
    font-size: 16.5px;
    font-weight: 800;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ticket-who bdi {
    color: var(--muted);
    font-size: 13.5px;
    font-weight: 600;
}

.is-active .ticket-who bdi {
    color: rgba(255, 255, 255, 0.7);
}

.ticket-line {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: start;
    gap: 8px;
}

.line-icon {
    display: grid;
    place-items: center;
    height: 28px;
    color: var(--muted);
}

.line-icon .icon {
    width: 17px;
    height: 17px;
}

.is-active .line-icon {
    color: rgba(255, 255, 255, 0.6);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    min-height: 28px;
    padding: 3px 10px;
    border: 0;
    border-radius: 999px;
    background: var(--surface-3);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.2;
}

.chip > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chip b {
    font-weight: 800;
}

.chip-product {
    padding-inline-start: 3px;
}

.chip-thumb {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 50%;
    background: #fff;
    color: var(--muted);
}

.chip-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chip-thumb .icon {
    width: 13px;
    height: 13px;
}

.chip-add {
    border: 1.5px dashed var(--line-2);
    background: transparent;
    color: var(--ink-2);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.chip-add .icon {
    width: 15px;
    height: 15px;
}

.chip-add:hover {
    border-color: var(--ink);
    color: var(--ink);
}

.is-active .chip {
    background: rgba(255, 255, 255, 0.13);
    color: #fff;
}

.is-active .chip-add {
    border-color: rgba(255, 255, 255, 0.35);
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
}

.is-active .chip-add:hover {
    border-color: #fff;
    color: #fff;
}

.is-done .chip {
    background: #ebeae5;
}

.chip-none {
    padding: 4px 0;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 600;
}

.ticket-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 2px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.is-active .ticket-foot {
    border-top-color: rgba(255, 255, 255, 0.14);
}

.ticket-total {
    font-size: 17px;
    font-weight: 800;
}

.ticket-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-inline-start: auto;
}

.is-active .btn-icon:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.14);
}

.paid-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--done-ink);
    font-size: 13px;
    font-weight: 800;
}

.paid-label .icon {
    width: 17px;
    height: 17px;
}

/* ---------------- Empty states ---------------- */

.empty-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    max-width: 540px;
    margin: 32px auto;
    padding: 40px 28px;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: #fff;
    text-align: center;
}

.empty-hero-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin-bottom: 6px;
    border-radius: 20px;
    background: var(--ink);
    color: #fff;
}

.empty-hero-icon .icon {
    width: 30px;
    height: 30px;
}

.empty-hero h2 {
    font-size: 22px;
    font-weight: 800;
}

.empty-hero p {
    max-width: 420px;
    margin-bottom: 8px;
    color: var(--ink-2);
}

.empty-hero .inline-form {
    width: 100%;
    max-width: 420px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 60px 20px;
    color: var(--ink-2);
    text-align: center;
}

.empty-state .icon {
    width: 32px;
    height: 32px;
}

.inline-empty {
    padding: 14px;
    border-radius: 12px;
    background: var(--surface-2);
    color: var(--ink-2);
    font-size: 14px;
}

.notice {
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--waiting-bg);
    color: var(--waiting-ink);
    font-size: 14px;
    font-weight: 600;
}

/* ---------------- Modals ---------------- */

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(12, 12, 12, 0.5);
    opacity: 0;
    transition: opacity 0.18s;
}

.modal-backdrop.show {
    opacity: 1;
}

.modal {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    border-radius: 24px;
    background: #fff;
    box-shadow: var(--shadow-lg);
    outline: none;
    transform: translateY(10px) scale(0.985);
    transition: transform 0.2s;
}

.modal-backdrop.show .modal {
    transform: none;
}

.modal-sm {
    max-width: 440px;
}

.modal-md {
    max-width: 580px;
}

.modal-lg {
    max-width: 880px;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 10px 24px;
    padding-inline: 24px 18px;
}

.modal-head h2 {
    font-size: 20px;
    font-weight: 800;
}

.modal-body {
    flex: 1;
    min-height: 0;
    padding: 4px 24px 20px;
    overflow-y: auto;
}

.modal-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid var(--line);
}

.confirm-text {
    color: var(--ink-2);
    font-size: 15.5px;
}

/* ---------------- Client form ---------------- */

.form-section {
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
    scroll-margin-top: 8px;
}

.form-section:first-child {
    padding-top: 6px;
}

.form-section:last-child {
    border-bottom: 0;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 15.5px;
    font-weight: 800;
}

.section-title .icon {
    width: 19px;
    height: 19px;
}

.linked-row:empty,
.suggestions:empty {
    display: none;
}

.linked-row {
    margin-top: 10px;
}

.linked-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 4px 4px 12px;
    padding-inline: 12px 4px;
    border-radius: 999px;
    background: var(--info-bg);
    color: var(--info-ink);
    font-size: 14px;
    font-weight: 700;
}

.linked-pill .icon {
    width: 16px;
    height: 16px;
}

.linked-pill button {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
    cursor: pointer;
}

.suggestions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
}

.suggest-label {
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 700;
}

.suggest {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    background: var(--surface-2);
    font-size: 14px;
    font-weight: 650;
    cursor: pointer;
}

.suggest .icon {
    width: 16px;
    height: 16px;
}

.suggest bdi {
    color: var(--muted);
}

.suggest:hover {
    border-color: var(--ink);
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 8px;
}

.choice {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-height: 66px;
    padding: 12px 14px;
    padding-inline-end: 42px;
    border: 1.5px solid var(--line-2);
    border-radius: var(--radius);
    background: #fff;
    text-align: start;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
}

.choice:hover {
    border-color: var(--ink);
}

.choice-check {
    position: absolute;
    top: 11px;
    inset-inline-end: 11px;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border: 1.5px solid var(--line-2);
    border-radius: 50%;
    color: transparent;
}

.choice-check .icon {
    width: 14px;
    height: 14px;
    stroke-width: 3;
}

.choice-name {
    font-size: 15px;
    font-weight: 750;
    line-height: 1.25;
}

.choice-price {
    font-size: 13.5px;
    opacity: 0.75;
}

.choice.selected {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
}

.choice.selected .choice-check {
    border-color: #fff;
    background: #fff;
    color: var(--ink);
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.search-field {
    position: relative;
    display: flex;
    flex: 1 1 200px;
    align-items: center;
}

.search-field .icon {
    position: absolute;
    inset-inline-start: 12px;
    width: 18px;
    height: 18px;
    color: var(--muted);
}

.search-field input {
    height: 40px;
    padding-inline-start: 38px;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    background: #fff;
    color: var(--ink-2);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.filter-chip .icon {
    width: 16px;
    height: 16px;
}

.filter-chip.active {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
}

.filter-chip-ghost {
    border-style: dashed;
}

.pick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.pick {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1.5px solid var(--line-2);
    border-radius: 16px;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.pick:hover {
    border-color: #9e9d96;
}

.pick.selected {
    border-color: var(--ink);
    box-shadow: 0 0 0 1.5px var(--ink);
}

.pick-main {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
    padding: 0 0 10px;
    border: 0;
    background: transparent;
    text-align: start;
    cursor: pointer;
}

.pick-img {
    display: grid;
    place-items: center;
    aspect-ratio: 4 / 3;
    width: 100%;
    margin-bottom: 8px;
    overflow: hidden;
    background: var(--surface-3);
    color: var(--muted);
}

.pick-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pick-img .icon {
    width: 28px;
    height: 28px;
}

.pick-name,
.pick-price,
.pick-stock {
    padding: 0 12px;
}

.pick-name {
    display: -webkit-box;
    overflow: hidden;
    font-size: 14px;
    font-weight: 750;
    line-height: 1.25;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.pick-price {
    font-size: 13.5px;
    font-weight: 650;
}

.pick-stock {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.pick-stock.out {
    color: var(--danger-ink);
}

.pick-qty {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 6px;
    background: var(--ink);
    color: #fff;
}

.pick.selected .pick-qty {
    display: flex;
}

.pick-qty button {
    display: grid;
    place-items: center;
    width: 38px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    cursor: pointer;
}

.pick-qty span {
    font-size: 17px;
    font-weight: 800;
}

.foot-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 18px;
    width: 100%;
    color: var(--ink-2);
    font-size: 14px;
    font-weight: 650;
}

.foot-summary b {
    color: var(--ink);
    font-weight: 800;
}

.foot-total {
    margin-inline-start: auto;
    color: var(--ink);
    font-size: 16px;
}

.foot-total b {
    font-size: 22px;
}

.foot-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    width: 100%;
}

/* ---------------- Pay ---------------- */

.pay {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pay-who {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pay-who strong {
    display: block;
    font-size: 17px;
}

.pay-who span:not(.avatar) {
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}

.pay-items {
    margin: 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    list-style: none;
}

.pay-items li {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    font-weight: 650;
}

.pay-items li:last-child {
    border-bottom: 0;
}

.pay-item-icon {
    display: grid;
    place-items: center;
    color: var(--muted);
}

.pay-item-icon .icon {
    width: 18px;
    height: 18px;
}

.pay-edit-row {
    display: flex;
    justify-content: flex-end;
    margin: -10px 0 -6px;
}

.pay-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 16px;
    background: var(--ink);
    color: #fff;
    font-weight: 700;
}

.pay-total strong {
    font-size: 28px;
    font-weight: 800;
}

.pay-change {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 6px;
    color: var(--ink-2);
    font-size: 13.5px;
    font-weight: 700;
}

.pay-change strong {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 46px;
    padding: 0 14px;
    border-radius: 12px;
    background: var(--done-bg);
    color: var(--done-ink);
    font-size: 17px;
}

.pay-change.short strong {
    background: var(--danger-bg);
    color: var(--danger-ink);
    font-size: 15px;
}

.barber-pick {
    display: grid;
    gap: 8px;
}

.barber-pick-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    background: #fff;
    font-size: 16px;
    font-weight: 750;
    text-align: start;
    cursor: pointer;
}

.barber-pick-option:hover {
    border-color: var(--ink);
}

/* ---------------- Dashboard ---------------- */

.kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.kpi {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
}

.kpi-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink-2);
    font-size: 14px;
    font-weight: 700;
}

.kpi-label .icon {
    width: 18px;
    height: 18px;
}

.kpi-value {
    overflow-wrap: anywhere;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.kpi-value .money {
    white-space: normal;
}

.kpi-value .money small {
    font-size: 15px;
}

.kpi-sub {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.kpi-hero {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
}

.kpi-hero .kpi-label,
.kpi-hero .kpi-sub {
    color: rgba(255, 255, 255, 0.68);
}

.kpi-hero .kpi-value {
    font-size: clamp(32px, 3.4vw, 48px);
}

.swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    border-radius: 4px;
}

.swatch-services {
    background: var(--services);
}

.swatch-products {
    background: var(--products);
}

.dash-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.card {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    font-size: 16px;
    font-weight: 800;
}

.card-title .icon {
    width: 19px;
    height: 19px;
}

.card-text {
    margin: -4px 0 14px;
    color: var(--ink-2);
    font-size: 14px;
}

.card-empty {
    padding: 12px 0;
    color: var(--muted);
    font-size: 14px;
}

.card-danger {
    border-color: #f1c6c6;
}

.card-danger .card-title {
    color: var(--danger-ink);
}

.segbar {
    display: flex;
    gap: 2px;
    height: 28px;
    margin-bottom: 12px;
}

.seg {
    display: flex;
    align-items: center;
    min-width: 0;
    padding-inline-start: 8px;
    border-radius: 4px;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}

.seg-services {
    background: var(--services);
}

.seg-products {
    background: var(--products);
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 0;
    padding: 0;
    color: var(--ink-2);
    font-size: 14px;
    font-weight: 600;
    list-style: none;
}

.legend li {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hbars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hbar-row {
    display: grid;
    grid-template-columns: minmax(70px, 120px) minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}

.hbar-name {
    overflow: hidden;
    font-size: 14px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hbar-track {
    height: 16px;
}

.hbar {
    height: 16px;
    background: #3b3a37;
    border-start-end-radius: 4px;
    border-end-end-radius: 4px;
}

.hbar-value {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 14px;
    font-weight: 800;
    text-align: end;
}

.hbar-sub {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.rank-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.rank-list li {
    display: grid;
    grid-template-columns: 22px 40px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.rank-num {
    color: var(--muted);
    font-weight: 800;
    text-align: center;
}

.rank-thumb {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    overflow: hidden;
    border-radius: 12px;
    background: var(--surface-3);
    color: var(--muted);
}

.rank-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rank-thumb .icon {
    width: 18px;
    height: 18px;
}

.rank-name {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: 14px;
    font-weight: 700;
}

.rank-name small {
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 600;
}

.rank-value {
    font-size: 14px;
    font-weight: 800;
}

/* ---------------- History ---------------- */

.print-header {
    display: none;
}

.hcol-totals {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.hcol-totals div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    padding: 10px 12px;
    border-radius: 14px;
    background: #fff;
}

.hcol-totals div:first-child {
    background: var(--ink);
    color: #fff;
}

.hcol-totals span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.hcol-totals div:first-child span {
    color: rgba(255, 255, 255, 0.68);
}

.hcol-totals strong {
    overflow-wrap: anywhere;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
}

.hcol-totals .money {
    white-space: normal;
}

.hlist {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hrow {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.hrow-when {
    display: flex;
    flex-direction: column;
    min-width: 58px;
    color: var(--ink-2);
    font-size: 12.5px;
    font-weight: 700;
}

.hrow-when small {
    color: var(--muted);
    font-weight: 600;
}

.hrow-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.hrow-main strong {
    font-size: 14.5px;
}

.hrow-phone {
    color: var(--muted);
    font-size: 12.5px;
}

.hrow-items {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    color: var(--ink-2);
    font-size: 12.5px;
}

.hrow-items .icon {
    width: 14px;
    height: 14px;
    margin-top: 2px;
}

.hrow-products .icon {
    color: var(--products);
}

.hrow-amount {
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
}

/* ---------------- Catalog ---------------- */

.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.service-card,
.product-card {
    position: relative;
    border: 1px solid var(--line);
    background: #fff;
    text-align: start;
    cursor: pointer;
    transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}

.service-card:hover,
.product-card:hover {
    border-color: var(--line-2);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.service-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 18px;
    border-radius: 20px;
}

.service-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 8px;
    border-radius: 14px;
    background: var(--ink);
    color: #fff;
}

.service-name {
    font-size: 16px;
    font-weight: 800;
}

.service-price {
    font-size: 18px;
    font-weight: 800;
}

.service-duration,
.product-category {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.service-duration .icon,
.product-category .icon {
    width: 14px;
    height: 14px;
}

.card-edit {
    position: absolute;
    top: 14px;
    inset-inline-end: 14px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--muted);
}

.card-edit .icon {
    width: 16px;
    height: 16px;
}

.catalog-filters {
    margin-bottom: 14px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px;
}

.product-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    border-radius: 20px;
}

.product-photo {
    display: grid;
    place-items: center;
    aspect-ratio: 1 / 1;
    width: 100%;
    overflow: hidden;
    background: var(--surface-3);
    color: var(--muted);
}

.product-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-photo.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.product-photo.empty .icon {
    width: 36px;
    height: 36px;
}

.product-photo small {
    font-size: 12px;
    font-weight: 700;
}

.product-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px 14px;
}

.product-name {
    font-size: 15px;
    font-weight: 800;
    line-height: 1.25;
}

.product-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.product-price {
    font-weight: 800;
}

.stock-badge {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--done-bg);
    color: var(--done-ink);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.stock-badge.low {
    background: var(--waiting-bg);
    color: var(--waiting-ink);
}

.stock-badge.out {
    background: var(--danger-bg);
    color: var(--danger-ink);
}

.product-form {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 20px;
    padding-top: 6px;
}

.photo-picker {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.photo-drop {
    display: grid;
    place-items: center;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: 2px dashed var(--line-2);
    border-radius: 18px;
    background: var(--surface-2);
    cursor: pointer;
}

.photo-drop:hover {
    border-color: var(--ink);
}

.photo-drop.has-photo {
    border-style: solid;
    border-color: var(--line);
}

.photo-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 100%;
    padding: 10px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.photo-preview .icon {
    width: 34px;
    height: 34px;
}

.has-photo .photo-preview {
    padding: 0;
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

.category-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px;
    padding-inline-start: 14px;
    border-radius: 12px;
    background: var(--surface-2);
    font-weight: 700;
}

.category-list li.muted {
    padding: 12px 14px;
    font-weight: 600;
}

.category-list span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-list span .icon {
    width: 16px;
    height: 16px;
    color: var(--muted);
}

/* ---------------- Barbers ---------------- */

.add-barber {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.add-barber-text .card-title {
    margin-bottom: 4px;
}

.add-barber-text p {
    color: var(--ink-2);
    font-size: 14px;
}

.add-barber .inline-form {
    flex: 1 1 340px;
    max-width: 500px;
}

.barber-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 14px;
}

.barber-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
}

.barber-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.barber-card-head h3 {
    font-size: 18px;
    font-weight: 800;
}

.barber-card-head .muted {
    font-size: 13px;
    font-weight: 600;
}

.barber-card-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.barber-card-stats div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    padding: 8px 12px;
    border-radius: 12px;
    background: var(--surface-2);
}

.barber-card-stats div:last-child {
    grid-column: 1 / -1;
    flex-direction: row-reverse;
    align-items: baseline;
    justify-content: space-between;
    background: var(--ink);
    color: #fff;
}

.barber-card-stats strong {
    font-size: 17px;
    font-weight: 800;
}

.barber-card-stats div > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.barber-card-stats div:last-child > span {
    color: rgba(255, 255, 255, 0.7);
}

.barber-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

/* ---------------- Settings ---------------- */

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 14px;
}

.language-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.language-option {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 14px;
    border: 1.5px solid var(--line-2);
    border-radius: 16px;
    background: #fff;
    text-align: start;
    cursor: pointer;
}

.language-option strong {
    font-size: 17px;
}

.language-option span {
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 600;
}

.language-option.active {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
}

.language-option.active span {
    color: rgba(255, 255, 255, 0.7);
}

.language-check {
    position: absolute;
    top: 10px;
    inset-inline-end: 10px;
    width: 18px;
    height: 18px;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ---------------- Toasts & status ---------------- */

.toast-root {
    position: fixed;
    inset-inline: 0;
    bottom: 24px;
    z-index: 80;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 560px;
    padding: 12px 18px;
    border-radius: 14px;
    background: var(--ink);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s, transform 0.2s;
    /* Messages never block a tap on the button under them. */
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: none;
}

.toast-success .icon {
    color: #4ade80;
}

.toast-error {
    background: var(--danger-ink);
}

#offline-status {
    position: fixed;
    bottom: 12px;
    inset-inline-end: 12px;
    z-index: 40;
    padding: 5px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink-2);
    font-size: 12px;
    font-weight: 700;
    pointer-events: none;
}

#offline-status[data-state="checking"] {
    display: none;
}

#offline-status[data-state="offline"] {
    border-color: #f1d9a0;
    background: var(--waiting-bg);
    color: var(--waiting-ink);
}

body[data-signed-in] #offline-status[data-key="net.onlineReady"],
body[data-signed-in] #offline-status[data-key="net.serverOnline"],
body[data-signed-in] #offline-status[data-state="error"] {
    display: none;
}

/* ---------------- Signed-in user, barber columns ---------------- */

.nav-user {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin-top: auto;
    padding: 8px 2px 2px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 11.5px;
    font-weight: 700;
    text-align: center;
}

.nav-user + .nav-signout {
    margin-top: 0;
}

.nav-user-name {
    overflow: hidden;
    max-width: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 14px;
}

.nav-user .avatar {
    background: #fff;
    color: var(--ink);
}

.nav-user .avatar .icon {
    width: 16px;
    height: 16px;
}

.col-mine {
    box-shadow: inset 0 0 0 2px var(--ink);
}

.tag-mine {
    background: var(--ink);
    color: #fff;
}

.badge-online {
    margin-inline-end: auto;
    background: var(--info-bg);
    color: var(--info-ink);
}

.ticket.is-active .badge-online {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.upcoming-pill {
    border-color: #bcd3ee;
    background: var(--info-bg);
    color: var(--info-ink);
}

.upcoming-pill:hover:not(:disabled) {
    background: #dbe9f9;
}

/* ---------------- Password for finished clients ---------------- */

.hrow-amount {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.hrow-edit {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 30px;
    margin-top: 4px;
    padding: 0 10px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    background: #fff;
    color: var(--ink-2);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
}

.hrow-edit .icon {
    width: 14px;
    height: 14px;
}

.hrow-edit:hover:not(:disabled) {
    border-color: var(--ink);
    color: var(--ink);
}

.hrow-edit:disabled {
    opacity: 0.5;
}

.unlock-pill {
    gap: 6px;
    border-color: #b7e0b7;
    background: var(--done-bg);
    color: var(--done-ink);
}

.unlock-pill b {
    padding: 2px 8px;
    border-radius: 999px;
    background: #fff;
    font-size: 12px;
}

.lock-hero {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--surface-2);
    color: var(--ink-2);
    font-size: 14px;
    font-weight: 600;
}

.lock-hero p {
    margin: 0;
}

.lock-hero .icon {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    color: var(--ink);
}

.field-error {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    color: var(--danger-ink);
    font-size: 13.5px;
    font-weight: 700;
}

.field-error .icon {
    width: 16px;
    height: 16px;
}

.field-hint {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.shake {
    border-color: var(--danger) !important;
    animation: shake 0.35s ease;
}

.notice-unlocked {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 4px 0 0;
    background: var(--done-bg);
    color: var(--done-ink);
}

.notice-unlocked .icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 1px;
}

/* ---------------- Barber sign-ins ---------------- */

.barber-account {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px 10px;
    padding: 10px 12px;
    border: 1px dashed var(--line-2);
    border-radius: 14px;
}

.barber-account.has-account {
    border-style: solid;
    background: var(--surface-2);
}

.barber-account-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--surface-3);
    color: var(--muted);
}

.barber-account.has-account .barber-account-icon {
    background: var(--ink);
    color: #fff;
}

.barber-account-icon .icon {
    width: 17px;
    height: 17px;
}

.barber-account-text {
    display: flex;
    flex: 1 1 150px;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.barber-account-text strong {
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
}

.barber-account-text span {
    overflow: hidden;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------------- Online booking settings ---------------- */

.card-wide {
    grid-column: 1 / -1;
}

.booking-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    margin-bottom: 6px;
}

.booking-head .card-title {
    margin-bottom: 0;
}

.booking-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 100%;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--surface-3);
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 700;
}

.booking-status .status-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    background: var(--muted);
}

.booking-status[data-state="ok"] {
    background: var(--done-bg);
    color: var(--done-ink);
}

.booking-status[data-state="ok"] .status-dot {
    background: var(--done);
}

.booking-status[data-state="error"] {
    background: var(--danger-bg);
    color: var(--danger-ink);
}

.booking-status[data-state="error"] .status-dot {
    background: var(--danger);
}

.booking-status[data-state="waiting"],
.booking-status[data-state="offline"] {
    background: var(--waiting-bg);
    color: var(--waiting-ink);
}

.booking-status[data-state="waiting"] .status-dot,
.booking-status[data-state="offline"] .status-dot {
    background: var(--waiting);
}

.switch-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--line-2);
    border-radius: 14px;
    cursor: pointer;
}

.switch-row input,
.day-check input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    border: 0;
    opacity: 0;
}

.switch {
    position: relative;
    flex-shrink: 0;
    width: 46px;
    height: 28px;
    border-radius: 999px;
    background: var(--line-2);
    transition: background-color 0.15s;
}

.switch::after {
    content: '';
    position: absolute;
    top: 3px;
    inset-inline-start: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s;
}

.switch-row input:checked + .switch {
    background: var(--done);
}

.switch-row input:checked + .switch::after {
    transform: translateX(18px);
}

[dir="rtl"] .switch-row input:checked + .switch::after {
    transform: translateX(-18px);
}

.switch-row input:focus-visible + .switch,
.day-check input:focus-visible + span {
    box-shadow: 0 0 0 3px rgba(11, 11, 11, 0.2);
}

.switch-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.switch-text strong {
    color: var(--ink);
    font-size: 15px;
}

.switch-text small {
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 500;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.day-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.day-check {
    position: relative;
}

.day-check span {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border: 1.5px solid var(--line-2);
    border-radius: 999px;
    background: #fff;
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.day-check input:checked + span {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
    text-decoration: line-through;
}

.booking-count {
    align-self: center;
    margin-inline-start: auto;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

/* ---------------- Barber photos and the booking website card ---------------- */

.avatar-photo {
    overflow: hidden;
    background: var(--surface-3);
}

.avatar-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-xl {
    width: 76px;
    height: 76px;
    font-size: 28px;
}

.barber-card-head {
    align-items: flex-start;
}

.barber-card-name {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.barber-photo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.photo-pick {
    cursor: pointer;
}

.site-link {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    gap: 8px;
    margin: 4px 0 14px;
    padding: 10px 14px;
    border: 1px solid var(--line-2);
    border-radius: 12px;
    background: var(--surface-2);
    color: var(--ink);
    font-size: 15px;
    font-weight: 800;
    text-decoration: none;
}

.site-link .icon {
    width: 18px;
    height: 18px;
}

.site-link:hover {
    border-color: var(--ink);
}

.site-card .card-text {
    margin-bottom: 8px;
}

#offline-status[data-key="net.serverOnline"] {
    background: var(--done-bg);
    color: var(--done-ink);
}

/* ---------------- Responsive ---------------- */

@media (max-width: 1180px) {
    .kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 960px) {
    .dash-grid,
    .settings-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .topbar-title p {
        display: none;
    }
}

@media (max-width: 760px) {
    :root {
        --nav-width: 0px;
    }

    .app-shell {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr) auto;
    }

    .main {
        grid-row: 1;
    }

    .nav {
        grid-row: 2;
        flex-direction: row;
        gap: 0;
        padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
        overflow: visible;
    }

    .nav-brand,
    .nav-signout {
        display: none;
    }

    .nav-links {
        flex-direction: row;
        gap: 2px;
    }

    .nav-link {
        flex: 1;
        min-width: 0;
        gap: 3px;
        padding: 6px 2px;
        border-radius: 12px;
        font-size: 10.5px;
    }

    .nav-link span {
        overflow: hidden;
        max-width: 100%;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .nav-link .icon {
        width: 21px;
        height: 21px;
    }

    .topbar {
        gap: 10px;
        padding: max(14px, env(safe-area-inset-top)) 14px 10px;
    }

    .topbar-title h1 {
        font-size: 21px;
    }

    .page {
        padding: 0 12px 12px;
    }

    .lang-full {
        display: none;
    }

    .lang-short {
        display: inline;
    }

    .col {
        flex: 0 0 86%;
        max-width: none;
    }

    .day-stat-money {
        margin-inline-start: 0;
    }

    .toast-root {
        bottom: calc(84px + env(safe-area-inset-bottom));
    }

    #offline-status {
        bottom: calc(80px + env(safe-area-inset-bottom));
    }

    .modal-backdrop {
        align-items: flex-end;
        padding: 0;
    }

    .modal {
        max-height: 94vh;
        max-height: 94dvh;
        border-radius: 24px 24px 0 0;
    }

    .modal-foot {
        padding-bottom: calc(14px + env(safe-area-inset-bottom));
    }

    .modal-body {
        padding: 4px 18px 18px;
    }

    .modal-head {
        padding-inline: 18px 12px;
    }

    .product-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .photo-picker {
        max-width: 220px;
    }
}

@media (max-width: 600px) {
    .grid-2,
    .grid-3 {
        grid-template-columns: minmax(0, 1fr);
    }

    .kpis {
        grid-template-columns: minmax(0, 1fr);
    }

    .language-options {
        grid-template-columns: minmax(0, 1fr);
    }

    .foot-buttons .btn {
        flex: 1 1 auto;
    }

    .foot-buttons .spacer {
        display: none;
    }

    .inline-form {
        flex-direction: column;
    }

    .hbar-row {
        grid-template-columns: minmax(60px, 90px) minmax(0, 1fr) auto;
        gap: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* ---------------- Print (History) ---------------- */

@media print {
    @page {
        margin: 12mm;
    }

    body {
        overflow: visible;
        background: #fff;
    }

    .nav,
    .topbar,
    #offline-status,
    .toast-root,
    #modal-root,
    .col-ghost,
    .btn-add-client,
    .ticket-actions {
        display: none !important;
    }

    .app-shell,
    .main,
    .page,
    .board,
    .col,
    .col-body {
        display: block !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .print-header {
        display: flex !important;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 6mm;
        padding-bottom: 3mm;
        border-bottom: 2px solid #000;
        font-size: 14px;
    }

    .day-stat,
    .day-stat-money,
    .hcol-totals div,
    .hcol-totals div:first-child {
        border: 1px solid #999 !important;
        background: #fff !important;
        color: #000 !important;
    }

    .day-stat-money strong,
    .hcol-totals div:first-child span {
        color: #000 !important;
    }

    .col {
        max-width: none !important;
        margin-bottom: 6mm;
        padding: 0 !important;
        border: 0 !important;
        background: #fff !important;
        break-inside: avoid-page;
    }

    .col-head {
        margin-bottom: 3mm;
    }

    .hcol-totals {
        margin-bottom: 3mm;
    }

    .hrow {
        border: 0;
        border-bottom: 1px solid #ddd;
        border-radius: 0;
        break-inside: avoid;
    }
}

/* ---------------- Accounts & booking: small screens and print ---------------- */

@media (max-width: 960px) {
    .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .nav-user {
        display: none;
    }

    /* Barbers have no Settings page, so they keep Sign out in the bottom bar. */
    body[data-role="barber"] .nav-links {
        flex: 2;
    }

    body[data-role="barber"] .nav-signout {
        display: flex;
        flex: 1;
        margin-top: 0;
    }

    .booking-count {
        width: 100%;
        margin-inline-start: 0;
    }
}

@media print {
    .hrow-edit,
    .unlock-pill,
    .upcoming-pill {
        display: none !important;
    }
}

/* ---------------- Cashier: time slots ---------------- */

.slot-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin: -4px 0 12px;
    padding: 6px 6px 6px 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
}

.slot-bar-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--ink-2);
    font-size: 14px;
    font-weight: 700;
}

.slot-bar-label .icon {
    width: 18px;
    height: 18px;
}

.slot-bar-label strong {
    color: var(--ink);
    font-weight: 800;
}

.slot-bar-hours {
    color: var(--ink-2);
    font-size: 13.5px;
    font-weight: 700;
}

.slot-past-toggle[aria-pressed="true"] {
    background: var(--surface-3);
    color: var(--ink);
}

.notice-slim {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: -4px 0 12px;
    padding: 8px 14px;
}

.notice-slim .icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.col-body {
    position: relative;
    gap: 8px;
}

.col-stats .stat-free {
    box-shadow: inset 0 3px 0 var(--line-2);
}

.col-stats .stat-waiting {
    box-shadow: inset 0 3px 0 var(--waiting);
}

.col-stats .stat-done {
    box-shadow: inset 0 3px 0 var(--done);
}

/* "At work" / "Not at work" under the barber's name. */
.col-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.col-tags .tag {
    align-self: center;
}

/* Open / Closed for website bookings */
.online-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 26px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.online-pill svg.icon {
    width: 13px;
    height: 13px;
}

button.online-pill {
    cursor: pointer;
}

button.online-pill:hover {
    border-color: currentColor;
}

.online-pill.is-on {
    background: #111;
    color: #fff;
}

.online-pill.is-off {
    border-color: var(--line-2);
    background: #fff;
    color: var(--ink-2);
    text-decoration: line-through;
}

.my-online {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    padding: 14px 16px;
    border: 1px solid var(--line-2);
    border-radius: 16px;
    background: #fff;
}

.my-online.is-on {
    border-color: #b7e0b7;
    background: var(--done-bg);
}

.my-online-dot {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    border-radius: 50%;
    box-shadow: inset 0 0 0 2px var(--ink-2);
}

.my-online.is-on .my-online-dot {
    background: var(--done-ink);
    box-shadow: 0 0 0 5px rgba(46, 125, 50, 0.18);
}

.my-online-text {
    display: grid;
    flex: 1;
    gap: 2px;
}

.my-online-text span {
    color: var(--ink-2);
    font-size: 13.5px;
}

@media (max-width: 620px) {
    .my-online {
        flex-wrap: wrap;
    }

    .my-online .btn {
        width: 100%;
    }
}

.work-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 26px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

button.work-pill {
    cursor: pointer;
}

.work-pill.is-on {
    border-color: #b7e0b7;
    background: var(--done-bg);
    color: var(--done-ink);
}

.work-pill.is-off {
    border-color: var(--line-2);
    background: #fff;
    color: var(--ink-2);
}

button.work-pill:hover {
    border-color: currentColor;
}

.work-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.work-pill.is-off .work-dot {
    background: transparent;
    box-shadow: inset 0 0 0 1.5px currentColor;
}

.col-off {
    background: #e2e1dc;
}

.col-off .col-head .avatar {
    background: #8d8c86;
}

.col-off-note {
    display: flex;
    flex-shrink: 0;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    padding: 12px;
    border: 1.5px dashed #c4c3bb;
    border-radius: 14px;
    color: var(--ink-2);
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.4;
}

.col-off-note .icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Each barber's own time between clients, at the top of their column. */
.col-slot {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 6px;
    padding: 4px 4px 4px 10px;
    border-radius: 12px;
    background: #fff;
}

.col-days select {
    flex: 1;
    min-width: 0;
    height: 34px;
    padding: 0 8px;
    border: 1px solid var(--line-2);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
}

.col-days {
    margin-top: 6px;
}

.col-slot-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.col-slot-label .icon,
.col-slot-readonly .icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.col-slot-presets {
    padding: 3px;
}

.col-slot-presets button {
    height: 30px;
    padding: 0 9px;
    font-size: 13.5px;
}

.col-slot-custom {
    display: inline-flex;
    flex: 1;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    min-width: 0;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 700;
}

.col-slot-custom input {
    width: 52px;
    height: 32px;
    padding: 0 6px;
    border-radius: 8px;
    font-size: 14.5px;
    font-weight: 700;
    text-align: center;
}

.col-slot-custom.active input {
    border-color: var(--ink);
    box-shadow: inset 0 0 0 1px var(--ink);
}

.col-slot-readonly {
    gap: 6px;
    padding: 8px 10px;
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 700;
}

/* "Add slot": a free time at any hour, for the barber of this column. */
.btn-add-slot {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    height: 40px;
    border: 1.5px dashed #bdbcb4;
    border-radius: 12px;
    background: transparent;
    color: var(--ink);
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
}

.btn-add-slot .icon {
    width: 17px;
    height: 17px;
}

.btn-add-slot:hover {
    border-style: solid;
    border-color: var(--ink);
    background: #fff;
}

.add-slot-panel {
    display: flex;
    flex-shrink: 0;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    border: 2px solid var(--ink);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.12);
}

.add-slot-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.add-slot-head strong {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14.5px;
    font-weight: 800;
}

.add-slot-head strong .icon {
    width: 17px;
    height: 17px;
}

.add-slot-group {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.time-chips {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: 6px;
}

.time-chip {
    height: 40px;
    padding: 0 6px;
    border: 1.5px solid var(--line-2);
    border-radius: 11px;
    background: #fff;
    color: var(--ink);
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}

.time-chip:hover:not(:disabled),
.time-chip:focus-visible {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
}

.add-slot-other {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 700;
}

.add-slot-other span {
    white-space: nowrap;
}

.add-slot-other select {
    height: 40px;
    font-size: 15px;
}

/* A slot added by hand, with a button to take it away. */
.slot-row {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 4px;
}

.slot-row .slot {
    flex: 1;
    min-width: 0;
}

.slot-remove {
    color: var(--muted);
}

.slot-remove:hover:not(:disabled) {
    background: var(--danger-bg);
    color: var(--danger-ink);
}

.slot-extra-tag {
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--info-bg);
    color: var(--info-ink);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

/* Settings: each barber's own time between clients. */
.barber-times {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.barber-time {
    display: grid;
    grid-template-columns: auto minmax(80px, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-2);
}

.barber-time strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.barber-time .hours-minutes {
    width: 110px;
    flex: none;
}

@media (max-width: 600px) {
    .barber-time {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .barber-time .hours-slot {
        grid-column: 1 / -1;
    }
}

/* A free time: tap it to add a client there. */
.slot {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 46px;
    padding: 6px 8px 6px 12px;
    border: 1.5px dashed #cbcac2;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.55);
    color: var(--ink);
    font-family: inherit;
    text-align: start;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
}

button.slot:hover:not(:disabled) {
    border-style: solid;
    border-color: var(--ink);
    background: #fff;
}

.slot-time {
    min-width: 66px;
    font-size: 14.5px;
    font-weight: 800;
    white-space: nowrap;
}

.slot-free {
    flex: 1;
    min-width: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.slot-plus {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 32px;
    padding: 0 10px;
    border-radius: 10px;
    background: var(--surface-3);
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
    transition: background-color 0.15s, color 0.15s;
}

button.slot:hover:not(:disabled) .slot-plus,
button.slot:focus-visible .slot-plus {
    background: var(--ink);
    color: #fff;
}

.slot-plus .icon {
    width: 16px;
    height: 16px;
}

.slot.is-past {
    opacity: 0.6;
}

.slot-readonly {
    cursor: default;
}

/* The small form inside a slot (no pop-up). */
.slot-form {
    display: flex;
    flex-shrink: 0;
    flex-direction: column;
    gap: 8px;
    padding: 10px 10px 12px;
    border: 2px solid var(--ink);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.12);
}

.slot-form-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-inline-start: 2px;
}

.slot-form-head strong {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    font-weight: 800;
}

.slot-form input,
.slot-form select {
    height: 44px;
    font-size: 16px;
}

.slot-form-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 2px;
}

.slot-form-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 700;
}

.slot-form-label .icon {
    width: 16px;
    height: 16px;
}

.slot-form-hint {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
}

.slot-form-hint .icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}

.slot-form-move .field {
    font-size: 12.5px;
}

.slot-form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.slot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.slot-suggestions:empty {
    display: none;
}

.svc-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.svc-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 4px 12px;
    border: 1.5px solid var(--line-2);
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.svc-chip small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.svc-chip.selected {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
}

.svc-chip.selected small {
    color: rgba(255, 255, 255, 0.7);
}

.money-input {
    position: relative;
    display: flex;
    align-items: center;
}

.money-input input {
    padding-inline-end: 52px;
}

.money-input > span {
    position: absolute;
    inset-inline-end: 12px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    pointer-events: none;
}

.btn-icon-sm {
    width: 32px;
    height: 32px;
    border-radius: 9px;
}

.btn-icon-sm .icon {
    width: 17px;
    height: 17px;
}

/* Client cards in the slots */
.ticket-clock {
    font-size: 15px;
    font-weight: 800;
    white-space: nowrap;
}

.ticket-clock-none {
    color: var(--muted);
    font-size: 13px;
}

.ticket-top {
    justify-content: flex-start;
}

.ticket-top .ticket-edit {
    margin-inline-start: auto;
}

.ticket-top .badge-online {
    margin-inline-end: 0;
}

.is-active .ticket-clock {
    color: #fff;
}

.ticket-money {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.money-tag {
    align-self: flex-start;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--info-bg);
    color: var(--info-ink);
    font-size: 11px;
    font-weight: 800;
}

.is-active .money-tag {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.ticket-actions .btn-sm {
    padding: 0 10px;
}

.btn-done {
    min-width: 84px;
}

.ticket-compact {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 8px 6px 8px 12px;
    border: 1px solid #cfe9cf;
    border-inline-start: 4px solid var(--done);
    background: #f4fbf4;
}

.ticket-compact .ticket-clock {
    min-width: 66px;
    color: var(--done-ink);
    font-size: 14px;
}

.ticket-compact-main {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.ticket-compact-main strong,
.ticket-compact-main span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ticket-compact-main strong {
    font-size: 14.5px;
    font-weight: 800;
}

.ticket-compact-main span {
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 600;
}

.ticket-compact-end {
    display: flex;
    align-items: center;
    gap: 2px;
}

.ticket-compact-money {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--done-ink);
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
}

.ticket-compact-money .icon {
    width: 16px;
    height: 16px;
    stroke-width: 3;
}

/* Done: "Are you sure?" */
.done-question {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--waiting-bg);
    color: var(--waiting-ink);
    font-size: 14px;
    font-weight: 700;
}

.done-question .icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.finished-money {
    margin-top: 12px;
}

/* ---------------- History: delete and product sales ---------------- */

.hrow-buttons {
    display: inline-flex;
    gap: 4px;
}

.hrow-delete {
    padding: 0 8px;
    color: var(--danger-ink);
}

.hrow-delete:hover:not(:disabled) {
    border-color: var(--danger);
    background: var(--danger-bg);
    color: var(--danger-ink);
}

.avatar-products {
    background: var(--products);
}

.hcol-sales {
    background: #f6ece6;
}

/* ---------------- Product cashier ---------------- */

.sell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
    align-items: start;
    gap: 18px;
}

.sell-main {
    min-width: 0;
}

.sell-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.sell-side {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sell-cart {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sell-cart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sell-cart-head .card-title {
    margin: 0;
}

.sell-lines {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sell-lines li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
        "thumb name total"
        "thumb qty qty";
    align-items: center;
    gap: 4px 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

.sell-lines .rank-thumb {
    grid-area: thumb;
}

.sell-line-name {
    grid-area: name;
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: 14.5px;
    font-weight: 750;
}

.sell-line-name small {
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 600;
}

.sell-warn {
    color: var(--danger-ink);
    font-weight: 800;
}

.sell-line-total {
    grid-area: total;
    font-size: 14.5px;
    font-weight: 800;
    white-space: nowrap;
}

.sell-qty {
    grid-area: qty;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sell-qty button {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--line-2);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
}

.sell-qty button .icon {
    width: 16px;
    height: 16px;
}

.sell-qty b {
    min-width: 24px;
    font-size: 15px;
    text-align: center;
}

.sell-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.sell-empty .icon {
    width: 26px;
    height: 26px;
}

.sell-cart .pay-total {
    margin: 0;
}

.sell-stats {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 6px;
    margin-bottom: 12px;
}

.sell-stats div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    border-radius: 12px;
    background: var(--surface-2);
}

.sell-stats span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.sell-stats strong {
    font-size: 16px;
    font-weight: 800;
}

.sell-stats .sell-stat-money {
    background: var(--ink);
}

.sell-stats .sell-stat-money span {
    color: rgba(255, 255, 255, 0.7);
}

.sell-stats .sell-stat-money strong {
    color: #fff;
}

.sell-subtitle {
    margin: 14px 0 6px;
    color: var(--ink-2);
    font-size: 13.5px;
    font-weight: 800;
}

.sale-list {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sale-list li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid var(--line);
    font-size: 13.5px;
}

.sale-list li:last-child {
    border-bottom: 0;
}

.sale-time {
    color: var(--ink-2);
    font-weight: 700;
    white-space: nowrap;
}

.sale-items {
    overflow: hidden;
    color: var(--ink-2);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sale-money {
    font-weight: 800;
    white-space: nowrap;
}

.sale-delete {
    color: var(--danger-ink);
}

.sell-bar {
    display: none;
}

/* ---------------- Settings: working hours ---------------- */

.hours-slot {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hours-slot .segmented button {
    height: 38px;
    padding: 0 12px;
}

.hours-minutes {
    flex: 1;
    min-width: 96px;
}

.booking-hours-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    align-self: end;
    margin: 0 0 12px;
}

.booking-hours-hint .icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

@media (max-width: 900px) {
    .sell {
        grid-template-columns: minmax(0, 1fr);
    }

    .sell-side {
        position: static;
    }

    .sell-bar {
        position: sticky;
        bottom: 0;
        z-index: 5;
        display: flex;
        align-items: center;
        gap: 10px;
        margin: 0 -4px;
        padding: 10px 12px;
        border-radius: 16px;
        background: var(--ink);
        color: #fff;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    }

    .sell-bar-count {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        color: rgba(255, 255, 255, 0.75);
        font-size: 14px;
        font-weight: 700;
    }

    .sell-bar-count .icon {
        width: 18px;
        height: 18px;
    }

    .sell-bar-total {
        flex: 1;
        font-size: 17px;
        font-weight: 800;
    }

    .sell-bar .btn-primary {
        background: #fff;
        color: var(--ink);
    }
}

@media (max-width: 600px) {
    .slot-bar {
        gap: 6px;
        margin-bottom: 10px;
        padding: 6px 8px;
    }

    .slot-bar .spacer {
        display: none;
    }

    .hours-slot {
        flex-wrap: wrap;
    }

    .sell-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media print {
    .slot-bar,
    .notice-slim,
    .slot,
    .slot-form,
    .hrow-delete,
    .sale-delete,
    .sell-bar {
        display: none !important;
    }
}
