:root {
    color-scheme: light;
    --font-sans: Inter, system-ui, sans-serif;
    --color-bg: #f7f9fc;
    --color-surface: #ffffff;
    --color-surface-soft: #fbfcfe;
    --color-surface-muted: #f3f6fa;
    --color-line: #e3e8ef;
    --color-line-strong: #d8e0ea;
    --color-field-border: #d8e0ea;
    --color-text: #152033;
    --color-text-muted: #5b677b;
    --color-text-soft: #7c8798;
    --color-accent: #3158d7;
    --color-accent-strong: #2445ae;
    --color-accent-soft: #eef3ff;
    --color-info-soft: #eef3ff;
    --color-success: #2e7a58;
    --color-success-soft: #edf7f1;
    --color-warning: #a06a11;
    --color-warning-soft: #fbf4e8;
    --color-danger: #ae4c42;
    --color-danger-soft: #faefed;
    --container-width: 1120px;
    --settings-content-width: 780px;
    --radius-card: 10px;
    --radius-surface: 12px;
}

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

[hidden] {
    display: none !important;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.55;
    color: var(--color-text);
    background: var(--color-bg);
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition:
        color 160ms ease,
        opacity 160ms ease,
        border-color 160ms ease,
        background-color 160ms ease;
}

a:hover {
    color: var(--color-accent-strong);
}

button,
input,
select,
textarea {
    font: inherit;
}

p,
ul,
ol {
    margin: 0;
}

h1,
h2,
h3 {
    margin: 0;
    letter-spacing: -0.035em;
    color: var(--color-text);
}

h1 {
    font-size: 56px;
    font-weight: 700;
    line-height: 1.02;
}

h2 {
    font-size: 34px;
    font-weight: 650;
    line-height: 1.1;
}

h3 {
    font-size: 24px;
    font-weight: 650;
    line-height: 1.15;
}

.site-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-main {
    flex: 1;
    padding: 24px 0 32px;
}

.shell,
.shell--cms,
.shell--app {
    width: min(calc(100% - 48px), var(--container-width));
    margin: 0 auto;
}

.site-header,
.site-footer {
    position: relative;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    border-bottom: 1px solid var(--color-line);
    background: #ffffff;
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 56px;
    padding-block: 8px;
}

.header-row__secondary {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    flex: 1;
    min-width: 0;
    flex-wrap: nowrap;
}

.header-row__secondary .nav-cluster {
    flex-wrap: nowrap;
    min-width: 0;
    gap: 6px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: inherit;
}

.brand__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-accent);
}

.brand__mark--accent {
    color: var(--color-accent);
}

.brand__meta {
    display: grid;
    gap: 0;
}

.brand__name {
    font-size: 15px;
    font-weight: 650;
    line-height: 1.15;
}

.brand__subtle {
    font-size: 11px;
    line-height: 1.25;
    color: var(--color-text-soft);
}

.nav-cluster,
.header-chip-row,
.chip-row,
.button-row,
.badge-row,
.choice-row,
.footer-links,
.page-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.nav-link,
.chip,
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    font-weight: 600;
}

.nav-link {
    min-height: 28px;
    padding: 0 10px;
    border-radius: 6px;
    font-size: 14px;
    color: var(--color-text-muted);
}

.nav-link:hover,
.nav-link.is-active {
    color: var(--color-text);
    border-color: var(--color-line);
    background: var(--color-surface-soft);
}

.session-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    margin-left: auto;
    flex-shrink: 0;
}

.session-chip__user {
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.session-chip__logout-form {
    margin: 0;
    padding-left: 10px;
    border-left: 1px solid var(--color-line);
}

.session-chip__logout.button {
    min-height: auto;
    height: auto;
    padding: 0;
    border-color: transparent;
    background: transparent;
    border-radius: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
}

.session-chip__logout.button:hover {
    color: var(--color-text);
    border-color: transparent;
    background: transparent;
}

.chip,
.badge {
    min-height: 22px;
    height: 22px;
    padding: 0 10px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1;
}

.chip {
    color: var(--color-text-muted);
    background: var(--color-surface-muted);
}

.chip--soft {
    background: var(--color-surface-muted);
}

.chip--interactive:hover {
    color: var(--color-text);
    border-color: var(--color-line);
    background: #ffffff;
}

.badge--pending {
    color: var(--color-warning);
    background: var(--color-warning-soft);
}

.badge--confirmed {
    color: var(--color-accent);
    background: var(--color-accent-soft);
}

.badge--cancelled {
    color: var(--color-danger);
    background: var(--color-danger-soft);
}

.badge--archived {
    color: var(--color-text-muted);
    background: var(--color-surface-muted);
    border-color: var(--color-line-strong);
}

.badge--completed {
    color: var(--color-success);
    background: var(--color-success-soft);
}

.badge--missed {
    color: #7a4c7d;
    background: #f5eef7;
}

.client-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.client-title__badge {
    min-height: 24px;
    height: 24px;
    padding: 0 12px;
    font-size: 12px;
    line-height: 1;
    letter-spacing: 0.01em;
}

.hero-block {
    margin: 24px 0;
    padding: 32px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-surface);
    background: #ffffff;
}

.hero-grid,
.hero-copy {
    display: grid;
    gap: 12px;
}

.hero-panel {
    display: grid;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--color-line);
}

.hero-panel__label,
.detail-panel__label,
.summary-strip__label,
.calendar-weekday,
.footer-title,
.field label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.hero-panel__label,
.detail-panel__label,
.summary-strip__label,
.calendar-weekday,
.field label {
    color: var(--color-text-soft);
}

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

.hero-metric {
    display: grid;
    gap: 4px;
    padding-right: 12px;
    border-right: 1px solid var(--color-line);
}

.hero-metric:last-child {
    padding-right: 0;
    border-right: none;
}

