:root {
    --ps-purple: #6f2da8;
    --ps-deep-purple: #3f1b62;
    --ps-lavender: #ede4fb;
    --ps-lavender-soft: #f8f5fd;
    --ps-coral: #ef5b5b;
    --ps-coral-dark: #c84242;
    --ps-dark: #1f1728;
    --ps-bg: #faf8fd;
    --ps-card: #ffffff;
    --ps-text: #21172b;
    --ps-muted: #675972;
    --ps-border: #ded4eb;
    --ps-success: #177245;
    --ps-warning: #9b6a10;
    --ps-danger: #a13535;
    --ps-info: #4d216f;
    --ps-radius: 14px;
    --ps-radius-sm: 10px;
    --ps-shadow: 0 18px 46px rgba(31, 23, 40, 0.10);
    --ps-shadow-soft: 0 10px 28px rgba(31, 23, 40, 0.07);
    --ps-focus: 0 0 0 4px rgba(111, 45, 168, 0.18);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--ps-text);
    background:
        radial-gradient(circle at top left, rgba(111, 45, 168, 0.13), transparent 330px),
        linear-gradient(180deg, #ffffff 0, var(--ps-bg) 340px);
    font-family: "Poppins", "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0;
}

@media screen {
    body {
        background:
            radial-gradient(circle at top left, rgba(111, 45, 168, 0.13), transparent 330px),
            linear-gradient(180deg, #ffffff 0, var(--ps-bg) 340px);
    }
}

img {
    max-width: 100%;
}

a {
    color: var(--ps-purple);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

a:hover {
    color: var(--ps-deep-purple);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: none;
    box-shadow: var(--ps-focus);
}

.page {
    width: min(100%, 1180px);
    margin: 0 auto;
    padding: 34px 16px;
}

.container {
    width: min(100%, 1180px);
    margin: 0 auto;
    padding: 0 16px;
}

.panel,
.card,
.dashboard-card {
    background: var(--ps-card);
    border: 1px solid var(--ps-border);
    border-radius: var(--ps-radius);
    box-shadow: var(--ps-shadow-soft);
}

.panel {
    padding: 24px;
    margin-bottom: 20px;
}

.panel > :first-child,
.card > :first-child {
    margin-top: 0;
}

h1,
h2,
h3 {
    color: var(--ps-text);
    line-height: 1.13;
    letter-spacing: 0;
}

h1 {
    margin: 0 0 10px;
    font-size: clamp(28px, 4vw, 42px);
}

body:not(.admin-dashboard-page):not(.auth-page) main.page > header h1,
body:not(.admin-dashboard-page):not(.auth-page) main.page > .header h1,
body:not(.admin-dashboard-page):not(.auth-page) main.page > .page-header h1,
body:not(.admin-dashboard-page):not(.auth-page) main.page > .panel > h1,
body:not(.admin-dashboard-page):not(.auth-page) main.page > section.panel > h1 {
    margin: 0 0 8px;
    color: var(--ps-text);
    font-size: 32px;
    font-weight: 700;
    line-height: 1.13;
    letter-spacing: 0;
}

body:not(.admin-dashboard-page):not(.auth-page) main.page > header .subtitle,
body:not(.admin-dashboard-page):not(.auth-page) main.page > header .meta,
body:not(.admin-dashboard-page):not(.auth-page) main.page > header .hint,
body:not(.admin-dashboard-page):not(.auth-page) main.page > .header .subtitle,
body:not(.admin-dashboard-page):not(.auth-page) main.page > .header .meta,
body:not(.admin-dashboard-page):not(.auth-page) main.page > .header .hint,
body:not(.admin-dashboard-page):not(.auth-page) main.page > .page-header .subtitle,
body:not(.admin-dashboard-page):not(.auth-page) main.page > .page-header .meta,
body:not(.admin-dashboard-page):not(.auth-page) main.page > .page-header .hint,
body:not(.admin-dashboard-page):not(.auth-page) main.page > .panel > .subtitle,
body:not(.admin-dashboard-page):not(.auth-page) main.page > .panel > .meta,
body:not(.admin-dashboard-page):not(.auth-page) main.page > .panel > .hint,
body:not(.admin-dashboard-page):not(.auth-page) main.page > section.panel > .subtitle,
body:not(.admin-dashboard-page):not(.auth-page) main.page > section.panel > .meta,
body:not(.admin-dashboard-page):not(.auth-page) main.page > section.panel > .hint {
    color: var(--ps-muted);
    font-size: 16px;
    line-height: 1.45;
    letter-spacing: 0;
}

h2 {
    margin: 0 0 16px;
    font-size: clamp(21px, 2.6vw, 28px);
}

h3 {
    margin: 22px 0 10px;
    font-size: 18px;
}

p {
    color: var(--ps-muted);
}

.header,
.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.brand-block,
.brand-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-block {
    justify-content: center;
    margin-bottom: 22px;
    text-align: left;
}

.brand-logo {
    width: 54px;
    height: 54px;
    flex: 0 0 auto;
    border-radius: 12px;
    object-fit: contain;
    box-shadow: 0 12px 26px rgba(111, 45, 168, 0.18);
}

.brand-logo.small {
    width: 42px;
    height: 42px;
    border-radius: 10px;
}

.brand-title {
    display: block;
    color: var(--ps-purple);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.brand-subtitle {
    display: block;
    color: var(--ps-muted);
    font-size: 14px;
}

label {
    display: block;
    margin: 16px 0 7px;
    color: var(--ps-text);
    font-size: 14px;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    border: 1px solid #d6cbe4;
    border-radius: var(--ps-radius-sm);
    background: #ffffff;
    color: var(--ps-text);
    font: inherit;
}

textarea {
    min-height: 160px;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: #9a8ba7;
}

.form-group {
    margin-bottom: 16px;
}

.filters,
.form-row,
.filter-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: end;
}

.ps-form-row-align {
    --ps-form-row-control-height: 46px;
    display: grid;
    gap: 12px;
    align-items: end;
}

.ps-form-control-stack,
.ps-form-action-stack {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: flex-end;
}

.ps-form-action-stack {
    align-items: flex-start;
}

.ps-form-control-label,
.ps-form-action-label {
    display: block;
    min-height: 17px;
    margin: 0 0 6px;
    color: var(--ps-deep-purple);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
}

.ps-form-short-control {
    display: block;
    width: 100%;
    height: var(--ps-form-row-control-height);
    min-height: var(--ps-form-row-control-height);
    box-sizing: border-box;
    padding: 10px 12px;
    line-height: 1.35;
}

.ps-form-short-textarea {
    resize: none;
    overflow-y: hidden;
}

.ps-form-file-control {
    display: block;
    width: 100%;
    height: var(--ps-form-row-control-height);
    min-height: var(--ps-form-row-control-height);
    box-sizing: border-box;
    padding: 8px 10px;
    line-height: 1.35;
}

.ps-form-file-control::file-selector-button {
    margin-right: 10px;
    padding: 7px 10px;
    border: 0;
    border-radius: 5px;
    background: #eee8f5;
    color: var(--ps-deep-purple);
    font-weight: 800;
    cursor: pointer;
}

.ps-form-check-control {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    height: var(--ps-form-row-control-height);
    min-height: var(--ps-form-row-control-height);
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 10px 14px;
    border: 1px solid #cfc6db;
    border-radius: 6px;
    background: #ffffff;
    color: var(--ps-text);
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
}

.ps-form-check-control input[type="checkbox"] {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin: 0;
    padding: 0;
    accent-color: var(--ps-purple);
}

.ps-form-action-button {
    display: inline-flex;
    width: auto;
    height: var(--ps-form-row-control-height);
    min-height: var(--ps-form-row-control-height);
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    text-align: center;
}

.ps-form-action-button-fill {
    width: 100%;
}

.ps-filter-toolbar {
    --ps-toolbar-control-height: 46px;
    --ps-toolbar-gap: 12px;
    display: flex;
    flex-wrap: wrap;
    column-gap: var(--ps-toolbar-gap);
    row-gap: 10px;
    align-items: end;
}

.ps-filter-group,
.ps-filter-segment {
    --ps-toolbar-gap: 10px;
    --toolbar-gap: 10px;
}

.ps-filter-field {
    display: grid;
    grid-template-rows: 18px var(--ps-toolbar-control-height);
    gap: 7px;
    min-width: 0;
    align-items: end;
}

.ps-filter-label {
    width: 100%;
    margin: 0;
    color: var(--ps-deep-purple);
    font-size: 13px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
    white-space: nowrap;
}

.ps-toolbar-control {
    display: flex;
    min-width: 0;
    max-width: 100%;
    height: var(--ps-toolbar-control-height);
    align-items: stretch;
}

.ps-toolbar-control > input,
.ps-toolbar-control > select {
    width: 100%;
    height: var(--ps-toolbar-control-height);
    min-height: var(--ps-toolbar-control-height);
    padding-top: 0;
    padding-bottom: 0;
    border-radius: 8px;
    box-sizing: border-box;
}

.ps-toolbar-control > input {
    text-align: center;
}

.ps-toolbar-control > select {
    text-align: left;
    text-align-last: center;
}

.ps-toolbar-control--date {
    width: 166px;
}

.ps-toolbar-control--search {
    width: 100%;
}

.ps-toolbar-control--select {
    width: 220px;
}

.ps-toolbar-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--ps-toolbar-gap);
    min-height: var(--ps-toolbar-control-height);
    align-items: stretch;
    align-self: end;
}

