:root {
    color-scheme: light;
    --ink: #14263e;
    --secondary: #34445a;
    --muted: #475569;
    --canvas: #f4f7fb;
    --line: #cbd5e1;
    --navy: #12263f;
    --paper: #fff;
    --focus: #075985;
    --shadow: 0 4px 20px #12263f08;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    font-synthesis: none
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    line-height: 1.5
}

button,
input,
select {
    font: inherit
}

button {
    cursor: pointer
}

button:disabled {
    cursor: not-allowed;
    color: var(--muted);
    background: #edf1f6;
    border-color: var(--line)
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px
}

button,
input,
[tabindex] {
    -webkit-tap-highlight-color: transparent
}

[hidden] {
    display: none !important
}

h1,
h2,
h3,
p {
    margin: 0
}

h1 {
    font-size: 27px;
    letter-spacing: -.7px;
    line-height: 1.2;
    font-weight: 750
}

h2 {
    font-size: 18px;
    letter-spacing: -.25px
}

h3 {
    font-size: 18px;
    letter-spacing: -.2px
}

.skip-link {
    position: fixed;
    top: -100px;
    left: 20px;
    z-index: 100;
    background: #fff;
    color: var(--ink);
    padding: 10px
}

.skip-link:focus {
    top: 10px
}

.masthead {
    background: var(--navy);
    color: #fff;
    padding: 25px 32px
}

.masthead-inner {
    max-width: 1640px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px
}

.brand {
    display: flex;
    gap: 17px;
    align-items: center
}

.brand-mark {
    display: block;
    background: #fff;
    border: 1px solid #8495aa;
    border-radius: 13px;
    width: 54px;
    height: 60px;
    flex-shrink: 0;
    padding: 5px;
    object-fit: contain
}

.eyebrow {
    font-size: 11px;
    letter-spacing: 2px;
    font-weight: 700;
    margin-bottom: 7px;
    color: #dce7f4
}

.eyebrow span {
    padding: 0 7px
}

.header-sub {
    color: #dce7f4;
    margin-top: 7px;
    font-size: 13px
}

.header-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center
}

.mode-pill {
    font-size: 12px;
    border: 1px solid #8495aa;
    border-radius: 30px;
    padding: 6px 12px;
    color: #fff;
    white-space: nowrap
}

.button {
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 12px;
    background: #fff;
    color: var(--ink);
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap
}

.button:hover:not(:disabled) {
    background: #e9eff7
}

.header-button {
    border-color: #fff;
    background: #fff;
    color: var(--navy)
}

.primary {
    background: var(--navy);
    color: #fff;
    border-color: var(--navy)
}

.primary:hover:not(:disabled) {
    background: #203c5d
}

.danger {
    color: #881b1b;
    border-color: #dca0a0;
    background: #fff
}

.danger:hover:not(:disabled) {
    background: #fff1f1
}

.text-button {
    border: 0;
    background: transparent;
    color: var(--ink);
    padding: 5px 7px;
    font-weight: 650;
    font-size: 12px;
    text-decoration: underline
}

.icon-button {
    height: 32px;
    width: 32px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    color: var(--ink);
    font-size: 23px;
    line-height: 1
}

.small {
    font-size: 11px;
    color: var(--secondary)
}

main {
    max-width: 1704px;
    margin: auto;
    padding: 24px 32px 0
}

.connection-card {
    background: #fff;
    border: 1px solid #dce3ec;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 7px
}

.connection {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 12px
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #475569;
    border-radius: 50%;
    flex-shrink: 0
}

.connection.online .status-dot {
    background: #167141
}

.connection.offline {
    color: #8a260e
}

.connection.offline .status-dot {
    background: #a8390f
}

.connection.saving .status-dot {
    background: #854d0e
}

#last-update {
    font-size: 11px;
    color: var(--secondary)
}

.department-bar {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    padding: 20px 0 22px
}

.filter-label {
    font-size: 11px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .7px;
    line-height: 30px;
    color: var(--secondary)
}

.department-filters {
    display: flex;
    gap: 7px;
    flex-wrap: wrap
}

.department-filter {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 5px 9px;
    font-size: 11px;
    font-weight: 650;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--dept-ink, var(--ink));
    background: var(--dept-bg, #fff);
    min-height: 30px
}

.department-filter[aria-pressed="true"] {
    outline: 2px solid var(--ink);
    outline-offset: 1px
}

.department-dot {
    width: 7px;
    height: 7px;
    border-radius: 3px;
    background: var(--dept-accent, var(--ink));
    flex-shrink: 0
}

.filter-count {
    font-variant-numeric: tabular-nums
}

