:root {
    --bg: #f5f6f4;
    --panel: #ffffff;
    --panel-soft: #eef4ee;
    --ink: #202522;
    --muted: #68736d;
    --line: #dce1dc;
    --accent: #0DA287;
    --accent-dark: #087764;
    --amber: #a06b18;
    --red: #b74343;
    --shadow: 0 18px 50px rgba(40, 51, 45, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    letter-spacing: 0;
}

body.avatar-modal-open {
    overflow: hidden;
}

a {
    color: var(--accent-dark);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

a:hover {
    text-decoration: underline;
}

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

.auth-page {
    background:
        linear-gradient(90deg, rgba(32, 37, 34, 0.68), rgba(32, 37, 34, 0.18)),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='800' viewBox='0 0 1200 800'%3E%3Crect width='1200' height='800' fill='%23d8ded7'/%3E%3Cg fill='none' stroke='%2395a397' stroke-width='2' opacity='.65'%3E%3Cpath d='M100 620h1000M140 560h310M520 560h520M180 500h170M430 500h300M820 500h230M230 440h280M590 440h420'/%3E%3Cpath d='M180 240h840v180H180zM250 220v220M370 220v220M490 220v220M610 220v220M730 220v220M850 220v220M970 220v220'/%3E%3C/g%3E%3Cg fill='%23758378' opacity='.5'%3E%3Crect x='220' y='300' width='140' height='34'/%3E%3Crect x='430' y='282' width='220' height='38'/%3E%3Crect x='710' y='320' width='170' height='30'/%3E%3C/g%3E%3C/svg%3E") center/cover;
}

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 40px;
}

.login-panel {
    width: min(440px, 100%);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 30px;
}

.login-brand,
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand {
    color: var(--ink);
    padding-bottom: 26px;
    text-decoration: none;
}

.brand:hover {
    text-decoration: none;
}

.brand small,
.login-brand small,
.user-chip small,
.muted-block {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.brand-logo {
    display: block;
    width: 142px;
    height: auto;
    flex: 0 0 auto;
}

.brand-product {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 9px;
    border-left: 1px solid var(--line);
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 850;
    letter-spacing: 0;
    line-height: 1;
    text-transform: uppercase;
}

.login-brand-logo {
    width: 180px;
}

.login-form {
    display: grid;
    gap: 18px;
    margin-top: 34px;
}

.login-form h1,
.page-title h1,
.section-head h2,
.empty-state h2 {
    margin: 0;
    line-height: 1.12;
}

.login-form p,
.section-head p,
.empty-state p {
    margin: 8px 0 0;
    color: var(--muted);
}

label {
    display: grid;
    gap: 8px;
    color: var(--ink);
    font-weight: 650;
}

label span {
    font-size: 13px;
}

.readonly-field {
    display: grid;
    gap: 8px;
    color: var(--ink);
    font-weight: 650;
}

.readonly-field > span {
    font-size: 13px;
}

.readonly-value {
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    line-height: 1.45;
}

.field-note-lines {
    display: grid;
    gap: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

.readonly-value .field-note-lines {
    margin-top: 6px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    padding: 11px 12px;
    outline: none;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(13, 162, 135, 0.14);
}

.primary-button,
.secondary-button,
.ghost-button,
.small-button,
.danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border-radius: 6px;
    border: 1px solid transparent;
    padding: 0 16px;
    cursor: pointer;
    font-weight: 750;
    text-decoration: none;
    white-space: nowrap;
}

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

.primary-button:hover {
    background: var(--accent-dark);
    text-decoration: none;
}

.secondary-button,
.small-button {
    background: #fff;
    border-color: var(--line);
    color: var(--ink);
}

.secondary-button:hover,
.small-button:hover {
    border-color: #bfc8c0;
    text-decoration: none;
}

.ghost-button:hover,
.danger-button:hover {
    text-decoration: none;
}

.small-button {
    min-height: 32px;
    padding: 0 10px;
    font-size: 13px;
}

.ghost-button {
    width: 100%;
    background: transparent;
    border-color: var(--line);
    color: var(--muted);
}

.ghost-link {
    align-self: end;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    color: var(--muted);
}

.danger-button {
    background: #fff;
    border-color: rgba(183, 67, 67, 0.35);
    color: var(--red);
}

.full {
    width: 100%;
}

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

.app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 14px 30px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: saturate(150%) blur(10px);
}

.app-header-brand {
    padding-bottom: 0;
    white-space: nowrap;
}

.nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.nav a {
    display: block;
    padding: 10px 12px;
    border-radius: 6px;
    color: var(--muted);
    font-weight: 750;
    text-decoration: none;
}

.nav a.active,
.nav a:hover {
    background: var(--panel-soft);
    color: var(--ink);
    text-decoration: none;
}

.logout-form {
    margin: 0;
}

.app-header-user {
    display: flex;
    align-items: center;
    justify-self: end;
    gap: 10px;
    min-width: 0;
}

.main {
    flex: 1 0 auto;
    min-width: 0;
    padding: 24px 30px 30px;
}

.app-sync-footer {
    display: flex;
    justify-content: flex-end;
    flex: 0 0 auto;
    padding: 0 30px 14px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
    text-align: right;
}

.section-head,
.form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.page-title {
    margin-bottom: 24px;
}

.page-title-main {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex-wrap: wrap;
}

.page-title-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.page-title-action {
    min-height: 40px;
}

.eyebrow {
    display: block;
    margin-bottom: 6px;
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.user-chip {
    display: grid;
    gap: 2px;
    min-width: 180px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.alert {
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: #fff;
}

.alert-success {
    border-color: rgba(13, 162, 135, 0.25);
    background: #edf6f2;
}

.alert-error {
    border-color: rgba(183, 67, 67, 0.3);
    background: #fff2f0;
    color: #7f2525;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 26px;
}

.stat,
.empty-state,
.form-section {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.stat {
    padding: 18px;
    container-type: inline-size;
}

.stat span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 8px;
}

.stat strong {
    display: block;
    font-size: 28px;
    font-variant-numeric: tabular-nums;
    line-height: 1.05;
    overflow-wrap: normal;
    white-space: nowrap;
}

.stat small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.dashboard-stats-grid .stat strong {
    font-size: clamp(18px, 1.5vw, 28px);
    font-size: clamp(18px, 11cqw, 28px);
}

.order-calendar {
    margin: 0 0 28px;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 8px;
}

.order-calendar-months {
    display: flex;
    gap: 8px;
    align-items: start;
    width: max-content;
    min-width: 100%;
}

.order-calendar-month {
    flex: 0 0 auto;
    width: 126px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfb;
}

.order-calendar-month-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 24px;
    padding: 5px 7px;
    border-bottom: 1px solid var(--line);
    background: #f4f7f4;
}

.order-calendar-month-head h3 {
    margin: 0;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.order-calendar-weekdays {
    border-bottom: 1px solid var(--line);
    background: #f4f7f4;
}

.order-calendar-weekdays span {
    padding: 4px 1px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 850;
    line-height: 1;
    text-align: center;
    text-transform: uppercase;
}

.order-calendar-days {
    gap: 1px;
    grid-auto-rows: 18px;
    background: var(--line);
}

.order-calendar-day {
    position: relative;
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 0;
    height: 18px;
    padding: 0;
    background: #fff;
    overflow: hidden;
}

.order-calendar-day > time {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    color: var(--ink);
    font-size: 11px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    text-align: center;
}

.order-calendar-day.is-outside-month,
.order-calendar-day.is-outside-range {
    background: #f8faf8;
}

.order-calendar-day.is-month-corner-top-left {
    border-top-left-radius: 7px;
}

.order-calendar-day.is-month-corner-top-right {
    border-top-right-radius: 7px;
}

.order-calendar-day.is-month-corner-bottom-left {
    border-bottom-left-radius: 7px;
}

.order-calendar-day.is-month-corner-bottom-right {
    border-bottom-right-radius: 7px;
}

.order-calendar-day.is-today > time {
    background: var(--accent);
    color: #fff;
}

.order-calendar-day.has-events {
    background: #e7f4ee;
    cursor: pointer;
}

.order-calendar-day.has-events:hover,
.order-calendar-day.has-events:focus,
.order-calendar-day.has-events.is-popover-active {
    z-index: 1;
    outline: 2px solid rgba(13, 162, 135, 0.45);
    outline-offset: -2px;
}

.order-calendar-day.has-events:hover > time,
.order-calendar-day.has-events:focus > time,
.order-calendar-day.has-events.is-popover-active > time {
    background: rgba(13, 162, 135, 0.16);
}

.order-calendar-day.is-overdue {
    background: #fff8f6;
}

.order-calendar-events {
    position: absolute;
    right: 1px;
    bottom: 1px;
    display: flex;
    gap: 1px;
    max-width: calc(100% - 4px);
}

.order-calendar-event {
    display: block;
    width: 4px;
    height: 4px;
    min-width: 0;
    overflow: hidden;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: var(--ink);
    font-size: 0;
    line-height: 0;
    text-decoration: none;
}

.order-calendar-event:hover {
    text-decoration: none;
    background: var(--accent-dark);
}

.order-calendar-event.is-overdue {
    background: var(--red);
}

.order-calendar-event.is-overdue:hover {
    background: #8c2d2d;
}

.order-calendar-event-code,
.order-calendar-event-name,
.order-calendar-event-status {
    display: none;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-calendar-day-count {
    position: absolute;
    right: 1px;
    top: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    font-size: 6px;
    font-weight: 900;
    line-height: 1;
}

.order-calendar-popover-source[hidden],
.order-calendar-popover[hidden] {
    display: none;
}

.order-calendar-popover {
    position: fixed;
    z-index: 80;
    display: grid;
    gap: 10px;
    width: min(340px, calc(100vw - 16px));
    max-height: min(420px, calc(100vh - 16px));
    overflow: auto;
    border: 1px solid rgba(48, 69, 59, 0.16);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(31, 45, 38, 0.18);
    padding: 10px;
}

.order-calendar-popover-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

.order-calendar-popover-head strong {
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
}

.order-calendar-popover-head span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
    white-space: nowrap;
}

.order-calendar-popover-list {
    display: grid;
    gap: 8px;
}

.order-calendar-popover-item {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 0 0 8px;
    border-bottom: 1px solid var(--line);
}

.order-calendar-popover-item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.order-calendar-popover-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.order-calendar-popover-item-head a {
    min-width: 0;
    overflow: hidden;
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-calendar-popover-overdue {
    flex: 0 0 auto;
    border-radius: 999px;
    background: #fff0ee;
    color: #9b332d;
    font-size: 10px;
    font-weight: 850;
    line-height: 1;
    padding: 4px 6px;
}

.order-calendar-popover-item strong {
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
}

.order-calendar-popover-products {
    display: grid;
    gap: 2px;
    margin: 0;
    padding: 0;
    color: var(--ink);
    font-size: 11px;
    line-height: 1.3;
    list-style: none;
}

.order-calendar-popover-products li {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-calendar-popover-products li::before {
    content: "• ";
    color: var(--accent-dark);
}

.order-calendar-popover-item > span {
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-calendar-empty {
    margin-bottom: 28px;
}

@keyframes pulseGlow {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(255, 106, 92, 0);
    }

    50% {
        box-shadow: 0 0 22px 0 rgba(255, 106, 92, 0.28);
    }
}

.screen-page {
    --bg: #0b110e;
    --ink: #f1f6f3;
    --muted: #9aa7a0;
    --dim: #7f8d85;
    --line: rgba(255, 255, 255, 0.08);
    --panel: rgba(255, 255, 255, 0.035);
    --teal: #15c8a0;
    --teal-brand: #0da287;
    --amber: #f2b54b;
    --red: #ff6a5c;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: var(--bg);
}

.screen-page .screen {
    width: 1920px;
    height: 1080px;
    padding: 40px 44px;
    display: flex;
    flex-direction: column;
    gap: 26px;
    overflow: hidden;
    background:
        radial-gradient(1400px 900px at 82% -12%, rgba(13, 162, 135, 0.1), transparent 60%),
        var(--bg);
    color: var(--ink);
    font-family: Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    transform: scale(var(--screen-scale, 1));
    transform-origin: top left;
}

.screen-page .head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    flex: 0 0 auto;
}

.screen-page .head-title {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.screen-page .eyebrow {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--teal-brand);
}

.screen-page .head-title h1 {
    margin: 0;
    color: #f4f8f6;
    font-size: 40px;
    font-weight: 800;
    line-height: 1.02;
    letter-spacing: -0.01em;
}

.screen-page .stats {
    display: flex;
    gap: 14px;
    flex: 0 0 auto;
}

.screen-page .stat {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-width: 116px;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
    padding: 12px 20px;
}

.screen-page .stat b {
    color: #f4f8f6;
    font-size: 40px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.screen-page .stat span {
    color: var(--dim);
    font-size: 13px;
    font-weight: 600;
}

.screen-page .stat.warn {
    border-color: rgba(242, 181, 75, 0.22);
    background: rgba(242, 181, 75, 0.08);
}

.screen-page .stat.warn b {
    color: var(--amber);
}

.screen-page .stat.warn span {
    color: #c9a663;
}

.screen-page .stat.bad {
    border-color: rgba(255, 106, 92, 0.26);
    background: rgba(255, 106, 92, 0.09);
}

.screen-page .stat.bad b {
    color: var(--red);
}

.screen-page .stat.bad span {
    color: #d98177;
}

.screen-page .clock {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex: 0 0 auto;
}

.screen-page .clock-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.screen-page .clock-hm {
    font-size: 52px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.01em;
    color: #f4f8f6;
    font-variant-numeric: tabular-nums;
}

.screen-page .clock-s {
    font-size: 22px;
    font-weight: 700;
    color: var(--teal-brand);
    font-variant-numeric: tabular-nums;
}

.screen-page .clock-date {
    font-size: 16px;
    font-weight: 600;
    color: var(--muted);
    text-transform: capitalize;
}

.screen-page .body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1 1 auto;
    min-height: 0;
}

.screen-page .cal {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-height: 0;
}

.screen-page .cal > strong {
    flex: 0 0 auto;
    padding-top: 8px;
    color: #55635b;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.screen-page .cal-grid {
    display: flex;
    gap: 10px;
    flex: 0 1 auto;
    min-height: 0;
}

.screen-page .month {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 7px 8px 8px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.screen-page .month h2 {
    margin: 0;
    font-size: 11px;
    font-weight: 800;
    color: #dfe8e3;
    letter-spacing: 0.01em;
}

.screen-page .wk {
    display: none;
}

.screen-page .wk span {
    text-align: center;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #55635b;
}

.screen-page .days {
    display: grid;
    grid-template-columns: repeat(7, 16px);
    grid-auto-rows: 16px;
    gap: 2px;
}

.screen-page .day {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #c6d2cc;
    background: rgba(255, 255, 255, 0.025);
    line-height: 1;
}

.screen-page .day.out {
    background: transparent;
    color: #3f4b45;
}

.screen-page .day.due {
    background: rgba(21, 200, 160, 0.15);
    color: #bff2e5;
}

.screen-page .day.overdue {
    background: rgba(255, 106, 92, 0.14);
    color: #ffb4ab;
}

.screen-page .day.today {
    box-shadow: inset 0 0 0 2px var(--teal);
    color: #fff;
    font-weight: 800;
}

.screen-page .day em {
    position: absolute;
    top: 0;
    right: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 11px;
    height: 11px;
    border-radius: 999px;
    background: var(--teal);
    color: #04241d;
    font-size: 8px;
    font-style: normal;
    font-weight: 800;
    line-height: 1;
    padding: 0 2px;
}

.screen-page .day.overdue em {
    background: var(--red);
    color: #2a0f0c;
}

.screen-page .items {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1 1 auto;
    min-height: 0;
}

.screen-page .items-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex: 0 0 auto;
}

.screen-page .items-head strong {
    font-size: 22px;
    font-weight: 800;
    color: #f4f8f6;
    letter-spacing: -0.01em;
}

.screen-page .items-head span {
    font-size: 16px;
    font-weight: 700;
    color: var(--dim);
    font-variant-numeric: tabular-nums;
}

.screen-page .items-grid {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    gap: 12px;
}

.screen-page .items-column {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    min-height: 0;
    gap: 8px;
}

.screen-page .screen-order-group {
    display: flex;
    flex: var(--screen-group-items) 1 0;
    min-height: 0;
    gap: 8px;
}

.screen-page .screen-order-group.is-single {
    padding-left: 30px;
}

.screen-page .screen-order-bracket {
    display: flex;
    flex: 0 0 22px;
    align-items: center;
    justify-content: center;
    min-height: 0;
    border: 1px solid rgba(126, 166, 196, 0.35);
    border-right: 0;
    border-radius: 8px 0 0 8px;
    background: rgba(126, 166, 196, 0.1);
    color: #7ea6c4;
}

.screen-page .screen-order-bracket span {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    white-space: nowrap;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.screen-page .screen-order-cards {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    gap: 5px;
}

.screen-page .card {
    position: relative;
    display: flex;
    flex: 1 1 0;
    min-height: 0;
    gap: 12px;
    padding: 7px 9px 7px 16px;
    border-radius: 14px;
    background: var(--panel);
    border: 1px solid var(--line);
    overflow: hidden;
}

.screen-page .card .stripe {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
}

.screen-page .card-content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    min-height: 0;
    gap: 7px;
}

.screen-page .card .name {
    display: flex;
    align-items: center;
    min-height: 0;
    gap: 6px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
}

.screen-page .card .name > span {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.screen-page .screen-quantity-badge {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    padding: 2px 6px;
    border: 1px solid rgba(255, 106, 92, 0.64);
    border-radius: 7px;
    background: rgba(255, 106, 92, 0.12);
    color: #ff8f83;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    vertical-align: middle;
    white-space: nowrap;
}

.screen-page .card .foot {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 9px;
    min-width: 0;
}

.screen-page .card time {
    min-width: 0;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
}

.screen-page .card .chip {
    flex: 0 0 auto;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.screen-page .card-photo {
    flex: 0 0 auto;
    align-self: stretch;
    height: 100%;
    aspect-ratio: 1;
    max-width: 52%;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.screen-page .card-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.screen-page .card-photo.is-placeholder {
    background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.09) 0 6px, rgba(255, 255, 255, 0.045) 6px 12px);
}

.screen-page .screen-item-options {
    display: flex;
    align-items: center;
    min-height: 15px;
    gap: 8px;
}

.screen-page .screen-option,
.screen-page .screen-legend-option {
    display: inline-flex;
    align-items: center;
}

.screen-page .screen-option {
    flex: 0 0 15px;
    height: 15px;
}

.screen-page .screen-option svg,
.screen-page .screen-legend-option svg {
    display: block;
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.screen-page .gift_box { color: oklch(0.78 0.13 165); }
.screen-page .passport { color: oklch(0.78 0.13 85); }
.screen-page .logo { color: oklch(0.78 0.13 320); }
.screen-page .catalog_logo { color: oklch(0.78 0.13 265); }
.screen-page .catalog_plain { color: oklch(0.78 0.13 205); }
.screen-page .napkins { color: oklch(0.78 0.13 130); }

.screen-page .screen-option.is-disabled {
    color: #2f3a35;
}

.screen-page .screen-legend {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    min-height: 20px;
    gap: 20px;
    padding-bottom: 6px;
    color: #66756d;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}

.screen-page .screen-legend-option {
    gap: 6px;
    white-space: nowrap;
}

.screen-page .screen-legend-option svg {
    width: 16px;
    height: 16px;
}

.screen-page .screen-legend-separator {
    color: #39443e;
    font-size: 15px;
}

.screen-page .screen-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    flex: 0 0 auto;
    min-height: 0;
}

.screen-page .screen-footer .cal {
    flex: 1 1 auto;
}

.screen-page .screen-footer .cal-grid .screen-empty {
    min-height: 96px;
    padding: 12px 18px;
}

.screen-page .screen-footer .screen-empty strong {
    font-size: 15px;
}

.screen-page .screen-footer .screen-empty span {
    font-size: 12px;
}

.screen-page .card.teal .stripe {
    background: var(--teal);
}

.screen-page .card.teal time {
    color: #f4f8f6;
}

.screen-page .card.teal .chip {
    background: rgba(21, 200, 160, 0.14);
    color: #5fe0c4;
}

.screen-page .card.amber .stripe {
    background: var(--amber);
}

.screen-page .card.amber time {
    color: var(--amber);
}

.screen-page .card.amber .chip {
    background: rgba(242, 181, 75, 0.16);
    color: #f5c877;
}

.screen-page .card.overdue {
    border-color: rgba(255, 106, 92, 0.4);
    background: rgba(255, 106, 92, 0.07);
    animation: pulseGlow 2.6s ease-in-out infinite;
}

.screen-page .card.overdue .stripe {
    background: var(--red);
}

.screen-page .card.overdue time {
    color: var(--red);
}

.screen-page .card.overdue .chip {
    background: rgba(255, 106, 92, 0.16);
    color: #ff8f83;
}

.screen-page .screen-empty {
    display: grid;
    place-items: center;
    gap: 8px;
    flex: 1 1 auto;
    min-height: 0;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
    padding: 24px;
    text-align: center;
}

.screen-page .screen-empty strong {
    color: #f4f8f6;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.1;
}

.screen-page .screen-empty span {
    color: var(--muted);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
}

.section-head {
    margin: 0 0 16px;
}

.filters {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 220px auto auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 16px;
}

.clients-filters {
    grid-template-columns: minmax(260px, 1fr) auto auto;
}

.status-filters {
    grid-template-columns: minmax(220px, 320px) auto auto;
    justify-content: start;
}

.table-tools {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 10px;
}

.table-filter {
    display: grid;
    gap: 6px;
    width: min(360px, 100%);
}

.table-filter span,
.table-counter {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.table-counter {
    padding-bottom: 12px;
    white-space: nowrap;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

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

.detail-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 18px;
}

.detail-panel h3 {
    margin: 0 0 14px;
}

.entity-list {
    display: grid;
    gap: 10px;
}

.entity-row {
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-size: 14px;
}

.entity-row strong {
    color: var(--ink);
}

.json-details {
    margin-top: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 14px 16px;
}

.json-details summary {
    cursor: pointer;
    font-weight: 800;
}

.json-details pre {
    overflow-x: auto;
    margin: 14px 0 0;
    white-space: pre-wrap;
    word-break: break-word;
    color: #33413b;
    font-size: 13px;
    line-height: 1.5;
}

table {
    width: 100%;
    min-width: 960px;
    border-collapse: collapse;
}

.clients-table,
.items-table,
.employees-table {
    min-width: 1280px;
}

.payroll-table {
    min-width: 0;
    table-layout: fixed;
}

.payroll-stats-grid {
    grid-template-columns: repeat(6, minmax(150px, 1fr));
}

.payroll-stats-grid .stat {
    min-width: 0;
}

.payroll-stats-grid .stat strong {
    font-size: clamp(18px, 1.3vw, 26px);
    font-size: clamp(18px, 10cqw, 26px);
    overflow-wrap: anywhere;
    white-space: normal;
}

.payroll-stats-grid .stat span,
.payroll-stats-grid .stat small {
    overflow-wrap: anywhere;
}

.payroll-head {
    margin-bottom: 18px;
}

.payroll-head > div:first-child {
    min-width: 0;
}

.payroll-head p {
    max-width: 880px;
    overflow-wrap: anywhere;
}

.payroll-nav {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.payroll-role-list {
    margin-top: 7px;
    min-width: 0;
}

.payroll-table th,
.payroll-table td {
    min-width: 0;
    padding-right: 10px;
    padding-left: 10px;
    overflow-wrap: anywhere;
    vertical-align: top;
}

.payroll-table th:nth-child(1),
.payroll-table td:nth-child(1) {
    width: 16%;
}

.payroll-table th:nth-child(2),
.payroll-table td:nth-child(2) {
    width: 12%;
}

.payroll-table th:nth-child(3),
.payroll-table td:nth-child(3) {
    width: 10%;
}

.payroll-table th:nth-child(4),
.payroll-table td:nth-child(4) {
    width: 15%;
}

.payroll-table th:nth-child(5),
.payroll-table td:nth-child(5) {
    width: 9%;
}

.payroll-table th:nth-child(6),
.payroll-table td:nth-child(6) {
    width: 11%;
}

.payroll-table th:nth-child(7),
.payroll-table td:nth-child(7) {
    width: 8%;
}

.payroll-table th:nth-child(8),
.payroll-table td:nth-child(8) {
    width: 10%;
}

.payroll-table th:nth-child(9),
.payroll-table td:nth-child(9) {
    width: 9%;
}

.payroll-table .money-cell {
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
    white-space: normal;
    word-break: normal;
}

.payroll-money-stack {
    display: grid;
    gap: 4px;
    justify-items: end;
}

.payroll-rounded-cash {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.payroll-table td > a,
.payroll-table td > strong,
.payroll-table .muted-block {
    min-width: 0;
    overflow-wrap: anywhere;
}

.payroll-table td > a {
    display: inline-block;
    max-width: 100%;
}

.payroll-table td > a strong {
    overflow-wrap: anywhere;
}

.payroll-table .employee-role {
    max-width: 100%;
    min-height: 0;
    padding: 5px 9px;
    line-height: 1.2;
    overflow-wrap: anywhere;
    text-align: left;
    white-space: normal;
}

.payroll-table tfoot th {
    border-top: 1px solid var(--line);
    background: var(--panel-soft);
    font-size: 14px;
}

.item-title-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
}

.item-thumb {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel-soft);
    object-fit: cover;
}

.item-title-text {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.item-source {
    color: var(--muted);
    font-size: 12px;
}

.item-price-stack {
    display: grid;
    gap: 4px;
    justify-items: end;
}

.item-amo-update-form {
    display: inline-flex;
}

.item-amo-update-button {
    min-height: 26px;
    border: 1px solid rgba(13, 162, 135, 0.24);
    border-radius: 6px;
    background: #fff;
    color: var(--accent-dark);
    cursor: pointer;
    font-size: 11px;
    font-weight: 850;
    line-height: 1;
    padding: 0 8px;
    white-space: nowrap;
}

.item-amo-update-button:hover {
    border-color: rgba(13, 162, 135, 0.48);
    background: rgba(13, 162, 135, 0.06);
}

.item-amo-price {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

th,
td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.sortable-header {
    cursor: pointer;
    padding-right: 24px;
    position: relative;
    user-select: none;
}

.sortable-header::after {
    content: "↕";
    font-size: 11px;
    opacity: 0.45;
    position: absolute;
    right: 8px;
}

.sortable-header.sort-asc::after {
    content: "↑";
    opacity: 1;
}

.sortable-header.sort-desc::after {
    content: "↓";
    opacity: 1;
}

tr:last-child td {
    border-bottom: 0;
}

.clickable-row {
    cursor: pointer;
}

.clickable-row:hover td,
.clickable-row:focus-visible td {
    background: var(--panel-soft);
}

.employee-row.is-terminated td {
    background: #f5f6f4;
    color: #7a837d;
}

.employee-row.is-terminated:hover td,
.employee-row.is-terminated:focus-visible td {
    background: #eef1ee;
}

.employee-row.is-terminated a,
.employee-row.is-terminated strong {
    color: #68716b;
}

.employee-row.is-terminated .employee-avatar {
    filter: grayscale(1);
    opacity: 0.68;
}

.employee-row.is-terminated .employee-role,
.employee-row.is-terminated .status {
    filter: grayscale(0.85);
    opacity: 0.72;
}

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

.employee-create-roles label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    min-height: 38px;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    padding: 8px 10px;
}

.employee-create-roles input {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    margin: 0;
    accent-color: var(--accent);
}

.employee-create-roles span {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--ink);
    font-size: 13px;
    font-weight: 750;
    line-height: 1.2;
}

.employee-create-contract-grid {
    margin-top: 0;
}

.employee-create-new-roles {
    margin: 0 0 14px;
}

.employee-access-key-form {
    display: grid;
    gap: 12px;
}

.employee-access-key-form-list,
.employee-access-key-list {
    display: grid;
    gap: 8px;
}

.employee-access-key-form-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
    gap: 12px;
    align-items: end;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.employee-access-key-form-row label {
    margin: 0;
}

.employee-access-key-remove {
    min-height: 42px;
}

.employee-access-key-list {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.employee-access-key-item {
    display: grid;
    gap: 6px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.employee-access-key-item span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.employee-access-key-item strong {
    min-width: 0;
    color: var(--ink);
    font-size: 16px;
    overflow-wrap: anywhere;
}

.order-item-links {
    display: grid;
    gap: 4px;
}

.order-item-links > a,
.order-item-links > strong {
    display: block;
    width: fit-content;
}

.order-item-links a {
    color: var(--text);
}

.order-item-links a:hover {
    color: var(--accent);
}

.line-quantity {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    margin-left: 6px;
    padding: 2px 8px;
    border: 2px solid transparent;
    border-radius: 8px;
    line-height: 1;
    white-space: nowrap;
}

.line-quantity.is-multiple {
    border-color: var(--red);
    color: var(--red);
    background: #fff7f6;
}

.status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border-radius: 999px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.status-call {
    background: #e9f1ef;
    color: #0DA287;
}

.status-cooperation {
    background: #e7eff9;
    color: #345f9f;
}

.status-doing {
    background: #fff4dc;
    color: #8b5a12;
}

.status-waiting_payment {
    background: #eef0f2;
    color: #596169;
}

.status-bought {
    background: #e7f5df;
    color: #3f742a;
}

.status-left {
    background: #ece7df;
    color: #61523c;
}

.status-not_relevant {
    background: #f7e7e5;
    color: #9c3932;
}

.status-amocrm {
    --status-color: var(--accent);
    background: var(--status-color);
    border: 1px solid var(--status-color);
    color: var(--ink);
}

.work-status-cell {
    text-align: center;
}

.next-payment-note {
    margin-top: 5px;
    text-align: center;
}

.dashboard-due-date-cell {
    min-width: 132px;
}

.dashboard-due-date-form {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-width: 104px;
    min-height: 30px;
}

.dashboard-due-date-trigger {
    display: inline-flex;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    padding: 0;
}

.dashboard-due-date-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    min-height: 30px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 650;
    line-height: 1;
    padding: 0 8px;
}

.dashboard-due-date-form:hover .dashboard-due-date-label,
.dashboard-due-date-form:focus-within .dashboard-due-date-label {
    border-color: rgba(13, 162, 135, 0.28);
    background: #eef8f4;
}

.dashboard-due-date-form.is-saving .dashboard-due-date-label {
    color: var(--muted);
}

.dashboard-due-date-form.is-error .dashboard-due-date-label {
    border-color: rgba(183, 67, 67, 0.3);
    background: #fff2f0;
    color: #7f2525;
}

.dashboard-due-date-input {
    position: absolute;
    width: 1px;
    height: 1px;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.dashboard-due-date-input:disabled {
    cursor: wait;
}

.dashboard-due-date-state {
    position: absolute;
    left: 0;
    top: 100%;
    display: block;
    min-width: 160px;
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 750;
    line-height: 1.2;
    white-space: normal;
}

.dashboard-due-date-form.is-error .dashboard-due-date-state {
    color: #7f2525;
}

.dashboard-date-picker[hidden] {
    display: none;
}

.dashboard-date-picker {
    position: fixed;
    z-index: 90;
    width: 238px;
    border: 1px solid rgba(48, 69, 59, 0.16);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(31, 45, 38, 0.18);
    padding: 10px;
}

.dashboard-date-picker-head {
    display: grid;
    grid-template-columns: 28px 1fr 28px;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.dashboard-date-picker-month {
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
}

.dashboard-date-picker-nav,
.dashboard-date-picker-day {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    line-height: 1;
    padding: 0;
}

.dashboard-date-picker-nav {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    color: var(--accent-dark);
    font-size: 18px;
}

.dashboard-date-picker-nav:hover,
.dashboard-date-picker-day:hover,
.dashboard-date-picker-day:focus-visible {
    border-color: rgba(13, 162, 135, 0.28);
    background: #eef8f4;
    outline: none;
}

.dashboard-date-picker-weekdays,
.dashboard-date-picker-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 2px;
}

.dashboard-date-picker-weekdays {
    margin-bottom: 4px;
}

.dashboard-date-picker-weekdays span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 750;
    line-height: 1;
    text-align: center;
}

.dashboard-date-picker-day,
.dashboard-date-picker-empty {
    width: 28px;
    height: 28px;
    border-radius: 6px;
}

.dashboard-date-picker-day {
    font-size: 12px;
    font-weight: 550;
}

.dashboard-date-picker-day.is-selected {
    background: var(--accent);
    color: #fff;
}

.dashboard-date-picker-day.is-today:not(.is-selected) {
    border-color: rgba(13, 162, 135, 0.42);
}

.actions-cell {
    text-align: right;
}

.table-nowrap,
.money-cell {
    white-space: nowrap;
}

.contact-cell {
    color: var(--muted);
    min-width: 150px;
    max-width: 210px;
    white-space: normal;
}

.contact-lines {
    display: grid;
    gap: 4px;
    min-width: 0;
    max-width: 210px;
}

.contact-phone {
    color: var(--ink);
    white-space: nowrap;
}

.contact-email {
    font-size: 12px;
    overflow-wrap: anywhere;
}

.employee-role-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.employee-name-cell,
.employee-view-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.employee-view-title {
    gap: 16px;
}

.employee-avatar {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--panel-soft);
    color: var(--accent-dark);
    object-fit: cover;
}

.employee-avatar-large {
    width: 84px;
    height: 84px;
    flex-basis: 84px;
}

.employee-avatar-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 850;
}

.employee-avatar-large.employee-avatar-initials {
    font-size: 26px;
}

.employee-avatar-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 104px;
    height: 104px;
    flex: 0 0 104px;
    margin: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    cursor: pointer;
    padding: 0;
}

.employee-avatar-button .employee-avatar {
    width: 100%;
    height: 100%;
    flex: 0 0 100%;
}

.employee-avatar-button:focus-visible {
    outline: 3px solid rgba(13, 162, 135, 0.22);
    outline-offset: 4px;
}

.employee-avatar-edit-label {
    position: absolute;
    left: 50%;
    bottom: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    border-radius: 999px;
    background: rgba(32, 37, 34, 0.82);
    color: #fff;
    font-size: 11px;
    font-weight: 850;
    opacity: 0;
    padding: 0 9px;
    pointer-events: none;
    transform: translateX(-50%);
    transition: opacity 0.16s ease;
}

.employee-avatar-button:hover .employee-avatar-edit-label,
.employee-avatar-button:focus-visible .employee-avatar-edit-label {
    opacity: 1;
}

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

.avatar-modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(32, 37, 34, 0.46);
}

.avatar-modal-panel {
    width: min(520px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.82);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
    padding: 18px;
}

.avatar-modal-panel form {
    display: grid;
    gap: 16px;
}

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

.avatar-modal-head h3 {
    margin: 0;
}

.avatar-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    font-size: 24px;
    font-weight: 650;
    line-height: 1;
}

.avatar-source-actions,
.avatar-modal-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.avatar-modal-actions {
    justify-content: flex-end;
}

.avatar-crop-shell {
    display: grid;
    justify-items: center;
    gap: 12px;
}

.avatar-crop-shell[hidden] {
    display: none;
}

.avatar-crop-stage {
    position: relative;
    width: min(340px, 100%);
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
    background: #dde4df;
    cursor: grab;
    touch-action: none;
}

.avatar-crop-stage.is-dragging {
    cursor: grabbing;
}

.avatar-crop-stage img {
    position: absolute;
    top: 0;
    left: 0;
    max-width: none;
    user-select: none;
    -webkit-user-drag: none;
}

.avatar-crop-ring {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 0 49%, rgba(32, 37, 34, 0.28) 50% 100%);
    pointer-events: none;
}

.avatar-crop-ring::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 2px solid rgba(255, 255, 255, 0.96);
    border-radius: 50%;
}

.avatar-zoom-control {
    display: grid;
    gap: 6px;
    width: min(340px, 100%);
    margin: 0;
}

.avatar-zoom-control span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.avatar-zoom-control input {
    width: 100%;
}

.employee-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
    gap: 22px;
    align-items: stretch;
    margin: 0 0 16px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(40, 51, 45, 0.08);
}