.ps-toolbar-button {
    display: inline-flex;
    width: auto;
    height: var(--ps-toolbar-control-height);
    min-height: var(--ps-toolbar-control-height);
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border-radius: 8px;
    line-height: 1;
    white-space: nowrap;
}

.ps-toolbar-button--icon {
    width: var(--ps-toolbar-control-height);
    padding-right: 0;
    padding-left: 0;
    font-size: 19px;
}

.ps-filter-toolbar .ps-filter-field {
    display: grid;
    grid-template-rows: 18px var(--ps-toolbar-control-height);
    align-items: end;
}

.ps-filter-toolbar .ps-filter-label {
    text-align: center;
}

.ps-filter-toolbar .ps-toolbar-control > input,
.ps-filter-toolbar .ps-toolbar-control > select,
.ps-filter-toolbar .ps-toolbar-button {
    height: var(--ps-toolbar-control-height);
    min-height: var(--ps-toolbar-control-height);
    box-sizing: border-box;
}

@media (max-width: 760px) {
    .ps-filter-toolbar {
        display: grid;
        grid-template-columns: 1fr;
    }

    .ps-filter-field,
    .ps-toolbar-actions,
    .ps-toolbar-control,
    .ps-toolbar-control--date,
    .ps-toolbar-control--search,
    .ps-toolbar-control--select {
        width: 100%;
    }

    .ps-toolbar-actions {
        flex-wrap: wrap;
    }

    .ps-toolbar-button {
        width: 100%;
    }
}

.ps-summary-card {
    position: relative;
    display: flex;
    min-height: 54px;
    align-items: center;
    gap: 16px;
    overflow: hidden;
    padding: 10px 14px 10px 17px;
    border: 1px solid var(--ps-border);
    border-radius: 8px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    box-shadow: 0 9px 22px rgba(31, 23, 40, 0.045);
    transition: transform 0.12s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, opacity 0.16s ease;
}

.ps-summary-card::before {
    content: "";
    position: absolute;
    inset: 8px auto 8px 0;
    width: 4px;
    border-radius: 0 999px 999px 0;
    background: transparent;
    transition: background 0.16s ease;
}

.ps-summary-card:hover {
    transform: translateY(-1px);
    border-color: rgba(111, 45, 168, 0.42);
    background: #fff;
    box-shadow: 0 14px 30px rgba(54, 24, 78, 0.11);
}

.ps-summary-card:hover::before {
    background: rgba(111, 45, 168, 0.42);
}

.ps-summary-card:focus-visible {
    border-color: rgba(111, 45, 168, 0.58);
    box-shadow: var(--ps-focus), 0 14px 30px rgba(54, 24, 78, 0.11);
}

