:root {
    /* Canonical design tokens. Pages consume these variables; they do not invent sizes or colours. */
    --ui-color-text: #202724;
    --ui-color-muted: #68736f;
    --ui-color-border: #d8dfdc;
    --ui-color-border-strong: #c9d2ce;
    --ui-color-surface: #fff;
    --ui-color-surface-soft: #f4f7f6;
    --ui-color-section: #e7edef;
    --ui-color-accent: #c74431;
    --ui-color-primary: #16876b;
    --ui-color-primary-hover: #106f58;
    --ui-color-danger: #be3f2e;
    --ui-color-warning-bg: #fff7cc;
    --ui-color-success-bg: #e3f5ed;
    --ui-color-danger-bg: #fff0ed;

    --ui-space-1: 4px;
    --ui-space-2: 8px;
    --ui-space-3: 12px;
    --ui-space-4: 16px;
    --ui-space-5: 24px;

    --ui-font-caption: 11px;
    --ui-font-body: 13px;
    --ui-font-emphasis: 15px;
    --ui-font-section: 18px;
    --ui-font-title: 24px;
    --ui-line-height: 1.25;

    --ui-control-height: 36px;
    --ui-table-row-height: 44px;
    --ui-radius-control: 8px;
    --ui-radius-panel: 12px;
    --ui-shadow-panel: 0 5px 18px rgba(38, 48, 44, .055);

    --ui-button-height: 36px;
    --ui-button-radius: 8px;
    --ui-button-padding: 13px;
    --ui-button-font-size: 12px;
    --ui-button-primary: var(--ui-color-primary);
    --ui-button-primary-hover: var(--ui-color-primary-hover);
    --ui-button-border: var(--ui-color-border-strong);
    --ui-button-danger: var(--ui-color-danger);
    --ui-button-danger-border: #efbdb5;
    --ui-button-danger-bg: #fff5f3;
    --ui-table-action-width: 98px;
}

/* Typography hierarchy */
.workspace-page { color: var(--ui-color-text); font-size: var(--ui-font-body); line-height: var(--ui-line-height); }
.workspace-page .eyebrow {
    color: var(--ui-color-accent);
    font-size: var(--ui-font-caption);
    font-weight: 850;
    letter-spacing: .13em;
    text-transform: uppercase;
}
.workspace-page :where(.register-head, .panel-heading) :where(h1, h2),
.workspace-page :where(.operation-form-panel, .data-panel) > :where(h1, h2) {
    margin: 1px 0 0;
    font-size: var(--ui-font-title);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -.025em;
}
.workspace-page :where(h3, .section-title) { font-size: var(--ui-font-section); line-height: 1.1; }
.workspace-page :where(small, .meta-text) { color: var(--ui-color-muted); }

/* Shared surfaces */
.workspace-page :where(
    .operation-form-panel, .operation-board, .data-panel, .summary-card,
    .inventory-side, .inventory-main, .service-list-panel, .service-editor-panel,
    .shift-editor, .shift-board, .shift-board-full, .customer-editor, .customers-register,
    .hire-drawer, .staff-register, .positions-register, .roles-rail, .permissions-panel,
    .camera-panel, .archive-panel, .ops-panel
) {
    border: 1px solid var(--ui-color-border);
    border-radius: var(--ui-radius-panel);
    background: var(--ui-color-surface);
    box-shadow: var(--ui-shadow-panel);
}

/* Shared form controls and labels */
.workspace-page form :where(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea) {
    box-sizing: border-box;
    min-width: 0;
    min-height: var(--ui-control-height);
    padding: 7px 10px;
    border: 1px solid var(--ui-color-border);
    border-radius: var(--ui-radius-control);
    background: var(--ui-color-surface);
    color: var(--ui-color-text);
    font: inherit;
    font-size: var(--ui-font-body);
    font-weight: 500;
    line-height: 1.3;
    outline: none;
    box-shadow: none;
}
.workspace-page form :where(input, select, textarea):focus {
    border-color: #7da99c;
    box-shadow: 0 0 0 3px rgba(22, 135, 107, .11);
}
.workspace-page :where(.operation-form, .hire-form, .compact-form, .role-editor, .position-form) label > span,
.workspace-page .field-label {
    display: block;
    margin-bottom: var(--ui-space-1);
    color: var(--ui-color-muted);
    font-size: var(--ui-font-caption);
    font-weight: 700;
    line-height: 1.15;
}

