:root {
    --sage: #95a65f;
    --olive: #6f7f3e;
    --moss: #3f512e;
    --forest: #09231c;
    --graphite: #171b1b;
    --stone: #d8d8cf;
    --stone-soft: #eeede6;
    --warm-white: #fbfaf5;
    --brass: #b89a52;
    --clay: #87422e;
    --aqua: var(--sage);
    --aqua-dark: var(--moss);
    --jeans: #677372;
    --blue: #1d2b31;
    --brown: var(--clay);
    --cream: #efe4bb;
    --black: var(--graphite);
    --beige: var(--brass);
    --bg: #eeeee7;
    --surface: var(--warm-white);
    --surface-soft: var(--stone-soft);
    --text: var(--black);
    --muted: #5f675f;
    --line: #d0d2c8;
    --primary: var(--aqua);
    --primary-dark: var(--aqua-dark);
    --accent: var(--beige);
    --danger: var(--brown);
    --success: #355f35;
    --warning: var(--beige);
    --shadow: 0 18px 45px rgba(17, 27, 24, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(149, 166, 95, 0.16), transparent 34%),
        linear-gradient(145deg, #f4f3ec 0%, var(--bg) 48%, #e4e3dc 100%);
    color: var(--text);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    line-height: 1.5;
}

.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 1000;
    padding: 10px 14px;
    border-radius: 6px;
    background: var(--graphite);
    color: #fff;
    font-weight: 800;
    text-decoration: none;
    transform: translateY(-150%);
}

.skip-link:focus {
    transform: translateY(0);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid rgba(184, 154, 82, 0.52);
    outline-offset: 2px;
}

form.was-validated :where(input, select, textarea):invalid,
:where(input, select, textarea)[aria-invalid="true"] {
    border-color: var(--danger);
    box-shadow: 0 0 0 2px rgba(135, 66, 46, 0.13);
}

form.was-validated :where(input, select, textarea):valid:not([type="checkbox"]):not([type="radio"]),
:where(input, select, textarea)[aria-invalid="false"]:not([type="checkbox"]):not([type="radio"]) {
    border-color: var(--success);
}

a {
    color: inherit;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 18px;
    align-items: center;
    padding: 14px 28px;
    background: rgba(251, 250, 245, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    text-decoration: none;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 7px;
    background: var(--forest);
    color: white;
    font-size: 0.75rem;
    font-weight: 900;
}

.brand-name {
    max-width: 180px;
    overflow: hidden;
    color: var(--text);
    font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
    font-size: 0.92rem;
    font-weight: 750;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav {
    display: flex;
    gap: 6px;
    justify-content: center;
    overflow-x: auto;
}

.nav-toggle {
    display: none;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--text);
    font: inherit;
    font-weight: 800;
}

.nav a {
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--muted);
    font-weight: 650;
    text-decoration: none;
    white-space: nowrap;
}

.nav a:hover {
    background: var(--surface-soft);
    color: var(--text);
}

.logout-form {
    margin: 0;
}

.app-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0 56px;
}

.auth-shell {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
}

.auth-card,
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.auth-card {
    width: min(460px, 100%);
    padding: 34px;
}

.auth-card-wide {
    width: min(760px, 100%);
}

.page-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.row-header {
    align-items: center;
}

.page-header h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.1rem);
    line-height: 1.05;
}

.auth-head {
    display: grid;
    gap: 5px;
    margin-bottom: 18px;
}

.auth-product-name {
    margin: 0;
    color: var(--text);
    font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
    font-size: clamp(1.18rem, 2vw, 1.45rem);
    font-weight: 750;
    line-height: 1.12;
}