.ps-summary-card.active,
.ps-summary-card.is-active {
    border-color: var(--ps-purple);
    background: linear-gradient(90deg, #fbf7ff 0%, #ffffff 72%);
    box-shadow: 0 12px 28px rgba(54, 24, 78, 0.12);
}

.ps-summary-card.active::before,
.ps-summary-card.is-active::before {
    background: var(--ps-purple);
}

.ps-summary-card--disabled {
    border-style: dashed;
    background: #f8f5fb;
    color: var(--ps-muted);
    opacity: 0.78;
    pointer-events: none;
    box-shadow: none;
}

.ps-summary-card--disabled::before,
.ps-summary-card--disabled:hover::before {
    background: transparent;
}

.ps-summary-card--disabled:hover {
    transform: none;
    border-color: var(--ps-border);
    box-shadow: none;
}

.ps-summary-card--stacked {
    min-height: 64px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 6px;
}

.ps-summary-card-count {
    display: block;
    flex: 0 0 auto;
    min-width: 34px;
    color: var(--ps-deep-purple);
    font-size: 25px;
    font-weight: 800;
    line-height: 1;
    text-align: center;
}

.ps-summary-card-label {
    display: block;
    min-width: 0;
    color: var(--ps-deep-purple);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
}

.ps-summary-card-helper {
    display: block;
    margin-top: 6px;
    color: var(--ps-muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.25;
}

.ps-summary-card--stacked .ps-summary-card-label {
    font-size: 17px;
    line-height: 1.15;
}

.ps-summary-card--stacked .ps-summary-card-helper {
    font-size: 13px;
    line-height: 1.35;
}

a.ps-summary-card,
.card.ps-summary-card,
.summary-card.ps-summary-card {
    display: flex;
    color: inherit;
    text-decoration: none;
}

a.ps-summary-card:hover,
.card.ps-summary-card:hover,
.summary-card.ps-summary-card:hover {
    color: inherit;
    text-decoration: none;
}

.actions,
.form-actions,
.availability-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.ps-btn,
.button,
.btn,
button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    border: 0;
    border-radius: var(--ps-radius-sm);
    background: var(--ps-purple);
    color: #ffffff;
    font: inherit;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(111, 45, 168, 0.18);
    transition: transform 0.08s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.ps-btn-primary,
.button.primary,
.btn-primary {
    border: 0;
    background: var(--ps-purple);
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(111, 45, 168, 0.18);
}

.ps-btn:hover,
.button:hover,
.btn:hover,
button:hover {
    background: var(--ps-deep-purple);
    color: #ffffff;
}

.ps-btn-primary:hover,
.button.primary:hover,
.btn-primary:hover {
    background: var(--ps-deep-purple);
    color: #ffffff;
    box-shadow: 0 14px 28px rgba(63, 27, 98, 0.20);
}

.ps-btn:active,
.button:active,
.btn:active,
button:active {
    transform: translateY(1px);
}

.ps-btn-secondary,
.button.secondary,
.btn-secondary {
    border: 1px solid rgba(111, 45, 168, 0.16);
    background: #f1ebf8;
    color: var(--ps-deep-purple);
    box-shadow: none;
}

.ps-btn-secondary:hover,
.button.secondary:hover,
.btn-secondary:hover {
    background: #e6daf3;
    border-color: rgba(111, 45, 168, 0.24);
    color: var(--ps-deep-purple);
    box-shadow: 0 8px 18px rgba(54, 24, 78, 0.07);
}

.ps-btn-teal,
.button.teal,
.button.input-shortcut,
.button.accent,
.btn-accent {
    border: 1px solid #8fb6c2;
    background: #326b7b;
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(50, 107, 123, 0.18);
}

.ps-btn-teal:hover,
.button.teal:hover,
.button.input-shortcut:hover,
.button.accent:hover,
.btn-accent:hover {
    background: #285c69;
    color: #ffffff;
    box-shadow: 0 14px 28px rgba(40, 92, 105, 0.20);
}

.ps-btn-danger,
.btn-danger,
button.danger,
.button.danger {
    border: 1px solid #8f2323;
    background: #9d1f1f;
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(157, 31, 31, 0.16);
}

.ps-btn-danger:hover,
.btn-danger:hover,
button.danger:hover,
.button.danger:hover {
    background: #7f1a1a;
    color: #ffffff;
    box-shadow: 0 14px 28px rgba(127, 26, 26, 0.18);
}

.button.logout {
    border: 1px solid #f0c9c9;
    background: #fff1f1;
    color: var(--ps-danger);
    box-shadow: none;
}

.button.logout:hover {
    background: #fbe2e2;
    color: var(--ps-danger);
    box-shadow: none;
}

.ps-btn-compact,
.button.small,
.btn-small {
    min-height: 36px;
    padding: 8px 11px;
    font-size: 14px;
}

.ps-btn-icon {
    width: 46px;
    padding-right: 0;
    padding-left: 0;
}

.ps-btn-disabled,
.ps-btn:disabled,
.button:disabled,
.btn:disabled,
button:disabled {
    border-color: #ded4eb;
    background: #eee8f5;
    color: #8b7c96;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.72;
    transform: none;
}

.ps-btn-disabled:hover,
.ps-btn:disabled:hover,
.button:disabled:hover,
.btn:disabled:hover,
button:disabled:hover {
    border-color: #ded4eb;
    background: #eee8f5;
    color: #8b7c96;
    box-shadow: none;
    transform: none;
}

.ps-btn.ps-btn-primary,
.button.ps-btn-primary,
.btn.ps-btn-primary,
button.ps-btn-primary {
    border: 0;
    background: var(--ps-purple);
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(111, 45, 168, 0.18);
}

.ps-btn.ps-btn-primary:hover,
.button.ps-btn-primary:hover,
.btn.ps-btn-primary:hover,
button.ps-btn-primary:hover {
    background: var(--ps-deep-purple);
    color: #ffffff;
    box-shadow: 0 14px 28px rgba(63, 27, 98, 0.20);
}

.ps-btn.ps-btn-secondary,
.button.ps-btn-secondary,
.btn.ps-btn-secondary,
button.ps-btn-secondary {
    border: 1px solid rgba(111, 45, 168, 0.16);
    background: #f1ebf8;
    color: var(--ps-deep-purple);
    box-shadow: none;
}

.ps-btn.ps-btn-secondary:hover,
.button.ps-btn-secondary:hover,
.btn.ps-btn-secondary:hover,
button.ps-btn-secondary:hover {
    background: #e6daf3;
    border-color: rgba(111, 45, 168, 0.24);
    color: var(--ps-deep-purple);
    box-shadow: 0 8px 18px rgba(54, 24, 78, 0.07);
}

.ps-btn.ps-btn-teal,
.button.ps-btn-teal,
.btn.ps-btn-teal,
button.ps-btn-teal {
    border: 1px solid #8fb6c2;
    background: #326b7b;
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(50, 107, 123, 0.18);
}

.ps-btn.ps-btn-teal:hover,
.button.ps-btn-teal:hover,
.btn.ps-btn-teal:hover,
button.ps-btn-teal:hover {
    background: #285c69;
    color: #ffffff;
    box-shadow: 0 14px 28px rgba(40, 92, 105, 0.20);
}

.ps-btn.ps-btn-danger,
.button.ps-btn-danger,
.btn.ps-btn-danger,
button.ps-btn-danger {
    border: 1px solid #8f2323;
    background: #9d1f1f;
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(157, 31, 31, 0.16);
}

.ps-btn.ps-btn-danger:hover,
.button.ps-btn-danger:hover,
.btn.ps-btn-danger:hover,
button.ps-btn-danger:hover {
    background: #7f1a1a;
    color: #ffffff;
    box-shadow: 0 14px 28px rgba(127, 26, 26, 0.18);
}

.ps-btn.ps-btn-compact,
.button.ps-btn-compact,
.btn.ps-btn-compact,
button.ps-btn-compact {
    min-height: 36px;
    padding: 8px 11px;
    font-size: 14px;
}

.ps-btn.ps-btn-disabled,
.button.ps-btn-disabled,
.btn.ps-btn-disabled,
button.ps-btn-disabled {
    border-color: #ded4eb;
    background: #eee8f5;
    color: #8b7c96;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.72;
    transform: none;
}

.ps-btn.ps-btn-disabled:hover,
.button.ps-btn-disabled:hover,
.btn.ps-btn-disabled:hover,
button.ps-btn-disabled:hover {
    border-color: #ded4eb;
    background: #eee8f5;
    color: #8b7c96;
    box-shadow: none;
    transform: none;
}

button.restore {
    border: 1px solid #bee2cd;
    background: #edf9f2;
    color: var(--ps-success);
    box-shadow: none;
}

.message,
.errors,
.alert-success,
.alert-error,
.alert-info {
    margin: 0 0 18px;
    padding: 13px 15px;
    border-radius: var(--ps-radius-sm);
    border: 1px solid transparent;
    box-shadow: 0 8px 20px rgba(31, 23, 40, 0.04);
}

.message.success,
.alert-success {
    border-color: #c9ead7;
    background: #edf9f2;
    color: var(--ps-success);
}

.message.error,
.errors,
.error,
.alert-error {
    border-color: #f0c9c9;
    background: #fff1f1;
    color: var(--ps-danger);
}

.message.info,
.alert-info {
    border-color: #dac9ee;
    background: #f1ebf8;
    color: var(--ps-info);
}

.message.warning {
    border-color: #efdca6;
    background: #fff8e5;
    color: var(--ps-warning);
}

.grid,
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}

.grid .card,
.dashboard-card {
    position: relative;
    display: block;
    min-height: 120px;
    overflow: hidden;
    padding: 22px;
    color: var(--ps-text);
    text-decoration: none;
    transition: transform 0.08s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.grid .card::before,
.dashboard-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: var(--ps-purple);
}

.grid .card:hover,
.dashboard-card:hover {
    transform: translateY(-1px);
    border-color: rgba(111, 45, 168, 0.38);
    box-shadow: var(--ps-shadow);
}

.grid .card strong,
.dashboard-card strong {
    display: block;
    margin-bottom: 8px;
    color: var(--ps-deep-purple);
    font-size: 21px;
}

.grid .card span,
.dashboard-card span {
    color: var(--ps-muted);
}

.role,
.super-label,
.status-pill,
.badge {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f1ebf8;
    color: var(--ps-deep-purple);
    font-size: 13px;
    font-weight: 800;
}

.super-label,
.badge.accent {
    background: var(--ps-purple);
    color: #ffffff;
}

.table-wrap,
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--ps-border);
    border-radius: var(--ps-radius);
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(31, 23, 40, 0.04);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
    font-size: 15px;
}

th,
td {
    padding: 12px 11px;
    border-bottom: 1px solid #ece5f3;
    text-align: left;
    vertical-align: top;
}

th {
    background: #efe8f7;
    color: var(--ps-deep-purple);
    font-weight: 900;
    white-space: nowrap;
}

tbody tr:nth-child(even) td {
    background: #fcfafd;
}

tbody tr:hover td {
    background: #f7f2fb;
}

.ps-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
}

.ps-table th,
.ps-table td {
    vertical-align: middle;
}

.ps-table th {
    font-weight: 900;
}

.ps-table tbody tr:nth-child(even) td {
    background: #fcfafd;
}

.ps-table tbody tr:hover td {
    background: #f7f2fb;
}

.ps-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--ps-border);
    border-radius: var(--ps-radius);
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(31, 23, 40, 0.04);
}

.ps-table-scroll {
    overflow-x: auto;
}

.ps-table-fixed {
    table-layout: fixed;
}

.ps-table-sticky thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: 0 1px 0 #ded8e8;
}

.ps-table-compact th,
.ps-table-compact td {
    padding: 8px 10px;
}

.ps-cell-center,
.ps-cell-status,
.ps-cell-code,
.ps-cell-number,
.ps-cell-money,
.ps-cell-date,
.ps-cell-time,
.ps-cell-action,
.ps-cell-actions {
    text-align: center !important;
    vertical-align: middle;
}

.ps-cell-status,
.ps-cell-code,
.ps-cell-number,
.ps-cell-money,
.ps-cell-date,
.ps-cell-time,
.ps-cell-action,
.ps-cell-actions {
    white-space: nowrap;
}