.hero-metric span {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text-soft);
}

.hero-metric strong {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
}

.eyebrow {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-accent);
}

.lede,
.text-secondary,
.help-text,
.error-text,
.footer-copy,
.summary-strip__meta,
.page-header__text {
    font-size: 14px;
    line-height: 1.45;
}

.lede,
.text-secondary,
.help-text,
.footer-copy,
.summary-strip__meta,
.page-header__text {
    color: var(--color-text-muted);
}

.error-text {
    color: var(--color-danger);
}

.section-stack {
    display: grid;
    gap: 12px;
    margin-bottom: 24px;
}

.section-stack--divided > * + * {
    padding-top: 24px;
    border-top: 1px solid var(--color-line);
}

.section-heading,
.stack-sm,
.editorial-block,
.validation-block,
.page-header__copy {
    display: grid;
    gap: 10px;
}

.open-grid,
.validation-grid,
.dashboard-grid,
.detail-stack {
    display: grid;
    gap: 20px;
}

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

.dashboard-grid {
    grid-template-columns: 1.2fr 0.8fr;
}

.section-surface {
    display: grid;
    gap: 12px;
    padding: 24px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-surface);
    background: #ffffff;
}

.section-surface--subtle {
    background: var(--color-surface-soft);
}

.settings-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
    font-size: 13px;
    line-height: 1.3;
    font-weight: 600;
    color: var(--color-text-soft);
}

.settings-breadcrumbs__item {
    color: var(--color-text-muted);
}

.settings-breadcrumbs__item:hover {
    color: var(--color-accent-strong);
}

.settings-breadcrumbs__item--current {
    color: var(--color-text-soft);
    font-weight: 600;
}

.settings-breadcrumbs__separator {
    color: var(--color-line-strong);
}

.app-settings-screen .settings-shell {
    width: min(100%, var(--settings-content-width));
    margin-inline: auto;
}

.app-settings-screen .settings-index__stack {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 32px;
}

.app-settings-screen .settings-index__group {
    width: 100%;
    align-content: start;
    gap: 12px;
    padding: 18px 20px;
}

.app-settings-screen .settings-index__links {
    display: grid;
    gap: 0;
    border-top: 1px solid var(--color-line);
}

.app-settings-screen .settings-index__link {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-line);
    color: inherit;
}

.app-settings-screen .settings-index__link:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.app-settings-screen .settings-index__link:hover .settings-index__link-action,
.app-settings-screen .settings-index__link:focus-visible .settings-index__link-action {
    color: var(--color-accent-strong);
}

.app-settings-screen .settings-index__link-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.app-settings-screen .settings-index__link-copy strong {
    font-size: 15px;
    line-height: 1.25;
}

.app-settings-screen .settings-index__link-copy span {
    font-size: 14px;
    line-height: 1.4;
    color: var(--color-text-muted);
}

.app-settings-screen .settings-index__link-action {
    justify-self: end;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-accent);
    white-space: nowrap;
}

.business-settings__grid {
    gap: 16px 20px;
}

.business-settings__field input {
    min-height: 40px;
    height: 40px;
}

.service-catalog__list {
    display: grid;
    border-top: 1px solid var(--color-line);
}

.service-catalog__item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--color-line);
}

.service-catalog__item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.service-catalog__copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.service-catalog__copy strong {
    font-size: 15px;
    line-height: 1.25;
}

.service-catalog__copy span {
    font-size: 14px;
    line-height: 1.4;
    color: var(--color-text-muted);
}

.service-catalog__actions {
    flex-shrink: 0;
    justify-content: flex-end;
}

.card-grid {
    display: grid;
    gap: 20px;
}

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

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

.card {
    display: grid;
    gap: 12px;
    padding: 24px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-card);
    background: #ffffff;
}

.card--feature {
    background: var(--color-surface-soft);
}

.card__header,
.footer-row,
.availability-row,
.calendar-toolbar,
.agenda-item__top,
.free-slot,
.action-item,
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.simple-list {
    display: grid;
    gap: 12px;
    padding-left: 18px;
    color: var(--color-text-muted);
}

.simple-list li::marker {
    color: var(--color-accent);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    height: 30px;
    padding: 0 16px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    background: transparent;
    color: var(--color-text);
}

.button--primary {
    color: #ffffff;
    background: var(--color-accent);
    border-color: var(--color-accent);
}

.button--primary:hover {
    background: var(--color-accent-strong);
    border-color: var(--color-accent-strong);
}

.button--secondary {
    color: var(--color-text);
    border-color: var(--color-line-strong);
    background: #ffffff;
}

.button--secondary:hover {
    border-color: var(--color-line);
    background: var(--color-surface-soft);
}

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

.button--ghost:hover {
    color: var(--color-text);
    border-color: var(--color-line);
    background: var(--color-surface-soft);
}

.button--danger {
    color: var(--color-danger);
    border-color: #ead0cc;
    background: #fcf5f4;
}

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

.field {
    display: grid;
    gap: 8px;
}

.field--full {
    grid-column: 1 / -1;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    border: 1px solid var(--color-field-border);
    border-radius: 6px;
    background: #ffffff;
    color: var(--color-text);
    font-size: 15px;
    outline: none;
    transition:
        border-color 160ms ease,
        box-shadow 160ms ease;
}

.field input,
.field select {
    min-height: 30px;
    height: 30px;
    padding: 0 12px;
    line-height: 1.2;
}

.field textarea {
    padding: 10px 12px;
    min-height: 128px;
    resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: rgba(49, 88, 215, 0.35);
    box-shadow: 0 0 0 2px rgba(49, 88, 215, 0.08);
}

.field input::placeholder,
.field textarea::placeholder {
    color: var(--color-text-soft);
}