.auth-card h1 {
    max-width: 100%;
    margin: 0;
    color: var(--muted);
    font-family: "Segoe UI", Inter, Arial, sans-serif;
    font-size: clamp(1.55rem, 2.8vw, 2.05rem);
    font-weight: 760;
    line-height: 1.12;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.section-heading h2,
.service-card h2 {
    margin: 0;
    font-size: 1.1rem;
}

.header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.muted {
    margin: 8px 0 0;
    color: var(--muted);
}

.flash-stack {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.flash {
    padding: 12px 14px;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    font-weight: 650;
}

.flash-success {
    color: var(--success);
}

.flash-danger {
    color: var(--danger);
}

.flash-warning {
    color: var(--warning);
}

.flash-info {
    color: var(--primary);
}

.scheduler-toast {
    position: fixed;
    top: calc(18px + env(safe-area-inset-top));
    right: 18px;
    z-index: 3000;
    max-width: min(360px, calc(100% - 36px));
    padding: 13px 16px;
    border: 1px solid rgba(53, 95, 53, 0.24);
    border-radius: 8px;
    background: #f8fff6;
    box-shadow: 0 18px 42px rgba(17, 27, 24, 0.18);
    color: var(--success);
    font-weight: 850;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.scheduler-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.metric-grid,
.quick-actions,
.card-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 24px;
}

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

.metric-card {
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.metric-card span {
    display: block;
    color: var(--muted);
    font-weight: 700;
}

.metric-card strong {
    display: block;
    margin-top: 10px;
    font-size: 2rem;
    line-height: 1.1;
}

.quick-actions {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.action-button {
    display: grid;
    min-height: 74px;
    place-items: center;
    padding: 16px;
    border-radius: 8px;
    background: var(--primary);
    color: white;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
}

.action-button:hover {
    background: var(--primary-dark);
}

.panel {
    padding: 22px;
}

.form-grid {
    display: grid;
    gap: 18px;
}

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

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

.span-two {
    grid-column: 1 / -1;
}

label {
    display: grid;
    gap: 7px;
    color: var(--text);
    font-weight: 750;
}

.field-hint {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffef9;
    color: var(--text);
    font: inherit;
    padding: 10px 12px;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(149, 166, 95, 0.2);
    border-color: var(--primary);
}

.form-actions,
.toolbar,
.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.toolbar {
    margin-bottom: 18px;
}

.toolbar input {
    flex: 1 1 260px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 15px;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.button-primary {
    background: var(--primary);
    color: white;
}

.button-primary:hover {
    background: var(--primary-dark);
}

.button-secondary {
    background: var(--surface-soft);
    color: var(--text);
}

.button-ghost {
    background: transparent;
    color: var(--muted);
}

.button-danger {
    background: #f0dfd7;
    color: var(--danger);
}

.button-small {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 0.9rem;
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.data-table th,
.data-table td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
}

.table-actions form {
    display: inline-flex;
    margin: 0;
}

.table-input {
    min-width: 115px;
}

.list-stack {
    display: grid;
    gap: 12px;
}

.list-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.list-item div {
    display: grid;
    gap: 3px;
}

.status {
    display: inline-flex;
    align-items: center;
    width: max-content;
    min-height: 28px;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--text);
    font-size: 0.86rem;
    font-weight: 800;
}

.status-confermato {
    background: #e8eddc;
    color: var(--primary-dark);
}

.status-arrivato,
.status-terminato,
.status-pagato {
    background: #e8eddc;
    color: var(--primary-dark);
}

.status-completato {
    background: #e8eddc;
    color: var(--success);
}

.status-annullato {
    background: #ebe7dc;
    color: var(--danger);
}

.status-prenotato {
    background: #e7ebe6;
    color: var(--jeans);
}

.status-in-attesa {
    background: var(--cream);
    color: var(--brown);
}

.status-in-corso {
    background: #e4e7df;
    color: var(--blue);
}

.status-in-lavorazione,
.status-in-lavaggio {
    background: #e4e7df;
    color: var(--blue);
}

.status-in-posa {
    background: var(--cream);
    color: var(--brown);
}

.status-no-show {
    background: #f0dfd7;
    color: var(--danger);
}

.status-ritardo {
    background: #f0dfd7;
    color: var(--danger);
}

.is-hidden {
    display: none !important;
}

.whatsapp-button {
    background: var(--forest);
    color: white;
}

.whatsapp-button:hover {
    background: var(--moss);
}

.filter-bar {
    display: grid;
    grid-template-columns: 1.5fr repeat(4, minmax(140px, 1fr)) auto auto;
    gap: 10px;
    margin-bottom: 18px;
}

.calendar-panel {
    margin-bottom: 24px;
}

#calendar {
    min-height: 680px;
}

.fc {
    font-family: inherit;
}

.fc .fc-toolbar {
    gap: 12px;
    flex-wrap: wrap;
}

.fc .fc-button-primary {
    background: var(--primary);
    border-color: var(--primary);
    border-radius: 8px;
    font-weight: 800;
}

.fc .fc-button-primary:not(:disabled):hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.fc .fc-event {
    border-radius: 6px;
    padding: 2px 4px;
    font-weight: 750;
}

.scheduler-page-header h1 {
    letter-spacing: 0;
}

.scheduler-shell {
    padding: 0;
    overflow: hidden;
    border-color: var(--line);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: none;
}

.scheduler-toolbar {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(250px, auto) minmax(280px, 1fr);
    align-items: center;
    gap: 16px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.scheduler-nav,
.scheduler-view-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.scheduler-nav {
    justify-content: flex-start;
}

.scheduler-icon-button,
.scheduler-today-button,
.scheduler-shop-pill {
    display: inline-grid;
    place-items: center;
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fffef9;
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 650;
    text-decoration: none;
    box-shadow: none;
}

.scheduler-icon-button:hover,
.scheduler-today-button:hover,
.scheduler-shop-pill:hover {
    background: var(--surface-soft);
}

.scheduler-icon-button {
    width: 36px;
    font-size: 1rem;
}

.scheduler-today-button {
    padding: 0 16px;
}

.scheduler-shop-pill {
    padding: 0 14px;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scheduler-date-title {
    display: grid;
    justify-items: center;
    gap: 2px;
    text-align: center;
}

.scheduler-date-title h2 {
    margin: 0;
    color: var(--text);
    font-size: 1.32rem;
    font-weight: 500;
    line-height: 1.18;
}

.scheduler-date-title span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 500;
}

.scheduler-date-title strong {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    height: 24px;
    margin: 0 3px;
    border-radius: 999px;
    background: var(--forest);
    color: white;
    font-size: 0.82rem;
}

.scheduler-view-tabs {
    justify-self: end;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fffef9;
}

.scheduler-view-tabs a {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 12px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 650;
    text-decoration: none;
}

.scheduler-view-tabs a.is-active {
    background: #e8eddc;
    color: var(--primary-dark);
}

.scheduler-filter-bar {
    padding: 10px 18px 12px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.scheduler-filter-bar input,
.scheduler-filter-bar select {
    min-height: 36px;
    border-color: var(--line);
    border-radius: 8px;
    background: #fffef9;
}

.scheduler-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 680px;
}

.scheduler-agenda-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 8px 18px;
    border-bottom: 1px solid var(--line);
    background: #f0efe8;
}

.scheduler-agenda-strip > span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #fffef9;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.scheduler-side {
    display: none;
    align-content: start;
    gap: 12px;
    padding: 14px;
    border-right: 1px solid var(--line);
    background: #f0efe8;
}

.side-card {
    display: grid;
    gap: 8px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffef9;
}

.side-card strong {
    font-size: 0.9rem;
}

.side-card span,
.side-card small {
    color: var(--muted);
}

.waiting-suggestion {
    display: inline-grid;
    gap: 0;
    min-height: 34px;
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fffef9;
    color: var(--text);
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.waiting-suggestion span {
    color: var(--text);
    font-weight: 850;
}

.scheduler-scroll {
    overflow: auto;
    background: var(--surface);
}

.scheduler-grid {
    position: relative;
    display: grid;
    min-width: max(1040px, calc(64px + var(--column-count) * 252px));
    grid-template-columns: 64px repeat(var(--column-count), minmax(252px, 1fr));
    grid-template-rows: 82px repeat(var(--slot-count), var(--slot-height));
}

.scheduler-time-head,
.scheduler-staff-head {
    position: sticky;
    top: 0;
    z-index: 8;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.scheduler-time-head {
    left: 0;
    z-index: 11;
    display: grid;
    place-items: center;
    grid-column: 1;
    grid-row: 1;
    border-right: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 650;
    text-transform: uppercase;
}

.scheduler-staff-head {
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 5px;
    min-width: 0;
    padding: 9px 10px 8px;
    border-left: 1px solid var(--line);
    text-align: center;
}

.staff-avatar {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    overflow: hidden;
    border-radius: 999px;
    border: 1px solid #c7cdb6;
    background: #e8eddc;
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 800;
    box-shadow: none;
}

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

.staff-face {
    font-size: 0.9rem;
    line-height: 1;
}

.staff-head-text {
    display: grid;
    gap: 2px;
    width: 100%;
    min-width: 0;
}

.scheduler-staff-head strong,
.scheduler-staff-head span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scheduler-staff-head span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 500;
}

.scheduler-staff-head strong {
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 650;
}

.scheduler-staff-head[class*="status-operator-"] span {
    color: inherit;
    opacity: 0.86;
}

.status-operator-occupato {
    background: var(--surface);
    color: var(--danger);
}

.status-operator-pausa,
.status-operator-ferie,
.status-operator-assente {
    background: var(--surface);
    color: #8b6723;
}

.status-operator-libero {
    background: var(--surface);
    color: var(--success);
}

.status-operator-occupato .staff-avatar {
    border-color: #e5b8aa;
    background: #f7eee9;
    color: var(--danger);
}

.status-operator-pausa .staff-avatar,
.status-operator-ferie .staff-avatar,
.status-operator-assente .staff-avatar {
    border-color: #d6bd72;
    background: #f5eed8;
    color: #8b6723;
}

.status-operator-libero .staff-avatar {
    border-color: #b9c6a1;
    background: #edf2df;
    color: var(--success);
}

.scheduler-time-cell {
    position: sticky;
    left: 0;
    z-index: 5;
    display: grid;
    align-items: start;
    justify-items: end;
    padding: 6px 8px 0 4px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid #e6e6df;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 500;
}

.scheduler-time-cell.is-major {
    color: var(--text);
}

.scheduler-cell {
    min-width: 0;
    min-height: 0;
    border: 0;
    border-left: 1px solid var(--line);
    border-bottom: 1px solid #e6e6df;
    background: #fffef9;
    cursor: pointer;
}

.scheduler-cell.is-major {
    border-top: 1px solid var(--line);
}

.scheduler-cell:hover,
.scheduler-cell.is-drop-target {
    background: #f2f4e9;
    outline: 2px solid #c7d1a7;
    outline-offset: -2px;
}

.scheduler-cell.is-outside-work-hours {
    background:
        repeating-linear-gradient(
            135deg,
            rgba(216, 216, 207, 0.34) 0,
            rgba(216, 216, 207, 0.34) 8px,
            rgba(251, 250, 245, 0.78) 8px,
            rgba(251, 250, 245, 0.78) 16px
        );
    cursor: not-allowed;
    opacity: 0.72;
}

.scheduler-cell.is-outside-work-hours:hover {
    outline: 0;
}

.scheduler-event {
    position: relative;
    z-index: 6;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    min-height: 42px;
    margin: 2px 6px;
    overflow: visible;
    border: 0;
    border-left: 4px solid color-mix(in srgb, var(--event-color) 88%, var(--forest));
    border-radius: 6px;
    background: color-mix(in srgb, var(--event-color) 18%, #fff);
    color: var(--text);
    box-shadow: none;
}

.scheduler-event:hover {
    box-shadow: 0 2px 8px rgba(17, 27, 24, 0.16);
}

.scheduler-event.is-new-client {
    border-left-color: var(--brass);
    background: #f3ead2;
    color: #5e4821;
}

.scheduler-event.is-block {
    border-left-color: #767d76;
    background: #ecece5;
    color: var(--text);
}

.scheduler-event.is-dragging,
.scheduler-event.is-resizing {
    opacity: 0.62;
}

.scheduler-event-body {
    display: grid;
    gap: 3px;
    min-height: 0;
    overflow: hidden;
    padding: 6px 32px 4px 8px;
    color: inherit;
    text-decoration: none;
}

.scheduler-event-body strong,
.scheduler-event-body span,
.scheduler-event-body em {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scheduler-event-body strong {
    color: inherit;
    font-size: 0.86rem;
    font-weight: 650;
    line-height: 1.15;
}

.scheduler-event-body span,
.scheduler-event-body em {
    color: inherit;
    font-size: 0.74rem;
    font-style: normal;
    font-weight: 500;
}

.event-client-line {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
}

.event-time {
    color: inherit !important;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    opacity: 0.82;
}

.scheduler-event.is-block .event-time {
    color: var(--muted) !important;
}

.event-service-pill {
    justify-self: start;
    max-width: 100%;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: inherit !important;
    font-size: 0.74rem !important;
    font-weight: 600 !important;
    opacity: 0.9;
}

.event-meta-line {
    color: inherit !important;
    font-size: 0.7rem !important;
    opacity: 0.72;
}

.scheduler-event.is-block .event-meta-line {
    color: var(--muted) !important;
}

.event-corner-actions {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 2;
    display: grid;
    gap: 4px;
}

.event-duration-row {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 0 7px 6px 8px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(2px);
    transition: opacity 0.14s ease, transform 0.14s ease;
}

.scheduler-event:hover .event-duration-row,
.scheduler-event:focus-within .event-duration-row {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.event-duration-row button {
    display: inline-grid;
    place-items: center;
    min-width: 28px;
    height: 22px;
    padding: 0 6px;
    border: 1px solid rgba(17, 27, 24, 0.16);
    border-radius: 999px;
    background: rgba(255, 254, 249, 0.9);
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-size: 0.66rem;
    font-weight: 650;
}

.event-circle {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid rgba(17, 27, 24, 0.18);
    border-radius: 999px;
    background: rgba(255, 254, 249, 0.86);
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: none;
}

.event-wa {
    color: #0f6f45;
}

.event-confirm {
    color: var(--success);
}

.event-cancel {
    color: var(--danger);
}

.mobile-duration-actions {
    display: none;
}

.scheduler-tooltip {
    position: absolute;
    left: 12px;
    bottom: calc(100% + 8px);
    z-index: 30;
    display: none;
    width: 270px;
    gap: 5px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 12px 28px rgba(17, 27, 24, 0.18);
}

.scheduler-tooltip span,
.scheduler-tooltip a {
    display: block;
    color: var(--muted);
    font-size: 0.86rem;
}

.scheduler-tooltip a {
    color: var(--primary-dark);
    font-weight: 650;
}

.scheduler-event:hover .scheduler-tooltip {
    display: grid;
}

.event-resize {
    position: absolute;
    right: 10px;
    bottom: 3px;
    width: 28px;
    height: 5px;
    border: 0;
    border-radius: 999px;
    background: rgba(17, 27, 24, 0.24);
    cursor: ns-resize;
}

.scheduler-event.is-resizing::after {
    content: attr(data-resize-label);
    position: absolute;
    right: 8px;
    bottom: 14px;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(255, 254, 249, 0.94);
    color: var(--text);
    font-size: 0.72rem;
    font-weight: 900;
}

.scheduler-agenda-list {
    display: grid;
    gap: 10px;
    padding: 16px;
}

.agenda-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.agenda-row div:first-child {
    display: grid;
    gap: 2px;
}

.agenda-row span,
.agenda-row small {
    color: var(--muted);
}

.scheduler-modal[hidden] {
    display: none;
}

.scheduler-modal {
    position: fixed;
    inset: 0;
    z-index: 140;
    display: grid;
    place-items: center;
    padding: 18px;
}

.scheduler-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(9, 35, 28, 0.52);
}

.scheduler-modal-panel {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 13px;
    width: min(680px, 100%);
    max-height: min(92vh, 820px);
    overflow-y: auto;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: white;
    box-shadow: 0 28px 80px rgba(31, 36, 40, 0.3);
}

.modal-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
}

.modal-head h2 {
    margin: 0;
}

.modal-close {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    background: var(--surface-soft);
    cursor: pointer;
    font: inherit;
    font-weight: 900;
}

.quick-summary,
.form-message {
    padding: 11px 12px;
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--muted);
    font-weight: 750;
}

.form-message {
    background: #f6e5de;
    color: var(--danger);
}

.form-message.is-success {
    background: #e5f5ea;
    color: #2f6d50;
}

.quick-create-client,
.quick-created-client {
    width: 100%;
    min-height: 46px;
    padding: 11px 12px;
    border-radius: 8px;
    font: inherit;
    font-weight: 850;
}

.quick-create-client {
    border: 1px solid var(--primary);
    background: #f8fbf4;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.quick-create-client span {
    color: var(--primary);
}

.quick-created-client {
    border: 1px solid #b9c6a1;
    background: #edf2df;
    color: var(--primary-dark);
}

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

.slot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbf4;
}

.slot-suggestions strong {
    flex-basis: 100%;
    font-size: 0.88rem;
}

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

.slot-suggestions button {
    min-height: 36px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: white;
    cursor: pointer;
    font: inherit;
    font-weight: 850;
}

.slot-suggestions button.is-active {
    background: var(--primary);
    color: white;
}

.client-insights {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbf4;
}

.client-insights-head strong,
.client-insights-head span {
    display: block;
}

.client-insights-head span {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 750;
}

.last-color-box {
    display: grid;
    gap: 5px;
    padding: 10px;
    border-left: 5px solid var(--primary);
    border-radius: 8px;
    background: white;
}

.last-color-box span,
.last-color-box small {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 750;
}

.last-color-box strong {
    color: var(--text);
    line-height: 1.25;
}

.last-color-box button,
.service-suggestions button,
.duration-quick-picks button {
    min-height: 36px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: white;
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 850;
}

.last-color-box button {
    justify-self: start;
    background: var(--surface-soft);
}

.service-suggestions,
.duration-quick-picks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.service-suggestions strong,
.duration-quick-picks strong {
    flex-basis: 100%;
    font-size: 0.88rem;
}

.service-suggestions button.is-active,
.duration-quick-picks button.is-active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.duration-quick-picks {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
}

.duration-control {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.duration-control-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.duration-control-head span {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 850;
}

.duration-adjust-buttons {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.duration-adjust-buttons button {
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-weight: 900;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.agenda-panel {
    margin-top: 24px;
}

.mobile-list,
.ranking-list,
.detail-list {
    display: grid;
    gap: 12px;
}

.mobile-list-item {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
}

.mobile-list-item div {
    display: grid;
    gap: 3px;
}

.mobile-list-item small,
.mobile-list-item span {
    color: var(--muted);
}

.item-actions {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.dashboard-grid,
.profile-layout,
.appointment-layout {
    display: grid;
    gap: 18px;
}

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

.dashboard-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mode-panel {
    display: grid;
    gap: 16px;
    margin-bottom: 24px;
}

.mode-heading {
    align-items: center;
    margin-bottom: 0;
}

.mode-form {
    display: grid;
    gap: 16px;
}

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

.mode-toggle {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    min-height: 76px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffef9;
    cursor: pointer;
}

.mode-toggle input {
    width: 22px;
    min-width: 22px;
    height: 22px;
    min-height: 22px;
    accent-color: var(--primary);
}

.mode-copy {
    display: grid;
    gap: 3px;
}

.mode-copy strong {
    color: var(--text);
    line-height: 1.15;
}

.mode-copy small {
    color: var(--muted);
    font-weight: 650;
    line-height: 1.25;
}

.mode-state {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #e8eddc;
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 900;
    white-space: nowrap;
}

.mode-toggle.is-off {
    background: var(--surface-soft);
}

.mode-toggle.is-off .mode-state {
    background: #ecece5;
    color: var(--muted);
}

.mode-actions {
    justify-content: flex-end;
}

.backoffice-mode-panel {
    margin-bottom: 18px;
    padding: 16px;
}

.backoffice-mode-panel .section-heading h2 {
    font-size: 1rem;
}

.backoffice-mode-panel .muted,
.backoffice-mode-panel .mode-copy small {
    font-size: 0.78rem;
}

.backoffice-mode-panel .mode-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.backoffice-mode-panel .mode-toggle {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    min-height: 62px;
    padding: 10px;
}

.backoffice-mode-panel .mode-toggle input {
    width: 18px;
    min-width: 18px;
    height: 18px;
    min-height: 18px;
}

.backoffice-mode-panel .mode-copy strong {
    font-size: 0.86rem;
}

.backoffice-mode-panel .mode-state {
    grid-column: 2;
    justify-self: start;
    min-height: 22px;
    padding: 2px 7px;
    font-size: 0.68rem;
}

.settings-mode-panel {
    background: #fffef9;
}

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

.settings-mode-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
}

.settings-mode-item input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.settings-mode-item span {
    display: grid;
    gap: 2px;
}

.settings-mode-item strong {
    font-size: 0.88rem;
}

.settings-mode-item small,
.settings-mode-item em {
    color: var(--muted);
    font-size: 0.76rem;
    font-style: normal;
}

.settings-mode-item.is-off {
    background: var(--surface-soft);
    opacity: 0.86;
}

@media (max-width: 1100px) {
    .backoffice-mode-panel .mode-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.profile-layout {
    grid-template-columns: 1fr 1fr;
}

.profile-layout .panel:first-child {
    grid-row: span 2;
}

.appointment-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
}

.appointment-client-panel {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    box-shadow: 0 12px 30px rgba(30, 27, 47, 0.08);
}

.quick-client-form {
    display: grid;
    gap: 12px;
}

.appointment-client-panel .section-heading {
    margin-bottom: 0;
}

.appointment-client-panel h2 {
    margin: 0;
    font-size: 1.15rem;
}

.sticky-panel {
    position: sticky;
    top: 120px;
}

.whatsapp-stack {
    display: grid;
    gap: 10px;
}

.client-grid,
.cash-grid {
    display: grid;
    gap: 16px;
}

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

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

.client-card,
.cash-card {
    display: grid;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
}

.client-top,
.staff-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.staff-head {
    justify-content: flex-start;
}

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

.staff-week-schedule span {
    display: grid;
    gap: 2px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffef9;
    color: var(--muted);
    font-size: 0.86rem;
}

.staff-week-schedule span strong {
    color: var(--text);
    font-size: 0.72rem;
    text-transform: uppercase;
}

.staff-week-schedule span.is-off {
    background: var(--surface-soft);
    opacity: 0.78;
}

.staff-schedule-grid {
    display: grid;
    grid-template-columns: minmax(90px, 0.55fr) repeat(2, minmax(220px, 1fr));
    gap: 10px;
    align-items: stretch;
}

.staff-schedule-grid > strong {
    color: var(--muted);
    font-size: 0.76rem;
    text-transform: uppercase;
}

.staff-day-name {
    align-self: center;
    color: var(--text) !important;
    font-size: 0.9rem !important;
}

.staff-shift-box {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffef9;
}

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

.staff-shift-times input {
    min-height: 42px;
}

.client-top h2,
.cash-card h2 {
    margin: 0;
    font-size: 1.1rem;
}

.detail-list span {
    display: grid;
    gap: 2px;
    color: var(--muted);
}

.detail-list strong {
    color: var(--text);
    font-size: 0.78rem;
    text-transform: uppercase;
}

.detail-list.big {
    gap: 14px;
}

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

.mini-tag {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 800;
}

.color-dot {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 0 1px var(--line);
}

.fieldset {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.fieldset legend {
    padding: 0 6px;
    font-weight: 800;
}

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

.services-checks {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.check-label {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    font-weight: 750;
}

.check-label input {
    width: 18px;
    min-height: 18px;
}

.ranking-list div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.compact-form {
    gap: 12px;
}

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

.photo-pair img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
}

.timeline-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.timeline-record {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-left: 6px solid var(--primary);
    border-radius: 8px;
    background: white;
}

.timeline-record > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.timeline-record p {
    margin: 0;
    color: var(--text);
    font-weight: 800;
}

.timeline-photo {
    width: min(180px, 100%);
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
}

.client-history-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.client-history-summary span,
.history-detail-grid span {
    display: grid;
    gap: 2px;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--muted);
}

.client-history-summary strong,
.history-detail-grid strong {
    color: var(--text);
    font-size: 0.74rem;
    text-transform: uppercase;
}

.client-history-list {
    display: grid;
    gap: 12px;
}

.client-history-card {
    display: grid;
    gap: 13px;
    padding: 14px;
    border: 1px solid var(--line);
    border-left: 6px solid var(--primary);
    border-radius: 8px;
    background: white;
}

.client-history-card.has-debt {
    border-left-color: var(--danger);
}

.client-history-head,
.client-history-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.client-history-head div,
.client-history-title div {
    display: grid;
    gap: 3px;
}

.client-history-head span,
.client-history-title span {
    color: var(--muted);
}

.client-history-title h3 {
    margin: 0;
    font-size: 1.05rem;
}

.history-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.history-detail-grid .debt-open {
    background: rgba(135, 66, 46, 0.1);
    border-color: rgba(135, 66, 46, 0.34);
    color: var(--danger);
    font-weight: 900;
}

.history-notes {
    display: grid;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fffef9;
}

.history-notes p {
    margin: 0;
    color: var(--muted);
}

.history-notes strong {
    color: var(--text);
}

.marketing-card {
    align-content: start;
}

.marketing-preview-message,
.marketing-message {
    margin: 0;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--muted);
}

.marketing-recipient {
    align-items: flex-start;
}

.marketing-recipient > div {
    gap: 6px;
}

.marketing-recipient .button,
.marketing-recipient .mini-tag {
    flex: 0 0 auto;
}

.receipt-body {
    background: white;
}

.receipt {
    width: min(720px, calc(100% - 32px));
    margin: 32px auto;
    padding: 32px;
    border: 1px solid var(--line);
}

.receipt h1 {
    margin: 0;
}

.receipt-lines {
    display: grid;
    gap: 10px;
    margin: 28px 0;
}

.receipt-lines div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 8px;
}

.legal-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto 24px;
    color: var(--muted);
    font-size: 0.92rem;
}

.legal-footer a,
.link-button {
    color: var(--muted);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.link-button {
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
    padding: 0;
}

.legal-page {
    display: grid;
    gap: 22px;
}

.legal-hero h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3rem);
}

.legal-content {
    max-width: 900px;
}

.legal-content h2 {
    margin: 28px 0 8px;
    font-size: 1.2rem;
}

.legal-content p,
.legal-content li {
    color: var(--muted);
}

.legal-content code {
    padding: 2px 5px;
    border-radius: 5px;
    background: var(--surface-soft);
    color: var(--text);
}

.notice {
    padding: 14px;
    border: 1px solid #ead79c;
    border-radius: 8px;
    background: var(--cream);
    color: var(--warning) !important;
    font-weight: 700;
}

.cookie-banner {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 100;
    display: none;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    width: min(760px, calc(100% - 36px));
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 20px 60px rgba(31, 36, 40, 0.22);
}

.cookie-banner.is-visible {
    display: grid;
}

.cookie-banner strong {
    display: block;
    margin-bottom: 5px;
}

.cookie-banner p {
    margin: 0;
    color: var(--muted);
}

.cookie-links,
.cookie-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.cookie-links {
    margin-top: 10px;
}

.cookie-links a {
    color: var(--primary);
    font-weight: 800;
}

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

.more-card {
    display: grid;
    gap: 6px;
    min-height: 112px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    color: inherit;
    text-decoration: none;
}

.more-card strong {
    font-size: 1.05rem;
}

.more-card span {
    color: var(--muted);
}

.alert-panel {
    margin-bottom: 16px;
    border-color: #ead79c;
    background: var(--cream);
}

.inventory-tabs {
    margin-bottom: 18px;
}

.inline-search {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    min-width: min(100%, 420px);
}

.inline-search input {
    flex: 1 1 220px;
}

.low-stock-card {
    border-color: #ead79c;
    background: #fff8dc;
}

.stock-alert {
    margin: 0;
    padding: 9px 10px;
    border-radius: 8px;
    background: #f5e7b6;
    color: #6f5222;
    font-weight: 850;
}

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

.stock-form input,
.stock-form select {
    min-height: 38px;
}

.stock-form .button {
    grid-column: 1 / -1;
}

.usage-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 120px 110px;
    gap: 8px;
    align-items: center;
}