@supports (color: color-mix(in srgb, black, white)) {
    .department-filter[data-department]:not([data-department=""]),
    .person-card,
    .slot.occupied {
        --dept-bg: color-mix(in srgb, var(--dept-accent) 11%, white);
        --dept-ink: color-mix(in srgb, var(--dept-accent) 24%, var(--ink))
    }
}

.workspace {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 22px;
    align-items: start
}

.team-panel[hidden]+.planning {
    grid-column: 1/-1
}

.team-panel {
    background: #fff;
    border: 1px solid #dce3ec;
    border-radius: 12px;
    padding: 19px 16px 13px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 18px
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px
}

.count-badge {
    font-weight: 750;
    font-size: 12px;
    background: #e9eef6;
    color: var(--ink);
    border-radius: 6px;
    padding: 3px 8px
}

.panel-description {
    font-size: 12px;
    line-height: 1.55;
    color: var(--secondary);
    margin: 0 0 15px
}

.search-label {
    font-size: 11px;
    font-weight: 650;
    display: block;
    margin-bottom: 5px
}

input:not([type="checkbox"]),
#assign-person,
.directory-form select {
    width: 100%;
    min-height: 38px;
    border: 1px solid #9daec1;
    background: #fff;
    border-radius: 7px;
    padding: 8px 10px;
    color: var(--ink)
}

.directory-fields {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0
}

.directory-form input[type="color"] {
    width: 76px;
    padding: 4px 6px;
    cursor: pointer
}

.directory-picker {
    display: flex;
    align-items: flex-end;
    gap: 8px
}

.directory-picker > div {
    flex: 1;
    min-width: 0
}

.directory-form .dialog-actions {
    flex-wrap: wrap
}

.directory-form [data-delete] {
    margin-right: auto
}

input::placeholder {
    color: var(--muted);
    opacity: 1
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--secondary);
    margin: 12px 0 15px
}

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

.team-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    max-height: 580px;
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: #8193aa #edf2f8;
    padding: 3px 3px 5px
}

.person-card {
    min-width: 0;
    min-height: 72px;
    text-align: left;
    border: 1px solid var(--dept-accent, var(--line));
    border-left: 3px solid var(--dept-accent, var(--line));
    border-radius: 7px;
    background: var(--dept-bg, #edf2f8);
    color: var(--dept-ink, var(--ink));
    padding: 9px 7px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    cursor: grab
}

.person-card:hover {
    box-shadow: 0 2px 5px #14263e1c
}

.person-card[aria-pressed="true"] {
    outline: 2px solid var(--ink);
    outline-offset: 1px
}

.person-name {
    font-weight: 750;
    line-height: 1.25;
    font-size: 12px;
    overflow-wrap: anywhere
}

.person-dept {
    font-size: 10px;
    line-height: 1.3
}

.person-hours {
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    align-self: flex-end;
    margin-top: 1px
}

.person-days-count {
    font-size: 14px
}

.person-days-count.below-target {
    color: #a61b16
}

.panel-footnote {
    font-size: 10px;
    color: var(--secondary);
    margin: 12px 0 0
}

.empty-message {
    font-size: 12px;
    padding: 20px 5px;
    color: var(--secondary)
}

.planning {
    min-width: 0
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    min-height: 38px;
    margin-bottom: 12px
}

.history-actions,
.export-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap
}

.planning-label {
    font-size: 14px;
    font-weight: 700
}

.boards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: start
}

.day-board {
    border: 1px solid #d7e0eb;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: var(--shadow)
}

.day-heading {
    padding: 17px 17px 14px;
    border-bottom: 1px solid #dce3ec;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
    background: #fff
}

.day-kicker {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.1px;
    color: var(--secondary);
    font-weight: 700;
    margin-bottom: 3px
}

.day-heading h3 {
    font-size: 19px
}

.day-hours {
    color: var(--secondary);
    font-size: 11px;
    margin-top: 3px
}

.day-status {
    text-align: right;
    font-size: 11px;
    color: var(--secondary);
    white-space: nowrap
}

.day-status strong {
    display: block;
    font-size: 18px;
    color: var(--ink)
}

table {
    border-collapse: collapse;
    width: 100%;
    table-layout: fixed
}

col.time-col {
    width: 70px
}

thead {
    background: #edf2f8;
    color: #273e5c
}

thead th {
    padding: 9px 3px;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .5px
}

tbody th {
    padding: 6px 3px 6px 9px;
    color: var(--secondary);
    font-variant-numeric: tabular-nums;
    font-size: 11px;
    font-weight: 650;
    line-height: 1.4;
    text-align: left
}

tbody th span {
    display: block
}