.choice {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    line-height: 1.45;
    color: var(--color-text-muted);
}

.choice input {
    accent-color: var(--color-accent);
}

.alert {
    padding: 14px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-card);
    font-size: 14px;
    line-height: 1.45;
}

.alert--info {
    color: var(--color-accent);
    background: var(--color-info-soft);
    border-color: #dfe7ff;
}

.alert--success {
    color: var(--color-success);
    background: var(--color-success-soft);
    border-color: #dceee3;
}

.alert--warning {
    color: var(--color-warning);
    background: var(--color-warning-soft);
    border-color: #efe2c6;
}

.alert--danger {
    color: var(--color-danger);
    background: var(--color-danger-soft);
    border-color: #efd8d4;
}

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

.client-search {
    display: grid;
    gap: 8px;
}

.client-search__label {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
    letter-spacing: 0;
    text-transform: none;
    color: var(--color-text-muted);
}

.client-search__controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.client-search__controls input {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
}

.client-search__controls .button {
    flex: 0 0 auto;
}

.client-search__clear {
    justify-self: start;
}

.table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
}

.table thead th {
    padding: 0 0 12px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-soft);
    border-bottom: 1px solid var(--color-line);
}

.table tbody td {
    padding: 14px 0;
    border-bottom: 1px solid var(--color-line);
    color: var(--color-text-muted);
    vertical-align: top;
}

.table tbody tr:last-child td {
    border-bottom: none;
    padding-bottom: 0;
}

.table--compact tbody td {
    padding: 12px 0;
}

.empty-state {
    display: grid;
    justify-items: center;
    gap: 12px;
    padding: 24px;
    text-align: center;
    border: 1px dashed var(--color-line-strong);
    border-radius: var(--radius-card);
    background: var(--color-surface-soft);
}

.empty-state__icon {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-accent);
}

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

.swatch,
.metric {
    display: grid;
    gap: 10px;
}

.swatch strong {
    font-size: 16px;
    font-weight: 600;
}

.swatch span:last-child,
.metric span {
    font-size: 14px;
    line-height: 1.45;
    color: var(--color-text-soft);
}

.swatch__tone {
    width: 100%;
    height: 72px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-card);
}

.swatch__tone--bg {
    background: var(--color-bg);
}

.swatch__tone--surface {
    background: #ffffff;
}

.swatch__tone--accent {
    background: var(--color-accent);
}

.swatch__tone--muted {
    background: #7c8798;
}

.metric strong {
    font-size: 24px;
    line-height: 1.15;
}

.summary-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid var(--color-line);
    border-radius: var(--radius-surface);
    background: #ffffff;
    overflow: hidden;
}

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

.summary-strip__item {
    display: grid;
    gap: 8px;
    padding: 20px 24px;
}

.summary-strip__item + .summary-strip__item {
    border-left: 1px solid var(--color-line);
}

.summary-strip__value {
    font-size: 24px;
    font-weight: 650;
    line-height: 1.15;
}

.summary-strip__link {
    font-size: 14px;
    font-weight: 600;
}

.site-footer {
    margin-top: 32px;
    border-top: 1px solid var(--color-line);
    background: transparent;
}

.footer-row {
    padding: 20px 0;
    align-items: center;
}

.footer-row__meta,
.footer-row__aside {
    display: grid;
    gap: 6px;
}

.footer-row__aside {
    justify-items: end;
}

.footer-title {
    color: var(--color-accent);
}

.footer-links {
    gap: 16px;
}

.footer-link {
    font-size: 14px;
    line-height: 1.45;
    color: var(--color-text-muted);
}

.availability-row {
    padding-block: 2px;
    color: var(--color-text-muted);
}

.availability-row strong {
    color: var(--color-text);
}

.page-header {
    margin-top: 24px;
}

.app-agenda-screen,
.app-appointment-screen {
    --app-chrome-offset-desktop: 330px;
    --agenda-operational-height: clamp(604px, calc(100dvh - var(--app-chrome-offset-desktop)), 820px);
}

.app-agenda-screen .site-main,
.app-appointment-screen .site-main {
    padding-top: 20px;
    padding-bottom: 20px;
    margin-bottom: 0;
}

.app-agenda-screen .site-footer,
.app-appointment-screen .site-footer {
    margin-top: 0;
}

.agenda-screen {
    display: grid;
    gap: 0;
}

.agenda-screen .section-stack {
    gap: 0;
    margin-bottom: 0;
}

.agenda-header {
    margin-top: 0;
    margin-bottom: 12px;
}

.app-agenda-screen .agenda-header,
.app-appointment-screen .agenda-header {
    align-items: center;
}

.app-agenda-screen .page-header__copy,
.app-appointment-screen .agenda-header .page-header__copy {
    gap: 0;
}

.app-appointment-screen .agenda-header .page-header__copy {
    gap: 4px;
}

.app-agenda-screen .agenda-header__eyebrow,
.app-appointment-screen .agenda-header__eyebrow {
    font-size: 11px;
    line-height: 1;
    margin-bottom: 3px;
    opacity: 0.78;
}

.app-agenda-screen .agenda-header__title,
.app-appointment-screen .agenda-header__title {
    margin: 0;
    font-size: 38px;
    line-height: 1;
}

.app-agenda-screen .agenda-header__subtitle,
.app-appointment-screen .agenda-header__subtitle {
    max-width: 520px;
    margin-top: 4px;
    margin-bottom: 0;
    font-size: 13px;
    line-height: 1.25;
}

.app-appointment-screen .agenda-header__subtitle {
    max-width: 420px;
    margin-top: 1px;
    font-size: 12px;
    color: var(--color-text-muted);
}

.app-agenda-screen .agenda-header .page-actions,
.app-appointment-screen .agenda-header .page-actions {
    gap: 6px;
    align-items: center;
}