.ps-cell-code,
.ps-cell-number,
.ps-cell-money,
.ps-cell-date,
.ps-cell-time {
    font-variant-numeric: tabular-nums;
}

.ps-cell-left,
.ps-cell-text,
.ps-cell-long {
    text-align: left !important;
}

.ps-cell-right {
    text-align: right !important;
}

.ps-cell-long {
    overflow-wrap: anywhere;
}

.ps-cell-nowrap {
    white-space: nowrap;
}

.ps-cell-wrap {
    white-space: normal;
}

.ps-cell-action,
.ps-cell-actions {
    width: 1%;
    min-width: 104px;
}

.ps-cell-action .ps-btn,
.ps-cell-action .button,
.ps-cell-actions .ps-btn,
.ps-cell-actions .button {
    margin-right: auto;
    margin-left: auto;
}

.ps-row-action,
.ps-table .ps-cell-action .ps-btn,
.ps-table .ps-cell-action .button,
.ps-table .ps-cell-actions .ps-btn,
.ps-table .ps-cell-actions .button {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 13px;
    line-height: 1.1;
    white-space: nowrap;
    box-shadow: none;
}

.ps-table th.ps-cell-center,
.ps-table td.ps-cell-center,
.ps-table th.ps-cell-status,
.ps-table td.ps-cell-status,
.ps-table th.ps-cell-code,
.ps-table td.ps-cell-code,
.ps-table th.ps-cell-number,
.ps-table td.ps-cell-number,
.ps-table th.ps-cell-money,
.ps-table td.ps-cell-money,
.ps-table th.ps-cell-date,
.ps-table td.ps-cell-date,
.ps-table th.ps-cell-time,
.ps-table td.ps-cell-time,
.ps-table th.ps-cell-action,
.ps-table td.ps-cell-action,
.ps-table th.ps-cell-actions,
.ps-table td.ps-cell-actions {
    text-align: center !important;
    vertical-align: middle;
}

.ps-table th.ps-cell-status,
.ps-table td.ps-cell-status,
.ps-table th.ps-cell-code,
.ps-table td.ps-cell-code,
.ps-table th.ps-cell-number,
.ps-table td.ps-cell-number,
.ps-table th.ps-cell-money,
.ps-table td.ps-cell-money,
.ps-table th.ps-cell-date,
.ps-table td.ps-cell-date,
.ps-table th.ps-cell-time,
.ps-table td.ps-cell-time,
.ps-table th.ps-cell-action,
.ps-table td.ps-cell-action,
.ps-table th.ps-cell-actions,
.ps-table td.ps-cell-actions {
    white-space: nowrap;
}

.ps-table th.ps-cell-code,
.ps-table td.ps-cell-code,
.ps-table th.ps-cell-number,
.ps-table td.ps-cell-number,
.ps-table th.ps-cell-money,
.ps-table td.ps-cell-money,
.ps-table th.ps-cell-date,
.ps-table td.ps-cell-date,
.ps-table th.ps-cell-time,
.ps-table td.ps-cell-time {
    font-variant-numeric: tabular-nums;
}

.ps-table th.ps-cell-left,
.ps-table td.ps-cell-left,
.ps-table th.ps-cell-text,
.ps-table td.ps-cell-text,
.ps-table th.ps-cell-long,
.ps-table td.ps-cell-long {
    text-align: left !important;
}

.ps-table th.ps-cell-right,
.ps-table td.ps-cell-right {
    text-align: right !important;
}

.ps-table .ps-cell-long {
    overflow-wrap: anywhere;
}

.ps-table .ps-cell-nowrap {
    white-space: nowrap;
}

.ps-table .ps-cell-wrap {
    white-space: normal;
}

.ps-table .ps-cell-action > .ps-btn,
.ps-table .ps-cell-action .ps-btn,
.ps-table .ps-cell-action > .button,
.ps-table .ps-cell-action .button,
.ps-table .ps-cell-actions > .ps-btn,
.ps-table .ps-cell-actions .ps-btn,
.ps-table .ps-cell-actions > .button,
.ps-table .ps-cell-actions .button {
    margin-right: auto;
    margin-left: auto;
}

.ps-table thead th:not(.ps-th-left),
.ps-table thead th.ps-cell-center:not(.ps-th-left),
.ps-table thead th.ps-cell-status:not(.ps-th-left),
.ps-table thead th.ps-cell-code:not(.ps-th-left),
.ps-table thead th.ps-cell-number:not(.ps-th-left),
.ps-table thead th.ps-cell-money:not(.ps-th-left),
.ps-table thead th.ps-cell-date:not(.ps-th-left),
.ps-table thead th.ps-cell-time:not(.ps-th-left),
.ps-table thead th.ps-cell-action:not(.ps-th-left),
.ps-table thead th.ps-cell-actions:not(.ps-th-left),
.ps-table thead th.ps-cell-left:not(.ps-th-left),
.ps-table thead th.ps-cell-text:not(.ps-th-left),
.ps-table thead th.ps-cell-long:not(.ps-th-left),
.ps-table thead th.ps-cell-right:not(.ps-th-left) {
    text-align: center !important;
}

.ps-table thead th.ps-th-left {
    text-align: left;
}

.ps-table.ps-table-review tbody td,
.ps-table.ps-table-review tbody td.ps-cell-center,
.ps-table.ps-table-review tbody td.ps-cell-status,
.ps-table.ps-table-review tbody td.ps-cell-code,
.ps-table.ps-table-review tbody td.ps-cell-number,
.ps-table.ps-table-review tbody td.ps-cell-money,
.ps-table.ps-table-review tbody td.ps-cell-date,
.ps-table.ps-table-review tbody td.ps-cell-time,
.ps-table.ps-table-review tbody td.ps-cell-action,
.ps-table.ps-table-review tbody td.ps-cell-actions,
.ps-table.ps-table-review tbody td.ps-cell-left,
.ps-table.ps-table-review tbody td.ps-cell-text,
.ps-table.ps-table-review tbody td.ps-cell-long,
.ps-table.ps-table-review tbody td.ps-cell-right {
    text-align: center !important;
}

.ps-table.ps-table-review tbody td.ps-cell-left-force {
    text-align: left !important;
}

.status,
td.status {
    color: var(--ps-deep-purple);
    font-weight: 900;
}

td.status::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 7px;
    border-radius: 999px;
    background: var(--ps-purple);
    vertical-align: middle;
}

.status-note,
.empty,
.worker-detail,
.welcome,
.week-range {
    color: var(--ps-muted);
}

.inline-form {
    display: inline;
}

/* Branded login shells */
body:has(form[action*="/login.php"]) {
    background:
        radial-gradient(circle at top left, rgba(111, 45, 168, 0.16), transparent 350px),
        linear-gradient(135deg, #fbf9fd 0%, #f0e9fb 100%);
}

body:has(form[action*="/login.php"]) .page {
    max-width: 470px;
    min-height: 100vh;
    display: grid;
    align-items: center;
    padding-top: 28px;
    padding-bottom: 28px;
}

body:has(form[action*="/login.php"]) .panel {
    border-radius: 20px;
    box-shadow: var(--ps-shadow);
}

body:has(form[action*="/login.php"]) button[type="submit"] {
    width: 100%;
    margin-top: 22px;
}

/* Worker dashboard */
.panel > .actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 13px;
    margin-top: 22px;
}

.panel > .actions .button {
    width: 100%;
    min-height: 58px;
    border-radius: 13px;
    font-size: 17px;
}

.panel > .actions .button[href*="scan.php?type=IN"],
.panel > .actions .button[href*="scan.php?type=OUT"] {
    min-height: 74px;
    font-size: 20px;
}

.panel > .actions .button[href*="scan.php?type=OUT"] {
    background: var(--ps-deep-purple);
}

.panel > .actions .button[href*="availability.php"],
.panel > .actions .button[href*="history.php"],
.panel > .actions .button[href*="shifts.php"],
.panel > .actions .button[href*="change-password.php"] {
    border: 1px solid rgba(111, 45, 168, 0.16);
    background: #f1ebf8;
    color: var(--ps-deep-purple);
    box-shadow: none;
}