.usage-grid strong {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
}

.category-picker {
    display: grid;
    gap: 10px;
}

.inline-create-box {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 90px 100px;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.inline-create-box.is-hidden {
    display: none;
}

.category-admin-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 58px 90px auto;
    gap: 10px;
    align-items: center;
}

.category-admin-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

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

.inline-role-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.inline-role-form select {
    min-width: 150px;
}

.permission-table {
    min-width: 720px;
}

.copy-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.booking-integration-settings {
    display: grid;
    gap: 14px;
}

.app-install-settings {
    display: grid;
    gap: 10px;
}

.app-install-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.app-install-row p {
    margin: 4px 0 0;
}

.offline-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    margin: 0;
    padding: 20px;
    background: #f3f6f4;
}

.offline-panel {
    display: grid;
    justify-items: start;
    gap: 12px;
    width: min(460px, 100%);
    padding: 28px;
    border: 1px solid #d8dfdb;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(30, 27, 47, 0.1);
}

.offline-panel img {
    border-radius: 8px;
}

.offline-panel h1,
.offline-panel p {
    margin: 0;
}

.public-booking-body {
    min-height: 100vh;
    margin: 0;
    background: #f3f6f4;
    color: #1f2925;
}

.public-booking-shell {
    width: min(820px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0;
}

.public-booking-header {
    display: flex;
    gap: 18px;
    align-items: center;
    padding: 22px 0 28px;
    border-bottom: 1px solid #d8dfdb;
}

.public-booking-header img {
    flex: 0 0 auto;
    width: 72px;
    height: 72px;
    border: 1px solid #d8dfdb;
    border-radius: 8px;
    background: #fff;
    object-fit: cover;
}

.public-booking-header h1 {
    margin: 2px 0 6px;
    font-size: 2rem;
    letter-spacing: 0;
}

.public-booking-header p:last-child {
    max-width: 620px;
    margin: 0;
    color: #53615b;
}

.public-booking-step {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 16px;
    padding: 28px 0;
    border-bottom: 1px solid #d8dfdb;
}

.public-step-number,
.success-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: var(--public-primary, #95a65f);
    color: #13221b;
    font-weight: 850;
}

.public-step-content {
    min-width: 0;
}

.public-step-content h2,
.public-booking-success h2 {
    margin: 4px 0 18px;
    font-size: 1.25rem;
}

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

.public-booking-grid > .button {
    align-self: end;
}

.public-slot-fieldset {
    grid-column: 1 / -1;
    margin: 0;
    padding: 0;
    border: 0;
}

.public-slot-fieldset legend {
    margin-bottom: 10px;
    font-weight: 800;
}

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

.public-slot {
    display: block;
    cursor: pointer;
}

.public-slot input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.public-slot span {
    display: grid;
    min-height: 46px;
    place-items: center;
    border: 1px solid #bcc8c1;
    border-radius: 8px;
    background: #fff;
    color: #24312b;
    font-weight: 800;
    transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.public-slot:hover span {
    border-color: #607d6f;
    transform: translateY(-1px);
}

.public-slot input:checked + span {
    border-color: #294f3d;
    background: var(--public-primary, #95a65f);
    color: #13221b;
}

.public-slot input:focus-visible + span {
    outline: 3px solid rgba(184, 154, 82, 0.52);
    outline-offset: 2px;
}

.public-booking-summary {
    display: grid;
    gap: 3px;
    padding: 14px;
    border-left: 4px solid var(--public-primary, #95a65f);
    border-radius: 6px;
    background: #fff;
}

.public-booking-summary span {
    color: #53615b;
}

.public-booking-errors,
.public-booking-success {
    margin: 24px 0;
    padding: 18px;
    border-radius: 8px;
}

.public-booking-errors {
    border: 1px solid #d8a39d;
    background: #fff2f0;
    color: #7b241c;
}

.public-booking-errors ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.public-booking-success {
    display: grid;
    justify-items: start;
    gap: 8px;
    border: 1px solid #a8cdb8;
    background: #edf8f1;
}

.public-booking-success p {
    margin: 0;
}

.public-booking-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 0 10px;
    color: #66736d;
    font-size: 0.82rem;
}

.honeypot {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

@media (max-width: 767px) {
    .copy-field,
    .public-booking-grid {
        grid-template-columns: 1fr;
    }

    .public-booking-shell {
        width: min(100% - 24px, 820px);
        padding: 14px 0 28px;
    }

    .public-booking-header {
        align-items: flex-start;
        padding: 16px 0 22px;
    }

    .public-booking-header img {
        width: 54px;
        height: 54px;
    }

    .public-booking-header h1 {
        font-size: 1.55rem;
    }

    .public-booking-step {
        grid-template-columns: 34px minmax(0, 1fr);
        gap: 10px;
        padding: 22px 0;
    }

    .public-step-number,
    .success-mark {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

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

    .public-booking-footer {
        flex-direction: column;
    }

    .app-install-row {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

.mobile-tabbar,
.quick-action-sheet,
.mobile-scheduler,
.mobile-day-agenda,
.mobile-step-indicator,
.mobile-step-controls {
    display: none;
}

.desktop-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.desktop-only {
    display: inline-flex;
}

@media print {
    .print-hide {
        display: none;
    }

    .receipt {
        border: 0;
        width: 100%;
        margin: 0;
    }
}

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

.service-card {
    display: grid;
    gap: 18px;
    min-height: 210px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
}

.service-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
}

.service-meta strong {
    color: var(--text);
}

.empty-state {
    margin: 0;
    padding: 24px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    text-align: center;
}

@media (max-width: 920px) {
    .topbar {
        grid-template-columns: 1fr auto auto;
    }

    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .nav {
        grid-column: 1 / -1;
        order: 3;
        display: none;
        justify-content: start;
    }

    .nav-open .nav {
        display: flex;
    }

    .metric-grid,
    .quick-actions,
    .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-metrics,
    .dashboard-grid,
    .profile-layout,
    .appointment-layout,
    .client-grid,
    .cash-grid {
        grid-template-columns: 1fr;
    }

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

    .sticky-panel {
        position: static;
    }
}

@media (max-width: 767px) {
    body {
        padding-bottom: 92px;
        background: var(--bg);
    }

    .topbar {
        position: sticky;
        grid-template-columns: 1fr auto;
        padding: 10px 14px;
    }

    .brand span:last-child {
        max-width: 190px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .brand-mark {
        width: 34px;
        height: 34px;
        border-radius: 8px;
    }

    .nav-toggle,
    .nav,
    .logout-form {
        display: none !important;
    }

    .mobile-tabbar {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 80;
        display: grid;
        grid-template-columns: 1fr 1fr 74px 1fr 1fr;
        align-items: end;
        min-height: 74px;
        padding: 9px 10px calc(9px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--line);
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 -14px 35px rgba(31, 36, 40, 0.12);
        backdrop-filter: blur(16px);
    }

    .mobile-tabbar a,
    .mobile-tabbar button {
        display: grid;
        place-items: center;
        min-height: 48px;
        border: 0;
        background: transparent;
        color: var(--muted);
        font: inherit;
        font-size: 0.78rem;
        font-weight: 850;
        text-decoration: none;
    }

    .mobile-fab {
        width: 62px;
        height: 62px;
        margin: -26px auto 0;
        border-radius: 999px !important;
        background: var(--primary) !important;
        color: white !important;
        font-size: 2rem !important;
        line-height: 1;
        box-shadow: 0 16px 30px rgba(17, 100, 102, 0.28);
    }

    .quick-action-sheet.is-open {
        position: fixed;
        inset: 0;
        z-index: 120;
        display: block;
    }

    .quick-action-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(31, 36, 40, 0.42);
    }

    .quick-action-panel {
        position: absolute;
        right: 0;
        bottom: 0;
        left: 0;
        display: grid;
        gap: 10px;
        padding: 14px 16px calc(20px + env(safe-area-inset-bottom));
        border-radius: 18px 18px 0 0;
        background: white;
        box-shadow: 0 -20px 50px rgba(31, 36, 40, 0.24);
    }

    .quick-action-panel h2 {
        margin: 4px 0 6px;
        font-size: 1.1rem;
    }

    .quick-action-panel a,
    .quick-action-panel button {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 54px;
        padding: 0 16px;
        border: 1px solid var(--line);
        border-radius: 10px;
        background: var(--surface);
        color: var(--text);
        font: inherit;
        font-weight: 850;
        text-decoration: none;
    }

    .quick-action-panel button {
        justify-content: center;
        background: var(--surface-soft);
    }

    .sheet-handle {
        justify-self: center;
        width: 44px;
        height: 5px;
        border-radius: 99px;
        background: var(--line);
    }

    .app-shell {
        width: min(100% - 18px, 1180px);
        padding-top: 16px;
        padding-bottom: 22px;
    }

    .page-header {
        margin-bottom: 16px;
    }

    .page-header h1 {
        font-size: 1.8rem;
    }

    .dashboard-metrics .metric-card,
    .quick-actions {
        display: none;
    }

    .dashboard-metrics .metric-card:nth-child(1),
    .dashboard-metrics .metric-card:nth-child(3) {
        display: block;
    }

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

    .metric-card {
        padding: 15px;
    }

    .metric-card strong {
        font-size: 1.35rem;
    }

    .dashboard-grid {
        gap: 12px;
    }

    .mode-panel {
        gap: 14px;
        margin-bottom: 16px;
        padding: 16px;
    }

    .mode-heading {
        align-items: start;
    }

    .mode-heading .status {
        justify-self: start;
    }

    .mode-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .mode-toggle {
        grid-template-columns: auto minmax(0, 1fr);
        min-height: 74px;
        padding: 13px;
    }

    .mode-state {
        grid-column: 2;
        justify-self: start;
    }

    .mode-actions .button {
        width: 100%;
    }

    .backoffice-mode-panel .mode-grid {
        grid-template-columns: 1fr;
    }

    .backoffice-mode-panel .mode-toggle {
        min-height: 58px;
    }

    .dashboard-grid .panel:nth-of-type(n+4) {
        display: none;
    }

    .calendar-panel,
    .agenda-panel,
    .scheduler-shell,
    .desktop-calendar-actions {
        display: none;
    }

    .mobile-scheduler {
        display: grid;
        gap: 13px;
    }

    .mobile-scheduler-top {
        display: grid;
        grid-template-columns: 48px 1fr 48px;
        align-items: center;
        gap: 10px;
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: 14px;
        background: white;
        box-shadow: 0 10px 24px rgba(31, 36, 40, 0.06);
    }

    .mobile-scheduler-top h2 {
        margin: 0;
        font-size: 1.28rem;
        text-align: center;
    }

    .mobile-scheduler-top .eyebrow {
        text-align: center;
    }

    .mobile-view-tabs {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 5px;
        padding: 5px;
        border: 1px solid var(--line);
        border-radius: 14px;
        background: white;
        box-shadow: 0 8px 20px rgba(31, 36, 40, 0.05);
    }

    .mobile-view-tabs a {
        display: grid;
        place-items: center;
        min-height: 42px;
        padding: 6px 4px;
        border-radius: 10px;
        color: var(--muted);
        font-size: 0.82rem;
        font-weight: 900;
        text-align: center;
        text-decoration: none;
        white-space: nowrap;
    }

    .mobile-view-tabs a.is-active {
        background: var(--primary);
        color: white;
    }

    .mobile-calendar-fab {
        position: sticky;
        top: 62px;
        z-index: 25;
        display: grid;
        place-items: center;
        min-height: 56px;
        border: 0;
        border-radius: 14px;
        background: var(--primary);
        color: white;
        box-shadow: 0 12px 26px rgba(17, 100, 102, 0.22);
        font: inherit;
        font-size: 1rem;
        font-weight: 900;
    }

    .mobile-timeline {
        display: grid;
        gap: 16px;
    }

    .mobile-day-group {
        display: grid;
        gap: 10px;
    }

    .mobile-day-group-header {
        position: sticky;
        top: 126px;
        z-index: 18;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 12px;
        border: 1px solid var(--line);
        border-radius: 13px;
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 8px 20px rgba(31, 36, 40, 0.06);
        backdrop-filter: blur(12px);
    }

    .mobile-day-group-header h3 {
        margin: 0;
        font-size: 1rem;
    }

    .mobile-day-group-header .eyebrow {
        margin-bottom: 2px;
    }

    .mobile-day-add {
        display: grid;
        place-items: center;
        width: 44px;
        height: 44px;
        flex: 0 0 44px;
        border: 0;
        border-radius: 999px;
        background: var(--primary);
        color: white;
        font: inherit;
        font-size: 1.55rem;
        font-weight: 900;
    }

    .mobile-empty-day {
        margin: 0;
        padding: 14px;
        border: 1px dashed var(--line);
        border-radius: 13px;
        background: white;
        color: var(--muted);
        font-weight: 750;
        text-align: center;
    }

    .mobile-event-card {
        display: grid;
        gap: 12px;
        padding: 14px;
        border: 1px solid var(--line);
        border-left: 7px solid var(--event-color);
        border-radius: 14px;
        background: white;
        box-shadow: 0 10px 24px rgba(31, 36, 40, 0.07);
    }

    .mobile-event-main {
        display: grid;
        grid-template-columns: 62px 1fr;
        gap: 12px;
        align-items: start;
    }

    .mobile-event-time {
        display: grid;
        place-items: center;
        min-height: 58px;
        border-radius: 12px;
        background: var(--surface-soft);
    }

    .mobile-event-time strong,
    .mobile-event-time span {
        display: block;
        line-height: 1.1;
    }

    .mobile-event-time strong {
        font-size: 1.05rem;
        font-weight: 950;
    }

    .mobile-event-time span {
        color: var(--muted);
        font-size: 0.78rem;
        font-weight: 850;
    }

    .mobile-event-main h3 {
        margin: 0;
        font-size: 1.08rem;
        line-height: 1.25;
    }

    .mobile-event-main p,
    .mobile-event-main small,
    .mobile-event-note {
        margin: 3px 0 0;
        color: var(--muted);
    }

    .mobile-event-note {
        padding: 10px;
        border-radius: 10px;
        background: var(--cream);
        color: var(--brown);
        font-weight: 750;
    }

    .mobile-duration-actions {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 8px;
    }

    .mobile-duration-actions button {
        min-height: 44px;
        border: 1px solid var(--line);
        border-radius: 11px;
        background: white;
        color: var(--muted);
        font: inherit;
        font-weight: 900;
    }

    .duration-control {
        border-radius: 14px;
        padding: 12px;
    }

    .duration-control-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .duration-adjust-buttons {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .duration-adjust-buttons button,
    .duration-quick-picks button {
        min-height: 46px;
        border-radius: 12px;
    }

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

    .mobile-event-actions a,
    .mobile-event-actions button {
        display: grid;
        place-items: center;
        min-height: 46px;
        border: 0;
        border-radius: 11px;
        background: var(--surface-soft);
        color: var(--text);
        font: inherit;
        font-size: 0.9rem;
        font-weight: 900;
        text-decoration: none;
    }

    .mobile-event-actions .whatsapp-inline {
        border-radius: 11px;
        background: #dff3e6;
        color: var(--aqua-dark);
    }

    .status-border-ritardo { border-left-color: var(--brown); }
    .status-border-new-client { border-left-color: var(--blue); }

    .mobile-day-agenda {
        display: grid;
        gap: 14px;
    }

    .mobile-day-header {
        display: grid;
        grid-template-columns: 48px 1fr 48px;
        align-items: center;
        gap: 10px;
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: white;
    }

    .mobile-day-header h2 {
        margin: 0;
        font-size: 1.35rem;
        text-align: center;
    }

    .mobile-day-header .eyebrow {
        text-align: center;
    }

    .day-arrow {
        display: grid;
        place-items: center;
        width: 48px;
        height: 48px;
        border-radius: 999px;
        background: var(--surface-soft);
        color: var(--text);
        font-size: 2rem;
        font-weight: 900;
        text-decoration: none;
    }

    .mobile-staff-filter select {
        min-height: 54px;
        border-radius: 12px;
        font-weight: 800;
    }

    .mobile-sticky-new {
        position: sticky;
        top: 62px;
        z-index: 20;
        min-height: 54px;
        border-radius: 12px;
        box-shadow: 0 10px 24px rgba(17, 100, 102, 0.18);
    }

    .appointment-card-list {
        display: grid;
        gap: 12px;
    }

    .mobile-appointment-card {
        display: grid;
        gap: 12px;
        padding: 14px;
        border: 1px solid var(--line);
        border-left: 7px solid var(--primary);
        border-radius: 12px;
        background: white;
        box-shadow: 0 10px 24px rgba(31, 36, 40, 0.06);
    }

    .status-border-prenotato { border-left-color: var(--jeans); }
    .status-border-confermato { border-left-color: var(--primary); }
    .status-border-arrivato { border-left-color: var(--primary); }
    .status-border-in-attesa { border-left-color: var(--accent); }
    .status-border-in-corso { border-left-color: var(--blue); }
    .status-border-in-lavorazione { border-left-color: var(--blue); }
    .status-border-in-posa { border-left-color: var(--accent); }
    .status-border-in-lavaggio { border-left-color: var(--jeans); }
    .status-border-terminato { border-left-color: var(--primary); }
    .status-border-completato { border-left-color: var(--success); }
    .status-border-pagato { border-left-color: var(--success); }
    .status-border-annullato { border-left-color: var(--jeans); }
    .status-border-no-show { border-left-color: var(--danger); }

    .appointment-card-main {
        display: grid;
        grid-template-columns: 62px 1fr;
        gap: 12px;
        color: inherit;
        text-decoration: none;
    }

    .appointment-time {
        display: grid;
        place-items: center;
        height: 54px;
        border-radius: 10px;
        background: var(--surface-soft);
        font-size: 1.1rem;
        font-weight: 900;
    }

    .appointment-card-main h3 {
        margin: 0;
        font-size: 1.1rem;
    }

    .appointment-card-main p,
    .appointment-card-main small {
        margin: 2px 0 0;
        color: var(--muted);
    }

    .appointment-price {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    .appointment-contact {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    .appointment-contact a,
    .whatsapp-inline {
        display: inline-flex;
        align-items: center;
        min-height: 38px;
        padding: 7px 11px;
        border-radius: 999px;
        background: var(--surface-soft);
        color: var(--text);
        font-weight: 850;
        text-decoration: none;
    }

    .whatsapp-inline {
        background: #dff3e6;
        color: var(--aqua-dark);
    }

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

    .appointment-quick-actions a,
    .appointment-quick-actions button {
        display: grid;
        place-items: center;
        width: 100%;
        min-height: 42px;
        border: 0;
        border-radius: 9px;
        background: var(--surface-soft);
        color: var(--text);
        font: inherit;
        font-size: 0.86rem;
        font-weight: 850;
        text-decoration: none;
    }

    .appointment-quick-actions form {
        margin: 0;
    }

    .appointment-form-header .desktop-only,
    .desktop-form-actions,
    .desktop-whatsapp-panel {
        display: none !important;
    }

    .mobile-appointment-layout {
        grid-template-columns: 1fr;
    }

    .appointment-form-panel {
        padding: 14px;
    }

    .appointment-client-panel {
        margin-top: 12px;
        padding: 14px;
        border-radius: 14px;
    }

    .appointment-client-panel .modal-two-cols {
        grid-template-columns: 1fr;
    }

    .mobile-step-indicator {
        display: flex;
        gap: 7px;
        overflow-x: auto;
        padding-bottom: 8px;
        margin-bottom: 12px;
    }

    .mobile-step-indicator span {
        display: inline-flex;
        align-items: center;
        min-height: 32px;
        padding: 5px 10px;
        border-radius: 999px;
        background: var(--surface-soft);
        color: var(--muted);
        font-size: 0.78rem;
        font-weight: 850;
        white-space: nowrap;
    }

    .mobile-step-indicator span.is-active {
        background: var(--primary);
        color: white;
    }

    .appointment-step-form {
        display: block;
    }

    .appointment-step {
        display: none;
    }

    .appointment-step.is-active {
        display: grid;
        gap: 16px;
    }

    .step-title h2 {
        margin: 0;
        font-size: 1.35rem;
    }

    .mobile-step-actions {
        display: grid;
        gap: 8px;
    }

    .step-inline-fields {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .appointment-step input,
    .appointment-step select,
    .appointment-step textarea {
        min-height: 54px;
        border-radius: 12px;
        font-size: 1rem;
    }

    .appointment-summary {
        display: grid;
        gap: 10px;
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: var(--surface-soft);
    }

    .appointment-summary div {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        border-bottom: 1px solid rgba(101, 113, 123, 0.2);
        padding-bottom: 8px;
    }

    .appointment-summary div:last-child {
        border-bottom: 0;
        padding-bottom: 0;
    }

    .mobile-step-controls {
        position: fixed;
        right: 0;
        bottom: 74px;
        left: 0;
        z-index: 70;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 10px 12px;
        background: rgba(255, 255, 255, 0.96);
        border-top: 1px solid var(--line);
        backdrop-filter: blur(14px);
    }

    .mobile-step-controls .button {
        min-height: 52px;
        border-radius: 12px;
    }

    .mobile-step-controls .button[disabled] {
        opacity: 0.45;
    }

    .client-grid,
    .cash-grid,
    .card-grid,
    .staff-grid,
    .more-grid {
        grid-template-columns: 1fr !important;
    }

    .more-card {
        min-height: 86px;
        border-radius: 12px;
    }

    .client-card,
    .cash-card,
    .service-card {
        border-radius: 12px;
        box-shadow: 0 8px 22px rgba(31, 36, 40, 0.06);
    }

    .profile-layout .panel,
    .panel {
        border-radius: 12px;
    }
}

@media (max-width: 640px) {
    .topbar {
        padding: 12px 16px;
    }

    .app-shell {
        width: min(100% - 22px, 1180px);
        padding-top: 22px;
    }

    .page-header,
    .section-heading,
    .list-item {
        align-items: stretch;
        flex-direction: column;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .auth-product-name {
        font-size: 1.12rem;
    }

    .auth-card h1 {
        font-size: 1.45rem;
    }

    .metric-grid,
    .quick-actions,
    .card-grid,
    .two-columns,
    .four-columns,
    .filter-bar,
    .checkbox-grid,
    .usage-grid,
    .inline-create-box,
    .category-admin-form,
    .category-admin-row,
    .services-checks,
    .staff-schedule-grid,
    .staff-week-schedule {
        grid-template-columns: 1fr;
    }

    .staff-schedule-grid > strong {
        display: none;
    }

    .staff-day-name {
        margin-top: 8px;
    }

    .staff-shift-times {
        grid-template-columns: 1fr 1fr;
    }

    .usage-grid > strong {
        display: none;
    }

    .mobile-list-item,
    .client-top {
        align-items: stretch;
        flex-direction: column;
    }

    .client-history-summary,
    .history-detail-grid,
    .settings-mode-grid {
        grid-template-columns: 1fr;
    }

    .client-history-head,
    .client-history-title {
        flex-direction: column;
    }

    .inline-role-form {
        align-items: stretch;
        flex-direction: column;
    }

    .item-actions {
        justify-content: flex-start;
    }

    #calendar {
        min-height: 560px;
    }

    .fc .fc-toolbar-title {
        font-size: 1.1rem;
    }

    .auth-card,
    .panel,
    .metric-card {
        padding: 18px;
    }

    .button,
    .form-actions .button {
        width: 100%;
    }

    .legal-footer {
        align-items: center;
        flex-direction: column;
        gap: 10px;
    }

    .cookie-banner {
        right: 11px;
        bottom: calc(86px + env(safe-area-inset-bottom));
        grid-template-columns: 1fr;
        width: calc(100% - 22px);
    }

    .cookie-actions .button {
        width: 100%;
    }
}