.app-agenda-screen .agenda-header .button,
.app-appointment-screen .agenda-header .button {
    min-height: 28px;
    height: 28px;
    font-size: 12px;
    line-height: 1;
}

.app-agenda-screen .agenda-header .button--primary,
.app-appointment-screen .agenda-header .button--primary {
    padding: 0 12px;
}

.app-agenda-screen .agenda-header .button--secondary,
.app-appointment-screen .agenda-header .button--secondary {
    padding: 0 10px;
}

.agenda-context-strip {
    margin-bottom: 16px;
}

.agenda-context-strip__context {
    margin: 0 0 6px 0;
}

.agenda-layout {
    display: grid;
    grid-template-columns: minmax(0, 2.1fr) minmax(320px, 0.9fr);
    gap: 24px;
    align-items: stretch;
}

.app-agenda-screen .agenda-layout,
.app-appointment-screen .agenda-layout {
    height: var(--agenda-operational-height);
}

.agenda-month,
.agenda-panel {
    border: 1px solid var(--color-line);
    border-radius: var(--radius-surface);
    background: #ffffff;
}

.agenda-month {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    height: 100%;
    overflow: hidden;
}

.agenda-month__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.agenda-month__header {
    padding: 16px;
    border-bottom: 1px solid var(--color-line);
}

.agenda-month__nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.agenda-month__nav-link,
.agenda-month__nav-separator {
    font-size: 13px;
    line-height: 1.3;
}

.agenda-month__nav-link {
    color: var(--color-text-muted);
    font-weight: 600;
    text-decoration: none;
}

.agenda-month__nav-link--static {
    color: var(--color-text-soft);
}

.agenda-month__nav-separator {
    color: var(--color-text-soft);
}

.agenda-month__weekdays,
.agenda-month__grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.agenda-month__grid {
    min-height: 0;
    height: 100%;
    align-content: stretch;
}

.agenda-month__grid--weeks-5 {
    grid-template-rows: repeat(5, minmax(84px, 1fr));
}

.agenda-month__grid--weeks-6 {
    grid-template-rows: repeat(6, minmax(84px, 1fr));
}

.agenda-month__weekdays {
    border-bottom: 1px solid var(--color-line);
    background: var(--color-surface-soft);
}

.agenda-month__weekday {
    padding: 8px 8px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-soft);
}

.app-agenda-screen .summary-strip__item {
    gap: 3px;
    padding: 10px 14px;
}

.app-agenda-screen .summary-strip__value {
    font-size: 15px;
    line-height: 1;
    font-weight: 700;
}

.app-agenda-screen .summary-strip__label {
    font-size: 11px;
    line-height: 1.05;
    letter-spacing: 0.04em;
}

.app-agenda-screen .summary-strip__meta {
    font-size: 11px;
    line-height: 1.2;
}

.agenda-day {
    min-height: 84px;
    height: 100%;
    padding: 8px;
    display: grid;
    align-content: start;
    gap: 6px;
    border-right: 1px solid rgba(227, 232, 239, 0.58);
    border-bottom: 1px solid rgba(227, 232, 239, 0.58);
    background: #ffffff;
}

.agenda-day:nth-child(7n) {
    border-right: none;
}

.agenda-day:nth-last-child(-n + 7) {
    border-bottom: none;
}

.agenda-day--outside {
    background: var(--color-surface-soft);
}

.agenda-day--today {
    background: #f6f9ff;
}

.agenda-day--selected {
    background: #f4f8ff;
    outline: 2px solid rgba(49, 88, 215, 0.38);
    outline-offset: -2px;
}

.agenda-day--manual-closure {
    background: var(--color-success-soft);
}

.agenda-day--non-working {
    background: var(--color-warning-soft);
}

.agenda-day--official-holiday {
    background: var(--color-danger-soft);
}

.agenda-day__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.agenda-day__link {
    display: grid;
    align-content: start;
    gap: 3px;
    min-height: 100%;
    color: inherit;
    text-decoration: none;
}

.agenda-day__link:focus-visible {
    outline: 2px solid rgba(49, 88, 215, 0.28);
    outline-offset: 2px;
}

.agenda-day__link--static {
    cursor: default;
}