/* Worker availability and shifts */
.availability-page .panel {
    max-width: 1040px;
    margin-right: auto;
    margin-left: auto;
}

.availability-list {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.availability-day {
    margin: 0;
    padding: 16px;
    border: 1px solid var(--ps-border);
    border-radius: var(--ps-radius);
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(31, 23, 40, 0.04);
}

.availability-day legend {
    display: flex;
    width: 100%;
    justify-content: space-between;
    gap: 10px;
    padding: 0 6px;
}

.availability-day legend span {
    color: var(--ps-muted);
}

.availability-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
    margin-top: 12px;
}

.availability-options label {
    display: flex;
    min-height: 54px;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 12px;
    border: 1px solid rgba(111, 45, 168, 0.18);
    border-radius: var(--ps-radius-sm);
    background: #ffffff;
    cursor: pointer;
}

.availability-options input[type="radio"] {
    width: auto;
    min-height: 0;
    accent-color: var(--ps-purple);
}

.availability-options label:has(input:checked) {
    border-color: var(--ps-purple);
    background: #f1ebf8;
    color: var(--ps-deep-purple);
    font-weight: 900;
}

.availability-day.locked {
    border-color: #cfc0df;
    background: #f7f2fb;
}

.locked-message {
    margin: 0;
    padding: 10px 12px;
    border-radius: var(--ps-radius-sm);
    background: #efe8f7;
    color: var(--ps-deep-purple);
    font-weight: 900;
}

.locked-shifts {
    margin: 0;
    padding-left: 20px;
}

/* Scanner */
.scanner,
#reader {
    min-height: clamp(280px, 62vw, 440px);
    border-radius: var(--ps-radius) !important;
    background: var(--ps-dark);
    box-shadow: var(--ps-shadow-soft);
}

#scan-message {
    border-radius: var(--ps-radius);
    font-size: 18px;
}

/* Tablet QR */
body.tablet-qr-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 50% 0%, rgba(111, 45, 168, 0.35), transparent 420px),
        radial-gradient(circle at 12% 18%, rgba(239, 91, 91, 0.10), transparent 280px),
        var(--ps-dark);
    color: #ffffff;
}

body.tablet-qr-page .page {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(12px, 2vh, 22px);
    overflow: hidden;
}

body.tablet-qr-page .screen {
    width: min(900px, 100%);
    display: grid;
    justify-items: center;
    text-align: center;
}

body.tablet-qr-page .kiosk-header {
    display: grid;
    justify-items: center;
    align-items: center;
    justify-content: center;
    gap: clamp(6px, 1.2vh, 10px);
    margin-bottom: clamp(10px, 2vh, 18px);
    text-align: center;
}

body.tablet-qr-page .kiosk-logo {
    width: clamp(48px, 7vw, 66px);
    height: clamp(48px, 7vw, 66px);
    border-radius: 16px;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
}

body.tablet-qr-page h1,
body.tablet-qr-page .status {
    color: #ffffff;
}

body.tablet-qr-page h1 {
    margin: 0 0 4px;
    font-size: clamp(27px, 4.1vw, 46px);
}

body.tablet-qr-page .site {
    margin: 0;
    color: #f3e9ff;
    font-size: clamp(20px, 2.6vw, 30px);
    font-weight: 900;
}

body.tablet-qr-page .tablet {
    margin: 3px 0 0;
    color: #cfc1dc;
    font-size: clamp(14px, 1.6vw, 18px);
}

body.tablet-qr-page .kiosk-card {
    width: min(650px, 100%);
    padding: clamp(12px, 2.2vw, 22px);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(6px);
}

body.tablet-qr-page .qr-frame {
    width: min(470px, 76vw, 58vh);
    height: min(470px, 76vw, 58vh);
    margin: 0 auto;
    border: 14px solid #ffffff;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.36);
}

body.tablet-qr-page #qrCode {
    width: 100%;
    height: 100%;
}

body.tablet-qr-page #qrCode img,
body.tablet-qr-page #qrCode canvas {
    width: 100%;
    height: 100%;
}

body.tablet-qr-page .status {
    margin-top: clamp(12px, 2vh, 20px);
    font-size: clamp(22px, 2.8vw, 32px);
}

body.tablet-qr-page .refreshed {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.68);
    font-size: clamp(14px, 1.6vw, 18px);
}

body.tablet-qr-page .error {
    margin: 10px auto 0;
    max-width: 560px;
    border-radius: 12px;
}

body.tablet-qr-page .admin-exit {
    position: fixed;
    right: 18px;
    bottom: 16px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    opacity: 0.58;
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
}

body.tablet-qr-page .admin-exit:hover {
    opacity: 0.92;
}

@media (max-width: 680px) {
    body.tablet-qr-page .page {
        padding: 12px;
    }

    body.tablet-qr-page .kiosk-header {
        gap: 8px;
    }

    body.tablet-qr-page .kiosk-card {
        border-radius: 20px;
    }
}

/* Landing page compatibility */
body.landing-page,
.landing-shell {
    background: var(--ps-bg);
}

.landing-panel,
.portal-link,
.landing-card {
    border-radius: var(--ps-radius);
}

.privacy-link,
.register-link,
.login-link,
.back-link {
    margin-top: 16px;
    text-align: center;
}

.privacy-page .panel {
    max-width: 780px;
    margin: 0 auto;
}

@media (max-width: 560px) {
    .page {
        padding: 20px 12px;
    }

    .panel {
        padding: 18px;
    }

    .header,
    .page-header {
        display: block;
    }

    .header .actions,
    .page-header .actions {
        margin-top: 14px;
    }

    .button,
    .btn,
    button {
        width: 100%;
    }

    table {
        font-size: 14px;
    }

    th,
    td {
        padding: 10px 9px;
    }

    .brand-block {
        justify-content: flex-start;
    }
}

@media (min-width: 720px) {
    .page {
        padding: 44px 22px;
    }

    .panel {
        padding: 30px;
    }

    .filters,
    .form-row,
    .filter-row {
        grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    }

    .form-actions,
    .availability-nav {
        display: flex;
    }

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

@media (min-width: 900px) {
    .panel > .actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .panel > .actions .button.logout {
        grid-column: 1 / -1;
    }
}

/* Design Fix 1: compact premium auth pages and landing proportions */
body.auth-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 18% 10%, rgba(111, 45, 168, 0.16), transparent 330px),
        linear-gradient(135deg, #ffffff 0%, #f6f1fb 52%, #efe6fb 100%);
}

body.auth-page .page {
    width: min(100%, 600px);
    max-width: 600px;
    min-height: 100vh;
    display: grid;
    align-items: center;
    padding: 28px 16px;
}

body.auth-page .panel {
    width: 100%;
    padding: clamp(24px, 5vw, 38px);
    border-radius: 22px;
    box-shadow: 0 24px 64px rgba(31, 23, 40, 0.13);
}

body.auth-page .brand-block {
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    margin-bottom: 22px;
    text-align: center;
}

body.auth-page .brand-logo {
    width: clamp(76px, 14vw, 90px);
    height: clamp(76px, 14vw, 90px);
    border-radius: 18px;
}

body.auth-page .brand-title {
    font-size: 13px;
}

body.auth-page .brand-subtitle {
    font-size: 14px;
}

body.auth-page h1 {
    margin-bottom: 8px;
    font-size: clamp(26px, 5vw, 34px);
    text-align: center;
}

body.auth-page p {
    max-width: 400px;
    margin-right: auto;
    margin-left: auto;
    text-align: center;
}

body.auth-page form {
    margin-top: 18px;
}

body.auth-page input,
body.auth-page button {
    width: 100%;
}

body.auth-page .register-link,
body.auth-page .login-link,
body.auth-page .privacy-link {
    text-align: center;
}

/* Worker Design Fix 1: worker portal layout consistency */
body.worker-dashboard-page .page,
body.worker-scan-page .page,
body.worker-change-password-page .page {
    max-width: 600px;
}

body.worker-dashboard-page .panel {
    padding: clamp(22px, 5vw, 34px);
}

body.worker-dashboard-page .brand-block {
    margin-bottom: 18px;
}