tbody td {
    padding: 6px 5px 6px 2px;
    height: 83px
}

tbody tr {
    border-top: 1px solid #e2e8f0
}

tbody tr:first-child {
    border-top: 0
}

.slot {
    height: 49px;
    min-width: 0;
    border: 1px dashed #a9b9cc;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    color: #42556f;
    cursor: pointer;
    padding: 9px 7px;
    position: relative
}

.empty-slot-content {
    display: flex;
    align-items: center;
    gap: 5px;
    text-align: center;
    font-size: 10px;
    font-weight: 650;
    line-height: 1.2
}

.slot:hover:not(.occupied) {
    border-color: #345775;
    background: #eaf2fc
}

.slot.occupied {
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    border-style: solid;
    border-color: var(--dept-accent, var(--line));
    border-left-width: 3px;
    background: var(--dept-bg, #edf2f8);
    color: var(--dept-ink, var(--ink));
    cursor: default
}

.slot.admin-editable {
    cursor: grab;
    padding-right: 25px
}

.slot .person-name {
    font-size: 12px
}

.slot .person-dept {
    font-size: 10px
}

.slot.selected {
    outline: 2px solid var(--ink);
    outline-offset: 1px
}

.slot.drop-target {
    outline: 3px solid var(--focus);
    outline-offset: 0
}

.slot[aria-disabled="true"] {
    cursor: not-allowed
}

.remove-slot {
    position: absolute;
    right: 4px;
    top: 4px;
    border: 0;
    background: transparent;
    color: var(--dept-ink, var(--ink));
    border-radius: 4px;
    width: 21px;
    height: 21px;
    font-size: 19px;
    line-height: 1;
    display: grid;
    place-items: center
}

.remove-slot:hover {
    background: #ffffffb0
}

.day-footnote {
    padding: 12px 16px;
    background: #f7f9fc;
    border-top: 1px solid #dce3ec;
    color: var(--secondary);
    font-size: 11px
}

.planning-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--secondary);
    font-size: 11px;
    line-height: 1.6;
    margin-top: 18px;
    padding: 0 2px
}

.planning-footer p {
    max-width: 620px
}

.selection-banner {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    padding: 10px 13px;
    margin-bottom: 12px;
    background: #fff4cf;
    color: #51400f;
    border: 1px solid #b69a42;
    border-radius: 7px;
    font-size: 12px
}

.pending-banner {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border: 1px solid #9e501e;
    background: #fff2df;
    color: #613311;
    border-radius: 7px;
    font-size: 12px;
    margin-bottom: 14px
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    font-size: 11px;
    color: var(--secondary);
    border-top: 1px solid #cdd7e4;
    margin-top: 24px;
    padding: 16px 0 20px
}

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

#toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    max-width: min(640px, calc(100% - 30px));
    z-index: 50;
    background: var(--navy);
    color: #fff;
    padding: 13px 18px;
    border-radius: 10px;
    box-shadow: 0 8px 30px #12263f33;
    font-size: 13px
}

#toast.error {
    background: #6e2020
}

dialog {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 25px;
    max-width: 440px;
    width: calc(100% - 32px);
    background: #fff;
    color: var(--ink);
    box-shadow: 0 16px 70px #12263f40
}

dialog::backdrop {
    background: #081b35a8
}

.dialog-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px
}

.dialog-heading+h2 {
    margin-top: 0
}

dialog p {
    font-size: 13px;
    color: var(--secondary);
    margin: 12px 0 17px
}

dialog label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin: 13px 0 5px
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 22px
}

.error-message {
    color: #811e1e !important;
    padding: 9px;
    background: #fff0f0;
    border: 1px solid #db9c9c;
    border-radius: 6px;
    font-size: 12px !important
}

.dragging {
    box-shadow: 0 5px 14px #14263e38
}

.touch-hint {
    font-size: 11px
}

@media(min-width:1600px) {
    .workspace {
        grid-template-columns: 310px minmax(0, 1fr)
    }

    .slot .person-name {
        font-size: 14px
    }

    .slot .person-dept {
        font-size: 11px
    }

    .person-name {
        font-size: 13px
    }

    .team-list {
        max-height: 650px
    }

    col.time-col {
        width: 79px
    }
}

@media(max-width:1150px) {
    main {
        padding: 20px 20px 0
    }

    .masthead {
        padding: 22px 20px
    }

    .workspace {
        grid-template-columns: 240px minmax(0, 1fr);
        gap: 16px
    }

    .boards {
        grid-template-columns: 1fr
    }

    .team-panel {
        padding: 16px 12px
    }

    .connection-card {
        padding: 14px
    }

    .department-bar {
        gap: 10px
    }

    h1 {
        font-size: 24px
    }

    .brand-mark {
        width: 45px;
        height: 52px
    }

    .person-name {
        font-size: 11px
    }

    .slot .person-name {
        font-size: 14px
    }

    .slot .person-dept {
        font-size: 11px
    }

    .slot {
        height: 60px
    }

    tbody td {
        height: 72px
    }

    col.time-col {
        width: 80px
    }
}