.agenda-day__link--stateful {
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.agenda-day__number {
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    color: var(--color-text);
}

.agenda-day--outside .agenda-day__number {
    color: var(--color-text-soft);
}

.agenda-day--today .agenda-day__number,
.agenda-day--selected .agenda-day__number {
    color: var(--color-accent);
}

.agenda-day__state {
    display: grid;
    align-content: center;
    justify-items: center;
    text-align: center;
    min-height: 0;
    gap: 2px;
    padding-inline: 4px;
}

.agenda-day__state--non-working {
    gap: 1px;
}

.agenda-day__state-line {
    font-size: 9px;
    line-height: 1.2;
    font-weight: 500;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.agenda-day__state--non-working .agenda-day__state-line {
    color: var(--color-warning);
}

.agenda-day__state--non-working .agenda-day__state-line:last-child {
    font-weight: 450;
}

.agenda-day__state--official-holiday .agenda-day__state-line {
    color: var(--color-danger);
}

.agenda-day__state--manual-closure .agenda-day__state-line {
    color: var(--color-success);
}

.agenda-day__markers {
    display: grid;
    gap: 3px;
    max-height: 32px;
    overflow: hidden;
}

.agenda-day__marker {
    font-size: 10px;
    line-height: 1.15;
    color: var(--color-text-soft);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agenda-day__marker--busy {
    color: var(--color-text-muted);
    font-weight: 500;
}

.agenda-day__marker--blocked {
    color: var(--color-warning);
}

.agenda-day__marker--manual-closure {
    color: var(--color-danger);
    font-weight: 500;
}

.agenda-day__marker--official-holiday {
    color: var(--color-danger);
    font-weight: 500;
}

.agenda-day__marker--non-working {
    color: var(--color-warning);
    font-weight: 500;
}

.agenda-panel {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 12px;
    padding: 16px;
    height: 100%;
}

.agenda-panel__section {
    display: grid;
    gap: 0;
    align-content: start;
}

.app-agenda-screen .agenda-panel__eyebrow,
.app-appointment-screen .agenda-panel__eyebrow {
    font-size: 12px;
    line-height: 1;
    margin-bottom: 4px;
}

.app-agenda-screen .agenda-panel__date,
.app-appointment-screen .agenda-panel__date {
    font-size: 20px;
    line-height: 1.05;
    margin: 0;
}

.app-agenda-screen .agenda-panel__summary,
.app-appointment-screen .agenda-panel__summary {
    font-size: 11px;
    line-height: 1.2;
    margin: 0 0 8px 0;
}

.agenda-panel__status,
.agenda-panel__status-copy {
    margin: 6px 0 0;
}

.agenda-panel__status {
    font-size: 11px;
    line-height: 1.2;
    font-weight: 600;
}

.agenda-panel__status--manual-closure {
    color: var(--color-danger);
}

.agenda-panel__status--non-working {
    color: var(--color-warning);
}

.agenda-panel__status-copy {
    font-size: 10px;
    line-height: 1.3;
    color: var(--color-text-soft);
}

.appointment-create-panel {
    overflow: hidden;
}

.app-appointment-screen .appointment-create-panel {
    gap: 12px;
    padding: 16px;
}

.app-appointment-screen .agenda-panel__date {
    font-size: 17px;
    line-height: 1.08;
    color: var(--color-text-muted);
}

.appointment-create-panel__body {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 16px;
    align-content: stretch;
    height: 100%;
    min-height: 0;
}

.appointment-edit-panel__body {
    display: flex;
    flex: 1;
    min-height: 0;
}

.appointment-create-panel__block {
    display: grid;
    gap: 14px;
    align-content: start;
    padding-top: 16px;
    border-top: 1px solid var(--color-line);
}

.appointment-create-panel__block--form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    gap: 14px;
}

.appointment-edit-panel__block {
    flex: 1;
}

.appointment-edit-panel__intro {
    gap: 10px;
}

.appointment-edit-panel .text-secondary {
    margin: 0;
    font-size: 11px;
    line-height: 1.3;
}

.appointment-edit-panel__status-row {
    min-width: 0;
}

.appointment-edit-panel__status-field {
    min-width: 0;
}

.appointment-edit-panel__status-field.field--status::after {
    display: none;
}

.appointment-edit-panel__status-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: center;
}

.appointment-edit-panel__status-action {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
}

.appointment-edit-panel__delete-trigger {
    width: 100%;
    color: var(--color-danger);
    border-color: #e7d9d6;
    background: #ffffff;
}

.appointment-edit-panel__delete-trigger:hover,
.appointment-edit-panel__delete-trigger:focus-visible {
    color: #8f3f38;
    border-color: #dcbfba;
    background: #fcf5f4;
}

.appointment-edit-panel__decision-zone {
    display: grid;
    gap: 10px;
    min-height: 0;
    align-content: start;
}

.appointment-edit-panel__decision-block {
    display: grid;
    gap: 10px;
}

.appointment-edit-panel__decision-copy {
    display: grid;
    gap: 4px;
}

.appointment-edit-panel__decision-actions {
    gap: 6px;
    padding-top: 0;
    margin-top: 0;
}

.appointment-create-panel__block-header {
    display: flex;
    align-items: center;
}

.appointment-create-panel__block-header h3 {
    margin: 0;
    font-size: 14px;
    line-height: 1.2;
}

.appointment-create-panel__block-header p {
    margin: 0;
    font-size: 11px;
    line-height: 1.25;
}

.appointment-slot-list {
    display: grid;
    gap: 0;
}

.appointment-slot-row {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-height: 28px;
    padding: 4px 0;
    border-top: 1px solid rgba(227, 232, 239, 0.58);
}

.appointment-slot-row--button {
    width: 100%;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.appointment-slot-row:first-child {
    border-top: none;
}

.appointment-slot-row--button:hover {
    background: rgba(49, 88, 215, 0.04);
}

.appointment-slot-row--button:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 1px rgba(49, 88, 215, 0.28);
}

.appointment-slot-row--inactive {
    opacity: 0.84;
}

.appointment-slot-row--complete {
    opacity: 1;
}

.appointment-slot-row--selected {
    margin-inline: -8px;
    padding-inline: 8px;
    border-radius: 8px;
    background: rgba(49, 88, 215, 0.08);
}

.appointment-slot-row--selected .appointment-slot-row__time {
    color: var(--color-accent-strong);
}

.appointment-slot-row__time {
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    color: var(--color-text);
}

.appointment-slot-row__meta {
    min-width: 0;
    display: flex;
    align-items: center;
}

.appointment-slot-row__state {
    font-size: 10px;
    line-height: 1.15;
}

.appointment-slot-row__state--busy {
    color: var(--color-text-muted);
    font-weight: 500;
}

.appointment-create-panel__form {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 14px;
    min-height: 0;
}

.appointment-create-panel__form-fields {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: visible;
    padding-right: 0;
}

.appointment-create-panel__control-stack {
    display: grid;
    flex: 1;
    min-height: 0;
    gap: 12px;
    width: 100%;
    align-content: start;
}

.appointment-create-panel__primary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    align-items: start;
}

.appointment-create-panel__grid-cell,
.appointment-create-panel__grid-field,
.appointment-create-panel__notes-field {
    min-width: 0;
}

.appointment-create-panel__grid-cell {
    display: grid;
    gap: 5px;
    align-content: start;
}