body.worker-dashboard-page h1 {
    font-size: clamp(26px, 5vw, 34px);
}

body.worker-dashboard-page .worker-detail {
    margin-bottom: 20px;
}

body.worker-dashboard-page .panel > .actions {
    gap: 12px;
}

body.worker-dashboard-page .panel > .actions .button[href*="scan.php?type=IN"],
body.worker-dashboard-page .panel > .actions .button[href*="scan.php?type=OUT"] {
    min-height: 68px;
}

body.worker-scan-page .panel {
    padding: clamp(20px, 5vw, 30px);
}

body.worker-scan-page h1,
body.worker-scan-page .instructions {
    text-align: center;
}

body.worker-scan-page .instructions {
    max-width: 460px;
    margin-right: auto;
    margin-left: auto;
}

body.worker-scan-page .scanner,
body.worker-scan-page #qr-reader {
    width: min(100%, 520px);
    min-height: clamp(260px, 64vw, 390px);
    margin: 18px auto 0;
    border: 2px solid rgba(111, 45, 168, 0.46) !important;
    border-radius: 18px !important;
}

body.worker-scan-page #scan-message {
    width: min(100%, 520px);
    margin: 14px auto 0;
}

body.worker-scan-page #dashboard-button,
body.worker-scan-page .button[href*="dashboard.php"] {
    width: min(100%, 520px);
    margin: 14px auto 0;
}

body.worker-shifts-page .page,
body.worker-history-page .page,
body.worker-availability-page .page {
    max-width: 940px;
}

body.worker-shifts-page .brand-block {
    justify-content: flex-start;
    margin-bottom: 16px;
}

body.worker-shifts-page .panel:first-child {
    padding-bottom: 22px;
}

.empty-state {
    margin: 0;
    padding: 18px;
    border: 1px dashed rgba(111, 45, 168, 0.28);
    border-radius: var(--ps-radius);
    background: #fbf8fe;
    color: var(--ps-muted);
    text-align: center;
    font-weight: 700;
}

body.worker-history-page .nav,
body.worker-history-page .back,
body.worker-history-page .availability-nav {
    gap: 10px;
}

body.worker-history-page .nav {
    display: grid;
    grid-template-columns: 1fr;
    margin-bottom: 18px;
}

body.worker-history-page .table-wrap,
body.worker-shifts-page .table-wrap {
    margin-top: 8px;
}

body.worker-history-page td.status {
    white-space: nowrap;
}

body.worker-history-page td.status,
body.worker-shifts-page td.status {
    font-size: 14px;
}

body.worker-availability-page .panel {
    padding: clamp(20px, 4vw, 30px);
}

body.worker-availability-page .availability-list {
    gap: 16px;
}

body.worker-availability-page .availability-day {
    padding: 18px;
}

body.worker-availability-page .availability-day-header {
    margin: 0 0 12px;
}

body.worker-availability-page .availability-day-header strong {
    display: inline-flex;
    align-items: center;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: var(--ps-deep-purple);
    font-size: 16px;
    line-height: 1.25;
}

body.worker-availability-page .availability-options {
    gap: 10px;
}

body.worker-availability-page .availability-options label {
    justify-content: flex-start;
    min-height: 58px;
}