/* Shared data table */
.workspace-page :where(.data-table, .orders-table, .staff-table) {
    width: 100%;
    border-collapse: collapse;
    color: var(--ui-color-text);
}
.workspace-page :where(.data-table, .orders-table, .staff-table) th {
    position: sticky;
    top: 0;
    z-index: var(--layer-table-header);
    height: 34px;
    padding: 7px 10px;
    border-bottom: 1px solid var(--ui-color-border-strong);
    background: var(--ui-color-surface-soft);
    color: var(--ui-color-muted);
    font-size: var(--ui-font-caption);
    font-weight: 750;
    line-height: 1.15;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: .035em;
}
.workspace-page :where(.data-table, .orders-table, .staff-table) td {
    height: var(--ui-table-row-height);
    padding: 7px 10px;
    border-top: 1px solid var(--ui-color-border);
    font-size: var(--ui-font-body);
    font-weight: 500;
    line-height: 1.2;
    vertical-align: middle;
}
.workspace-page :where(.data-table, .orders-table, .staff-table) tbody tr:hover td { background: #f8faf9; }

/* Shared statuses */
.workspace-page .status-pill {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    border: 0;
    border-radius: 999px;
    font-size: var(--ui-font-caption);
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}
.workspace-page .status-pill.is-active { background: var(--ui-color-success-bg); color: #167446; }
.workspace-page .status-pill.is-warn { background: #fff0ce; color: #885f0b; }
.workspace-page .status-pill.is-off { background: #eceff1; color: #667078; }

:is(.workspace-page, .auth-page) :is(
    .primary-button, .secondary-button, .small-button, .danger-button,
    .appointment-editor-save, .appointment-editor-cancel,
    .appointment-arrival-submit, .appointment-menu-payment button
) {
    box-sizing: border-box;
    display: inline-flex;
    min-width: 0;
    min-height: var(--ui-button-height);
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 var(--ui-button-padding);
    border: 1px solid var(--ui-button-border);
    border-radius: var(--ui-button-radius);
    font: inherit;
    font-size: var(--ui-button-font-size);
    font-weight: 750;
    line-height: 1;
    white-space: nowrap;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    box-shadow: none;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease, transform .15s ease;
}

:is(.workspace-page, .auth-page) :is(.primary-button, .appointment-editor-save, .appointment-arrival-submit, .appointment-menu-payment button) {
    border-color: var(--ui-button-primary);
    background: var(--ui-button-primary);
    color: #fff;
}

:is(.workspace-page, .auth-page) :is(.primary-button, .appointment-editor-save, .appointment-arrival-submit, .appointment-menu-payment button):hover { border-color: var(--ui-button-primary-hover); background: var(--ui-button-primary-hover); }
:is(.workspace-page, .auth-page) :is(.secondary-button, .small-button, .appointment-editor-cancel) { background: #fff; color: #26322f; }
:is(.workspace-page, .auth-page) :is(.secondary-button, .small-button, .appointment-editor-cancel):hover { border-color: #8fa19a; background: #f5f8f7; }
:is(.workspace-page, .auth-page) .danger-button { border-color: var(--ui-button-danger-border); background: var(--ui-button-danger-bg); color: var(--ui-button-danger); }
:is(.workspace-page, .auth-page) .danger-button:hover { border-color: #dc8174; background: #ffe9e5; }

:is(.workspace-page, .auth-page) :is(.primary-button, .secondary-button, .small-button, .danger-button, .appointment-editor-save, .appointment-editor-cancel, .appointment-arrival-submit, .appointment-menu-payment button):focus-visible {
    outline: 3px solid rgba(22, 135, 107, .2);
    outline-offset: 2px;
}

:is(.workspace-page, .auth-page) :is(.primary-button, .secondary-button, .small-button, .danger-button, .appointment-editor-save, .appointment-editor-cancel, .appointment-arrival-submit, .appointment-menu-payment button):active { transform: translateY(1px); }
:is(.workspace-page, .auth-page) :is(.primary-button, .secondary-button, .small-button, .danger-button, .appointment-editor-save, .appointment-editor-cancel, .appointment-arrival-submit, .appointment-menu-payment button):disabled,
:is(.workspace-page, .auth-page) :is(.primary-button, .secondary-button, .small-button, .danger-button, .appointment-editor-save, .appointment-editor-cancel, .appointment-arrival-submit, .appointment-menu-payment button)[aria-disabled="true"] {
    opacity: .48;
    cursor: not-allowed;
    transform: none;
}

.button-block { width: 100%; }
.button-dashed { border-style: dashed; }

.auth-card :where(.primary-button, .secondary-button),
.narrow-panel :where(.primary-button, .secondary-button) {
    width: 100%;
    min-height: 52px;
}