.appointment-create-panel__grid-cell--action {
    padding-top: 16px;
}

.appointment-create-panel__grid-action-body {
    display: flex;
    align-items: center;
    min-height: 28px;
}

.appointment-create-panel__grid-action-button {
    width: 100%;
    min-height: 28px;
    justify-content: center;
    padding: 0 8px;
    white-space: nowrap;
}

.appointment-create-panel .form-grid {
    display: grid;
    flex: 1;
    min-height: 0;
    grid-template-rows: auto auto auto;
    gap: 10px 12px;
    align-content: start;
}

.appointment-create-panel .field {
    gap: 5px;
}

.appointment-create-panel .field--slot,
.appointment-create-panel .field--status {
    align-content: start;
}

.appointment-create-panel .field--status::after {
    content: "";
    display: block;
    min-height: 10px;
}

.appointment-create-panel .field label {
    font-size: 11px;
    line-height: 1.15;
    color: var(--color-text-muted);
}

.appointment-create-panel .field input,
.appointment-create-panel .field select {
    min-height: 28px;
    height: 28px;
    padding: 0 9px;
    font-size: 13px;
}

.appointment-services-picker {
    position: relative;
    min-width: 0;
}

.appointment-services-picker__toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    height: 28px;
    padding: 0 28px 0 9px;
    border: 1px solid var(--color-field-border);
    border-radius: 6px;
    background: #ffffff;
    color: var(--color-text);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
}

.appointment-services-picker__toggle [data-service-picker-summary] {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.appointment-services-picker__toggle::before {
    content: none;
}

.appointment-services-picker__toggle::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 6px;
    width: 6.3px;
    height: 6.3px;
    border-right: 2px solid var(--color-text);
    border-bottom: 2px solid var(--color-text);
    transform: translateY(-60%) rotate(45deg);
    pointer-events: none;
}

.appointment-services-field.is-open .appointment-services-picker__toggle::after {
    border-right-color: var(--color-accent);
    border-bottom-color: var(--color-accent);
    transform: translateY(-35%) rotate(225deg);
}

.appointment-services-picker__toggle:focus-visible {
    outline: none;
    border-color: rgba(49, 88, 215, 0.35);
    box-shadow: 0 0 0 2px rgba(49, 88, 215, 0.08);
}

.appointment-services-picker__panel {
    display: grid;
    gap: 2px;
    margin-top: 6px;
    padding: 6px;
    border: 1px solid var(--color-line);
    border-radius: 6px;
    background: #ffffff;
}

.js .appointment-services-picker__panel {
    position: absolute;
    z-index: 20;
    right: 0;
    left: 0;
    display: none;
    max-height: 172px;
    overflow-y: auto;
    box-shadow: 0 12px 28px rgba(21, 32, 51, 0.12);
}

.js .appointment-services-field.is-open .appointment-services-picker__panel {
    display: grid;
}

.appointment-services-picker__option {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 6px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--color-text);
    cursor: pointer;
}

.appointment-create-panel .field .appointment-services-picker__option,
.field .appointment-services-picker__option {
    font-size: 13px;
    line-height: 1.2;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--color-text);
}

.appointment-services-picker__option:hover {
    background: var(--color-surface-soft);
}

.field .appointment-services-picker__option input {
    flex: 0 0 auto;
    width: 13px;
    min-height: 13px;
    height: 13px;
    margin: 0;
    padding: 0;
    accent-color: var(--color-accent);
}

.appointment-create-panel .field--full {
    align-self: start;
    min-height: 0;
}

.appointment-create-panel .field textarea {
    height: 64px;
    min-height: 64px;
    max-height: 64px;
    padding: 7px 9px;
    font-size: 13px;
    overflow-y: auto;
    resize: none;
}

.appointment-create-panel .alert {
    padding: 8px 10px;
    font-size: 11px;
    line-height: 1.3;
}

.appointment-create-panel .field__feedback {
    display: grid;
    gap: 2px;
}

.appointment-create-panel .field__feedback--slot {
    min-height: 24px;
    align-content: start;
}

.appointment-create-panel__slot-help {
    margin: 0;
    font-size: 10px;
    line-height: 1.2;
    color: var(--color-text-muted);
}

.appointment-create-panel__slot-field {
    display: grid;
    gap: 6px;
}

.js .appointment-create-panel__slot-select-shell {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    border: 0;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.appointment-create-panel .error-text {
    margin: 0;
    font-size: 10px;
    line-height: 1.2;
}

.appointment-create-panel .page-actions {
    gap: 6px;
    margin-top: auto;
    padding-top: 18px;
    align-items: center;
}

.appointment-create-panel .button {
    min-height: 28px;
    height: 28px;
    font-size: 11px;
}

.agenda-settings__choice-field {
    padding: 14px 16px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-card);
    background: var(--color-surface-soft);
}

.agenda-settings__choice {
    display: inline-flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    color: var(--color-text);
    font-weight: 600;
}

.agenda-settings__choice input[type="checkbox"] {
    width: auto;
    min-height: auto;
    height: auto;
    margin: 2px 0 0;
    padding: 0;
    border: 0;
    box-shadow: none;
    accent-color: var(--color-accent);
}

.agenda-settings__choice-copy {
    display: grid;
    gap: 4px;
}

.agenda-settings__choice-value {
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-soft);
}

.agenda-settings__actions,
.agenda-settings__table-actions {
    justify-content: flex-end;
}

.agenda-settings__manual-closures-list {
    display: grid;
    gap: 0;
    border-top: 1px solid var(--color-line);
}

.agenda-settings__manual-closure-item {
    display: grid;
    gap: 6px;
    padding: 14px 0;
    border-bottom: 1px solid var(--color-line);
}

.agenda-settings__manual-closure-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.agenda-settings__manual-closure-topline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
}