body.worker-availability-page .availability-day.locked {
    border-color: rgba(111, 45, 168, 0.34);
    background: linear-gradient(180deg, #ffffff 0%, #f7f2fb 100%);
}

body.worker-availability-page .locked-availability {
    display: grid;
    gap: 10px;
}

body.worker-availability-page .locked-message {
    border: 1px solid rgba(111, 45, 168, 0.18);
}

body.worker-availability-page .locked-shifts {
    margin-top: 8px;
}

body.worker-change-password-page {
    background:
        radial-gradient(circle at 18% 10%, rgba(111, 45, 168, 0.12), transparent 310px),
        linear-gradient(135deg, #ffffff 0%, #f7f2fb 100%);
}

body.worker-change-password-page .page {
    min-height: 100vh;
    display: grid;
    align-items: center;
    padding: 28px 16px;
}

body.worker-change-password-page .panel {
    width: 100%;
    border-radius: 22px;
    padding: clamp(24px, 5vw, 36px);
    box-shadow: 0 24px 64px rgba(31, 23, 40, 0.12);
}

body.worker-change-password-page h1,
body.worker-change-password-page .hint {
    text-align: center;
}

body.worker-change-password-page .hint {
    max-width: 390px;
    margin-right: auto;
    margin-left: auto;
}

body.worker-change-password-page .form-row {
    display: block;
    margin-bottom: 15px;
}

body.worker-change-password-page label {
    display: block;
    margin: 0 0 7px;
}

body.worker-change-password-page input,
body.worker-change-password-page button,
body.worker-change-password-page .button {
    width: 100%;
}

body.worker-change-password-page .actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

body.worker-shifts-page .actions .button {
    width: auto;
    min-width: 180px;
}

/* Admin Design Fix 1: consistent admin portal polish */
body.admin-dashboard-page .page,
body.admin-attendance-page .page,
body.admin-workers-page .page,
body.admin-availability-page .page,
body.admin-shift-bookings-page .page,
body.admin-users-page .page,
body.admin-bulk-page .page {
    width: min(100%, 1240px);
    padding: 32px 18px;
}

body.admin-dashboard-page .header,
body.admin-attendance-page .header,
body.admin-workers-page .header,
body.admin-availability-page .header,
body.admin-shift-bookings-page .header,
body.admin-users-page .header,
body.admin-bulk-page .header {
    margin-bottom: 22px;
}

body.admin-attendance-page .panel,
body.admin-workers-page .panel,
body.admin-availability-page .panel,
body.admin-shift-bookings-page .panel,
body.admin-users-page .panel,
body.admin-bulk-page .panel {
    padding: clamp(18px, 2.5vw, 26px);
}

body.admin-attendance-page .filters,
body.admin-availability-page .filters,
body.admin-shift-bookings-page .filters {
    margin-bottom: 16px;
}

body.admin-attendance-page .empty,
body.admin-workers-page .empty,
body.admin-availability-page .panel > p,
body.admin-shift-bookings-page .panel > p,
body.admin-users-page .empty {
    margin: 0;
    padding: 16px;
    border: 1px dashed rgba(111, 45, 168, 0.22);
    border-radius: var(--ps-radius-sm);
    background: #fbf8fe;
}

body.admin-workers-page .panel:first-of-type form {
    max-width: 640px;
}

body.admin-workers-page .panel:first-of-type .form-row {
    grid-template-columns: minmax(220px, 1fr) auto;
    align-items: end;
}

body.admin-workers-page .panel:first-of-type > .actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
    margin-top: 16px !important;
}

body.admin-workers-page .panel:first-of-type > .actions .button {
    min-height: 48px;
}

body.admin-workers-page form[method="get"] {
    margin-bottom: 18px !important;
}

body.admin-workers-page .table-wrap,
body.admin-users-page .table-wrap {
    overflow-x: auto;
}

body.admin-workers-page table {
    min-width: 1120px;
}

body.admin-workers-page th:last-child,
body.admin-workers-page td:last-child,
body.admin-users-page th:last-child,
body.admin-users-page td:last-child {
    min-width: 250px;
}

body.admin-workers-page td:last-child .actions,
body.admin-users-page td:last-child {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

body.admin-workers-page td:last-child .button,
body.admin-workers-page td:last-child button,
body.admin-users-page td:last-child .button,
body.admin-users-page td:last-child button,
body.admin-users-page .action-link,
body.admin-users-page button.action-button {
    min-height: 40px;
    padding: 9px 11px;
    white-space: nowrap;
}

body.admin-users-page .badge {
    white-space: nowrap;
}

body.admin-users-page .role-badge {
    text-transform: capitalize;
}

body.admin-users-page .status-badge.active {
    border: 1px solid #bee2cd;
    background: #edf9f2;
    color: var(--ps-success);
}

body.admin-users-page .status-badge.inactive {
    border: 1px solid #f0c9c9;
    background: #fff1f1;
    color: var(--ps-danger);
}

body.admin-shift-bookings-page .booking-summary-grid,
body.admin-bulk-page .summary-grid,
body.admin-import-payroll-page .summary-grid {
    align-items: stretch;
}

body.admin-shift-bookings-page .booking-summary-card {
    border: 1px solid rgba(111, 45, 168, 0.12);
    border-radius: var(--ps-radius-sm);
    background: #fbf8fe;
}

body.admin-shift-bookings-page .booking-preview-list {
    border-color: var(--ps-border);
    border-radius: var(--ps-radius-sm);
    background: #ffffff;
}

body.admin-form-page,
body.admin-change-password-page {
    background:
        radial-gradient(circle at 18% 10%, rgba(111, 45, 168, 0.12), transparent 310px),
        linear-gradient(135deg, #ffffff 0%, #f7f2fb 100%);
}

body.admin-form-page .page,
body.admin-change-password-page .page {
    width: min(100%, 600px);
    max-width: 600px;
    min-height: 100vh;
    display: grid;
    align-items: center;
    padding: 28px 16px;
}

body.admin-form-page .panel,
body.admin-change-password-page .panel {
    width: 100%;
    border-radius: 22px;
    padding: clamp(24px, 5vw, 36px);
    box-shadow: 0 24px 64px rgba(31, 23, 40, 0.12);
}

body.admin-form-page h1,
body.admin-form-page .hint,
body.admin-change-password-page h1,
body.admin-change-password-page .hint {
    text-align: center;
}

body.admin-form-page .hint,
body.admin-change-password-page .hint {
    max-width: 430px;
    margin-right: auto;
    margin-left: auto;
}

body.admin-form-page .form-row,
body.admin-change-password-page .form-row {
    display: block;
    margin-bottom: 15px;
}

body.admin-form-page label,
body.admin-change-password-page label {
    display: block;
    margin: 0 0 7px;
}

body.admin-form-page input,
body.admin-form-page select,
body.admin-form-page button,
body.admin-form-page .button,
body.admin-change-password-page input,
body.admin-change-password-page button,
body.admin-change-password-page .button {
    width: 100%;
}

body.admin-form-page .actions,
body.admin-change-password-page .actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

/* Admin Design Fix 2 final desktop table overrides */
body.admin-workers-page .page {
    width: min(100%, 1400px);
    max-width: 1400px;
}

body.admin-users-page .page {
    width: min(100%, 1360px);
    max-width: 1360px;
}

body.admin-workers-page .table-wrap,
body.admin-users-page .table-wrap {
    overflow: visible;
    max-height: none;
}

body.admin-workers-page table,
body.admin-users-page table {
    width: 100%;
    min-width: 0;
    table-layout: auto;
}

body.admin-workers-page th:last-child,
body.admin-workers-page td:last-child {
    width: 300px;
    min-width: 300px;
}

body.admin-users-page th:last-child,
body.admin-users-page td:last-child {
    width: 260px;
    min-width: 260px;
}

body.admin-workers-page td:last-child .actions,
body.admin-users-page td:last-child {
    align-items: flex-start;
}

body.admin-workers-page td .empty,
body.admin-users-page td .empty {
    display: inline;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

/* Admin Design Fix 3: compact desktop table action rows */
body.admin-workers-page td:nth-child(2) {
    white-space: nowrap;
}

body.admin-workers-page th:last-child,
body.admin-workers-page td:last-child {
    width: 390px;
    min-width: 390px;
}

body.admin-users-page th:last-child,
body.admin-users-page td:last-child {
    width: 310px;
    min-width: 310px;
}

body.admin-workers-page td:last-child .actions,
body.admin-users-page td:last-child {
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

body.admin-workers-page td:last-child form,
body.admin-users-page td:last-child form {
    flex: 0 0 auto;
}

body.admin-workers-page td:last-child .button,
body.admin-workers-page td:last-child button,
body.admin-users-page td:last-child .button,
body.admin-users-page td:last-child button,
body.admin-users-page .action-link,
body.admin-users-page button.action-button {
    min-height: 36px;
    padding: 8px 10px;
    font-size: 14px;
}

@media (max-width: 760px) {
    body.admin-workers-page .panel:first-of-type .form-row {
        grid-template-columns: 1fr;
    }

    body.admin-workers-page .panel:first-of-type > .actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1160px) {
    body.admin-workers-page .table-wrap,
    body.admin-users-page .table-wrap {
        overflow-x: auto;
        overflow-y: hidden;
    }

    body.admin-workers-page table {
        min-width: 1080px;
    }

    body.admin-users-page table {
        min-width: 920px;
    }
}

@media (max-width: 900px) {
    body.admin-workers-page td:last-child .actions,
    body.admin-users-page td:last-child {
        flex-wrap: wrap;
        white-space: normal;
    }
}

/* Admin Design Fix 4: contained Workers table and centered Admin Users table */
body.admin-workers-page .table-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    max-height: none;
}

body.admin-workers-page table {
    min-width: 1080px;
}

body.admin-workers-page td:nth-child(2) {
    white-space: normal;
}

body.admin-workers-page th:last-child,
body.admin-workers-page td:last-child {
    width: 320px;
    min-width: 320px;
}

body.admin-workers-page td:last-child .actions {
    flex-wrap: wrap;
    white-space: normal;
}

body.admin-workers-page td:last-child .button,
body.admin-workers-page td:last-child button {
    flex: 0 1 auto;
}

body.admin-users-page th,
body.admin-users-page td {
    text-align: center;
    vertical-align: middle;
}

body.admin-users-page td:nth-child(2) {
    text-align: center;
}

body.admin-users-page td:last-child {
    justify-content: center;
}

/* Final Design Polish: sensible table alignment consistency */
body.admin-attendance-page th,
body.admin-workers-page th,
body.admin-availability-page th,
body.admin-shift-bookings-page th,
body.worker-history-page th,
body.worker-shifts-page th {
    text-align: center;
    vertical-align: middle;
}

body.admin-attendance-page td,
body.admin-workers-page td,
body.admin-availability-page td,
body.admin-shift-bookings-page td,
body.worker-history-page td,
body.worker-shifts-page td {
    vertical-align: middle;
}

body.admin-attendance-page td:nth-child(3),
body.admin-attendance-page td:nth-child(4),
body.admin-attendance-page td:nth-child(5),
body.admin-attendance-page td:nth-child(6),
body.admin-attendance-page td:nth-child(7),
body.admin-attendance-page td:nth-child(9),
body.admin-attendance-page td:nth-child(10) {
    text-align: center;
}

body.admin-attendance-page td:nth-child(10) .button {
    margin-right: auto;
    margin-left: auto;
}

body.admin-workers-page td:nth-child(1),
body.admin-workers-page td:nth-child(3),
body.admin-workers-page td:nth-child(4),
body.admin-workers-page td:nth-child(5),
body.admin-workers-page td:nth-child(6),
body.admin-workers-page td:nth-child(7) {
    text-align: center;
}

body.admin-workers-page td:nth-child(2) {
    text-align: left;
}

body.admin-workers-page td:last-child .actions {
    justify-content: center;
}

body.admin-availability-page td:nth-child(3),
body.admin-availability-page td:nth-child(4),
body.admin-availability-page td:nth-child(5),
body.admin-availability-page td:nth-child(6),
body.admin-availability-page td:nth-child(7) {
    text-align: center;
}

body.admin-shift-bookings-page td:nth-child(1),
body.admin-shift-bookings-page td:nth-child(3),
body.admin-shift-bookings-page td:nth-child(4),
body.admin-shift-bookings-page td:nth-child(5),
body.admin-shift-bookings-page td:nth-child(6) {
    text-align: center;
}

body.admin-shift-bookings-page td:nth-child(2),
body.admin-shift-bookings-page td:nth-child(7) {
    text-align: left;
}

body.worker-history-page td,
body.worker-shifts-page td:nth-child(1),
body.worker-shifts-page td:nth-child(2),
body.worker-shifts-page td:nth-child(3),
body.worker-shifts-page td:nth-child(4),
body.worker-shifts-page td:nth-child(5) {
    text-align: center;
}

body.worker-shifts-page td:nth-child(6) {
    text-align: left;
}

body.admin-attendance-page .empty,
body.admin-workers-page .empty,
body.admin-availability-page .panel > p,
body.admin-shift-bookings-page .panel > p,
body.admin-users-page .empty,
body.worker-shifts-page .empty {
    text-align: center;
}

@media (min-width: 680px) {
    body.worker-history-page .nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    body.worker-availability-page .availability-options {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Desktop-first admin/client portal foundation for work laptops */
body.admin-dashboard-page .page,
body.admin-attendance-page .page,
body.admin-workers-page .page,
body.admin-availability-page .page,
body.admin-shift-bookings-page .page,
body.admin-users-page .page,
body.admin-payroll-hub-page .page,
body.admin-workforce-hub-page .page,
body.admin-live-dashboard-page .page,
body.admin-attendance-exceptions-page .page,
body.admin-fire-register-page .page,
body.admin-payroll-preview-page .page,
body.admin-payroll-rules-page .page,
body.admin-worker-roles-page .page,
body.admin-worker-role-assignments-page .page,
body.admin-worker-documents-page .page,
body.admin-create-retrospective-booking-page .page,
body.admin-bulk-page .page,
body.client-dashboard-page .page,
body.client-live-dashboard-page .page,
body.client-attendance-exceptions-page .page,
body.client-fire-register-page .page {
    width: min(calc(100% - 48px), 1560px);
    max-width: 1560px;
    padding: 36px 0;
}

body.admin-dashboard-page .page {
    width: min(calc(100% - 48px), 1480px);
    max-width: 1480px;
}

body.client-dashboard-page .page {
    width: min(calc(100% - 48px), 1440px);
    max-width: 1440px;
}

body.admin-change-password-page .page,
body.admin-create-admin-page .page,
body.admin-reset-admin-password-page .page,
body.admin-reset-worker-password-page .page,
body.admin-reset-worker-pin-page .page {
    width: min(calc(100% - 48px), 860px);
    max-width: 860px;
    padding: 36px 0;
}

body.admin-correct-attendance-page .correction-page {
    width: min(calc(100% - 48px), 1280px);
    max-width: 1280px;
    padding: 36px 0;
}

body.admin-dashboard-page .grid,
body.client-dashboard-page .grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

body.admin-dashboard-page .dashboard-section,
body.client-dashboard-page .notice {
    margin-bottom: 30px;
}

body.admin-dashboard-page .dashboard-section {
    margin-top: 34px;
}

body.admin-dashboard-page .card,
body.client-dashboard-page .card {
    min-height: 132px;
    padding: 24px;
}

body.admin-live-dashboard-page .card-grid,
body.admin-attendance-exceptions-page .card-grid,
body.admin-payroll-preview-page .card-grid,
body.client-live-dashboard-page .card-grid,
body.client-attendance-exceptions-page .card-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

body.admin-payroll-preview-page .panel,
body.admin-payroll-hub-page .panel,
body.admin-workforce-hub-page .panel,
body.admin-payroll-rules-page .panel,
body.admin-worker-roles-page .panel,
body.admin-worker-role-assignments-page .panel,
body.admin-workers-page .panel,
body.admin-live-dashboard-page .panel,
body.admin-attendance-exceptions-page .panel,
body.admin-fire-register-page .panel,
body.client-live-dashboard-page .panel,
body.client-attendance-exceptions-page .panel,
body.client-fire-register-page .panel {
    padding: 24px;
}

body.admin-payroll-rules-page .form-row,
body.admin-worker-roles-page .form-row,
body.admin-worker-role-assignments-page .form-row {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

body.admin-payroll-rules-page input,
body.admin-payroll-rules-page select,
body.admin-payroll-rules-page textarea,
body.admin-worker-roles-page input,
body.admin-worker-roles-page textarea,
body.admin-worker-role-assignments-page input,
body.admin-worker-role-assignments-page select,
body.admin-worker-role-assignments-page textarea {
    width: 100%;
}

body.admin-payroll-preview-page .table-wrap,
body.admin-payroll-rules-page .table-wrap,
body.admin-worker-roles-page .table-wrap,
body.admin-worker-role-assignments-page .table-wrap,
body.admin-workers-page .table-wrap,
body.admin-availability-page .table-wrap,
body.admin-shift-bookings-page .table-wrap,
body.admin-live-dashboard-page .table-wrap,
body.admin-attendance-exceptions-page .table-wrap,
body.admin-fire-register-page .table-wrap,
body.client-live-dashboard-page .table-wrap,
body.client-attendance-exceptions-page .table-wrap,
body.client-fire-register-page .table-wrap {
    width: 100%;
}

body.admin-payroll-hub-page .hub-step-grid,
body.admin-workforce-hub-page .hub-step-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    align-items: stretch;
}

body.admin-payroll-hub-page .hub-step-grid .step-card,
body.admin-workforce-hub-page .hub-step-grid .step-card {
    display: flex;
    flex-direction: column;
}

body.admin-payroll-hub-page .hub-step-grid .button-row,
body.admin-workforce-hub-page .hub-step-grid .button-row {
    margin-top: auto;
}

body.admin-payroll-hub-page .hub-final-action,
body.admin-workforce-hub-page .hub-final-action {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
    margin-top: 22px;
}

body.admin-payroll-hub-page .hub-final-action .button-row,
body.admin-workforce-hub-page .hub-final-action .button-row {
    justify-content: flex-end;
}

body.admin-payroll-preview-page .action-toolbar {
    align-items: stretch;
    justify-content: flex-end;
    gap: 12px;
    max-width: 980px;
}

body.admin-payroll-preview-page .action-toolbar-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border: 1px solid #ded8e8;
    border-radius: 8px;
    background: #ffffff;
}

body.admin-payroll-preview-page .toolbar-label {
    width: 100%;
    color: #5d5168;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

@media (min-width: 1280px) {
    body.admin-dashboard-page .grid,
    body.client-dashboard-page .grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    body.admin-payroll-hub-page .hub-step-grid,
    body.admin-workforce-hub-page .hub-step-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    body.admin-dashboard-page .dashboard-section[aria-labelledby="quick-status-heading"] .grid {
        grid-template-columns: repeat(2, minmax(280px, 1fr));
    }

    body.admin-live-dashboard-page .card-grid,
    body.admin-attendance-exceptions-page .card-grid,
    body.admin-payroll-preview-page .card-grid,
    body.client-live-dashboard-page .card-grid,
    body.client-attendance-exceptions-page .card-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    body.admin-dashboard-page .page,
    body.admin-attendance-page .page,
    body.admin-workers-page .page,
    body.admin-availability-page .page,
    body.admin-shift-bookings-page .page,
    body.admin-users-page .page,
    body.admin-payroll-hub-page .page,
    body.admin-workforce-hub-page .page,
    body.admin-live-dashboard-page .page,
    body.admin-attendance-exceptions-page .page,
    body.admin-fire-register-page .page,
    body.admin-payroll-preview-page .page,
    body.admin-payroll-rules-page .page,
    body.admin-worker-roles-page .page,
    body.admin-worker-role-assignments-page .page,
    body.admin-worker-documents-page .page,
    body.admin-create-retrospective-booking-page .page,
    body.admin-bulk-page .page,
    body.admin-change-password-page .page,
    body.admin-create-admin-page .page,
    body.admin-reset-admin-password-page .page,
    body.admin-reset-worker-password-page .page,
    body.admin-reset-worker-pin-page .page,
    body.admin-correct-attendance-page .correction-page,
    body.client-dashboard-page .page,
    body.client-live-dashboard-page .page,
    body.client-attendance-exceptions-page .page,
    body.client-fire-register-page .page {
        width: min(100%, calc(100% - 24px));
        padding: 22px 0;
    }

    body.admin-dashboard-page .grid,
    body.client-dashboard-page .grid {
        grid-template-columns: 1fr;
    }

    body.admin-payroll-hub-page .hub-final-action,
    body.admin-workforce-hub-page .hub-final-action {
        grid-template-columns: 1fr;
    }

    body.admin-payroll-hub-page .hub-final-action .button-row,
    body.admin-workforce-hub-page .hub-final-action .button-row {
        justify-content: flex-start;
    }

    body.admin-payroll-preview-page .action-toolbar {
        max-width: none;
        justify-content: flex-start;
    }
}