@media(max-width:740px) {
    main {
        padding: 15px 12px 0
    }

    .masthead {
        padding: 19px 16px
    }

    .masthead-inner {
        align-items: flex-start;
        gap: 16px;
        flex-direction: column
    }

    .header-actions {
        justify-content: space-between;
        width: 100%
    }

    .connection-card {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 4px 12px;
        padding: 10px 12px
    }

    .connection-card .small {
        display: none
    }

    .department-bar {
        display: block;
        padding: 13px 0 16px
    }

    .filter-label {
        display: block;
        margin-bottom: 4px
    }

    .workspace {
        grid-template-columns: 1fr;
        gap: 16px
    }

    .team-panel {
        position: static;
        padding: 14px
    }

    .panel-description {
        margin-bottom: 10px
    }

    .team-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        max-height: 232px;
        gap: 7px
    }

    .person-card {
        min-height: 76px
    }

    .person-name {
        font-size: 12px
    }

    .person-dept {
        font-size: 10px
    }

    .checkbox-label {
        margin: 10px 0
    }

    .panel-footnote {
        margin-top: 9px
    }

    .boards {
        gap: 18px
    }

    .toolbar {
        gap: 9px;
        margin-bottom: 11px
    }

    .export-actions {
        gap: 5px
    }

    .button {
        font-size: 11px;
        padding: 7px 9px;
        min-height: 35px
    }

    .planning-label {
        font-size: 13px
    }

    .site-footer {
        flex-direction: column;
        gap: 3px
    }

    .planning-footer {
        flex-direction: column;
        align-items: flex-start
    }

    .day-heading {
        padding: 16px
    }

    .selection-banner {
        position: sticky;
        top: 6px;
        z-index: 10
    }

    .pending-banner {
        flex-direction: column;
        align-items: flex-start
    }

    .slot .person-name {
        font-size: 12px
    }

    .slot .person-dept {
        font-size: 10px
    }

    .slot {
        height: 66px
    }

    tbody td {
        height: 78px
    }

    col.time-col {
        width: 67px
    }
}

@media print {
    @page {
        size: A4 landscape;
        margin: 10mm
    }

    body {
        background: #fff;
        font-size: 10px
    }

    .masthead {
        background: #fff;
        color: #14263e;
        padding: 0 0 10px
    }

    .brand-mark,
    .header-actions,
    .team-panel,
    .toolbar,
    .department-bar,
    .selection-banner,
    .pending-banner,
    .connection-card,
    #toast,
    dialog,
    .skip-link,
    .planning-footer button,
    .remove-slot {
        display: none !important
    }

    .masthead .eyebrow,
    .header-sub {
        color: #34445a
    }

    h1 {
        font-size: 22px
    }

    main {
        padding: 0;
        max-width: none
    }

    .workspace {
        display: block
    }

    .boards {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 14px
    }

    .day-board {
        box-shadow: none;
        break-inside: avoid
    }

    .day-heading {
        padding: 10px
    }

    .day-heading h3 {
        font-size: 17px
    }

    .day-kicker {
        font-size: 9px
    }

    .day-hours {
        font-size: 10px
    }

    .slot {
        height: 48px;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact
    }

    .slot.admin-editable {
        padding-right: 7px
    }

    .slot .person-name {
        font-size: 11px
    }

    .slot .person-dept {
        font-size: 9px
    }

    tbody td {
        height: 56px;
        padding: 4px 5px 4px 2px
    }

    tbody th {
        font-size: 30px
    }

    thead {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact
    }

    thead th {
        font-size: 30px;
        padding: 7px
    }

    .day-footnote {
        padding: 8px;
        font-size: 9px
    }

    .planning-footer {
        font-size: 9px;
        margin-top: 10px
    }

    .site-footer {
        font-size: 9px;
        margin-top: 10px;
        padding: 8px 0
    }
}

.week-table {
    overflow-x: auto
}

.week-table th {
    overflow-wrap: anywhere
}

.week-table td {
    vertical-align: top
}

.day-assignments {
    display: grid;
    gap: 6px
}

.day-add {
    width: 100%
}

@media screen and (max-width:520px) {
    .week-table table {
        min-width: 440px
    }
}

@media print {
    .day-add {
        display: none
    }
}