.agenda-settings__manual-closure-label,
.agenda-settings__manual-closure-dates,
.agenda-settings__manual-closure-reason {
    min-width: 0;
}

.agenda-settings__manual-closure-label strong {
    font-size: 15px;
    line-height: 1.25;
    color: var(--color-text);
}

.agenda-settings__manual-closure-dates,
.agenda-settings__manual-closure-reason {
    font-size: 14px;
    line-height: 1.45;
    color: var(--color-text-muted);
}

.agenda-settings__manual-closure-dates {
    white-space: nowrap;
}

.agenda-settings__manual-closure-actions {
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 12px;
    white-space: nowrap;
}

.manual-closure-form__grid > .field {
    align-content: start;
}

.app-settings-screen #cierres-manuales .page-actions {
    flex-shrink: 0;
}

.app-settings-screen #cierres-manuales .page-actions .button {
    white-space: nowrap;
}

.agenda-settings__sync-shell {
    display: grid;
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-card);
    background: var(--color-surface-soft);
}

.agenda-timeline {
    display: grid;
    grid-template-rows: repeat(8, minmax(0, 1fr));
    min-height: 0;
}

.agenda-slot {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 4px 0;
    border-top: 1px solid var(--color-line);
}

.agenda-slot__time-stack {
    display: grid;
    align-content: start;
    gap: 3px;
    min-width: 0;
}

.agenda-slot__time {
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    color: var(--color-text);
}

.agenda-slot__time-meta {
    font-size: 9px;
    line-height: 1.1;
}

.agenda-slot__time-meta--complete {
    color: var(--color-danger);
    font-weight: 600;
}

.agenda-slot__content {
    min-height: 0;
    display: grid;
    align-content: center;
    gap: 3px;
}

.agenda-slot--with-entries .agenda-slot__content {
    align-content: start;
}

.agenda-slot__entries {
    display: grid;
    gap: 2px;
    align-content: start;
}

.agenda-slot__entry {
    min-width: 0;
}

.agenda-slot__entry-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: center;
    min-width: 0;
    padding: 1px 4px;
    margin-inline: -4px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.agenda-slot__entry-card:hover {
    color: inherit;
    border-color: rgba(227, 232, 239, 0.72);
    background: var(--color-surface-soft);
}

.agenda-slot__entry-card:focus-visible {
    outline: 2px solid rgba(49, 88, 215, 0.24);
    outline-offset: 1px;
}

.agenda-slot__entry-main {
    display: flex;
    align-items: baseline;
    gap: 4px;
    min-width: 0;
}

.agenda-slot__entry-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.05;
    color: var(--color-text);
}

.agenda-slot__entry-service {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 9px;
    line-height: 1.05;
    font-weight: 400;
    color: var(--color-text-soft);
}

.agenda-slot__entry-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 14px;
    padding: 0 5px;
    border-radius: 999px;
    font-size: 8px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.agenda-slot__entry-status--pending {
    color: var(--color-warning);
    background: var(--color-warning-soft);
}

.agenda-slot__entry-status--confirmed {
    color: var(--color-accent-strong);
    background: var(--color-accent-soft);
}

.agenda-slot__entry-status--cancelled {
    color: var(--color-danger);
    background: var(--color-danger-soft);
}

.agenda-slot__entry-status--completed {
    color: var(--color-success);
    background: var(--color-success-soft);
}

.agenda-slot__entry-status--missed {
    color: #7a4c7d;
    background: rgba(122, 76, 125, 0.12);
}

.agenda-slot__state {
    align-self: start;
}

.agenda-slot__meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.agenda-slot__meta-main {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1 1 auto;
}

.agenda-slot__meta-primary {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agenda-slot__meta-side {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
}

.agenda-slot__meta-action-form {
    margin: 0;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}

.agenda-slot__meta-action {
    display: inline;
    padding: 0;
    min-height: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    font-size: 9px;
    line-height: 1.1;
    font-weight: 400;
    color: var(--color-text-soft);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    white-space: nowrap;
}

.agenda-slot__meta-action:hover,
.agenda-slot__meta-action:focus-visible {
    color: var(--color-text-muted);
}

.agenda-slot__meta-action--danger {
    color: var(--color-danger);
}

.agenda-slot__meta-action--success {
    color: var(--color-success);
}

.agenda-slot__state--empty {
    display: block;
    width: 74%;
    height: 1px;
    background: var(--color-line);
    opacity: 0.55;
}

.agenda-slot__state--blocked {
    font-size: 10px;
    font-weight: 500;
    line-height: 1.1;
    color: var(--color-warning);
}

.agenda-slot__state--complete {
    font-size: 9px;
    font-weight: 600;
    line-height: 1.1;
    color: var(--color-accent-strong);
}

.agenda-slot__state--available {
    font-size: 9px;
    font-weight: 400;
    line-height: 1.1;
    color: var(--color-text-muted);
}

.agenda-slot__state--unavailable {
    font-size: 9px;
    font-weight: 400;
    line-height: 1.1;
    color: var(--color-text-soft);
    opacity: 0.82;
}

.app-agenda-screen .footer-row,
.app-appointment-screen .footer-row {
    padding: 14px 0;
}

.app-agenda-screen .footer-links,
.app-appointment-screen .footer-links {
    gap: 12px;
}

.app-agenda-screen .footer-row__meta,
.app-agenda-screen .footer-row__aside,
.app-appointment-screen .footer-row__meta,
.app-appointment-screen .footer-row__aside {
    gap: 4px;
}

.app-agenda-screen .footer-copy,
.app-appointment-screen .footer-copy {
    font-size: 13px;
    line-height: 1.35;
}

.calendar-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.95fr);
    gap: 20px;
    align-items: start;
}