.employee-hero-main {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.employee-hero .employee-avatar-large {
    width: 104px;
    height: 104px;
    flex: 0 0 104px;
    border: 3px solid #fff;
    box-shadow: 0 8px 24px rgba(40, 51, 45, 0.16);
}

.employee-hero-copy {
    min-width: 0;
}

.employee-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex-wrap: wrap;
}

.employee-status-pill,
.employee-folder-pill {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    min-height: 26px;
    padding: 0 9px;
    border: 1px solid rgba(13, 162, 135, 0.25);
    border-radius: 999px;
    background: #eef7f3;
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 850;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.employee-status-terminated {
    border-color: #d9d5cd;
    background: #f2efea;
    color: #6c6253;
}

.employee-hero-copy h2 {
    margin: 0;
    font-size: 30px;
    line-height: 1.08;
}

.employee-hero-copy p {
    margin: 8px 0 0;
    max-width: 720px;
    color: var(--muted);
    line-height: 1.45;
}

.employee-full-name-note,
.employee-field-note {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.35;
}

.employee-hero-roles {
    margin-top: 14px;
}

.employee-hero-roles .employee-role,
.employee-profile .employee-role {
    max-width: 100%;
    height: auto;
    padding-top: 4px;
    padding-bottom: 4px;
    line-height: 1.2;
    overflow-wrap: anywhere;
    white-space: normal;
}

.employee-hero-aside {
    display: grid;
    align-content: center;
    gap: 14px;
    min-width: 0;
    padding-left: 20px;
    border-left: 1px solid var(--line);
}

.employee-hero-metric,
.employee-hero-contract {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.employee-hero-metric span,
.employee-hero-contract span,
.employee-quick-facts span,
.employee-document-folder span,
.employee-document-files > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.employee-hero-metric strong {
    display: block;
    font-size: 30px;
    font-variant-numeric: tabular-nums;
    line-height: 1.05;
    white-space: nowrap;
}

.employee-hero-metric small,
.employee-hero-contract strong,
.employee-document-folder small,
.employee-document-list small {
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.employee-hero-contract strong {
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.employee-termination-form {
    display: grid;
    grid-template-columns: minmax(170px, 220px) auto;
    gap: 8px;
    align-items: end;
    width: max-content;
    max-width: 100%;
    min-width: 0;
    margin: -8px 0 24px auto;
}

.employee-termination-form label {
    display: grid;
    gap: 5px;
    margin: 0;
    min-width: 0;
}

.employee-termination-form span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.employee-termination-form input {
    min-height: 46px;
}

.employee-termination-form .secondary-button {
    border-color: #c9362f;
    color: #c9362f;
    min-height: 46px;
    margin-top: 0;
}

.employee-termination-form .secondary-button:hover {
    border-color: #a92722;
    background: #fff3f2;
    color: #a92722;
}

.employee-hero-aside .secondary-button {
    justify-self: start;
    margin-top: 2px;
}

.employee-quick-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.employee-quick-facts article {
    display: grid;
    gap: 7px;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.employee-quick-facts strong {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    font-size: 15px;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.employee-level-fact {
    align-content: start;
}

.employee-level-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.employee-level-form select {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #f8faf8;
    color: var(--ink);
    font-weight: 750;
}

.employee-level-form .small-button {
    min-height: 38px;
    padding-inline: 12px;
}

.employee-avatar-source {
    display: grid;
    gap: 6px;
    margin: -6px 0 22px;
    color: var(--muted);
}

.employee-avatar-source span {
    display: block;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.employee-avatar-source strong {
    color: var(--ink);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.employee-role {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    padding: 0 9px;
    background: var(--panel-soft);
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.employee-role-assembly {
    background: #b8dcff;
    color: #0d5da4;
}

.employee-role-cnc {
    background: #ffb4ad;
    color: #a41e16;
}

.employee-role-galvanic {
    background: #ffc9a4;
    color: #8b4a16;
}

.employee-role-stonecutter {
    background: #bcecc4;
    color: #087344;
}

.employee-role-marble {
    background: #e1e4e8;
    color: #1f2933;
}

.employee-role-turner {
    background: #dfc3ef;
    color: #71439b;
}

.employee-role-bronze {
    background: #f5dd93;
    color: #6f5211;
}

.employee-role-management {
    background: #b7dfd5;
    color: #086353;
}

.employee-profile {
    margin-bottom: 24px;
}

.employee-role-card {
    display: grid;
    gap: 16px;
    margin-bottom: 24px;
}

.role-history-head {
    align-items: center;
}

.role-history-head p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.employee-role-form,
.employee-role-history-row {
    display: grid;
    grid-template-columns: minmax(150px, 0.5fr) minmax(280px, 1.4fr) minmax(180px, 0.8fr) auto;
    gap: 12px;
    align-items: end;
}

.employee-role-form {
    padding: 12px;
    border: 1px solid rgba(13, 162, 135, 0.18);
    border-radius: 8px;
    background: #f7fbf9;
}

.employee-role-history-list {
    display: grid;
    gap: 8px;
}

.employee-role-history-row {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.role-date-control,
.role-note-control {
    display: grid;
    gap: 6px;
    margin: 0;
}

.role-date-control span,
.role-note-control span,
.role-select-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.role-select {
    position: relative;
    display: grid;
    gap: 6px;
    min-width: 0;
}

.role-select-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    font-weight: 750;
    padding: 0 36px 0 12px;
    text-align: left;
}

.role-select-button::after {
    content: "";
    position: absolute;
    right: 13px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    pointer-events: none;
    transform: translateY(-50%) rotate(45deg);
}

.role-select.is-open .role-select-button::after {
    transform: translateY(-20%) rotate(225deg);
}

.role-select-button span {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.role-select-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 12;
    display: grid;
    gap: 4px;
    max-height: 260px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 16px 36px rgba(40, 51, 45, 0.16);
    padding: 8px;
}

.role-select-menu[hidden] {
    display: none;
}

.role-select-menu label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    margin: 0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 750;
    padding: 7px 8px;
}

.role-select-menu label:hover {
    background: var(--panel-soft);
}

.role-select-menu input {
    width: 14px;
    height: 14px;
    margin: 0;
    accent-color: var(--accent);
}

.employee-role-history-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.salary-chart-section {
    margin-bottom: 24px;
}

.salary-chart-head {
    align-items: flex-start;
}

.salary-chart-head p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.salary-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.salary-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.salary-chart-legend i {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
}

.legend-salary {
    border: 3px solid var(--accent);
}

.legend-shift {
    border: 3px solid #2175b5;
}

.salary-chart-wrap {
    position: relative;
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfb;
}

.salary-chart {
    display: block;
    width: 100%;
    height: 310px;
}

.salary-chart-line {
    fill: none;
    stroke: #26312c;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 3;
}

.salary-chart-point {
    cursor: default;
    fill: #fff;
    stroke-width: 3;
    transition: fill 0.16s ease, opacity 0.16s ease, r 0.16s ease;
}

.salary-chart-point.is-salary {
    stroke: var(--accent);
}

.salary-chart-point.is-shift {
    stroke: #2175b5;
}

.salary-chart-point.is-empty {
    opacity: 0.55;
}

.salary-chart-point:hover,
.salary-chart-point.chart-detail-active {
    opacity: 1;
    r: 7;
}

.salary-chart-point.is-salary:hover,
.salary-chart-point.is-salary.chart-detail-active {
    fill: var(--accent);
}

.salary-chart-point.is-shift:hover,
.salary-chart-point.is-shift.chart-detail-active {
    fill: #2175b5;
}

.employee-salary-card {
    display: grid;
    gap: 16px;
    margin-bottom: 24px;
}

.employee-pay-mode-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border: 1px solid rgba(13, 162, 135, 0.25);
    border-radius: 999px;
    background: #edf8f4;
    color: #0b6f61;
    font-size: 12px;
    font-weight: 850;
    padding: 0 10px;
    white-space: nowrap;
}

.salary-history-head {
    align-items: center;
}

.salary-history-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex-wrap: wrap;
}

.salary-history-title h3 {
    margin: 0;
}

.salary-add-toggle {
    min-width: 0;
}

.salary-change-form {
    display: grid;
    grid-template-columns: minmax(130px, 0.8fr) minmax(140px, 0.8fr) minmax(140px, 0.8fr) minmax(200px, 1.1fr) minmax(180px, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.salary-change-form[hidden] {
    display: none;
}

.salary-change-form label {
    margin: 0;
}

.salary-change-form .wide {
    grid-column: auto;
}

.salary-change-form button {
    min-width: 172px;
}

.salary-history-list {
    display: grid;
    gap: 8px;
}

.salary-history-row {
    display: grid;
    grid-template-columns: minmax(120px, 0.75fr) minmax(130px, 0.8fr) minmax(120px, 0.75fr) minmax(190px, 1fr) minmax(170px, 1.1fr) auto;
    gap: 8px;
    align-items: end;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.salary-history-row.is-current {
    border-color: rgba(13, 162, 135, 0.25);
    background: #f7fbf9;
}

.salary-history-row label {
    margin: 0;
}

.salary-history-actions {
    display: flex;
    align-items: center;
    align-self: end;
    justify-content: flex-end;
    gap: 8px;
    min-height: 40px;
    min-width: 188px;
}

.salary-history-actions .small-button,
.salary-history-actions .danger-button {
    min-height: 40px;
    padding: 0 12px;
}

.employee-shifts {
    display: grid;
    gap: 16px;
    margin-bottom: 24px;
}

.shift-month-nav {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-weight: 800;
}

.shift-month-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    text-decoration: none;
}

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

.shift-summary-grid div {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
}

.shift-summary-grid span {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.shift-summary-grid strong {
    font-size: 18px;
    font-variant-numeric: tabular-nums;
}

.shift-calendar-form {
    display: grid;
    gap: 10px;
    user-select: none;
}

.shift-rate-control {
    display: grid;
    gap: 4px;
    width: min(220px, 100%);
    margin: 0;
}

.shift-rate-control span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.shift-weekdays,
.shift-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(64px, 1fr));
    gap: 6px;
}

.shift-weekdays span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
    text-align: center;
    text-transform: uppercase;
}

.shift-day {
    position: relative;
    display: grid;
    align-content: center;
    gap: 4px;
    min-height: 64px;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    text-align: left;
    touch-action: none;
}

.shift-day > input[type="checkbox"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}

.shift-day:hover {
    border-color: rgba(13, 162, 135, 0.35);
    background: #f4faf7;
}

.shift-day[data-shift-hint]:not([data-shift-hint=""]):hover::after {
    content: attr(data-shift-hint);
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: calc(100% + 6px);
    z-index: 3;
    min-width: 120px;
    padding: 7px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(40, 51, 45, 0.12);
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.25;
    white-space: normal;
}

.shift-day:has(input:focus-visible) {
    box-shadow: 0 0 0 3px rgba(13, 162, 135, 0.14);
}

.shift-day.is-muted {
    cursor: default;
}

.shift-day.is-muted {
    opacity: 0.35;
}

.shift-day.is-locked {
    border-color: #e2e0d8;
    background: #f7f5ee;
    color: #8a806d;
    cursor: not-allowed;
}

.shift-day.is-locked:hover {
    border-color: #e2e0d8;
    background: #f7f5ee;
}

.shift-day.is-today:not(.is-worked) {
    border-color: rgba(13, 162, 135, 0.55);
}

.shift-day.is-worked {
    border-color: rgba(13, 162, 135, 0.3);
    background: #dff0ea;
    color: #083d34;
}

.shift-day.is-editing {
    align-content: start;
    min-height: 174px;
    z-index: 4;
}

.shift-day-number {
    font-size: 15px;
    font-weight: 850;
}

.shift-day-rate {
    color: var(--accent-dark);
    font-size: 11px;
    font-weight: 850;
    white-space: nowrap;
}

.shift-calendar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
    min-height: 64px;
}

.shift-calendar-actions .shift-rate-control {
    align-self: center;
    position: relative;
    padding-top: 0;
}

.shift-calendar-actions input {
    min-height: 40px;
}

.shift-calendar-actions .shift-rate-control span {
    position: absolute;
    left: 0;
    bottom: calc(100% + 4px);
    line-height: 1;
}

.shift-action-total {
    margin-right: auto;
    color: var(--ink);
    font-size: 14px;
    font-weight: 850;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.shift-day-inline {
    display: grid;
    gap: 6px;
    margin-top: 6px;
    min-width: 0;
}

.shift-day-inline[hidden] {
    display: none;
}

.shift-day-inline label {
    display: grid;
    gap: 2px;
    margin: 0;
    min-width: 0;
}

.shift-day-inline span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 850;
}

.shift-day-inline input {
    min-height: 30px;
    padding: 0 7px;
    font-size: 12px;
}

.shift-day-inline-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.shift-day-inline-actions .small-button {
    min-height: 28px;
    padding: 0 8px;
    font-size: 12px;
}

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

.employee-personal-meta strong {
    line-height: 1.45;
}

.document-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.document-list li {
    display: grid;
    gap: 4px;
}

.document-list span {
    color: var(--muted);
    font-size: 12px;
    overflow-wrap: anywhere;
    text-transform: none;
}

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

.employee-documents-card {
    padding: 0;
}

.employee-documents-card summary {
    align-items: center;
    cursor: pointer;
    list-style: none;
    padding: 18px;
}

.employee-documents-card summary::-webkit-details-marker {
    display: none;
}

.employee-documents-card summary::after {
    content: "Раскрыть";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    flex: 0 0 auto;
    min-width: 104px;
    min-height: 40px;
    margin-left: auto;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    font-size: 14px;
    font-weight: 850;
    line-height: 1;
    padding: 0 16px;
    text-align: center;
    white-space: nowrap;
}

.employee-documents-card[open] summary::after {
    content: "Свернуть";
}

.employee-card-section-head p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.employee-documents-layout {
    display: grid;
    grid-template-columns: minmax(220px, 0.8fr) minmax(0, 2fr);
    gap: 16px;
    align-items: start;
    padding: 0 18px 18px;
}

.employee-document-folder,
.employee-document-files {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.employee-document-folder strong {
    min-width: 0;
    font-size: 18px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.employee-document-list {
    gap: 8px;
}

.employee-document-list li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
}

.employee-document-list div {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.employee-document-list a {
    min-width: 0;
    color: var(--ink);
    text-decoration: none;
}

.employee-document-list a:hover {
    color: var(--accent-dark);
    text-decoration: underline;
}

.document-list .document-file-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 32px;
    border: 1px solid rgba(13, 162, 135, 0.2);
    border-radius: 6px;
    background: #fff;
    color: var(--accent-dark);
    font-size: 11px;
    font-weight: 900;
    overflow-wrap: normal;
    text-transform: uppercase;
}

.employee-document-list strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    padding: 38px;
    text-align: center;
}

.empty-state .primary-button {
    margin-top: 16px;
}

.inline-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.client-profile {
    margin-bottom: 24px;
}

.item-profile-grid {
    display: grid;
    grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.item-hero-link {
    display: block;
}

.item-hero {
    width: 100%;
    aspect-ratio: 1;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
    object-fit: cover;
}

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

.item-meta div {
    align-content: start;
    align-items: start;
}

.item-meta .item-amo-price {
    margin-top: 4px;
}

.client-meta .item-card-price-action {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.item-description {
    margin: 18px 0 0;
    color: var(--ink);
    line-height: 1.55;
}

.item-source-button {
    margin-top: 16px;
}

.item-copy-note {
    display: grid;
    gap: 6px;
    margin-bottom: 16px;
    color: var(--muted);
}

.item-copy-note strong {
    color: var(--ink);
}

.item-form-error {
    margin-bottom: 16px;
    border-color: rgba(183, 67, 67, 0.22);
    background: #fff7f6;
}

.item-image-form-grid {
    display: grid;
    grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.item-image-preview {
    display: grid;
    width: 100%;
    aspect-ratio: 1;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-align: center;
}

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

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

.item-remove-image {
    align-self: end;
}

.sales-chart-section {
    margin-bottom: 24px;
}

.sales-chart-head {
    align-items: flex-start;
}

.sales-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.sales-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.sales-chart-legend i {
    display: inline-block;
    width: 22px;
    height: 8px;
    border-radius: 8px;
}

.legend-bar {
    background: rgba(13, 162, 135, 0.34);
}

.legend-line {
    background: var(--amber);
}

.legend-finance-line,
.legend-finance-income {
    background: #0da287;
}

.legend-finance-expense {
    background: #b74343;
}

.legend-finance-result {
    background: #202522;
}

.sales-chart-wrap {
    position: relative;
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfb;
}

.sales-chart {
    display: block;
    min-width: 760px;
    width: 100%;
    height: 340px;
}

.chart-axis {
    stroke: #aeb8b1;
    stroke-width: 1.2;
}

.chart-grid {
    stroke: #e0e6e1;
    stroke-width: 1;
}

.chart-zero-line {
    stroke: #202522;
    stroke-dasharray: 6 5;
    stroke-width: 1.4;
    opacity: 0.42;
}

.chart-tick {
    stroke: #9aa69e;
    stroke-width: 1;
}

.chart-hover-surface {
    fill: transparent;
    pointer-events: all;
}

.sales-chart-hover {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.sales-chart-hover.is-active {
    opacity: 1;
    visibility: visible;
}

.chart-hover-line {
    stroke: #26312c;
    stroke-dasharray: 4 4;
    stroke-width: 1.2;
    opacity: 0.48;
}

.chart-hover-label-bg {
    fill: var(--ink);
    opacity: 0.94;
}

.chart-hover-label {
    fill: #fff;
    font-size: 12px;
    font-weight: 800;
    text-anchor: middle;
}

.chart-label {
    fill: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.chart-label-left {
    text-anchor: end;
}

.chart-label-right {
    text-anchor: start;
}

.chart-label-bottom {
    text-anchor: middle;
}

.sales-chart-bar {
    fill: rgba(13, 162, 135, 0.34);
    cursor: default;
}

.sales-chart-line {
    fill: none;
    stroke: var(--amber);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 3;
}

.sales-chart-point {
    fill: #fff;
    cursor: default;
    stroke: var(--amber);
    stroke-width: 2;
}

.sales-chart-bar.chart-detail-active {
    fill: rgba(13, 162, 135, 0.72);
}

.sales-chart-point.chart-detail-active {
    fill: var(--amber);
}

.chart-tooltip {
    position: absolute;
    z-index: 4;
    display: grid;
    gap: 4px;
    min-width: 150px;
    max-width: 230px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(32, 37, 34, 0.96);
    box-shadow: 0 14px 35px rgba(32, 37, 34, 0.22);
    color: #fff;
    font-size: 12px;
    line-height: 1.35;
    pointer-events: none;
}

.chart-tooltip[hidden] {
    display: none;
}

.chart-tooltip strong {
    font-size: 13px;
}

.chart-tooltip.is-floating {
    position: fixed;
    z-index: 10000;
    max-width: min(340px, calc(100vw - 16px));
}

.finance-stats-grid .stat strong {
    font-size: clamp(18px, 1.5vw, 28px);
    font-size: clamp(18px, 11cqw, 28px);
}

.finance-chart-wrap {
    overflow: visible;
}

.finance-chart {
    min-width: 0;
    height: 320px;
}

.finance-chart-line,
.finance-income-line {
    stroke: #0da287;
}

.finance-expense-line {
    stroke: #b74343;
}

.finance-result-line {
    stroke: #202522;
}

.finance-chart-point {
    stroke: #0da287;
}

.finance-income-point {
    stroke: #0da287;
}

.finance-expense-point {
    stroke: #b74343;
}

.finance-result-point {
    stroke: #202522;
}

.finance-chart-point:hover {
    fill: #0da287;
}

.finance-chart-point.chart-detail-active {
    fill: #0da287;
}

.finance-expense-point:hover,
.finance-expense-point.chart-detail-active {
    fill: #b74343;
}

.finance-result-point:hover,
.finance-result-point.chart-detail-active {
    fill: #202522;
}

.finance-products-list {
    display: grid;
    gap: 3px;
    margin-top: 6px;
}

.finance-products-list span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.35;
}

.finance-table-wrap td:first-child {
    min-width: 220px;
}

.finance-expense-head {
    margin-top: 30px;
}

.finance-expense-entry {
    margin: 0 0 24px;
    padding: 18px;
}

.finance-expense-form {
    display: grid;
    grid-template-columns: minmax(130px, 0.75fr) minmax(150px, 0.85fr) minmax(190px, 1.35fr) minmax(130px, 0.8fr) minmax(150px, 0.8fr);
    gap: 14px;
    align-items: end;
}

.finance-expense-form .wide {
    grid-column: span 4;
}

.finance-expense-edit-wrap {
    border-color: rgba(111, 124, 114, 0.24);
    background:
        linear-gradient(180deg, rgba(13, 162, 135, 0.055), rgba(13, 162, 135, 0) 120px),
        #f7f9f7;
    padding: 8px;
}

.finance-expense-edit-table {
    min-width: 1180px;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.finance-expense-edit-table th {
    border-bottom: 0;
    color: #6a776e;
    font-size: 11px;
    letter-spacing: 0;
    padding: 7px 12px 4px;
}

.finance-expense-edit-table tbody td {
    border-top: 1px solid rgba(111, 124, 114, 0.18);
    border-bottom: 1px solid rgba(111, 124, 114, 0.18);
    background: rgba(255, 255, 255, 0.92);
    padding: 12px 10px;
    vertical-align: middle;
}

.finance-expense-edit-table tbody td:first-child {
    min-width: 230px;
    border-left: 1px solid rgba(111, 124, 114, 0.18);
    border-radius: 8px 0 0 8px;
    padding-left: 14px;
}

.finance-expense-edit-table tbody td:last-child {
    min-width: 168px;
    border-right: 1px solid rgba(111, 124, 114, 0.18);
    border-radius: 0 8px 8px 0;
    padding-right: 14px;
}

.finance-expense-edit-table tbody tr:hover td {
    border-color: rgba(13, 162, 135, 0.22);
    background: #fbfdfb;
}

.finance-expense-edit-table tfoot th {
    border-bottom: 0;
    color: #6a776e;
    padding: 12px 12px 6px;
}

.finance-expense-edit-table tfoot .money-cell {
    color: var(--ink);
    font-size: 15px;
    font-variant-numeric: tabular-nums;
}

.finance-expense-table-input {
    width: 100%;
    min-height: 38px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: #f4f7f5;
    box-shadow: inset 0 0 0 1px rgba(111, 124, 114, 0.14);
    color: var(--ink);
    font: inherit;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.2;
    padding: 8px 10px;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.finance-expense-table-input:hover {
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(111, 124, 114, 0.24);
}

.finance-expense-table-input:focus {
    border-color: rgba(13, 162, 135, 0.5);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(13, 162, 135, 0.12);
    outline: none;
}

.finance-expense-title-input {
    min-width: 190px;
    background: #fbfcfb;
    font-size: 14px;
    font-weight: 850;
}

.finance-expense-type-select,
.finance-expense-recurrence-select {
    min-width: 146px;
    border-radius: 999px;
    background: #edf8f4;
    box-shadow: inset 0 0 0 1px rgba(13, 162, 135, 0.16);
    color: #087966;
    font-weight: 850;
    padding-right: 28px;
}

.finance-expense-recurrence-select {
    min-width: 166px;
    background: #f2f5f1;
    box-shadow: inset 0 0 0 1px rgba(111, 124, 114, 0.14);
    color: #59665e;
}

.finance-expense-date-input {
    min-width: 150px;
    color: #202522;
    font-weight: 850;
}

.finance-expense-money-input {
    min-width: 124px;
    background: #f8f7f1;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    font-weight: 850;
    text-align: right;
}

.finance-expense-note-input {
    min-width: 170px;
    color: #526057;
    font-weight: 650;
}

[data-finance-recurrence-field] {
    display: block;
}

[data-finance-recurrence-field][hidden] {
    display: none;
}

.finance-expense-no-recurrence {
    display: flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #f0f3f1;
    color: #9aa69e;
    font-weight: 850;
    text-align: center;
}

.finance-expense-no-recurrence[hidden] {
    display: none;
}

.finance-expense-edit-table .muted-block {
    margin-top: 5px;
    color: #77837b;
    font-size: 12px;
    font-weight: 700;
}

.finance-expense-row-actions {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 7px;
}

.finance-expense-row-actions form {
    margin: 0;
}

.finance-expense-save-control {
    display: grid;
    justify-items: stretch;
    gap: 3px;
}

.finance-expense-action {
    min-height: 36px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 850;
    padding: 0 12px;
}

.finance-expense-save-button {
    border-color: #0da287;
    background: #0da287;
    color: #fff;
}

.finance-expense-save-button:hover {
    border-color: #087966;
    background: #087966;
}

.finance-expense-delete-button {
    width: 30px;
    min-width: 30px;
    height: 30px;
    padding: 0;
    border-color: rgba(183, 67, 67, 0.24);
    background: transparent;
    color: #b74343;
    border-radius: 7px;
    font-size: 22px;
    line-height: 1;
}

.finance-expense-delete-button:hover {
    border-color: rgba(183, 67, 67, 0.42);
    background: #fff5f4;
}

.max-expense-intro { align-items: center; }
.max-expense-stats { margin-bottom: 24px; }
.max-expense-money-stat strong {
    font-size: clamp(18px, 10cqw, 28px);
    letter-spacing: -0.02em;
}
.max-expense-table-wrap { margin-top: 18px; }
.max-expense-table { width: 100%; min-width: 1080px; table-layout: fixed; }
.max-expense-table th,
.max-expense-table td { padding: 7px 5px; vertical-align: top; }
.max-expense-table th:nth-child(1) { width: 126px; }
.max-expense-table th:nth-child(2) { width: 22%; }
.max-expense-table th:nth-child(3) { width: 105px; }
.max-expense-table th:nth-child(4) { width: 155px; }
.max-expense-table th:nth-child(5) { width: 86px; }
.max-expense-table th:nth-child(6) { width: 72px; }
.max-expense-table th:nth-child(7) { width: 105px; }
.max-expense-table th:nth-child(8) { width: 82px; }
.max-expense-table th:nth-child(9) { width: 174px; }
.max-expense-table tbody tr.max-expense-sender-alexey > td { background: #fff2cc; }
.max-expense-table tbody tr.max-expense-sender-yury > td { background: #ffe0e0; }
.max-expense-table tbody tr.max-expense-sender-vladimir > td { background: #e0f5dc; }
.max-expense-table .finance-expense-table-input { width: 100%; min-width: 0; padding: 7px 8px; }
.max-expense-category,
.max-expense-description,
.max-expense-article,
.max-expense-quantity { width: 100%; min-width: 0 !important; }
.max-expense-table .muted-block { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.max-expense-review td { background: #fff8e8; }
.expense-personal-cell { text-align: center; }
.expense-personal-toggle { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.expense-personal-toggle input { width: 18px; height: 18px; accent-color: #9a6a13; }
.max-expense-server-filter { display: grid; gap: 7px; margin: 18px 0; }
.max-expense-server-filter > label { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.max-expense-server-filter > div { display: flex; gap: 10px; align-items: center; }
.max-expense-server-filter input { flex: 1 1 420px; min-width: 220px; }
.max-expense-filter-row th { padding: 8px 6px; background: #f5f8f6; vertical-align: middle; }
.max-expense-filter-row input,
.max-expense-filter-row select { width: 100%; min-width: 0; padding: 7px 6px; font-size: 12px; font-weight: 500; }
.max-expense-filter-row .small-button { white-space: nowrap; }
.expense-pagination,
.table-pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 18px 0 28px; }
.expense-pagination span,
.table-pagination span { color: var(--muted); font-weight: 800; }
.expense-autosave-status {
    min-width: 0;
    max-width: 190px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.2;
    text-align: center;
}
.expense-autosave-status:empty { display: none; }
.expense-autosave-status.is-saved { color: var(--green); }
.expense-autosave-status.is-error { color: var(--red); }
.alexey-reimbursements {
    margin: 0 0 26px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}
.alexey-reimbursements > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 74px;
    padding: 16px 20px;
    cursor: pointer;
    list-style: none;
}
.alexey-reimbursements > summary::-webkit-details-marker { display: none; }
.alexey-reimbursements > summary:focus-visible { outline: 3px solid rgba(13, 162, 135, 0.35); outline-offset: -3px; }
.alexey-reimbursements-summary-copy { display: grid; gap: 4px; }
.alexey-reimbursements-summary-copy strong { font-size: 18px; }
.alexey-reimbursements-summary-copy > span { color: var(--muted); font-size: 13px; font-weight: 700; }
.alexey-reimbursements-action {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 7px;
    color: #087966;
    font-size: 13px;
    font-weight: 850;
    white-space: nowrap;
}
.alexey-reimbursements-action::before { content: '⌄'; font-size: 18px; line-height: 1; transition: transform 160ms ease; }
.alexey-reimbursements-action-open { display: none; }
.alexey-reimbursements[open] .alexey-reimbursements-action::before { transform: rotate(180deg); }
.alexey-reimbursements[open] .alexey-reimbursements-action-closed { display: none; }
.alexey-reimbursements[open] .alexey-reimbursements-action-open { display: inline; }
.alexey-reimbursements-content { padding: 0 20px 22px; border-top: 1px solid var(--line); }
.alexey-reimbursements-description { margin: 18px 0; color: var(--muted); }
.alexey-reimbursement-grid { display: grid; gap: 24px; }
.alexey-reimbursement-entry {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8faf8;
}
.alexey-reimbursement-entry h3,
.alexey-reimbursement-history h3 { margin: 0; }
.alexey-reimbursement-form {
    display: grid;
    grid-template-columns: minmax(180px, 0.8fr) minmax(160px, 0.7fr) minmax(240px, 1.4fr) auto;
    gap: 14px;
    align-items: end;
    margin: 14px 0 0;
    min-width: 0;
}
.alexey-reimbursement-form label { min-width: 0; }
.alexey-reimbursement-form input { width: 100%; min-width: 0; }
.alexey-reimbursement-form .primary-button { min-width: 180px; white-space: nowrap; }
.alexey-reimbursement-history { display: grid; gap: 14px; }
.alexey-reimbursement-history-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.alexey-reimbursement-history-head p { margin: 5px 0 0; color: var(--muted); }
.expense-review-label { display: block; margin-top: 5px; color: #a45c00; white-space: nowrap; }
.max-message-head { margin-top: 38px; }
.max-message-text { min-width: 320px; white-space: normal; }

.finance-role-list {
    margin-top: 8px;
}

.finance-expense-stats-grid .stat strong {
    font-size: clamp(18px, 1.5vw, 28px);
    font-size: clamp(18px, 11cqw, 28px);
}

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

.client-meta div {
    display: grid;
    gap: 6px;
}

.client-meta span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.client-meta strong,
.client-note {
    overflow-wrap: anywhere;
}

.client-note {
    margin: 16px 0 0;
    color: var(--muted);
}

.orders-section-head {
    margin-top: 24px;
}

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

.form-section {
    padding: 18px;
}

.form-section h3 {
    margin: 0 0 14px;
}

.form-section h3 a {
    color: inherit;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

.section-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.section-row h3 {
    margin: 0;
}

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

.order-items-table-wrap {
    overflow-x: auto;
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.order-items-table {
    min-width: 1080px;
}

.order-items-table th,
.order-items-table td {
    padding: 10px;
}

.order-items-table th:nth-child(1) {
    width: 34%;
}

.order-items-table th:nth-child(2) {
    width: 16%;
}

.order-items-table th:nth-child(3),
.order-items-table th:nth-child(4),
.order-items-table th:nth-child(5) {
    width: 11%;
}

.order-items-table th:nth-child(6) {
    width: 18%;
}

.order-items-table th:nth-child(7) {
    width: 8%;
}

.order-item-value {
    display: block;
    min-height: 42px;
    padding: 10px 0;
    color: var(--ink);
    line-height: 1.35;
}

.order-item-money {
    white-space: nowrap;
}

.order-item-options {
    min-width: 190px;
}

.order-item-option {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 22px;
    color: var(--ink);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.order-item-option input[type="checkbox"] {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: var(--accent);
}

.order-items-footer {
    display: flex;
    justify-content: flex-end;
}

.order-total-summary {
    display: grid;
    min-width: min(260px, 100%);
    gap: 6px;
    text-align: right;
}

.order-total-summary span,
.notes-field span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.order-total-summary strong {
    font-size: 24px;
    line-height: 1.1;
}

.order-details-grid {
    margin-top: 2px;
}

.wide {
    grid-column: span 2;
}

.field-error {
    color: var(--red);
    font-weight: 700;
}

.danger-zone {
    margin-top: 18px;
}

.inline-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.client-profile {
    margin-bottom: 24px;
}

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

.client-meta div {
    display: grid;
    gap: 6px;
}

.client-meta span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.client-meta strong,
.client-note {
    overflow-wrap: anywhere;
}

.client-note {
    margin: 16px 0 0;
    color: var(--muted);
}

.orders-section-head {
    margin-top: 24px;
}

@media (max-width: 980px) {
    .alexey-reimbursement-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .app-header {
        grid-template-columns: 1fr;
        align-items: start;
        gap: 12px;
        padding: 14px 18px;
    }

    .nav {
        max-width: 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .nav a {
        white-space: nowrap;
    }

    .app-header-user {
        justify-self: start;
        flex-wrap: wrap;
    }

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

    .employee-hero {
        grid-template-columns: 1fr;
    }

    .employee-hero-aside {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: end;
        padding: 16px 0 0;
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .employee-termination-form {
        margin-top: -8px;
    }

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

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

    .filters,
    .form-grid,
    .finance-expense-form,
    .clients-filters,
    .detail-grid,
    .shift-summary-grid,
    .client-meta,
    .item-meta,
    .employee-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .shift-weekdays,
    .shift-calendar {
        grid-template-columns: repeat(7, minmax(44px, 1fr));
    }

    .shift-day {
        min-height: 56px;
    }

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

    .finance-expense-form .wide {
        grid-column: 1 / -1;
    }

    .employee-role-form,
    .employee-role-history-row,
    .employee-access-key-form-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .role-select,
    .role-note-control {
        grid-column: 1 / -1;
    }

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

    .salary-change-form button {
        width: 100%;
    }

    .salary-history-actions {
        justify-content: flex-start;
    }

    .item-image-form-grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 680px) {
    .alexey-reimbursement-form {
        grid-template-columns: 1fr;
    }

    .alexey-reimbursement-form .primary-button {
        width: 100%;
    }

    .alexey-reimbursement-entry,
    .alexey-reimbursements-content { padding-left: 14px; padding-right: 14px; }

    .login-wrap,
    .main {
        padding: 18px;
    }

    .section-head,
    .section-row,
    .form-actions,
    .table-tools {
        align-items: stretch;
        flex-direction: column;
    }

    .app-header-user,
    .user-chip {
        width: 100%;
    }

    .payroll-stats-grid,
    .stats-grid,
    .filters,
    .form-grid,
    .finance-expense-form,
    .clients-filters,
    .detail-grid,
    .shift-summary-grid,
    .client-meta,
    .item-meta,
    .item-image-fields,
    .employee-meta {
        grid-template-columns: 1fr;
    }

    .shift-weekdays,
    .shift-calendar {
        gap: 4px;
        grid-template-columns: repeat(7, minmax(34px, 1fr));
    }

    .shift-day {
        min-height: 48px;
        padding: 5px;
    }

    .employee-create-roles {
        grid-template-columns: 1fr;
    }

    .shift-day-rate {
        font-size: 10px;
    }

    .salary-change-form {
        grid-template-columns: 1fr;
    }

    .employee-role-form,
    .employee-role-history-row,
    .employee-access-key-form-row {
        grid-template-columns: 1fr;
    }

    .role-select,
    .role-note-control {
        grid-column: auto;
    }

    .employee-role-history-actions {
        justify-content: stretch;
    }

    .employee-role-history-actions .small-button {
        width: 100%;
    }

    .salary-history-row {
        grid-template-columns: 1fr;
    }

    .salary-history-actions {
        align-self: stretch;
        align-items: stretch;
        flex-direction: column;
        min-width: 0;
    }

    .salary-history-actions .small-button,
    .salary-history-actions .danger-button {
        width: 100%;
    }

    .shift-calendar-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .shift-action-total {
        margin-right: 0;
    }

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

    .employee-view-head {
        align-items: flex-start;
    }

    .employee-hero {
        padding: 16px;
    }

    .employee-hero-main {
        align-items: flex-start;
    }

    .employee-hero .employee-avatar-large {
        width: 76px;
        height: 76px;
        flex-basis: 76px;
    }

    .employee-avatar-button {
        width: 76px;
        height: 76px;
        flex-basis: 76px;
    }

    .employee-hero-copy h2 {
        font-size: 22px;
    }

    .employee-hero-aside,
    .employee-quick-facts {
        grid-template-columns: 1fr;
    }

    .employee-termination-form {
        display: grid;
        grid-template-columns: 1fr;
        justify-self: stretch;
        width: 100%;
    }

    .employee-quick-facts strong,
    .employee-document-folder strong,
    .employee-document-list strong {
        overflow-wrap: anywhere;
        white-space: normal;
    }

    .employee-card-section-head {
        align-items: stretch;
        flex-direction: column;
    }

    .avatar-modal {
        padding: 12px;
    }

    .avatar-modal-panel {
        max-height: calc(100vh - 24px);
        padding: 14px;
    }

    .avatar-source-actions,
    .avatar-modal-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .avatar-source-actions .secondary-button,
    .avatar-modal-actions .secondary-button,
    .avatar-modal-actions .primary-button {
        width: 100%;
    }

    .table-counter {
        padding-bottom: 0;
    }

    .wide {
        grid-column: auto;
    }
}

/* Production workspace */
.production-page {
    display: grid;
    gap: 16px;
    max-width: 100%;
}

.production-page .section-head {
    margin-bottom: 0;
}

.production-head {
    position: relative;
    align-items: center;
    min-height: 118px;
    padding: 22px 24px;
    overflow: hidden;
    border: 1px solid rgba(31, 45, 40, 0.12);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(26, 40, 36, 0.96), rgba(38, 67, 58, 0.96)),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 26px);
    box-shadow: 0 18px 42px rgba(31, 45, 40, 0.16);
    color: #fff;
}

.production-head::after {
    content: "";
    position: absolute;
    inset: auto 22px 18px auto;
    width: min(360px, 42%);
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42));
}

.production-head-copy {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.production-head h2 {
    margin: 0;
    font-size: 30px;
    line-height: 1.05;
}

.production-head p {
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.74);
    font-size: 14px;
    font-weight: 750;
}

.production-head .inline-actions {
    position: relative;
    z-index: 1;
}

.production-head .secondary-button {
    min-height: 34px;
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    backdrop-filter: blur(8px);
}

.production-head .secondary-button:hover {
    border-color: rgba(255, 255, 255, 0.42);
    background: rgba(255, 255, 255, 0.18);
}

.production-module-nav {
    position: sticky;
    top: 12px;
    z-index: 12;
    align-self: start;
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    overflow-x: auto;
    padding: 8px;
    border: 1px solid rgba(32, 37, 34, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 10px 28px rgba(36, 47, 42, 0.08);
    backdrop-filter: saturate(150%) blur(10px);
}

.production-module-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    border-radius: 6px;
    padding: 0 11px;
    color: #45504a;
    font-size: 12px;
    font-weight: 850;
    text-decoration: none;
    white-space: nowrap;
}

.production-module-nav a:hover {
    background: #edf4ef;
    color: var(--accent-dark);
    text-decoration: none;
}

.production-stats-grid {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 0;
}

.production-stats-grid .stat {
    position: relative;
    min-width: 0;
    padding: 14px 14px 13px;
    overflow: hidden;
    border-color: rgba(32, 37, 34, 0.08);
    background: #fff;
    box-shadow: 0 8px 24px rgba(36, 47, 42, 0.06);
}

.production-stats-grid .stat::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--accent);
}

.production-stats-grid .stat:nth-child(2)::before {
    background: #386aa3;
}

.production-stats-grid .stat:nth-child(4)::before {
    background: #a36c1d;
}

.production-stats-grid .stat:nth-child(5)::before {
    background: #8c4f70;
}

.production-stats-grid .stat span {
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0;
    text-transform: uppercase;
}

.production-stats-grid .stat strong {
    font-size: clamp(20px, 2.2vw, 28px);
    overflow-wrap: anywhere;
    white-space: normal;
}

.production-stats-grid .stat small {
    margin-top: 6px;
    font-size: 11px;
}

.production-panel {
    display: grid;
    gap: 0;
    margin-bottom: 0;
    padding: 0;
    overflow: hidden;
    border-color: rgba(32, 37, 34, 0.1);
    box-shadow: 0 12px 34px rgba(36, 47, 42, 0.08);
}

.production-panel > h3 {
    display: flex;
    align-items: center;
    min-height: 48px;
    margin: 0;
    padding: 0 16px;
    border-bottom: 1px solid rgba(32, 37, 34, 0.08);
    background: linear-gradient(180deg, #ffffff, #f8faf8);
    color: #1f2925;
    font-size: 15px;
    font-weight: 900;
}

.production-panel > h3::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 22px;
    margin-right: 10px;
    border-radius: 999px;
    background: var(--accent);
}

.production-form-grid,
.production-compact-form {
    display: grid;
    grid-template-columns: repeat(6, minmax(112px, 1fr));
    gap: 9px;
    align-items: end;
}

.production-panel > form {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(32, 37, 34, 0.08);
    background: #f7faf8;
}

.production-panel label {
    gap: 5px;
    min-width: 0;
}

.production-panel label span,
.production-panel .readonly-field > span {
    color: #5d6861;
    font-size: 11px;
    font-weight: 850;
    line-height: 1.2;
    text-transform: uppercase;
}

.production-panel input,
.production-panel select,
.production-panel textarea {
    min-height: 34px;
    border-color: #d7ded8;
    border-radius: 6px;
    padding: 8px 9px;
    font-size: 13px;
}

.production-panel textarea {
    min-height: 58px;
}

.production-panel input::placeholder,
.production-panel textarea::placeholder {
    color: #98a39d;
}

.production-panel .form-actions {
    align-self: end;
    justify-content: flex-start;
}

.production-panel .primary-button,
.production-panel .secondary-button,
.production-panel .danger-button,
.production-panel .small-button {
    min-height: 34px;
    border-radius: 6px;
    padding: 0 12px;
    font-size: 13px;
}

.production-panel .primary-button {
    box-shadow: 0 8px 18px rgba(13, 162, 135, 0.18);
}

.production-briefing-list {
    display: grid;
    background: #fff;
}

.production-briefing-item {
    border-bottom: 1px solid rgba(32, 37, 34, 0.09);
}

.production-briefing-item:last-child {
    border-bottom: 0;
}

.production-briefing-item > summary {
    display: grid;
    grid-template-columns: minmax(240px, 2fr) minmax(120px, 1fr) minmax(150px, 1.2fr) minmax(100px, 0.8fr);
    gap: 14px;
    align-items: center;
    min-height: 68px;
    padding: 10px 44px 10px 16px;
    cursor: pointer;
    list-style: none;
    position: relative;
}

.production-briefing-item > summary::-webkit-details-marker {
    display: none;
}

.production-briefing-item > summary::after {
    content: "⌄";
    position: absolute;
    right: 18px;
    color: #68726c;
    font-size: 22px;
    transition: transform 0.18s ease;
}

.production-briefing-item[open] > summary::after {
    transform: rotate(180deg);
}

.production-briefing-item > summary:hover,
.production-briefing-item > summary:focus-visible {
    background: #f8fbf9;
}

.production-briefing-item > summary span {
    min-width: 0;
}

.production-briefing-product {
    display: flex;
    align-items: center;
    gap: 10px;
}

.production-briefing-thumb {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    overflow: hidden;
    place-items: center;
    border: 1px solid #e0e7e2;
    border-radius: 8px;
    background: #eef3f0;
    color: #9ba69f;
    font-size: 18px;
}

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

.production-briefing-product-text {
    min-width: 0;
}

.production-briefing-product-text a,
.production-item-overview-fields a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: rgba(8, 119, 100, 0.3);
    text-underline-offset: 3px;
}

.production-briefing-product-text a:hover,
.production-item-overview-fields a:hover {
    color: #087764;
}

.production-briefing-item > summary strong,
.production-briefing-item > summary small {
    display: block;
}

.production-briefing-item > summary strong {
    overflow: hidden;
    color: #18211d;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.production-briefing-item > summary small {
    margin-bottom: 3px;
    color: #7a857f;
    font-size: 10px;
}

.production-briefing-details {
    padding: 16px;
    border-top: 1px solid rgba(32, 37, 34, 0.07);
    background: #f7faf8;
}

.production-briefing-details input[readonly],
.production-briefing-details textarea[readonly] {
    background: #fff;
    color: #202521;
    cursor: default;
}

.production-item-overview {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
    padding: 14px;
    border: 1px solid #dce5df;
    border-radius: 12px;
    background: #fff;
}

.production-item-image {
    display: grid;
    min-height: 116px;
    overflow: hidden;
    place-items: center;
    border-radius: 9px;
    background: #eef3f0;
    color: #87918b;
    font-size: 11px;
    font-weight: 750;
}

.production-item-image img {
    width: 100%;
    height: 100%;
    max-height: 150px;
    object-fit: cover;
}

.production-item-overview-fields {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    align-content: center;
}

.production-item-overview-fields > div {
    min-width: 0;
}

.production-item-overview-fields span,
.production-item-overview-fields strong {
    display: block;
}

.production-item-overview-fields span {
    margin-bottom: 5px;
    color: #76817b;
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
}

.production-item-overview-fields strong {
    overflow-wrap: anywhere;
    color: #202521;
    font-size: 13px;
}

.production-item-order-link {
    grid-column: 1 / -1;
}

.production-difficulty-form {
    position: relative;
    min-width: 0;
}

.production-difficulty-form label,
.production-difficulty-form label > span {
    display: block;
}

.production-difficulty-form select {
    width: 100%;
    min-height: 34px;
}

.production-difficulty-state {
    position: absolute;
    top: calc(100% + 2px);
    right: 0;
    color: #087764;
    font-size: 9px;
    font-weight: 750;
}

.item-difficulty-card .production-difficulty-form label > span {
    margin-bottom: 6px;
}

.item-difficulty-card .production-difficulty-form select {
    max-width: 260px;
}

.item-production-params-card {
    grid-column: span 2;
}

.item-production-params-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(130px, 1fr)) auto;
    gap: 10px;
    align-items: end;
}

.item-production-params-form label,
.item-production-params-form label > span {
    display: block;
}

.item-production-params-form label > span {
    margin-bottom: 6px;
}

.item-production-history {
    margin-top: 18px;
}

.production-item-order-link a {
    color: #087764;
    text-decoration: underline;
    text-decoration-color: rgba(8, 119, 100, 0.3);
    text-underline-offset: 3px;
}

.production-responsibles-field {
    display: grid;
    gap: 5px;
    min-width: 0;
    align-self: end;
}

.production-responsibles-field > span {
    color: #5d6861;
    font-size: 11px;
    font-weight: 850;
    line-height: 1.2;
    text-transform: uppercase;
}

.production-multiselect {
    position: relative;
}

.production-multiselect > summary {
    min-height: 34px;
    padding: 8px 32px 8px 9px;
    overflow: hidden;
    border: 1px solid #d7ded8;
    border-radius: 6px;
    background: #fff;
    color: #202521;
    cursor: pointer;
    font-size: 13px;
    list-style: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.production-multiselect > summary::-webkit-details-marker {
    display: none;
}

.production-multiselect > summary::after {
    content: "⌄";
    position: absolute;
    top: 6px;
    right: 10px;
    color: #68726c;
    font-size: 18px;
}

.production-multiselect-menu {
    position: absolute;
    z-index: 5;
    top: calc(100% + 4px);
    left: 0;
    display: grid;
    width: max(100%, 240px);
    max-height: 300px;
    gap: 2px;
    padding: 8px;
    overflow-y: auto;
    border: 1px solid #d7ded8;
    border-radius: 7px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(36, 47, 42, 0.16);
}

.production-multiselect-menu label {
    display: flex;
    min-height: 32px;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 5px 7px;
    border-radius: 5px;
    cursor: pointer;
}

.production-multiselect-menu label:hover {
    background: #f2f7f4;
}

.production-multiselect-menu label input {
    width: 16px;
    min-height: 16px;
    height: 16px;
    margin: 0;
}

.production-multiselect-menu label span {
    color: #202521;
    font-size: 13px;
    font-weight: 600;
    text-transform: none;
}

.production-multiselect-menu button {
    margin-top: 5px;
}

.production-span-all {
    grid-column: 1 / -1;
}

.production-responsibles-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
    gap: 12px;
    padding: 0;
    background: transparent;
}

.production-responsible-card {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid #d8e1dc;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(36, 47, 42, 0.07);
}

.production-responsible-card > header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 11px;
    border-bottom: 1px solid #e8eeea;
}

.production-responsible-avatar {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border-radius: 50%;
    background: #def3ed;
    color: #087764;
    font-size: 15px;
    font-weight: 900;
}

.production-responsible-card > header strong,
.production-responsible-card > header small {
    display: block;
}

.production-responsible-card > header strong {
    color: #18211d;
    font-size: 14px;
}

.production-responsible-card > header small {
    margin-top: 2px;
    color: #87918b;
    font-size: 10px;
}

.production-responsible-save-state {
    margin-left: auto;
    color: #087764;
    font-size: 11px;
    font-weight: 800;
}

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

.production-responsible-extra {
    display: flex;
    min-height: 34px;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 7px;
    background: #f5f8f6;
}

.production-responsible-extra input {
    width: 16px;
    min-height: 16px;
    height: 16px;
    margin: 0;
}

.production-responsible-extra span {
    color: #37413c;
    font-size: 12px;
    font-weight: 700;
    text-transform: none;
}

.production-responsible-conditions textarea {
    min-height: 68px;
    resize: vertical;
}

.production-responsible-conditions-first textarea {
    min-height: 76px;
    background: #fbfdfc;
}

.production-workload-panel .section-row p {
    margin: 4px 0 0;
    color: #748078;
    font-size: 11px;
}

.production-workload-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
}

.production-workload-card {
    overflow: hidden;
    border: 1px solid #d8e1dc;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(28, 55, 46, 0.06);
}

.production-workload-card > header {
    display: flex;
    justify-content: space-between;
    gap: 28px;
    align-items: center;
    padding: 22px 26px;
    background: #f4f8f6;
}

.production-workload-person {
    display: grid;
    gap: 4px;
}

.production-workload-person small,
.production-workload-summary small {
    color: #87918b;
    font-size: 10px;
    font-style: normal;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.production-workload-person > a strong {
    font-size: 18px;
}

.production-workload-person > span {
    color: #657169;
    font-size: 12px;
}

.production-workload-summary {
    display: grid;
    grid-template-columns: minmax(150px, 220px) auto;
    gap: 6px 14px;
    align-items: center;
    min-width: 280px;
}

.production-workload-summary > span {
    grid-row: 1 / span 2;
    grid-column: 2;
    color: #657169;
    font-size: 12px;
    white-space: nowrap;
}

.production-workload-summary > span strong {
    color: #087764;
    font-size: 24px;
}

.production-workload-summary > small {
    grid-row: 2;
    grid-column: 1;
}

.production-workload-meter {
    grid-row: 1;
    grid-column: 1;
    overflow: hidden;
    height: 9px;
    border-radius: 999px;
    background: #dfe9e4;
}

.production-workload-meter i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #13a58a, #087764);
}

.production-workload-items > div {
    display: grid;
    grid-template-columns: minmax(260px, 2fr) minmax(130px, 0.8fr) minmax(90px, 0.55fr) minmax(100px, 0.55fr);
    gap: 24px;
    align-items: center;
    padding: 18px 26px;
    border-top: 1px solid #edf1ee;
}

.production-workload-items span,
.production-workload-items strong,
.production-workload-items small {
    display: block;
    min-width: 0;
}

.production-workload-items strong {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.production-workload-items small {
    color: #87918b;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.production-workload-items em {
    display: block;
    margin-top: 4px;
    color: #87918b;
    font-size: 11px;
    font-style: normal;
}

.production-workload-points {
    color: #087764;
    font-weight: 900;
}

.production-workload-points strong {
    margin-top: 3px;
    font-size: 18px;
}

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

.production-responsible-card > footer {
    display: flex;
    justify-content: flex-end;
}

.production-responsibles-empty {
    padding: 18px;
    border: 1px dashed #cad5cf;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.66);
    color: #738078;
    font-size: 12px;
    text-align: center;
}

.production-span-2 {
    grid-column: span 2;
}

.production-span-4 {
    grid-column: span 4;
}

.checkbox-field {
    display: flex;
    min-height: 34px;
    align-items: center;
    gap: 8px;
    align-self: end;
    padding: 8px 0;
}

.checkbox-field input {
    width: 16px;
    height: 16px;
}

.checkbox-field span {
    text-transform: none;
}

.production-table-wrap,
.production-panel .table-wrap {
    border: 0;
    border-radius: 0;
}

.production-panel .table-tools {
    margin: 0;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(32, 37, 34, 0.08);
    background: #fff;
}

.production-panel .table-filter {
    width: min(320px, 100%);
}

.production-panel .table-filter input {
    min-height: 32px;
}

.production-panel table {
    min-width: 1120px;
}

.production-panel th,
.production-panel td {
    padding: 10px 12px;
}

.production-panel th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f2f5f3;
    color: #68726c;
    font-size: 10px;
    letter-spacing: 0;
}

.production-panel tbody tr:hover td {
    background: #f8fbf9;
}

.production-panel td {
    font-size: 13px;
    line-height: 1.35;
}

.production-panel td strong,
.production-panel td a strong {
    color: #18211d;
}

.production-panel .muted-block {
    margin-top: 3px;
    font-size: 11px;
}

.production-panel .money-cell {
    font-variant-numeric: tabular-nums;
}

.production-panel .status,
.production-panel .employee-role {
    min-height: 22px;
    border-radius: 999px;
    padding: 0 8px;
    font-size: 11px;
    font-weight: 850;
}

.production-status-planned {
    background: #eef1ef;
    color: #4e5852;
}

.production-status-in_work {
    background: #dcf2ec;
    color: #087764;
}

.production-status-accepted {
    background: #e5eef8;
    color: #315e99;
}

.production-status-paused {
    background: #fff1d8;
    color: #815614;
}

.production-level-novice {
    background: #e5eef8;
    color: #315e99;
}

.production-level-middle {
    background: #fff1d8;
    color: #815614;
}

.production-level-professional {
    background: #ddf1eb;
    color: #087764;
}

.production-level-none {
    background: #edf0ee;
    color: #68736d;
}

.production-stage-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(160px, 1fr));
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(32, 37, 34, 0.08);
    background: #fbfcfb;
}

.production-stage {
    min-height: 118px;
    padding: 10px;
    border-color: rgba(32, 37, 34, 0.08);
    border-radius: 7px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(36, 47, 42, 0.05);
}

.production-stage strong {
    color: #1f2925;
    font-size: 12px;
}

.production-stage span,
.production-stage small {
    font-size: 11px;
}

.production-payout-table {
    min-width: 1180px;
}

.production-payout-table tbody td:nth-last-child(2) strong {
    color: var(--accent-dark);
}

.production-payout-table tfoot th {
    position: sticky;
    bottom: 0;
    background: #eaf2ee;
    color: #1f2925;
}

@media (max-width: 1240px) {
    .production-stats-grid {
        grid-template-columns: repeat(3, minmax(160px, 1fr));
    }

    .production-form-grid,
    .production-compact-form {
        grid-template-columns: repeat(4, minmax(120px, 1fr));
    }

    .production-stage-grid {
        grid-template-columns: repeat(3, minmax(170px, 1fr));
    }
}

@media (max-width: 900px) {
    .production-head {
        align-items: flex-start;
        flex-direction: column;
        min-height: 0;
    }

    .production-module-nav {
        top: 66px;
    }

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

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

    .production-briefing-item > summary {
        grid-template-columns: minmax(180px, 1.8fr) minmax(130px, 1fr) minmax(110px, 0.8fr);
    }

    .production-briefing-item > summary > span:nth-child(3) {
        display: none;
    }

    .production-responsibles-list {
        grid-template-columns: 1fr;
    }

    .production-workload-card > header {
        align-items: stretch;
        flex-direction: column;
    }

    .production-workload-summary {
        width: 100%;
    }

    .production-workload-items > div {
        grid-template-columns: minmax(220px, 1.6fr) repeat(3, minmax(80px, 0.6fr));
        gap: 16px;
    }

    .production-item-overview-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .production-span-2,
    .production-span-4 {
        grid-column: 1 / -1;
    }

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

@media (max-width: 620px) {

    .item-production-params-card {
        grid-column: auto;
    }

    .item-production-params-form,
    .production-workload-items > div {
        grid-template-columns: 1fr;
    }

    .production-workload-card > header,
    .production-workload-items > div {
        padding: 18px;
    }

    .production-workload-summary {
        grid-template-columns: minmax(0, 1fr) auto;
        min-width: 0;
    }

    .production-item-overview {
        grid-template-columns: 1fr;
    }

    .production-item-image {
        max-height: 220px;
    }

    .production-item-overview-fields,
    .production-responsible-fields,
    .production-responsible-notes {
        grid-template-columns: 1fr;
    }
    .production-head {
        padding: 18px;
    }

    .production-head h2 {
        font-size: 24px;
    }

    .production-head .inline-actions,
    .production-head .secondary-button {
        width: 100%;
    }

    .production-stats-grid,
    .production-form-grid,
    .production-compact-form,
    .production-stage-grid {
        grid-template-columns: 1fr;
    }
}

/* Основная навигация: постоянная боковая панель на широких экранах. */
@media (min-width: 981px) {
    .app-shell {
        display: grid;
        grid-template-columns: 248px minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr) auto;
        min-height: 100vh;
    }

    .app-header {
        position: sticky;
        top: 0;
        grid-column: 1;
        grid-row: 1 / 3;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 24px;
        height: 100vh;
        padding: 24px 18px 18px;
        border-right: 1px solid var(--line);
        border-bottom: 0;
        overflow-y: auto;
    }

    .app-header-brand {
        padding: 0 8px 20px;
        border-bottom: 1px solid var(--line);
    }

    .app-header-brand .brand-logo {
        width: 126px;
    }

    .nav {
        display: grid;
        align-content: start;
        gap: 4px;
        width: 100%;
    }

    .nav a {
        width: 100%;
        padding: 11px 12px;
    }

    .app-header-user {
        display: grid;
        justify-items: stretch;
        gap: 12px;
        width: 100%;
        margin-top: auto;
        padding: 18px 8px 0;
        border-top: 1px solid var(--line);
    }

    .app-header-user .ghost-button {
        width: 100%;
    }

    .main {
        grid-column: 2;
        grid-row: 1;
        width: 100%;
        max-width: 1700px;
        margin: 0 auto;
    }

    .app-sync-footer {
        grid-column: 2;
        grid-row: 2;
    }

    .sidebar-toggle {
        position: fixed;
        top: 82px;
        left: 247px;
        z-index: 30;
        display: grid;
        place-items: center;
        width: 28px;
        height: 36px;
        padding: 0;
        border: 1px solid var(--line);
        border-left: 0;
        border-radius: 0 9px 9px 0;
        background: #fff;
        color: var(--muted);
        box-shadow: 4px 3px 12px rgba(40, 51, 45, 0.08);
        cursor: pointer;
        transition: left 180ms ease, color 180ms ease, background 180ms ease;
    }

    .sidebar-toggle:hover {
        background: var(--panel-soft);
        color: var(--accent-dark);
    }

    .sidebar-toggle span {
        font-size: 22px;
        font-weight: 700;
        line-height: 1;
        transform: translateY(-1px);
    }

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

    .app-shell.sidebar-collapsed .app-header {
        transform: translateX(-100%);
        visibility: hidden;
        pointer-events: none;
    }

    .app-shell.sidebar-collapsed .sidebar-toggle {
        left: 0;
    }
}

@media (max-width: 980px) {
    .sidebar-toggle {
        display: none;
    }
}

.tbank-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.tbank-account-card small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
}

.bank-income {
    color: var(--accent-dark) !important;
}

.bank-expense {
    color: var(--red) !important;
}

.bank-section-head {
    margin-bottom: 18px;
}

.bank-filters {
    display: grid;
    grid-template-columns: minmax(260px, 2fr) minmax(150px, 1fr) minmax(190px, 1fr) auto;
    gap: 10px;
    margin-bottom: 16px;
}

.bank-purpose {
    max-width: 640px;
    margin-top: 4px;
    white-space: normal;
}

.bank-category-form select {
    min-width: 190px;
    padding: 8px 10px;
}

.cash-balance-stat {
    min-width: 0;
}

.cash-balance-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.cash-balance-form input {
    min-width: 0;
    font-size: 18px;
    font-weight: 800;
}

.cash-balance-form .small-button {
    width: 100%;
}

@media (max-width: 1200px) {
    .tbank-summary {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }
}

@media (max-width: 760px) {
    .tbank-summary,
    .bank-filters {
        grid-template-columns: 1fr;
    }

    .bank-section-head {
        align-items: stretch;
        flex-direction: column;
    }

    .bank-section-head .primary-button {
        width: 100%;
    }
}

/* Vacation planner */
.vacation-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin: -2px 0 18px;
    padding: 22px 24px;
    overflow: hidden;
    border: 1px solid rgba(16, 100, 83, 0.2);
    border-radius: 8px;
    background:
        radial-gradient(circle at 86% -30%, rgba(155, 224, 203, 0.82), transparent 42%),
        linear-gradient(135deg, #e9f5ef, #f9fcfa 68%);
}

.vacation-head .eyebrow {
    margin-bottom: 8px;
}

.vacation-head h2,
.vacation-calendar-head h2,
.vacation-upcoming-panel h2 {
    margin: 0;
    line-height: 1.15;
}

.vacation-head p,
.vacation-calendar-head p,
.vacation-upcoming-panel p,
.vacation-form-main p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.vacation-head-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
}

.vacation-legend,
.vacation-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 25px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.15;
    white-space: nowrap;
}

.vacation-legend-planned,
.vacation-status-planned {
    background: #eef0fa;
    color: #4d5d9b;
}

.vacation-legend-approved,
.vacation-status-approved {
    background: #e8f5ed;
    color: #177554;
}

.vacation-legend-taken,
.vacation-status-taken {
    background: #e9f4f6;
    color: #276d79;
}

.vacation-status-cancelled {
    background: #f5eeee;
    color: #8a5252;
}

.vacation-status-picker {
    display: inline-flex;
    margin: 0;
}

.vacation-status-picker-control {
    position: relative;
    display: inline-flex;
    border-radius: 999px;
}

.vacation-status-picker-control::after {
    position: absolute;
    top: 50%;
    right: 11px;
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    content: '';
    pointer-events: none;
    transform: translateY(-65%) rotate(45deg);
}

.vacation-status-select {
    display: block;
    min-height: 29px;
    padding: 4px 27px 4px 9px;
    border: 0;
    background: transparent;
    color: inherit;
    appearance: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

.vacation-status-select:hover {
    filter: brightness(0.97);
}

.vacation-status-select:focus-visible {
    outline: 2px solid rgba(13, 162, 135, 0.8);
    outline-offset: 2px;
}

.vacation-stat-accent {
    border-color: rgba(13, 162, 135, 0.26);
    background: #f2faf7;
}

.vacation-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 16px;
    margin-bottom: 28px;
}

.vacation-year-workspace {
    grid-template-columns: minmax(0, 1fr);
    margin-bottom: 16px;
}

.vacation-calendar-panel,
.vacation-upcoming-panel {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.vacation-calendar-head,
.vacation-upcoming-panel > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 18px 15px;
    border-bottom: 1px solid var(--line);
}

.vacation-calendar-nav {
    flex-wrap: nowrap;
    gap: 6px;
}

.vacation-calendar-nav .small-button {
    min-width: 34px;
    padding: 0 9px;
}

.vacation-calendar-wrap {
    overflow-x: auto;
    padding: 10px;
}

.vacation-year-calendar {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
}

.vacation-year-month {
    min-width: 0;
    padding: 7px;
    border: 1px solid #e4eae5;
    border-radius: 7px;
    background: #fbfcfb;
}

.vacation-year-month h3 {
    margin: 0 0 6px;
    color: var(--ink);
    font-size: 13px;
    line-height: 1.15;
}

.vacation-year-weekdays,
.vacation-year-month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 2px;
}

.vacation-year-weekdays {
    margin-bottom: 3px;
}

.vacation-year-weekdays span {
    color: var(--muted);
    font-size: 8px;
    font-weight: 850;
    text-align: right;
    text-transform: uppercase;
}

.vacation-weekdays,
.vacation-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(112px, 1fr));
    min-width: 784px;
}

.vacation-weekdays {
    gap: 5px;
    padding: 0 0 6px;
}

.vacation-weekdays span {
    padding: 0 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
    text-align: right;
    text-transform: uppercase;
}

.vacation-calendar {
    gap: 5px;
}

.vacation-day {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 106px;
    padding: 6px;
    border: 1px solid #e6eae6;
    border-radius: 6px;
    background: #fff;
}

.vacation-year-day {
    min-height: 40px;
    padding: 2px;
    border-radius: 5px;
}

.vacation-year-day.is-outside {
    min-height: 40px;
    border-color: transparent;
    background: transparent;
}

.vacation-year-day.is-occupied {
    border-color: rgba(13, 162, 135, 0.34);
    background: #f2fbf7;
}

.vacation-day-trigger {
    position: absolute;
    z-index: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
}

.vacation-day-trigger:hover,
.vacation-day-trigger:focus-visible {
    outline: 0;
    background: rgba(13, 162, 135, 0.055);
    box-shadow: inset 0 0 0 2px rgba(13, 162, 135, 0.44);
}

.vacation-day.is-outside {
    background: #fafbfa;
}

.vacation-day.is-outside .vacation-day-number,
.vacation-day.is-outside .vacation-day-events {
    opacity: 0.42;
}

.vacation-day.is-today {
    border-color: var(--accent);
    box-shadow: inset 0 0 0 1px var(--accent);
}

.vacation-day.is-holiday .vacation-day-number {
    color: #a26720;
}

.vacation-day-number {
    position: relative;
    z-index: 1;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 21px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 850;
}

.vacation-year-day .vacation-day-number {
    min-height: 8px;
    font-size: 7px;
    line-height: 1;
}

.vacation-day-events {
    position: relative;
    z-index: 1;
    display: grid;
    align-content: start;
    gap: 3px;
    min-height: 0;
}

.vacation-day-events { pointer-events: none; }
.vacation-day-events a { pointer-events: auto; }

.vacation-calendar-event {
    display: block;
    overflow: hidden;
    padding: 3px 5px;
    border-radius: 4px;
    color: #425262;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.15;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vacation-year-day .vacation-day-events {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 1px;
}

.vacation-year-day .vacation-calendar-event {
    display: inline-grid;
    min-width: 13px;
    min-height: 13px;
    max-width: 100%;
    place-items: center;
    overflow: hidden;
    padding: 1px 2px;
    border-radius: 3px;
    font-size: 7px;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: normal;
}

.vacation-year-day .vacation-more-events {
    padding: 0 2px;
    font-size: 7px;
}

.vacation-calendar-event:hover {
    filter: brightness(0.95);
    text-decoration: none;
}

.vacation-calendar-event-planned { background: #eef0fa; color: #4d5d9b; }
.vacation-calendar-event-approved { background: #e8f5ed; color: #177554; }
.vacation-calendar-event-taken { background: #e9f4f6; color: #276d79; }
.vacation-calendar-event-cancelled { background: #f5eeee; color: #8a5252; }

.vacation-more-events {
    padding: 1px 5px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
}

.vacation-upcoming-panel {
    display: flex;
    flex-direction: column;
}

.vacation-upcoming-list {
    display: grid;
}

.vacation-upcoming-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    text-decoration: none;
}

.vacation-upcoming-item:last-child {
    border-bottom: 0;
}

.vacation-upcoming-item:hover {
    background: #f8fbf9;
    text-decoration: none;
}

.vacation-upcoming-item .employee-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
}

.vacation-upcoming-copy {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.vacation-upcoming-copy strong,
.vacation-upcoming-copy span,
.vacation-upcoming-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vacation-upcoming-copy strong { font-size: 13px; }
.vacation-upcoming-copy span,
.vacation-upcoming-copy small { color: var(--muted); font-size: 11px; }
.vacation-upcoming-copy small { color: #9b6521; font-weight: 750; }

.vacation-upcoming-item .vacation-status {
    margin-left: auto;
}

.vacation-upcoming-empty {
    padding: 24px 18px;
    color: var(--muted);
    font-size: 13px;
}

.vacation-upcoming-wide {
    margin-bottom: 28px;
}

.vacation-upcoming-wide .vacation-upcoming-list {
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
}

.vacation-upcoming-wide .vacation-upcoming-item {
    min-width: 0;
}

.vacation-section-head {
    margin: 0 0 14px;
}

.vacation-balance-table { min-width: 1180px; }
.vacation-records-table { min-width: 1100px; }

.vacation-balance-table th,
.vacation-balance-table td,
.vacation-records-table th,
.vacation-records-table td {
    vertical-align: middle;
}

.vacation-employee-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--ink);
    text-decoration: none;
}

.vacation-employee-link:hover { text-decoration: none; color: var(--accent-dark); }

.vacation-employee-link .employee-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
}

.vacation-employee-link > span { display: grid; gap: 2px; }
.vacation-employee-link small,
.vacation-balance-table small,
.vacation-records-table small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }

.vacation-balance {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 9px;
    border-radius: 999px;
    background: #edf7f2;
    color: #127052;
    font-size: 13px;
    font-weight: 850;
    white-space: nowrap;
}

.vacation-balance.is-negative { background: #fff0ee; color: var(--red); }
.vacation-rule-ok { color: #157253; font-size: 12px; font-weight: 800; white-space: nowrap; }
.vacation-rule-attention,
.vacation-warning-text { color: #9b6521 !important; font-size: 11px; font-weight: 800; white-space: nowrap; }

.vacation-allowance-form {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 238px;
}

.vacation-allowance-form label { display: block; }

.vacation-allowance-form input {
    width: 52px;
    min-height: 32px;
    padding: 5px 4px;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}

.vacation-allowance-form > span { color: var(--muted); font-weight: 850; }
.vacation-allowance-form .small-button { min-height: 32px; padding: 0 8px; }

.vacation-records-heading { margin-top: 30px; }
.vacation-records-empty { margin-bottom: 24px; }
.vacation-record-cancelled { opacity: 0.56; }
.vacation-record-actions { display: flex; gap: 6px; align-items: center; }
.vacation-record-actions form { margin: 0; }
.vacation-cancel-button { color: #99504c; }

.vacation-law-note,
.vacation-inline-note {
    display: grid;
    gap: 5px;
    padding: 14px 16px;
    border: 1px solid #dbe7df;
    border-radius: 8px;
    background: #f7fbf8;
    color: #50665a;
    font-size: 12px;
    line-height: 1.5;
}

body.vacation-modal-open {
    overflow: hidden;
}

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

.vacation-quick-modal {
    position: fixed;
    z-index: 80;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
}

.vacation-quick-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(24, 35, 30, 0.42);
    backdrop-filter: blur(3px);
}

.vacation-quick-modal-panel {
    position: relative;
    z-index: 1;
    width: min(500px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    padding: 22px;
    border: 1px solid rgba(13, 162, 135, 0.25);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(23, 37, 30, 0.28);
}

.vacation-quick-modal-panel > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.vacation-quick-modal-panel .eyebrow {
    margin-bottom: 6px;
}

.vacation-quick-modal-panel h2 {
    margin: 0;
    line-height: 1.16;
}

.vacation-quick-modal-panel p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.42;
}

.vacation-quick-close {
    display: inline-grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--muted);
    cursor: pointer;
    font-size: 23px;
    line-height: 1;
}

.vacation-quick-close:hover { color: var(--ink); border-color: #bfc8c0; }

.vacation-quick-form {
    display: grid;
    gap: 14px;
}

.vacation-quick-form label > span {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.vacation-quick-form label small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
}

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

.vacation-quick-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 2px;
}

.vacation-law-note { margin-top: 18px; }
.vacation-law-note strong,
.vacation-inline-note strong { color: var(--ink); font-size: 13px; }

.vacation-form { display: grid; gap: 16px; max-width: 920px; }
.vacation-form-main { margin: 0; }
.vacation-form-main .section-row { align-items: flex-start; }
.vacation-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vacation-form-grid .wide { grid-column: 1 / -1; }

.vacation-calculation {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid rgba(13, 162, 135, 0.26);
    border-radius: 8px;
    background: #f4faf7;
}

.vacation-calculation article {
    display: grid;
    gap: 4px;
    min-height: 100px;
    padding: 16px;
    border-right: 1px solid rgba(13, 162, 135, 0.2);
}

.vacation-calculation article:last-child { border-right: 0; }
.vacation-calculation span,
.vacation-calculation small { color: var(--muted); font-size: 11px; font-weight: 700; line-height: 1.35; }
.vacation-calculation strong { align-self: center; color: #166e55; font-size: 22px; line-height: 1.05; }
.vacation-form-actions { margin-top: 2px; }
.vacation-status-form { margin: 4px 0 0; }

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

.pricing-sheet-note {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 18px;
}

.pricing-sheet-note strong { color: var(--ink); }
.pricing-sheet-note span { color: var(--muted); font-size: 13px; line-height: 1.45; }
.pricing-form { display: grid; gap: 24px; }
.pricing-table { min-width: 620px; }
.pricing-table th:nth-child(2),
.pricing-table td:nth-child(2) { width: 190px; }
.pricing-table th:nth-child(3),
.pricing-table td:nth-child(3) { width: 180px; }
.pricing-table th:last-child,
.pricing-table td:last-child { width: 68px; }
.pricing-table td strong,
.pricing-table td small { display: block; }
.pricing-table td small { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.pricing-table input { width: 100%; min-width: 0; }
.pricing-section { display: grid; gap: 18px; }
.pricing-section .section-row { margin: 0; }
.pricing-section .section-row h3 { margin-bottom: 3px; }
.pricing-section .section-row p { margin: 0; color: var(--muted); font-size: 13px; }
.pricing-settings-table { min-width: 500px; max-width: 760px; }
.pricing-base-table { min-width: 860px; table-layout: fixed; }
.pricing-base-table th:nth-child(1),
.pricing-base-table td:nth-child(1) { width: 42%; }
.pricing-base-table th:nth-child(2),
.pricing-base-table td:nth-child(2),
.pricing-base-table th:nth-child(3),
.pricing-base-table td:nth-child(3),
.pricing-base-table th:last-child,
.pricing-base-table td:last-child { width: 29%; }
.pricing-derived-value { display: block; color: var(--ink); font-variant-numeric: tabular-nums; }

.calculation-table-wrap {
    max-height: min(640px, calc(100vh - 250px));
    overflow: auto;
    overscroll-behavior: contain;
}
.calculation-form { min-height: 0; }
.calculation-table { min-width: 1080px; table-layout: fixed; }
.calculation-table th,
.calculation-table td { min-width: 0; padding: 10px 8px; vertical-align: middle; }
.calculation-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fff;
    box-shadow: 0 1px 0 var(--line);
    font-size: 11px;
    line-height: 1.25;
    white-space: normal;
}
.calculation-table td { font-size: 13px; white-space: nowrap; }
.calculation-table .calculation-column-0 { width: 15%; white-space: normal; }
.calculation-table .calculation-column-1 { width: 5%; text-align: center; }
.calculation-table .calculation-column-2 { width: 8%; text-align: center; }
.calculation-table .calculation-column-3 { width: 6%; text-align: center; }
.calculation-table .calculation-column-4 { width: 11%; }
.calculation-table .calculation-column-5 { width: 8%; }
.calculation-table .calculation-column-6 { width: 7%; }
.calculation-table .calculation-column-7 { width: 10%; }
.calculation-table .calculation-column-8 { width: 8%; }
.calculation-table .calculation-column-9 { width: 12%; }
.calculation-table .calculation-column-10 { width: 10%; }
.calculation-table .calculation-input { width: 100%; min-width: 0; border-color: rgba(13, 162, 135, 0.55); background: #effaf6; font-weight: 750; }
.calculation-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 5px;
    background: #e6f7f1;
    color: #087b5f;
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
}
.calculation-row-volume td { background: rgba(72, 142, 198, 0.07); }
.calculation-row-volume td:first-child { box-shadow: inset 3px 0 0 #468fc4; }
.pricing-actions { justify-content: flex-end; }

.pricing-results {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid rgba(13, 162, 135, 0.28);
    border-radius: 8px;
    background: #f4faf7;
    margin: 0 0 24px;
}

.pricing-results article {
    display: grid;
    align-content: start;
    gap: 7px;
    min-height: 112px;
    padding: 16px;
    border-right: 1px solid rgba(13, 162, 135, 0.2);
}

.pricing-results article:last-child { border-right: 0; }
.pricing-results span,
.pricing-results small { color: var(--muted); font-size: 11px; font-weight: 700; line-height: 1.35; }
.pricing-results strong { color: #166e55; font-size: 22px; line-height: 1.2; }

@media (min-width: 1041px) {
    .calculation-form {
        display: flex;
        flex-direction: column;
        height: calc(100dvh - 32px);
        gap: 12px;
    }
    .calculation-form .calculation-table-wrap {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
    }
    .calculation-form .pricing-actions { flex: 0 0 auto; }
}

@media (max-width: 1040px) {
    .vacation-workspace { grid-template-columns: 1fr; }
    .vacation-year-calendar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .vacation-upcoming-panel { max-width: none; }
    .vacation-upcoming-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .vacation-upcoming-item:nth-last-child(2) { border-bottom: 0; }
    .vacation-upcoming-item:nth-child(odd) { border-right: 1px solid var(--line); }
}

@media (max-width: 680px) {
    .vacation-head { align-items: stretch; flex-direction: column; padding: 18px; }
    .vacation-head-legend { justify-content: flex-start; }
    .vacation-upcoming-list { grid-template-columns: 1fr; }
    .vacation-upcoming-item:nth-child(odd) { border-right: 0; }
    .vacation-upcoming-item:nth-last-child(2) { border-bottom: 1px solid var(--line); }
    .vacation-year-calendar { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 8px; }
    .vacation-year-month { padding: 8px; }
    .vacation-year-day,
    .vacation-year-day.is-outside { min-height: 45px; }
    .vacation-year-day .vacation-calendar-event { font-size: 8px; }
    .vacation-form-grid,
    .vacation-calculation,
    .pricing-results { grid-template-columns: 1fr; }
    .vacation-quick-dates { grid-template-columns: 1fr; }
    .vacation-quick-actions { flex-direction: column-reverse; }
    .vacation-quick-actions .primary-button,
    .vacation-quick-actions .secondary-button { width: 100%; }
    .vacation-calculation article { min-height: 0; border-right: 0; border-bottom: 1px solid rgba(13, 162, 135, 0.2); }
    .vacation-calculation article:last-child { border-bottom: 0; }
    .pricing-results article { min-height: 0; border-right: 0; border-bottom: 1px solid rgba(13, 162, 135, 0.2); }
    .pricing-results article:last-child { border-bottom: 0; }
    .pricing-sheet-note { align-items: flex-start; flex-direction: column; }
}