.calendar-board,
.detail-panel {
    border: 1px solid var(--color-line);
    border-radius: var(--radius-surface);
    background: #ffffff;
}

.calendar-board {
    overflow: hidden;
}

.calendar-toolbar {
    padding: 24px;
    border-bottom: 1px solid var(--color-line);
}

.calendar-toolbar__copy {
    display: grid;
    gap: 8px;
}

.calendar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.calendar-weekdays,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
    border-bottom: 1px solid var(--color-line);
    background: var(--color-surface-soft);
}

.calendar-weekday {
    padding: 12px;
}

.calendar-cell {
    min-height: 120px;
    padding: 12px;
    display: grid;
    align-content: start;
    gap: 10px;
    border-right: 1px solid var(--color-line);
    border-bottom: 1px solid var(--color-line);
    background: #ffffff;
}

.calendar-cell:nth-child(7n) {
    border-right: none;
}

.calendar-cell:nth-last-child(-n + 7) {
    border-bottom: none;
}

.calendar-cell--muted {
    background: var(--color-surface-soft);
}

.calendar-cell--today {
    background: #f6f9ff;
}

.calendar-cell--blocked {
    background: #fcfaf6;
}

.calendar-day {
    font-size: 14px;
    font-weight: 650;
    line-height: 1.2;
}

.calendar-cell--muted .calendar-day {
    color: var(--color-text-soft);
}

.calendar-cell--today .calendar-day {
    color: var(--color-accent);
}

.calendar-notes {
    display: grid;
    gap: 6px;
}

.calendar-note {
    font-size: 12px;
    line-height: 1.4;
    color: var(--color-text-muted);
}

.calendar-note--strong {
    color: var(--color-text);
    font-weight: 600;
}

.calendar-note--blocked {
    color: var(--color-warning);
}

.detail-stack {
    grid-template-columns: 1fr;
}

.detail-panel {
    display: grid;
    gap: 20px;
    padding: 24px;
}

.detail-panel__section {
    display: grid;
    gap: 12px;
}

.detail-panel__section + .detail-panel__section {
    padding-top: 20px;
    border-top: 1px solid var(--color-line);
}

.agenda-list,
.free-slot-list,
.action-list {
    display: grid;
    gap: 14px;
}

.agenda-item {
    display: grid;
    gap: 6px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--color-line);
}

.agenda-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.agenda-item__time,
.agenda-item__name {
    font-weight: 600;
    color: var(--color-text);
}

.agenda-item__service,
.status-label,
.free-slot span:first-child,
.action-item span:first-child {
    font-size: 14px;
    line-height: 1.45;
    color: var(--color-text-muted);
}

.status-label {
    font-weight: 600;
}

.status-label--confirmed {
    color: var(--color-accent-strong);
}

.status-label--completed {
    color: var(--color-success);
}

.status-label--pending {
    color: var(--color-warning);
}

.free-slot,
.action-item {
    font-size: 14px;
    line-height: 1.45;
}

.action-item strong {
    color: var(--color-text);
}

@media (max-width: 920px) {
    .open-grid,
    .validation-grid,
    .dashboard-grid,
    .settings-index,
    .agenda-layout,
    .card-grid--two,
    .card-grid--three,
    .form-grid,
    .swatch-grid,
    .metric-grid,
    .calendar-layout,
    .hero-metrics,
    .summary-strip,
    .summary-strip--three {
        grid-template-columns: 1fr;
    }

    .summary-strip__item + .summary-strip__item {
        border-left: none;
        border-top: 1px solid var(--color-line);
    }

    .header-row,
    .page-header,
    .agenda-month__header,
    .card__header,
    .footer-row,
    .availability-row,
    .calendar-toolbar,
    .agenda-item__top,
    .service-catalog__item,
    .free-slot,
    .action-item {
        flex-direction: column;
    }

    .header-row__secondary,
    .session-chip {
        width: 100%;
    }

    .header-row__secondary {
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 8px 10px;
    }

    .session-chip {
        margin-left: 0;
    }

    .session-chip {
        justify-content: space-between;
    }

    .hero-metric {
        padding-right: 0;
        padding-bottom: 12px;
        border-right: none;
        border-bottom: 1px solid var(--color-line);
    }

    .hero-metric:last-child {
        padding-bottom: 0;
        border-bottom: none;
    }

    .footer-row__aside {
        justify-items: start;
    }

    .app-agenda-screen .agenda-layout,
    .app-appointment-screen .agenda-layout {
        height: auto;
    }

    .appointment-create-panel,
    .appointment-create-panel__body,
    .appointment-create-panel__block--form,
    .appointment-create-panel__form,
    .appointment-create-panel__form-fields,
    .appointment-edit-panel__body {
        overflow: visible;
    }

    .appointment-edit-panel__status-controls {
        grid-template-columns: 1fr;
    }

    .appointment-edit-panel__status-action {
        justify-content: flex-start;
    }
}

@media (max-height: 940px) and (min-width: 921px) {
    .app-agenda-screen .site-main,
    .app-appointment-screen .site-main {
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .agenda-header {
        margin-bottom: 10px;
    }

    .agenda-context-strip {
        margin-bottom: 8px;
    }

    .agenda-context-strip__context {
        margin-bottom: 2px;
    }
}

@media (max-width: 680px) {
    .shell,
    .shell--cms,
    .shell--app {
        width: min(calc(100% - 32px), 100%);
    }

    .site-main {
        padding-top: 20px;
    }

    .hero-block,
    .section-surface,
    .card,
    .agenda-month__header,
    .agenda-panel,
    .calendar-toolbar,
    .detail-panel,
    .summary-strip__item {
        padding-left: 20px;
        padding-right: 20px;
    }

    .agenda-slot {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .calendar-cell {
        min-height: 104px;
    }

    .agenda-day {
        min-height: 104px;
    }
}
