@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Sora:wght@600;700;800&display=swap");

:root {
    --font-ui: "Plus Jakarta Sans", "Aptos", "Segoe UI", sans-serif;
    --font-display: "Sora", "Plus Jakarta Sans", "Aptos", sans-serif;
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 12px;
    --shadow-panel: 0 24px 60px rgba(7, 13, 27, 0.22);
    --shadow-soft: 0 14px 30px rgba(17, 24, 39, 0.12);
    --accent: #1d6cff;
    --accent-2: #0d5bf0;
    --accent-soft: rgba(29, 108, 255, 0.16);
    --green: #22c55e;
    --blue: #2477ee;
    --purple: #8f2cc9;
    --teal: #14b8a6;
    --yellow: #f0b100;
    --orange: #f97316;
    --red: #ef4444;
    --muted: #9ca3af;
    --timeline-holiday: rgba(239, 68, 68, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-family: var(--font-ui);
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-ui);
    font-feature-settings: "liga" 1, "kern" 1;
    color: var(--text);
    background:
        radial-gradient(circle at top left, var(--bg-glow-1), transparent 28%),
        radial-gradient(circle at top right, var(--bg-glow-2), transparent 22%),
        linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
    transition: background 0.25s ease, color 0.25s ease;
}

h1,
h2,
h3,
h4,
.brand-copy strong,
.panel-title,
.nav-tile span,
.calendar-month-trigger,
.swap-month-trigger,
.hhee-monthbar strong,
.clockmarks-monthbar strong {
    font-family: var(--font-display);
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: auto;
    pointer-events: none;
    filter: blur(80px);
    opacity: 0.45;
    z-index: 0;
}

body::before {
    width: 240px;
    height: 240px;
    top: 72px;
    left: -48px;
    background: var(--bg-orb-1);
}

body::after {
    width: 320px;
    height: 320px;
    right: -80px;
    bottom: 40px;
    background: var(--bg-orb-2);
}

body.theme-dark {
    --bg-top: #08111d;
    --bg-bottom: #0d1625;
    --bg-glow-1: rgba(24, 95, 255, 0.18);
    --bg-glow-2: rgba(11, 183, 160, 0.12);
    --bg-orb-1: rgba(29, 108, 255, 0.24);
    --bg-orb-2: rgba(122, 92, 255, 0.16);
    --panel: rgba(10, 18, 30, 0.94);
    --panel-alt: rgba(20, 31, 48, 0.88);
    --panel-hover: rgba(28, 42, 64, 0.92);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);
    --text: #f6f8fc;
    --text-soft: #b8c4d8;
    --text-muted: #8a98ad;
    --field: rgba(15, 25, 40, 0.94);
    --field-border: rgba(255, 255, 255, 0.1);
    --timeline-empty: rgba(255, 255, 255, 0.05);
    --calendar-empty: rgba(255, 255, 255, 0.04);
    --calendar-disabled: rgba(148, 163, 184, 0.16);
    --inhabil-ring: rgba(248, 113, 113, 0.9);
    --inhabil-soft: rgba(248, 113, 113, 0.16);
    --weekday: rgba(255, 255, 255, 0.8);
    --scrollbar: rgba(255, 255, 255, 0.14);
}

body.theme-light {
    --bg-top: #f4f7ff;
    --bg-bottom: #f9fbff;
    --bg-glow-1: rgba(29, 108, 255, 0.14);
    --bg-glow-2: rgba(13, 91, 240, 0.08);
    --bg-orb-1: rgba(29, 108, 255, 0.14);
    --bg-orb-2: rgba(20, 184, 166, 0.12);
    --panel: rgba(255, 255, 255, 0.94);
    --panel-alt: rgba(248, 250, 255, 0.96);
    --panel-hover: rgba(240, 245, 255, 0.98);
    --border: rgba(14, 26, 44, 0.08);
    --border-strong: rgba(14, 26, 44, 0.14);
    --text: #112038;
    --text-soft: #30425c;
    --text-muted: #7d8aa0;
    --field: #ffffff;
    --field-border: rgba(17, 32, 56, 0.16);
    --timeline-empty: rgba(17, 32, 56, 0.06);
    --calendar-empty: rgba(17, 32, 56, 0.04);
    --calendar-disabled: rgba(17, 32, 56, 0.08);
    --inhabil-ring: rgba(220, 38, 38, 0.78);
    --inhabil-soft: rgba(220, 38, 38, 0.1);
    --weekday: #32425a;
    --scrollbar: rgba(17, 32, 56, 0.18);
    --shadow-panel: 0 20px 50px rgba(17, 32, 56, 0.08);
    --shadow-soft: 0 14px 28px rgba(17, 32, 56, 0.08);
}

input,
select,
textarea,
label,
button {
    font: inherit;
}

button,
input,
select,
textarea,
label {
    font-family: var(--font-ui);
}

button,
input,
select,
textarea {
    outline: none;
}

button {
    border: 0;
    cursor: pointer;
}

body.app-is-busy,
body.app-is-busy * {
    cursor: wait !important;
}

body.app-is-busy .app-shell,
body.app-is-busy .turn-change-dialog-backdrop {
    pointer-events: none;
    user-select: none;
}

.app-busy-indicator {
    position: fixed;
    top: max(16px, env(safe-area-inset-top));
    left: 50%;
    z-index: 240;
    display: none;
    align-items: center;
    gap: 9px;
    max-width: min(360px, calc(100vw - 24px));
    min-height: 40px;
    padding: 9px 14px;
    border: 1px solid rgba(29, 108, 255, 0.32);
    border-radius: 14px;
    background: var(--panel);
    color: var(--text);
    box-shadow: var(--shadow-soft);
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.2;
    pointer-events: none;
    transform: translateX(-50%);
}

body.app-is-busy .app-busy-indicator {
    display: flex;
}

.app-busy-indicator__spinner {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    border: 2px solid rgba(29, 108, 255, 0.22);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: app-busy-spin 0.7s linear infinite;
}

@keyframes app-busy-spin {
    to {
        transform: rotate(360deg);
    }
}

input,
select,
textarea {
    width: 100%;
    font-family: var(--font-ui);
    font-size: 0.96rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    border: 1px solid var(--field-border);
    background: var(--field);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

textarea {
    resize: vertical;
    min-height: 92px;
}

input::placeholder {
    color: var(--text-muted);
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(29, 108, 255, 0.48);
    box-shadow: 0 0 0 4px rgba(29, 108, 255, 0.12);
}

input:disabled,
select:disabled,
textarea:disabled {
    cursor: default;
    opacity: 1;
    color: var(--text);
    background: var(--panel-alt);
    border-color: var(--border);
    box-shadow: none;
}

body.theme-light input,
body.theme-light select,
body.theme-light textarea {
    background-color: #fff;
    border-color: rgba(17, 32, 56, 0.16);
    color: #0f172a;
}

body.theme-light input:disabled,
body.theme-light select:disabled,
body.theme-light textarea:disabled,
body.theme-light input[readonly],
body.theme-light textarea[readonly] {
    background-color: #fff;
    border-color: rgba(17, 32, 56, 0.14);
    color: #26364d;
    -webkit-text-fill-color: #26364d;
}

select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, currentColor 50%),
        linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position:
        calc(100% - 20px) calc(50% - 2px),
        calc(100% - 14px) calc(50% - 2px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    color: var(--text);
}

svg {
    display: block;
}

.hidden {
    display: none !important;
}

.app-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 18px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 6px 16px;
    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-mark {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: #fff;
    background: transparent;
    box-shadow: 0 18px 32px rgba(29, 108, 255, 0.18);
}

.brand-mark.brand-mark--wide {
    width: clamp(170px, 24vw, 280px);
    height: 46px;
    border-radius: 0;
    overflow: visible;
    background: transparent;
    box-shadow: none;
}

.brand-mark svg {
    width: 28px;
    height: 28px;
}

.brand-logo {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.brand-mark--wide .brand-logo {
    object-position: left center;
    opacity: 0.9;
    filter: saturate(0.98) contrast(1.04);
}

.brand-logo--dark {
    display: none;
}

body.theme-dark .brand-logo--light {
    display: none;
}

body.theme-dark .brand-logo--dark {
    display: block;
    opacity: 0.96;
    filter: drop-shadow(0 0 14px rgba(45, 212, 191, 0.22));
}

.brand-copy {
    display: grid;
    gap: 4px;
}

.brand-copy strong {
    color: #2c7be5;
    font-size: clamp(1.5rem, 2vw, 2.35rem);
    letter-spacing: -0.055em;
    line-height: 0.95;
}

.brand-accent {
    color: #72ba6a;
}

.brand-copy span {
    font-size: 0.92rem;
    color: var(--text-muted);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-menu-toggle,
.mobile-panel-toggle {
    display: none;
}

.profile-viewer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--text-soft);
    font-size: 0.86rem;
}

.profile-viewer label {
    white-space: nowrap;
}

.profile-viewer__field {
    display: inline-flex;
    align-items: center;
    min-width: 220px;
    max-width: 300px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel);
    overflow: hidden;
}

.profile-viewer__field input {
    width: 100%;
    min-width: 0;
    height: 100%;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 0 10px 0 12px;
    font-weight: 400;
    color: var(--text);
}

.profile-viewer__field input:focus {
    outline: none;
}

.profile-viewer__field:focus-within {
    border-color: rgba(29, 108, 255, 0.55);
    box-shadow: 0 0 0 3px rgba(29, 108, 255, 0.12);
}

.profile-viewer__button {
    width: 38px;
    height: 100%;
    border: 0;
    border-left: 1px solid var(--border);
    display: grid;
    place-items: center;
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
}

.profile-viewer__button:hover {
    color: var(--accent);
    background: var(--panel-hover);
}

.profile-viewer__button svg {
    width: 16px;
    height: 16px;
}

.calendar-profile-viewer {
    display: grid;
    grid-template-columns: auto minmax(320px, 1fr) auto;
    justify-content: stretch;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 3px 8px;
    border-radius: 10px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
}

.calendar-profile-viewer label {
    color: var(--text-soft);
    font-size: 0.8rem;
    font-weight: 800;
}

.calendar-profile-viewer .profile-viewer__field {
    width: 100%;
    max-width: none;
    height: 28px;
    border-radius: 9px;
    background: var(--field);
}

.calendar-profile-viewer .profile-viewer__field input {
    padding-inline: 9px;
    font-size: 0.8rem;
    font-weight: 600;
}

.calendar-profile-viewer .profile-viewer__button {
    width: 30px;
    height: 28px;
}

.calendar-profile-viewer .profile-viewer__button svg {
    width: 13px;
    height: 13px;
}

.calendar-edit-toggle {
    display: inline-flex;
    align-items: center;
    justify-self: end;
    gap: 10px;
    min-width: max-content;
    cursor: pointer;
}

.calendar-edit-switch {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    width: 44px;
    height: 24px;
}

.calendar-edit-switch input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
}

.calendar-edit-switch > span {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: rgba(125, 138, 160, 0.24);
    border: 1px solid var(--border-strong);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.calendar-edit-switch > span::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 4px 10px rgba(17, 32, 56, 0.2);
    transition: transform 0.2s ease;
}

.calendar-edit-switch input:checked + span {
    background: #22c55e;
    border-color: rgba(34, 197, 94, 0.72);
}

.calendar-edit-switch input:checked + span::after {
    transform: translateX(20px);
}

.theme-switch,
.icon-button,
.primary-button,
.secondary-button,
.ghost-button {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.theme-switch,
.icon-button {
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text-soft);
}

.theme-switch:hover,
.icon-button:hover {
    transform: translateY(-1px);
    background: var(--panel-hover);
}

.theme-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 42px;
    padding: 0 12px;
    border-radius: 999px;
}

.theme-switch__icon {
    width: 16px;
    height: 16px;
}

.theme-switch__track {
    position: relative;
    width: 42px;
    height: 22px;
    border-radius: 999px;
    background: rgba(29, 108, 255, 0.22);
}

.theme-switch__thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6aa7ff, #845fff);
    box-shadow: 0 6px 12px rgba(29, 108, 255, 0.26);
    transition: transform 0.2s ease;
}

body.theme-dark .theme-switch__thumb {
    transform: translateX(20px);
}

.icon-button {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
}

.mobile-menu-toggle,
.mobile-panel-toggle {
    display: none;
}

.icon-button svg {
    width: 18px;
    height: 18px;
}

.icon-button--small {
    width: 34px;
    height: 34px;
    border-radius: 12px;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--panel);
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
    transition:
        transform 0.16s ease,
        border-color 0.16s ease,
        background 0.16s ease;
}

.user-chip:hover {
    transform: translateY(-1px);
    border-color: rgba(29, 108, 255, 0.34);
    background: var(--panel-alt);
}

.user-chip--firebase {
    border-color: rgba(34, 197, 94, 0.32);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-soft);
}

.user-avatar svg {
    width: 18px;
    height: 18px;
}

.app-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    margin-top: 16px;
}

.panel,
.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-panel);
    backdrop-filter: blur(18px);
}

.sidebar,
.dashboard {
    min-width: 0;
}

.sidebar {
    --sidebar-sticky-top: 18px;
    --sidebar-viewport-gap: 36px;
    display: flex;
    flex-direction: column;
    padding: 18px;
    position: sticky;
    top: var(--sidebar-sticky-top);
    max-height: calc(100vh - var(--sidebar-viewport-gap));
    max-height: calc(100dvh - var(--sidebar-viewport-gap));
    overflow: hidden;
}

.sidebar:has(.profile-list) {
    height: calc(100vh - var(--sidebar-viewport-gap));
    height: calc(100dvh - var(--sidebar-viewport-gap));
}

.panel-title,
.section-head h3 {
    margin: 0;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.panel-title {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 16px;
}

.field-shell,
.field-stack {
    display: grid;
    gap: 8px;
}

.field-shell {
    margin-bottom: 12px;
}

.field-shell--icon {
    position: relative;
}

.field-shell--icon input,
.field-shell--icon select {
    padding-left: 44px;
}

.field-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    transform: translateY(-50%);
}

.field-stack span {
    color: var(--text-soft);
    font-size: 0.93rem;
    font-weight: 600;
}

.inline-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-soft);
}

.sidebar-toggle {
    margin: 12px 0 18px;
}

.toggle-check input {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--accent);
    cursor: pointer;
}

.toggle-check input:disabled {
    cursor: default;
}

.profile-list {
    display: grid;
    gap: 10px;
    align-content: start;
    align-items: start;
    grid-auto-rows: max-content;
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 2px;
    font-family: var(--font-ui);
}

.profile-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.profile-item:hover {
    transform: translateX(2px);
    background: var(--panel-hover);
    border-color: var(--border);
}

.profile-item.active {
    background: linear-gradient(135deg, rgba(29, 108, 255, 0.24), rgba(29, 108, 255, 0.1));
    border-color: rgba(29, 108, 255, 0.34);
}

.profile-item.is-inactive {
    opacity: 0.62;
    filter: grayscale(0.65);
}

.profile-item.is-inactive .profile-item__avatar {
    background: var(--calendar-disabled);
    color: var(--text-muted);
}

.profile-item__avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    flex-shrink: 0;
}

.profile-item.active .profile-item__avatar {
    background: rgba(255, 255, 255, 0.16);
}

.profile-item__content {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.profile-item__content strong,
.profile-item__content span {
    font-family: var(--font-ui);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-item__content strong {
    color: var(--text);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.profile-item__content span {
    color: var(--text-muted);
    font-size: 0.88rem;
}

body.theme-dark .profile-list .profile-item__content strong {
    color: #f8fafc;
    -webkit-text-fill-color: #f8fafc;
}

body.theme-dark .profile-list .profile-item__content span {
    color: rgba(226, 232, 240, 0.72);
    -webkit-text-fill-color: rgba(226, 232, 240, 0.72);
}

.dashboard {
    display: grid;
    gap: 18px;
}

.profile-view-layout {
    display: grid;
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

body:not([data-active-view="profile"]) #profileSection,
body:not([data-active-view="profile"]) .profile-view-layout,
body:not([data-active-view="profile"]) .availability-panel,
body:not([data-active-view="hours"]) #hoursView,
body:not([data-active-view="hours"]) .hours-panel,
body:not([data-active-view="hours"]) .hours-charts-panel,
body:not([data-active-view="weekly"]) #staffingWeeklyCalendar,
body:not([data-active-view="tasks"]) #taskAssignmentsPanel,
body:not([data-active-view="kanban"]) #kanbanPanel,
body:not([data-active-view="agenda"]) #agendaPanel,
body:not([data-active-view="turnos"]) .staffing-report-panel,
body:not([data-active-view="reports"]) #reportsPanel,
body:not([data-active-view="dashboard"]) #dashboardPanel,
body:not([data-active-view="requests"]) #workerRequestsPanel,
body:not([data-active-view="memos"]) #memosPanel,
body:not([data-active-view="clockmarks"]) #clockMarksPanel,
body:not([data-active-view="log"]) #auditLogPanel {
    display: none;
}

body[data-active-view="profile"] .calendar-panel,
body[data-active-view="profile"] .leave-panel,
body[data-active-view="profile"] .timeline-panel,
body[data-active-view="profile"] .secondary-grid {
    display: none;
}

body[data-active-view="hours"] #profileSection,
body[data-active-view="hours"] .calendar-panel,
body[data-active-view="hours"] .leave-panel,
body[data-active-view="hours"] .availability-panel,
body[data-active-view="hours"] .timeline-panel,
body[data-active-view="hours"] .secondary-grid {
    display: none;
}

body[data-active-view="turnos"] .secondary-grid,
body[data-active-view="requests"] .calendar-panel,
body[data-active-view="requests"] .leave-panel,
body[data-active-view="requests"] .timeline-panel,
body[data-active-view="requests"] #turnChangesView,
body[data-active-view="requests"] .primary-grid,
body[data-active-view="memos"] .calendar-panel,
body[data-active-view="memos"] .leave-panel,
body[data-active-view="memos"] .timeline-panel,
body[data-active-view="memos"] #turnChangesView,
body[data-active-view="memos"] .primary-grid,
body[data-active-view="clockmarks"] .calendar-panel,
body[data-active-view="clockmarks"] .leave-panel,
body[data-active-view="clockmarks"] .timeline-panel,
body[data-active-view="clockmarks"] #turnChangesView,
body[data-active-view="clockmarks"] #workerRequestsPanel,
body[data-active-view="clockmarks"] .primary-grid,
body[data-active-view="swap"] .calendar-panel,
body[data-active-view="swap"] .leave-panel,
body[data-active-view="swap"] .timeline-panel,
body[data-active-view="weekly"] .timeline-panel,
body[data-active-view="weekly"] .primary-grid,
body[data-active-view="weekly"] #turnChangesView,
body[data-active-view="tasks"] .primary-grid,
body[data-active-view="tasks"] .timeline-panel,
body[data-active-view="tasks"] #turnChangesView,
body[data-active-view="kanban"] .primary-grid,
body[data-active-view="kanban"] .timeline-panel,
body[data-active-view="kanban"] #turnChangesView,
body[data-active-view="agenda"] .primary-grid,
body[data-active-view="agenda"] .timeline-panel,
body[data-active-view="agenda"] #turnChangesView,
body[data-active-view="reports"] .timeline-panel,
body[data-active-view="reports"] .primary-grid,
body[data-active-view="reports"] .secondary-grid,
body[data-active-view="dashboard"] .timeline-panel,
body[data-active-view="dashboard"] .primary-grid,
body[data-active-view="dashboard"] .secondary-grid,
body[data-active-view="timeline"] .primary-grid,
body[data-active-view="timeline"] .secondary-grid,
body[data-active-view="timeline"] #turnChangesView,
body[data-active-view="log"] .calendar-panel,
body[data-active-view="log"] .leave-panel,
body[data-active-view="log"] .timeline-panel,
body[data-active-view="log"] #turnChangesView,
body[data-active-view="log"] .primary-grid {
    display: none;
}

body[data-active-view="profile"] .primary-grid {
    grid-template-columns: 1fr;
}

body[data-active-view="hours"] .primary-grid {
    grid-template-columns: minmax(0, 1fr);
}

body[data-active-view="requests"] .secondary-grid {
    grid-template-columns: minmax(0, 1fr);
}

body[data-active-view="memos"] .secondary-grid {
    grid-template-columns: minmax(0, 1fr);
}

body[data-active-view="weekly"] .secondary-grid {
    grid-template-columns: minmax(0, 1fr);
}

body[data-active-view="tasks"] .secondary-grid {
    grid-template-columns: minmax(0, 1fr);
}

body[data-active-view="kanban"] .secondary-grid {
    grid-template-columns: minmax(0, 1fr);
}

body[data-active-view="agenda"] .secondary-grid {
    grid-template-columns: minmax(0, 1fr);
}

body[data-active-view="clockmarks"] .secondary-grid {
    grid-template-columns: minmax(0, 1fr);
}

body[data-active-view="reports"] #reportsPanel {
    display: grid;
}

body[data-active-view="dashboard"] #dashboardPanel {
    display: block;
}

body[data-active-view="turnos"] .primary-grid {
    grid-template-columns: minmax(0, 1.38fr) minmax(0, 1.02fr);
}

body[data-active-view="profile"] .stacked-panels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-active-view="hours"] .stacked-panels {
    grid-template-columns: minmax(0, 1fr);
}

body[data-active-view="turnos"] .stacked-panels {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: stretch;
}

body[data-active-view="swap"] .secondary-grid,
body[data-active-view="staffing"] .secondary-grid,
body[data-active-view="log"] .secondary-grid {
    grid-template-columns: 1fr;
}

.turn-changes-view {
    display: grid;
    grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.hours-view {
    display: grid;
    grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.staffing-view {
    display: grid;
    grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.reports-view {
    display: grid;
    grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.agenda-view {
    display: grid;
    grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.hhee-content {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.hhee-overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
    gap: 18px;
    align-items: stretch;
}

.hhee-sidebar .profile-list {
    max-height: none;
    overflow-y: auto;
    padding-right: 2px;
}

.staffing-sidebar .profile-list {
    max-height: none;
    overflow-y: auto;
    padding-right: 2px;
}

.reports-sidebar .profile-list {
    max-height: none;
    overflow-y: auto;
    padding-right: 2px;
}

.agenda-sidebar .profile-list {
    max-height: none;
    overflow-y: auto;
    padding-right: 2px;
}

.reports-detail-panel {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.reports-selected-profile {
    display: grid;
    gap: 4px;
    text-align: left;
}

.reports-selected-profile span,
.reports-selected-profile small,
.report-download-card p {
    color: var(--text-soft);
}

.reports-selected-profile strong {
    color: var(--text);
    font-size: 1.08rem;
}

.report-download-card {
    display: grid;
    gap: 8px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.report-download-card__head {
    display: grid;
    gap: 8px;
}

.report-download-card__head strong {
    color: var(--text);
    font-size: 1.08rem;
}

.report-badge {
    width: fit-content;
    padding: 7px 10px;
    border-radius: 999px;
    color: var(--accent);
    background: rgba(29, 108, 255, 0.12);
    font-size: 0.82rem;
    font-weight: 800;
}

.report-download-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.report-download-card__actions .primary-button,
.report-download-card__actions .secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 168px;
    text-decoration: none;
}

.report-preview-heading {
    position: sticky;
    top: 8px;
    z-index: 30;
    display: grid;
    grid-template-columns: minmax(140px, 1fr) auto;
    gap: 8px;
    align-items: stretch;
    padding-bottom: 8px;
    background: var(--panel);
}

.report-preview-heading .report-title-strip {
    display: grid;
    place-items: center;
    min-height: 42px;
    min-width: 0;
    padding-inline: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: clamp(0.82rem, 1.2vw, 0.95rem);
}

.report-monthbar {
    width: 100%;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    align-items: center;
    gap: 8px;
}

.report-month-button,
.report-month-trigger {
    min-width: 0;
    color: #fff;
    cursor: pointer;
}

.report-month-button {
    width: 34px;
    height: 32px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.1);
}

.report-month-button svg {
    width: 16px;
    height: 16px;
}

.report-month-trigger {
    min-height: 32px;
    padding: 0 8px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font: inherit;
    font-size: inherit;
    font-weight: 900;
    text-transform: uppercase;
}

.report-month-button:hover,
.report-month-button:focus-visible {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.58);
    outline: none;
}

.report-month-trigger:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.report-month-trigger:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.72);
    outline-offset: 2px;
}

.report-preview-actions {
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
}

.report-download-inline {
    min-height: 42px;
    min-width: 120px;
    padding-inline: 12px;
    border-radius: 12px;
    font-size: 0.82rem;
    white-space: nowrap;
}

.report-preview-card {
    max-height: none;
    overflow: visible;
}

.report-preview-card .report-title-strip {
    display: none;
}

.no-assignment-report {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.report-title-strip {
    padding: 10px 12px;
    border-radius: 12px;
    color: #fff;
    background: #0f172a;
    font-weight: 900;
    text-align: center;
    letter-spacing: 0;
}

.report-section {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.report-section h4 {
    margin: 0;
    padding: 7px 10px;
    border-radius: 10px;
    color: #fff;
    background: var(--accent);
    font-size: 0.82rem;
    text-transform: uppercase;
}

.report-table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--panel);
}

.report-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.report-table th,
.report-table td {
    padding: 7px 8px;
    border: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.report-table th {
    color: var(--text);
    background: rgba(29, 108, 255, 0.14);
    font-weight: 800;
}

.report-table td {
    color: var(--text-soft);
    background: var(--field);
}

.report-worker-data-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    min-width: 0;
}

.report-worker-data-column {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.report-section--worker-data .report-table {
    min-width: 0;
}

.report-section--worker-data .report-table th:first-child,
.report-section--worker-data .report-table td:first-child {
    width: 1%;
    padding-right: 22px;
    white-space: nowrap;
}

.report-table .report-row--inhabil td:first-child {
    background: rgba(248, 113, 113, 0.16);
}

.report-signature-footer {
    justify-self: end;
    width: min(320px, 42%);
    min-width: 240px;
    margin-top: 84px;
    margin-right: 28px;
    padding: 8px 2px 0;
    border-top: 1px solid var(--text-soft);
    color: var(--text-soft);
    font-size: 0.8rem;
    font-weight: 650;
    line-height: 1.35;
    text-align: center;
    break-inside: avoid;
    page-break-inside: avoid;
}

.overview-card {
    padding: 24px;
}

.profile-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(190px, 20vw, 230px);
    gap: 12px;
    align-items: start;
    grid-auto-flow: row dense;
}

.profile-area {
    display: grid;
    gap: 14px;
    padding: 16px;
    border-radius: 18px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
}

body[data-active-view="profile"] .profile-view-layout {
    font-size: 0.9rem;
}

body[data-active-view="profile"] #profileSection .section-head h3 {
    font-size: 0.95rem;
}

body[data-active-view="profile"] #profileSection .profile-area--personal > .section-head h3,
body[data-active-view="profile"] #profileSection .profile-availability-card > .section-head h3,
body[data-active-view="profile"] #profileSection .profile-area--contract > .section-head h3 {
    font-size: 0.86rem;
}

body[data-active-view="profile"] #profileSection .metric-label,
body[data-active-view="profile"] #profileSection .record-field span {
    font-size: 0.82rem;
}

body[data-active-view="profile"] #profileSection .metric-row--field input,
body[data-active-view="profile"] #profileSection .metric-row--field select,
body[data-active-view="profile"] #profileSection .phone-prefix-field {
    font-size: 0.86rem;
}

body[data-active-view="profile"] #profileSection .profile-status-note,
body[data-active-view="profile"] #profileSection .record-item__values {
    font-size: 0.8rem;
}

body[data-active-view="profile"] #profileSection .profile-availability-card .availability-item,
body[data-active-view="profile"] #profileSection .profile-availability-card .availability-item input {
    font-size: 0.78rem;
}

body[data-active-view="profile"] #profileSection .record-card__head h4,
body[data-active-view="profile"] #profileSection .contract-history-head strong,
body[data-active-view="profile"] #profileSection .profile-mini-head strong {
    font-size: 0.9rem;
}

body[data-active-view="profile"] #profileSection .field-help,
body[data-active-view="profile"] #profileSection .profile-active-toggle small,
body[data-active-view="profile"] #profileSection .record-year-filter,
body[data-active-view="profile"] #profileSection .attachment-item small {
    font-size: 0.74rem;
}

body[data-active-view="profile"] #profileSection .primary-button,
body[data-active-view="profile"] #profileSection .secondary-button {
    font-size: 0.78rem;
}

body[data-active-view="profile"] .profile-view-layout > .sidebar {
    font-size: 0.8rem;
}

body[data-active-view="profile"] .profile-view-layout > .sidebar .panel-title {
    font-size: 0.78rem;
}

body[data-active-view="profile"] .profile-view-layout > .sidebar input,
body[data-active-view="profile"] .profile-view-layout > .sidebar select,
body[data-active-view="profile"] .profile-view-layout > .sidebar .inline-toggle {
    font-size: 0.78rem;
}

body[data-active-view="profile"] .profile-view-layout > .sidebar .profile-item {
    gap: 7px;
    padding: 7px 9px;
    border-radius: 11px;
}

body[data-active-view="profile"] .profile-view-layout > .sidebar .profile-item__avatar {
    width: 24px;
    height: 24px;
    font-size: 0.7rem;
}

body[data-active-view="profile"] .profile-view-layout > .sidebar .profile-item__content strong {
    font-size: 0.74rem;
}

body[data-active-view="profile"] .profile-view-layout > .sidebar .profile-item__content span {
    font-size: 0.64rem;
}

.profile-area--contract,
.profile-area--records,
.profile-availability-card {
    grid-column: 1;
}

.profile-medical-chart {
    grid-column: 1 / -1;
    min-width: 0;
}

.profile-side-column {
    display: grid;
    gap: 10px;
    grid-column: 2;
    grid-row: 1 / span 4;
    align-content: start;
    align-self: start;
    position: sticky;
    top: 16px;
    z-index: 6;
}

.profile-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
    align-items: start;
}

.phone-prefix-field {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    color: var(--text-soft);
    font-weight: 800;
}

.phone-prefix-field input {
    min-width: 0;
}

.field-help {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.attachment-list {
    display: grid;
    gap: 8px;
}

.attachment-empty {
    padding: 12px 14px;
    border-radius: 14px;
    color: var(--text-muted);
    background: var(--calendar-empty);
    border: 1px dashed var(--border);
}

.attachment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    background: var(--field);
    border: 1px solid var(--border);
}

.attachment-item > span:first-child {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.attachment-item strong,
.attachment-item small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-item small {
    color: var(--text-muted);
}

.attachment-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.attachment-view,
.attachment-remove {
    min-height: 34px;
    padding-inline: 12px;
    border-radius: 10px;
}

.profile-actions-card {
    align-content: start;
    position: static;
    width: 100%;
    min-width: 0;
    padding: 12px;
}

.profile-availability-card {
    width: 100%;
    padding: 16px;
    gap: 12px;
    align-content: start;
}

.profile-availability-card .section-head {
    gap: 8px;
    margin-bottom: 0;
}

.profile-availability-card .section-icon {
    width: 26px;
    height: 26px;
}

.profile-availability-card h3 {
    font-size: 1rem;
    line-height: 1.15;
}

.profile-availability-card .availability-list {
    grid-template-columns: repeat(var(--availability-columns, 4), minmax(0, 1fr));
}

.profile-availability-card .availability-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    min-width: 0;
    padding: 9px 10px;
    background: var(--field);
    border-color: var(--border);
    color: var(--text);
    font-size: 0.82rem;
}

.profile-availability-card .availability-item--wide {
    grid-column: auto;
}

.profile-availability-card .availability-item span {
    min-width: 0;
    color: var(--text-soft);
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.profile-availability-card .availability-item strong {
    color: var(--text);
}

.profile-availability-card .availability-item input {
    width: 74px;
    padding: 7px 8px;
    background: var(--panel-alt);
    border-color: var(--border);
    color: var(--text);
    -webkit-text-fill-color: var(--text);
}

.profile-availability-card .availability-item input:disabled,
.profile-availability-card .availability-item input[readonly] {
    background: var(--panel-alt);
    border-color: var(--border);
    color: var(--text);
    -webkit-text-fill-color: var(--text);
}

.profession-field-stack {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.profile-active-toggle {
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--field);
    border: 1px solid var(--border);
}

.profile-active-toggle span:first-child {
    display: grid;
    gap: 4px;
    font-weight: 800;
}

.profile-active-toggle small {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.35;
}

.profile-records-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.record-card {
    display: grid;
    gap: 14px;
    padding: 16px;
    border-radius: 18px;
    background: var(--field);
    border: 1px solid var(--border);
    font-family: var(--font-ui);
}

.record-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.record-card__head h4 {
    margin: 0;
    font-size: 1rem;
}

.record-year-filter {
    display: grid;
    gap: 5px;
    min-width: 130px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.record-year-filter select {
    min-height: 36px;
    padding: 8px 30px 8px 10px;
}

.record-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
    background: var(--panel-alt);
    border: 1px dashed var(--border-strong);
}

.record-field {
    display: grid;
    gap: 6px;
}

.record-field span {
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 800;
}

.record-field--wide,
.record-add {
    grid-column: 1 / -1;
}

.record-list {
    display: grid;
    gap: 10px;
}

.record-item {
    display: grid;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--panel);
    border: 1px solid var(--border);
}

.record-item__values {
    display: grid;
    gap: 4px;
    color: var(--text-soft);
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.35;
}

.record-item__values strong {
    color: var(--text);
    font-weight: 800;
}

.record-item small {
    color: var(--text-muted);
}

.overview-card__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.1fr) minmax(220px, 280px);
    gap: 18px 24px;
    align-items: start;
}

.overview-metrics,
.overview-side {
    display: grid;
    gap: 16px;
}

.metric-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 40px;
}

.metric-row--field {
    display: grid;
    grid-template-columns: 148px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    min-height: auto;
}

.metric-label {
    font-family: var(--font-display);
    color: var(--text-soft);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.metric-row--field .metric-label {
    font-weight: 700;
}

.metric-row strong {
    font-size: 1rem;
    letter-spacing: -0.02em;
}

.metric-row--field input,
.metric-row--field select {
    min-width: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.metric-input input {
    max-width: none;
    padding: 10px 12px;
}

.metric-toggle .toggle-check {
    justify-self: start;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 12px;
    border-radius: 12px;
    background: rgba(29, 108, 255, 0.14);
    color: #4190ff;
    font-weight: 700;
}

.overview-actions {
    display: grid;
    gap: 8px;
    align-self: stretch;
}

.overview-actions button {
    width: 100%;
}

.primary-button,
.secondary-button,
.ghost-button {
    min-height: 46px;
    border-radius: 14px;
    padding: 0 18px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.primary-button {
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 18px 26px rgba(29, 108, 255, 0.26);
}

.primary-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 24px 30px rgba(29, 108, 255, 0.32);
}

.primary-button:disabled,
.secondary-button:disabled,
.ghost-button:disabled {
    opacity: 0.45;
    pointer-events: none;
}

.secondary-button {
    color: var(--accent);
    background: transparent;
    border: 1px solid rgba(29, 108, 255, 0.72);
}

.secondary-button:hover,
.ghost-button:hover {
    transform: translateY(-1px);
    background: rgba(29, 108, 255, 0.08);
}

.secondary-button--wide,
.primary-button--wide {
    width: 100%;
}

.ghost-button {
    color: var(--text);
    background: var(--panel-alt);
    border: 1px solid var(--border);
}

.profile-status-note {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(29, 108, 255, 0.22);
    background: rgba(29, 108, 255, 0.1);
    color: var(--text-soft);
    line-height: 1.4;
}

.profile-status-note--soft {
    border-color: var(--border-strong);
    border-style: dashed;
    background: var(--panel-alt);
}

.profile-status-note--with-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.profile-status-note--with-action span {
    flex: 1 1 220px;
}

.profile-status-action {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 11px;
    border: 1px solid rgba(29, 108, 255, 0.34);
    background: var(--panel);
    color: var(--blue);
    font-size: 0.78rem;
    font-weight: 800;
}

.profile-status-action:hover {
    background: rgba(29, 108, 255, 0.1);
}

.profile-rotation-mini {
    padding: 12px;
    border-radius: 16px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
}

.profile-mini-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.profile-mini-head strong {
    text-align: center;
    text-transform: uppercase;
    font-size: 0.92rem;
    letter-spacing: -0.02em;
}

.profile-mini-head button {
    width: 32px;
    height: 30px;
    border-radius: 10px;
    color: var(--text);
    background: var(--field);
    border: 1px solid var(--border);
    font-weight: 900;
}

.profile-mini-head .profile-mini-month-trigger {
    width: auto;
    min-width: 0;
    height: auto;
    min-height: 30px;
    padding: 4px 10px;
    border-color: transparent;
    background: transparent;
    color: var(--text-strong);
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 850;
    line-height: 1.2;
    text-align: center;
    text-transform: uppercase;
    white-space: nowrap;
}

.profile-mini-head .profile-mini-month-trigger:hover,
.profile-mini-head .profile-mini-month-trigger:focus-visible {
    border-color: rgba(29, 108, 255, 0.42);
    background: rgba(29, 108, 255, 0.1);
    color: var(--accent);
    outline: none;
}

.profile-mini-weekdays,
.profile-mini-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
}

.profile-mini-weekdays {
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-align: center;
}

.profile-mini-spacer {
    min-height: 0;
}

.profile-mini-day {
    position: relative;
    overflow: hidden;
    min-height: 42px;
    padding: 5px;
    border-radius: 11px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    color: var(--text);
    background: var(--field);
    border: 1px solid var(--border);
}

.profile-mini-day span {
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1;
}

.profile-mini-day small {
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1;
}

.profile-mini-day.is-pickable {
    cursor: pointer;
}

.profile-mini-day.is-pickable:hover {
    border-color: rgba(29, 108, 255, 0.42);
    transform: translateY(-1px);
}

.profile-mini-day.is-selected {
    box-shadow:
        inset 0 0 0 2px rgba(29, 108, 255, 0.55),
        0 10px 20px rgba(29, 108, 255, 0.18);
}

.profile-mini-day.is-contract-range {
    border-color: rgba(22, 163, 74, 0.48);
    background: rgba(22, 163, 74, 0.16);
}

.profile-mini-day.is-contract-end {
    box-shadow:
        inset 0 0 0 2px rgba(22, 163, 74, 0.56),
        0 10px 20px rgba(22, 163, 74, 0.16);
}

.profile-mini-day.has-existing-contract {
    border-color: rgba(14, 165, 233, 0.75);
    box-shadow:
        inset 0 0 0 2px rgba(14, 165, 233, 0.62),
        0 10px 20px rgba(14, 165, 233, 0.14);
}

.profile-mini-day.has-existing-contract::after {
    content: "";
    position: absolute;
    top: 5px;
    right: 5px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #38bdf8;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.18);
}

.profile-mini-day.has-existing-contract small {
    color: #7dd3fc !important;
    text-transform: uppercase;
}

.profile-mini-day.has-existing-contract:disabled {
    opacity: 1;
}

.profile-mini-day:disabled {
    cursor: default;
    opacity: 0.82;
}

.profile-mini-day.is-contract-disabled {
    opacity: 0.42;
    filter: grayscale(0.5);
}

.profile-mini-help {
    margin: 10px 0 0;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.35;
}

.profile-editor {
    margin-top: 20px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel-alt);
}

.profile-editor__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.profile-editor__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.profile-editor__submit {
    align-self: stretch;
}

.replacement-contract-editor {
    display: grid;
    gap: 10px;
}

.honoraria-contract-editor {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 18px;
}

.honoraria-contract-editor .profile-status-note {
    grid-column: 1 / -1;
}

@media (max-width: 720px) {
    .honoraria-contract-editor {
        grid-template-columns: minmax(0, 1fr);
    }
}

.contract-history-panel {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(29, 108, 255, 0.08), transparent 46%),
        var(--panel);
}

.contract-history-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.contract-history-head strong {
    color: var(--text);
    font-size: 0.98rem;
    font-weight: 800;
}

.contract-history-head span,
.contract-history-section small,
.contract-history-muted {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.contract-history-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.contract-history-section {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.contract-history-section h4 {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.contract-history-section ul {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.contract-history-section li {
    display: grid;
    gap: 4px;
    padding: 10px 11px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel-alt);
}

.contract-history-section li strong {
    color: var(--text);
    font-size: 0.83rem;
    font-weight: 800;
}

.contract-history-section li span {
    color: var(--text-soft);
    font-size: 0.82rem;
    line-height: 1.35;
}

.contract-history-empty {
    color: var(--text-muted);
    font-size: 0.84rem;
}

.actionbar {
    order: -1;
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(16, minmax(0, 1fr));
    gap: 5px;
}

.actionbar .nav-tile[data-target="calendarPanel"] {
    order: 1;
}

.actionbar .nav-tile[data-target="timelinePanel"] {
    order: 2;
}

.actionbar .nav-tile[data-target="staffingWeeklyCalendar"] {
    order: 2;
}

.actionbar .nav-tile[data-target="taskAssignmentsPanel"] {
    order: 3;
}

.actionbar .nav-tile[data-target="kanbanPanel"] {
    order: 4;
}

.actionbar .nav-tile[data-target="agendaPanel"] {
    order: 5;
}

.actionbar .nav-tile[data-target="workerRequestsPanel"] {
    order: 6;
}

.actionbar .nav-tile[data-target="memosPanel"] {
    order: 7;
}

.actionbar .nav-tile[data-target="profileSection"] {
    order: 8;
}

.actionbar .nav-tile[data-target="clockMarksPanel"] {
    order: 9;
}

#turnChangesNav {
    order: 10;
}

.actionbar .nav-tile[data-target="hoursPanel"] {
    order: 11;
}

.actionbar .nav-tile[data-target="reportsPanel"] {
    order: 12;
}

.actionbar .nav-tile[data-target="dashboardPanel"] {
    order: 13;
}

.actionbar .nav-tile[data-target="auditLogPanel"] {
    order: 14;
}

#undoBtn {
    order: 15;
}

#redoBtn {
    order: 16;
}

.nav-tile {
    position: relative;
    display: grid;
    place-items: center;
    gap: 6px;
    min-height: 62px;
    padding: 7px 4px;
    border-radius: 15px;
    color: var(--text);
    background: transparent;
    border-bottom: 3px solid transparent;
}

.nav-tile--mobile-only {
    display: none;
}

.nav-tile:hover {
    background: var(--panel-hover);
}

.nav-tile:disabled,
.nav-tile.is-disabled,
.nav-tile.is-permission-disabled {
    opacity: 0.38;
    cursor: not-allowed;
    filter: grayscale(1);
}

.nav-tile:disabled:hover,
.nav-tile.is-disabled:hover,
.nav-tile.is-permission-disabled:hover {
    background: transparent;
}

.nav-tile.is-active {
    background: var(--panel-hover);
    border-bottom-color: var(--accent);
}

.nav-tile span {
    max-width: 100%;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.08;
    text-align: center;
}

.actionbar .nav-tile[data-target="staffingWeeklyCalendar"] span,
.actionbar .nav-tile[data-target="taskAssignmentsPanel"] span {
    white-space: normal;
}

.nav-tile .nav-alert-badge {
    position: absolute;
    top: 5px;
    right: 25%;
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #e11d48;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 8px 16px rgba(225, 29, 72, 0.28);
}

.floating-messages-button {
    position: fixed;
    right: 24px;
    bottom: calc(24px + env(safe-area-inset-bottom));
    z-index: 85;
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    box-shadow: 0 18px 40px rgba(29, 108, 255, 0.32);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.floating-messages-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 46px rgba(29, 108, 255, 0.38);
}

.floating-messages-button svg {
    width: 28px;
    height: 28px;
}

.floating-messages-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    padding: 0 6px;
    border: 2px solid var(--panel);
    border-radius: 999px;
    background: var(--red);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 900;
}

.supervisor-messages-backdrop {
    z-index: 120;
}

.supervisor-messages-dialog {
    width: min(920px, calc(100vw - 28px));
    max-height: min(760px, calc(100dvh - 34px));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--border-strong);
    border-radius: 22px;
    background: var(--panel);
    color: var(--text);
    box-shadow: var(--shadow-panel);
}

.supervisor-messages-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--panel-alt);
}

.supervisor-messages-header strong {
    display: block;
    font-family: var(--font-display);
    font-size: 1.05rem;
}

.supervisor-messages-header small {
    color: var(--text-muted);
    font-weight: 800;
}

.supervisor-messages-close {
    width: 42px;
    height: 42px;
}

.supervisor-messages-body {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(220px, 290px) minmax(0, 1fr);
}

.supervisor-message-workers {
    min-height: 0;
    overflow: auto;
    padding: 10px;
    border-right: 1px solid var(--border);
    background: var(--panel-alt);
}

.supervisor-message-worker {
    width: 100%;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.supervisor-message-worker:hover,
.supervisor-message-worker.is-active {
    border-color: var(--border-strong);
    background: var(--panel-hover);
}

.supervisor-message-worker strong,
.supervisor-message-chat-head strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.92rem;
}

.supervisor-message-worker small,
.supervisor-message-chat-head small {
    display: block;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.supervisor-message-avatar {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 900;
}

.supervisor-message-chat {
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(280px, 1fr) auto;
}

.supervisor-message-chat-head {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}

.supervisor-message-thread {
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: auto;
    padding: 14px;
}

.supervisor-message-bubble {
    max-width: min(78%, 520px);
    display: grid;
    gap: 5px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel-alt);
}

.supervisor-message-bubble.is-mine {
    align-self: flex-end;
    border-color: rgba(29, 108, 255, 0.36);
    background: var(--accent);
    color: #fff;
}

.supervisor-message-bubble.is-worker {
    align-self: flex-start;
}

.supervisor-message-bubble p {
    margin: 0;
    overflow-wrap: anywhere;
    line-height: 1.35;
}

.supervisor-message-bubble small {
    color: currentColor;
    font-size: 0.68rem;
    font-weight: 800;
    opacity: 0.72;
}

.supervisor-message-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px;
    border-top: 1px solid var(--border);
    background: var(--panel-alt);
}

.supervisor-message-form textarea {
    min-height: 48px;
    max-height: 120px;
    resize: vertical;
    border: 1px solid var(--field-border);
    border-radius: var(--radius-md);
    background: var(--field);
    color: var(--text);
    font: inherit;
    padding: 10px 12px;
}

.supervisor-messages-empty {
    align-self: center;
    justify-self: center;
    padding: 20px;
    color: var(--text-muted);
    font-weight: 800;
    text-align: center;
}

@media (max-width: 760px) {
    .floating-messages-button {
        right: 16px;
        bottom: calc(18px + env(safe-area-inset-bottom));
        width: 54px;
        height: 54px;
    }

    .supervisor-messages-dialog {
        width: 100vw;
        max-height: 92dvh;
        border-radius: 18px 18px 0 0;
    }

    .supervisor-messages-body {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr);
    }

    .supervisor-message-workers {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .supervisor-message-worker {
        min-width: 220px;
    }

    .supervisor-message-chat {
        grid-template-rows: auto minmax(260px, 1fr) auto;
    }

    .supervisor-message-form {
        grid-template-columns: 1fr;
    }

    .supervisor-message-bubble {
        max-width: 88%;
    }
}

.nav-icon {
    width: 24px;
    height: 24px;
}

.action-arrow-icon {
    width: 25px;
    height: 25px;
    filter: drop-shadow(0 5px 10px rgba(29, 108, 255, 0.14));
}

#undoBtn .action-arrow-icon {
    filter: drop-shadow(0 5px 10px rgba(34, 197, 94, 0.16));
}

#redoBtn .action-arrow-icon {
    filter: drop-shadow(0 5px 10px rgba(29, 108, 255, 0.16));
}

.history-action-toast {
    position: fixed;
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 4200;
    display: grid;
    gap: 6px;
    width: min(360px, calc(100vw - 32px));
    padding: 15px 18px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.95);
    color: #112038;
    box-shadow: 0 24px 52px rgba(15, 23, 42, 0.24);
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px) scale(0.98);
    transition:
        opacity 0.22s ease,
        transform 0.22s ease;
}

.history-action-toast.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.history-action-toast strong {
    color: #0f172a;
    font-size: 0.84rem;
    font-weight: 900;
    letter-spacing: 0;
}

.history-action-toast span {
    color: #1f2f47;
    font-size: 0.94rem;
    font-weight: 700;
    line-height: 1.32;
}

.history-action-toast--undo {
    border-color: rgba(34, 197, 94, 0.36);
}

.history-action-toast--redo {
    border-color: rgba(29, 108, 255, 0.36);
}

.dashboard-panel {
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.dashboard-shell {
    display: grid;
    gap: 16px;
}

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

.dashboard-head {
    padding: 18px 20px;
}

.dashboard-head h2,
.dashboard-card h3 {
    margin: 0;
    color: var(--text-strong);
    letter-spacing: 0;
}

.dashboard-head h2 {
    font-size: 1.25rem;
}

.dashboard-head p,
.dashboard-card p {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.4;
}

.dashboard-card {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.dashboard-card h3 {
    font-size: 1rem;
}

.dashboard-card-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(190px, 230px);
    gap: 14px;
    align-items: start;
}

.dashboard-card-layout--wide {
    grid-template-columns: minmax(0, 1fr);
}

.dashboard-chart-area {
    min-width: 0;
}

.dashboard-control-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel-alt);
}

.dashboard-control-card strong {
    color: var(--text-strong);
    font-size: 0.8rem;
}

.dashboard-check-list,
.dashboard-radio-list {
    display: grid;
    gap: 8px;
}

.dashboard-check-list label,
.dashboard-radio-list label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 7px 9px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--field);
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 800;
}

.dashboard-check-list input,
.dashboard-radio-list input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--accent);
}

.dashboard-check-list span::before {
    content: "";
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 7px;
    border-radius: 999px;
    background: var(--role-color, var(--accent));
}

.dashboard-bar-scroll,
.dashboard-line-scroll {
    overflow-x: auto;
    padding: 4px 4px 10px;
}

.dashboard-stacked-bars {
    display: grid;
    grid-template-columns: repeat(var(--dashboard-bars), minmax(42px, 1fr));
    align-items: end;
    gap: 10px;
    min-width: max(760px, calc(var(--dashboard-bars) * 52px));
    height: 300px;
    padding: 14px 8px 0;
    border: 1px solid var(--border);
    border-radius: 14px;
    background:
        linear-gradient(to top, rgba(148, 163, 184, 0.16) 1px, transparent 1px) 0 0 / 100% 25%,
        var(--panel-alt);
}

.dashboard-stacked-item {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 8px;
    min-width: 0;
    height: 100%;
}

.dashboard-stacked-bar {
    align-self: end;
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-start;
    width: 100%;
    height: 230px;
    overflow: hidden;
    border-radius: 10px 10px 7px 7px;
    background: rgba(148, 163, 184, 0.13);
}

.dashboard-stacked-bar span {
    display: block;
    min-height: 0;
}

.dashboard-stacked-item small,
.dashboard-line-label,
.dashboard-line-axis {
    color: var(--text-muted);
    fill: currentColor;
    font-size: 0.68rem;
    font-weight: 800;
}

.dashboard-stacked-item small {
    text-align: center;
    transform: rotate(-45deg);
    transform-origin: center top;
    white-space: nowrap;
}

.dashboard-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 10px;
    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: 800;
}

.dashboard-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dashboard-chart-legend i {
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.dashboard-line-chart {
    display: block;
    min-width: 760px;
    width: 100%;
    height: 300px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel-alt);
}

.dashboard-line-grid {
    stroke: rgba(148, 163, 184, 0.22);
    stroke-width: 1;
}

.dashboard-line-path {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dashboard-line-dot {
    stroke: var(--panel-alt);
    stroke-width: 2;
}

.dashboard-line-label {
    text-anchor: middle;
}

.dashboard-ranking {
    display: grid;
    gap: 9px;
}

.dashboard-ranking-row {
    display: grid;
    grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel-alt);
}

.dashboard-ranking-person {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 10px;
}

.dashboard-ranking-person b {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 10px;
    background: rgba(29, 108, 255, 0.14);
    color: var(--accent);
    font-size: 0.8rem;
}

.dashboard-ranking-person span {
    display: grid;
    min-width: 0;
}

.dashboard-ranking-person strong {
    color: var(--text-strong);
    font-size: 0.86rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-ranking-person small {
    color: var(--text-muted);
    font-size: 0.74rem;
}

.dashboard-ranking-bar {
    position: relative;
    min-height: 30px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.16);
}

.dashboard-ranking-bar span {
    position: absolute;
    inset: 0 auto 0 0;
    min-width: 2px;
    border-radius: inherit;
    background: linear-gradient(135deg, #ef4444, #f97316);
}

.dashboard-ranking-bar strong {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 30px;
    padding: 0 12px;
    color: var(--text-strong);
    font-size: 0.78rem;
}

.dashboard-empty,
.dashboard-loading {
    display: grid;
    place-items: center;
    min-height: 180px;
    padding: 18px;
    border: 1px dashed var(--border);
    border-radius: 14px;
    background: var(--panel-alt);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 800;
    text-align: center;
}

body.theme-dark .history-action-toast {
    border-color: rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.96);
    color: #fff;
}

body.theme-dark .history-action-toast strong,
body.theme-dark .history-action-toast span {
    color: #fff;
}

@media (max-width: 640px) {
    .dashboard-head,
    .dashboard-card {
        border-radius: 16px;
    }

    .dashboard-head,
    .dashboard-card {
        padding: 14px;
    }

    .dashboard-card-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .dashboard-control-card {
        order: -1;
    }

    .dashboard-ranking-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    .dashboard-ranking-person strong {
        white-space: normal;
    }

    .history-action-toast {
        right: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom));
        width: calc(100vw - 24px);
        padding: 13px 14px;
        border-radius: 14px;
    }

    .history-action-toast span {
        font-size: 0.86rem;
    }
}

.tone-blue {
    color: #2a7cff;
}

.tone-light {
    color: #8aa0bd;
}

.tone-green {
    color: #27c66d;
}

.tone-violet {
    color: #b03ff3;
}

.tone-orange {
    color: #ff8c1f;
}

.tone-cyan {
    color: #0ea5e9;
}

.tone-red {
    color: #ef4444;
}

.tone-yellow {
    color: #f4ba24;
}

.tone-muted {
    color: #98a2b3;
}

.primary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
    gap: 18px;
    align-items: start;
    min-width: 0;
}

.primary-grid > *,
.stacked-panels > * {
    min-width: 0;
}

.calendar-panel,
.leave-panel,
.availability-panel,
.hours-panel,
.hours-charts-panel,
.hhee-records-panel,
.staffing-report-panel,
.timeline-panel,
.staffing-panel,
.swap-panel,
.clockmarks-panel,
.audit-log-panel {
    padding: 18px;
}

.stacked-panels {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.section-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.section-head--with-action {
    justify-content: space-between;
    gap: 14px;
}

.section-head__title {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.secondary-button--small {
    min-height: 36px;
    padding: 0 12px;
    border-radius: 12px;
    font-size: 0.86rem;
    white-space: nowrap;
}

.section-icon,
.legend-dot {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.calendar-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 40px minmax(240px, 300px) 40px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.calendar-header #prevBtn {
    grid-column: 2;
}

.calendar-header #monthYear {
    grid-column: 3;
}

.calendar-header #nextBtn {
    grid-column: 4;
}

.calendar-month-trigger {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    margin: 0;
    min-width: 0;
    padding: 4px 8px;
    border-radius: 10px;
    text-align: center;
    font-size: clamp(1.35rem, 2vw, 1.9rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: color 0.18s ease, background 0.18s ease;
}

.calendar-month-trigger:hover,
.calendar-month-trigger:focus-visible {
    background: rgba(29, 108, 255, 0.1);
    color: var(--accent);
}

.calendar-rotation-button {
    grid-column: 5;
    justify-self: end;
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text-strong);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    transition:
        transform 0.16s ease,
        border-color 0.16s ease,
        background 0.16s ease,
        color 0.16s ease;
}

.calendar-rotation-button:hover,
.calendar-rotation-button:focus-visible {
    border-color: rgba(29, 108, 255, 0.58);
    background: rgba(29, 108, 255, 0.1);
    color: var(--accent);
    outline: none;
    transform: translateY(-1px);
}

.calendar-month-picker {
    position: fixed;
    z-index: 4000;
    width: min(320px, calc(100vw - 24px));
    padding: 10px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: var(--panel);
    box-shadow: var(--shadow-panel);
    backdrop-filter: blur(18px);
}

.calendar-month-picker__year {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) 30px;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    text-align: center;
}

.calendar-month-picker__year-button {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--field);
    color: var(--text);
    cursor: pointer;
}

.calendar-month-picker__year-button svg {
    width: 16px;
    height: 16px;
}

.calendar-month-picker__months {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.calendar-month-picker__month {
    min-height: 34px;
    padding: 5px 4px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--field);
    color: var(--text);
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 700;
}

.calendar-month-picker__month:hover,
.calendar-month-picker__month:focus-visible {
    border-color: rgba(29, 108, 255, 0.52);
}

.calendar-month-picker__month.is-active {
    border-color: rgba(29, 108, 255, 0.72);
    background: rgba(29, 108, 255, 0.16);
    color: var(--accent);
}

.weekdays,
.grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekdays {
    gap: 10px;
    margin-bottom: 12px;
    color: var(--weekday);
    font-size: 0.92rem;
    text-align: center;
}

.grid {
    gap: 10px;
}

.calendar-spacer {
    min-height: 0;
}

.calendar-empty {
    grid-column: 1 / -1;
    padding: 36px 18px;
    text-align: center;
    color: var(--text-muted);
    border: 1px dashed var(--border-strong);
    border-radius: 18px;
    background: var(--calendar-empty);
}

.day {
    position: relative;
    min-height: 78px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid transparent;
    background: var(--field);
    color: var(--text);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.day:hover {
    transform: translateY(-1px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-soft);
}

.day.draft-selected {
    border-color: rgba(29, 108, 255, 0.58);
    box-shadow: inset 0 0 0 2px rgba(29, 108, 255, 0.22);
}

.day.worker-blocked-day {
    border-color: rgba(148, 163, 184, 0.72);
    background:
        linear-gradient(135deg, rgba(148, 163, 184, 0.22), rgba(100, 116, 139, 0.12)),
        var(--field);
}

.day.worker-blocked-day .day-badge {
    background: rgba(100, 116, 139, 0.9);
    color: #fff;
    letter-spacing: 0;
}

body.theme-light .day.worker-blocked-day {
    background:
        linear-gradient(135deg, rgba(148, 163, 184, 0.22), rgba(203, 213, 225, 0.32)),
        var(--field);
}

.day.calendar-direct-edit-feedback {
    transform: scale(0.985);
    filter: saturate(1.08);
}

.day-number {
    font-size: 1.06rem;
    font-weight: 700;
    line-height: 1;
}

.day-label {
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.1;
}

.day-label-stack {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
}

.day-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-width: 100%;
}

.day-badge {
    align-self: flex-start;
    min-width: 20px;
    min-height: 20px;
    display: inline-grid;
    place-items: center;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.26);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.day.has-multiple-badges {
    min-height: auto;
    height: max-content;
    align-self: start;
    gap: 2px;
    padding: 6px;
    justify-content: flex-start;
    overflow: visible;
}

.day.has-multiple-badges .day-label-stack {
    gap: 1px;
}

.day.has-multiple-badges .day-badges {
    align-content: flex-start;
    gap: 2px;
}

.day.has-multiple-badges .day-badge {
    min-height: 15px;
    padding: 1px 4px;
    font-size: 0.5rem;
    line-height: 1;
}

.turn-change-day {
    box-shadow: inset 0 0 0 2px rgba(251, 146, 60, 0.55);
}

.turn-change-day .day-badge {
    max-width: 100%;
    background: rgba(234, 88, 12, 0.9);
    color: #fff;
    line-height: 1.05;
    letter-spacing: 0;
    overflow-wrap: anywhere;
    text-align: center;
}

.day.needs-replacement {
    box-shadow:
        inset 0 0 0 2px rgba(239, 68, 68, 0.58),
        0 10px 22px rgba(239, 68, 68, 0.16);
}

.day.needs-replacement .day-badge {
    background: #ef4444;
    color: #fff;
    font-size: 0.9rem;
    line-height: 1;
}

.day.needs-extra-reason {
    box-shadow:
        inset 0 0 0 2px rgba(245, 158, 11, 0.72),
        0 10px 22px rgba(245, 158, 11, 0.16);
}

.day.needs-extra-reason .day-badge {
    background: #f59e0b;
    color: #111827;
    font-size: 0.9rem;
    line-height: 1;
}

.day.clock-incident-day {
    box-shadow:
        inset 0 0 0 2px rgba(14, 165, 233, 0.56),
        0 10px 22px rgba(14, 165, 233, 0.12);
}

.day.clock-incident-day .day-badge {
    background: #0ea5e9;
    color: #fff;
    font-size: 0.9rem;
    line-height: 1;
}

.day.clock-severe-day {
    box-shadow:
        inset 0 0 0 2px rgba(220, 38, 38, 0.86),
        0 10px 22px rgba(220, 38, 38, 0.2);
}

.day.clock-severe-day .day-badge {
    min-width: 28px;
    background: #dc2626;
    color: #fff;
    font-size: 0.68rem;
    line-height: 1;
}

.day.contract-error-day {
    box-shadow:
        inset 0 0 0 2px rgba(220, 38, 38, 0.86),
        0 10px 22px rgba(220, 38, 38, 0.18);
}

.day.contract-error-day .day-badge {
    background: #dc2626;
    color: #fff;
    font-size: 0.88rem;
    line-height: 1;
}

.day.replacement-day {
    box-shadow:
        inset 0 0 0 2px rgba(34, 197, 94, 0.6),
        0 10px 22px rgba(34, 197, 94, 0.12);
}

.day.replacement-day .day-badge {
    background: rgba(22, 163, 74, 0.92);
    color: #fff;
    min-height: 17px;
    padding: 1px 6px;
    font-size: 0.54rem;
    letter-spacing: 0.04em;
}

.turn-change-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(2, 6, 23, 0.46);
    backdrop-filter: blur(8px);
}

.day.honoraria-limit-day:not(.needs-replacement):not(.contract-error-day):not(.clock-severe-day) {
    box-shadow:
        inset 0 0 0 2px rgba(220, 38, 38, 0.82),
        0 10px 22px rgba(220, 38, 38, 0.18);
}

.day.honoraria-limit-day:not(.needs-replacement):not(.contract-error-day):not(.clock-severe-day) .day-badge {
    background: #dc2626;
    color: #fff;
    font-size: 0.9rem;
    line-height: 1;
}

.turn-change-dialog-backdrop--locked {
    z-index: 120;
}

body.auth-gate-active .app-shell {
    pointer-events: none;
    user-select: none;
}

.turn-change-dialog {
    width: min(440px, 100%);
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--panel);
    color: var(--text);
    box-shadow: var(--shadow);
}

.turn-change-dialog strong {
    display: block;
    margin-bottom: 10px;
    color: var(--text-strong);
    font-size: 1.08rem;
}

.turn-change-dialog p {
    margin: 0 0 14px;
    color: var(--text-muted);
    line-height: 1.45;
}

.turn-change-dialog__meta {
    margin-bottom: 18px;
    padding: 10px 12px;
    border-radius: 14px;
    background: var(--field);
    color: var(--text-strong);
    font-weight: 700;
}

.turn-change-dialog__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.worker-app-invite-dialog {
    width: min(520px, 100%);
}

.worker-app-invite-profile {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    margin: 4px 0 14px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--field);
}

.worker-app-invite-avatar {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.15);
    color: #15803d;
    font-weight: 900;
}

.worker-app-invite-profile b,
.worker-app-invite-profile small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.worker-app-invite-profile small {
    margin-top: 3px;
    color: var(--text-muted);
    font-weight: 750;
}

.worker-app-invite-link {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
    color: var(--text-strong);
    font-weight: 850;
}

.worker-app-invite-link input {
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--field);
    color: var(--text);
    font: inherit;
}

.worker-app-invite-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rotation-config-dialog {
    width: min(620px, 100%);
    max-height: min(88vh, 760px);
    overflow: auto;
}

.rotation-start-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.rotation-start-option {
    display: grid;
    gap: 4px;
    min-height: 72px;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--field);
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.rotation-start-option span {
    color: var(--text-strong);
    font-weight: 900;
}

.rotation-start-option small {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.rotation-start-option.is-selected {
    border-color: rgba(29, 108, 255, 0.7);
    background:
        linear-gradient(135deg, rgba(29, 108, 255, 0.16), rgba(34, 197, 94, 0.08)),
        var(--panel);
    box-shadow: 0 0 0 3px rgba(29, 108, 255, 0.1);
}

.rotation-contract-field {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
    color: var(--text-strong);
    font-weight: 800;
}

.rotation-contract-field input,
.rotation-contract-field select {
    width: 100%;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--field);
    color: var(--text);
    font: inherit;
}

.rotation-contract-field input:focus,
.rotation-contract-field select:focus {
    outline: none;
    border-color: rgba(29, 108, 255, 0.58);
    box-shadow: 0 0 0 3px rgba(29, 108, 255, 0.12);
}

.rotation-modal-head {
    margin-top: 4px;
}

.rotation-modal-calendar {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel-alt);
}

.rotation-modal-grid .profile-mini-day {
    min-height: 52px;
}

.grade-effective-dialog {
    width: min(560px, 100%);
}

.grade-effective-dialog p {
    margin: 6px 0 10px;
    color: var(--text-muted);
    line-height: 1.45;
}

.grade-effective-dialog b {
    color: var(--text-strong);
    font-weight: 850;
}

.firebase-dialog {
    width: min(620px, 100%);
    max-height: min(88vh, 760px);
    overflow: auto;
}

.firebase-dialog code {
    padding: 2px 6px;
    border-radius: 8px;
    background: var(--field);
    color: var(--text-strong);
    font-size: 0.9em;
}

.firebase-dialog-note,
.firebase-empty {
    padding: 12px 14px;
    border: 1px dashed var(--border-strong);
    border-radius: 14px;
    background: var(--panel-alt);
    color: var(--text-muted);
    line-height: 1.4;
}

.firebase-dialog-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.firebase-field {
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel-alt);
}

.firebase-field span {
    color: var(--text-strong);
    font-weight: 800;
}

.firebase-field input {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--field);
    color: var(--text);
    font: inherit;
}

.firebase-field input:focus {
    outline: none;
    border-color: rgba(29, 108, 255, 0.58);
    box-shadow: 0 0 0 3px rgba(29, 108, 255, 0.12);
}

.firebase-workspace-list {
    display: grid;
    gap: 10px;
    margin: 14px 0;
}

.firebase-workspace-item {
    display: grid;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--field);
    color: var(--text);
    text-align: left;
    cursor: default;
}

.firebase-workspace-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.firebase-workspace-main span {
    display: grid;
    gap: 3px;
}

.firebase-workspace-main strong {
    color: var(--text-strong);
}

.firebase-workspace-main small {
    color: var(--text-muted);
}

.firebase-workspace-main em {
    color: var(--blue);
    font-style: normal;
    font-weight: 900;
}

.firebase-workspace-use {
    min-width: 92px;
    min-height: 38px;
}

.firebase-workspace-id {
    display: grid;
    gap: 6px;
}

.firebase-workspace-id span {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 800;
}

.firebase-workspace-id input {
    width: 100%;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: var(--text-strong);
    font: inherit;
    font-weight: 750;
    user-select: text;
}

.firebase-workspace-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.firebase-workspace-actions button {
    min-height: 38px;
    padding: 0 10px;
    font-size: 0.9rem;
}

.firebase-workspace-item.is-active {
    border-color: rgba(34, 197, 94, 0.55);
    background:
        linear-gradient(135deg, rgba(34, 197, 94, 0.13), rgba(29, 108, 255, 0.08)),
        var(--panel);
}

.firebase-linked-panel {
    display: grid;
    gap: 10px;
    margin-top: 12px;
    padding: 14px;
    border: 1px solid rgba(20, 184, 166, 0.22);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(20, 184, 166, 0.09), rgba(29, 108, 255, 0.05)),
        var(--panel-alt);
}

.firebase-linked-panel > strong {
    color: var(--text-strong);
}

.firebase-linked-panel p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.45;
}

.firebase-linked-status {
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(34, 197, 94, 0.14);
    color: #15803d;
    font-weight: 750;
}

.firebase-linked-request {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.firebase-linked-request input {
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: var(--text-strong);
    font: inherit;
}

.firebase-linked-list {
    display: grid;
    gap: 8px;
}

.firebase-linked-list > span {
    color: var(--text-soft);
    font-size: 0.84rem;
    font-weight: 850;
}

.firebase-linked-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
}

.firebase-linked-item--action {
    cursor: pointer;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.firebase-linked-item--action:hover,
.firebase-linked-item--action:focus-visible {
    border-color: rgba(37, 99, 235, 0.42);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    outline: none;
    transform: translateY(-1px);
}

.firebase-linked-item div:first-child {
    display: grid;
    gap: 3px;
}

.firebase-linked-item small {
    color: var(--text-muted);
}

.firebase-linked-item em {
    color: #0f766e;
    font-style: normal;
    font-weight: 900;
}

.firebase-linked-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.firebase-linked-actions button {
    min-height: 34px;
    padding-inline: 12px;
    font-size: 0.82rem;
}

.replacement-dialog .turn-change-dialog__actions {
    grid-template-columns: 1fr;
    margin-top: 14px;
}

.replacement-dialog-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 6px 0 12px;
}

.replacement-dialog-toolbar button {
    min-height: 40px;
    padding-inline: 12px;
    font-size: 0.78rem;
}

.replacement-dialog-note {
    padding: 10px 12px;
    border: 1px solid rgba(245, 158, 11, 0.28);
    border-radius: 14px;
    background: rgba(245, 158, 11, 0.12);
    color: var(--text-soft);
    font-size: 0.82rem;
    line-height: 1.35;
}

.replacement-candidate-list {
    display: grid;
    gap: 10px;
    max-height: min(420px, 52vh);
    overflow: auto;
    padding-right: 4px;
}

.replacement-candidate {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--field);
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.replacement-candidate:hover {
    transform: translateY(-1px);
    border-color: rgba(29, 108, 255, 0.48);
    background: var(--panel-alt);
}

.replacement-candidate.is-disabled,
.replacement-candidate:disabled {
    opacity: 0.62;
    cursor: not-allowed;
    transform: none;
}

.replacement-candidate.is-selected {
    border-color: rgba(29, 108, 255, 0.72);
    background: linear-gradient(135deg, rgba(29, 108, 255, 0.14), rgba(34, 197, 94, 0.1));
    box-shadow: 0 0 0 3px rgba(29, 108, 255, 0.1);
}

.replacement-candidate--forced {
    border-color: rgba(245, 158, 11, 0.46);
    background:
        linear-gradient(135deg, rgba(245, 158, 11, 0.1), transparent 54%),
        var(--field);
}

.replacement-candidate--linked {
    border-color: rgba(20, 184, 166, 0.48);
    background:
        linear-gradient(135deg, rgba(20, 184, 166, 0.12), transparent 58%),
        var(--field);
}

.replacement-candidate--worker-blocked {
    border-color: rgba(148, 163, 184, 0.72);
    background:
        linear-gradient(135deg, rgba(148, 163, 184, 0.18), transparent 58%),
        var(--field);
}

.replacement-candidate--request {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: flex-start;
    cursor: default;
}

.replacement-candidate--request:not(.is-disabled) {
    cursor: pointer;
}

.replacement-candidate-checkbox {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    accent-color: var(--blue);
}

.replacement-candidate span {
    display: grid;
    gap: 3px;
}

.replacement-candidate em {
    justify-self: end;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.18);
    color: #b45309;
    font-size: 0.66rem;
    font-style: normal;
    font-weight: 800;
}

.replacement-candidate b {
    justify-self: end;
}

.replacement-candidate-hours {
    justify-self: end;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.replacement-candidate small {
    color: var(--text-muted);
}

.replacement-candidate-warning {
    max-width: 54ch;
    color: #94a3b8 !important;
    font-weight: 800;
    line-height: 1.25;
}

body.theme-light .replacement-candidate-warning {
    color: #64748b !important;
}

.replacement-request-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 0 12px;
    padding: 12px 14px;
    border: 1px solid rgba(29, 108, 255, 0.22);
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(29, 108, 255, 0.08), transparent 68%),
        var(--field);
    color: var(--text);
}

.replacement-request-toggle input {
    width: 42px;
    height: 22px;
    accent-color: var(--blue);
}

.replacement-request-toggle span {
    display: grid;
    gap: 2px;
}

.replacement-request-toggle strong {
    margin-bottom: 0;
    font-size: 0.9rem;
    line-height: 1.15;
}

.replacement-request-toggle small {
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.replacement-bulk-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin: -4px 0 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel-alt);
}

.replacement-bulk-actions label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-soft);
    font-size: 0.84rem;
    font-weight: 800;
}

.replacement-bulk-actions input {
    width: 17px;
    height: 17px;
    accent-color: var(--blue);
}

.replacement-bulk-actions button {
    min-height: 38px;
    padding-inline: 14px;
    white-space: nowrap;
}

.replacement-request-list {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.replacement-request-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px dashed rgba(29, 108, 255, 0.34);
    border-radius: 14px;
    background: rgba(29, 108, 255, 0.07);
}

.replacement-request-item span {
    display: grid;
    gap: 2px;
}

.replacement-request-item small {
    color: var(--text-muted);
}

.extra-reason-dialog .turn-change-dialog__actions {
    grid-template-columns: 1fr 1fr;
}

.overtime-backup-dialog {
    width: min(560px, 100%);
    max-height: min(86vh, 760px);
    overflow: auto;
}

.overtime-backup-section {
    display: grid;
    gap: 12px;
    margin-top: 14px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background:
        linear-gradient(145deg, rgba(29, 108, 255, 0.06), rgba(34, 197, 94, 0.04)),
        var(--panel-alt);
}

.overtime-backup-section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-strong);
    font-size: 0.94rem;
    font-weight: 800;
}

.overtime-backup-section__head small {
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(29, 108, 255, 0.12);
    color: var(--blue);
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

.overtime-backup-section p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

.overtime-backup-subsection {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.44);
}

body.theme-dark .overtime-backup-subsection {
    background: rgba(15, 23, 42, 0.28);
}

.overtime-backup-subsection__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--text-strong);
    font-size: 0.9rem;
    font-weight: 800;
}

.overtime-backup-subsection .replacement-candidate-list {
    max-height: 240px;
}

.overtime-backup-subsection .extra-reason-field {
    margin-top: 0;
}

.extra-reason-field {
    display: grid;
    gap: 8px;
    margin-top: 14px;
    color: var(--text-soft);
    font-size: 0.9rem;
    font-weight: 700;
}

.extra-reason-field textarea {
    width: 100%;
    min-height: 78px;
    resize: vertical;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--field);
    color: var(--text);
    font: inherit;
}

.extra-reason-field textarea:focus {
    outline: none;
    border-color: rgba(29, 108, 255, 0.55);
    box-shadow: 0 0 0 3px rgba(29, 108, 255, 0.12);
}

.clock-mark-dialog {
    width: min(520px, 100%);
    padding: 28px;
    border-radius: 34px;
    background:
        radial-gradient(circle at 12% 10%, rgba(29, 108, 255, 0.12), transparent 32%),
        var(--panel);
}

.clock-mark-dialog--simple {
    width: min(460px, 100%);
}

.clock-mark-dialog--split {
    width: min(520px, 100%);
}

.clock-mark-dialog > p {
    margin-bottom: 18px;
}

.clock-mark-dialog .turn-change-dialog__actions {
    grid-template-columns: 1fr 1fr;
    margin-top: 22px;
}

.clock-mark-segments {
    display: grid;
    gap: 16px;
}

.clock-mark-segment {
    padding: 0 0 16px;
    border-bottom: 1px solid var(--border);
}

.clock-mark-segment:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.clock-mark-segment h3 {
    margin: 0 0 12px;
    color: var(--text-strong);
    font-size: 1rem;
    font-weight: 800;
}

.clock-mark-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

.clock-mark-column {
    display: grid;
    gap: 8px;
}

.clock-mark-column > span {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 700;
}

.clock-time-inputs {
    display: grid;
    grid-template-columns: minmax(58px, 1fr) auto minmax(58px, 1fr);
    align-items: center;
    gap: 7px;
}

.clock-time-inputs > span {
    color: var(--text-muted);
    font-weight: 800;
}

.clock-time-number {
    width: 100%;
    min-height: 38px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--field);
    color: var(--text-strong);
    font: inherit;
    font-weight: 700;
    text-align: center;
}

.clock-time-number:focus {
    outline: none;
    border-color: rgba(29, 108, 255, 0.6);
    box-shadow: 0 0 0 3px rgba(29, 108, 255, 0.12);
}

.clock-time-number:disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

.clock-missing-button {
    min-height: 36px;
    border: 1px solid rgba(29, 108, 255, 0.38);
    border-radius: 10px;
    background: rgba(29, 108, 255, 0.12);
    color: var(--text-strong);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.clock-missing-button span {
    color: #e11d48;
    font-weight: 900;
}

.clock-missing-button:hover {
    transform: translateY(-1px);
    border-color: rgba(29, 108, 255, 0.72);
    background: rgba(29, 108, 255, 0.18);
}

.clock-missing-button.is-active {
    border-color: rgba(225, 29, 72, 0.42);
    background: rgba(225, 29, 72, 0.12);
    color: #be123c;
}

.amount-dialog {
    width: min(430px, 100%);
    padding: 28px;
    border-radius: 34px;
    background:
        radial-gradient(circle at 12% 10%, rgba(29, 108, 255, 0.12), transparent 32%),
        var(--panel);
}

.amount-dialog .turn-change-dialog__actions {
    grid-template-columns: 1fr 1fr;
    margin-top: 22px;
}

.amount-dialog-field {
    display: grid;
    gap: 9px;
    margin-top: 18px;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 800;
}

.amount-dialog-field input {
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--field);
    color: var(--text-strong);
    font: inherit;
    font-size: 1.08rem;
    font-weight: 800;
}

.amount-dialog-field input:focus {
    outline: none;
    border-color: rgba(29, 108, 255, 0.6);
    box-shadow: 0 0 0 3px rgba(29, 108, 255, 0.12);
}

.amount-dialog-field small {
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 700;
}

.hours-return-dialog {
    width: min(540px, 100%);
    padding: 28px;
    border-radius: 34px;
    background:
        radial-gradient(circle at 12% 10%, rgba(20, 184, 166, 0.16), transparent 32%),
        var(--panel);
}

.hours-return-dialog .turn-change-dialog__actions {
    grid-template-columns: 1fr 1fr;
    margin-top: 18px;
}

.hours-return-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.hours-return-field {
    display: grid;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.94rem;
    font-weight: 800;
}

.hours-return-field input,
.hours-return-field select {
    min-height: 46px;
    font-weight: 800;
}

.hours-return-summary {
    display: grid;
    gap: 4px;
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid rgba(20, 184, 166, 0.22);
    border-radius: 16px;
    background: rgba(20, 184, 166, 0.1);
    color: var(--text);
}

.hours-return-summary span,
.hours-return-summary small {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 800;
}

.hours-return-summary strong {
    margin: 0;
    color: var(--text);
    font-size: 1rem;
}

.hours-return-result {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    background: var(--field);
    color: var(--text);
    font-weight: 800;
}

.hours-return-result.is-invalid {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.hours-return-full-button {
    width: 100%;
    min-height: 44px;
    margin-top: 12px;
    border: 1px solid rgba(20, 184, 166, 0.42);
    border-radius: 14px;
    background: rgba(20, 184, 166, 0.14);
    color: var(--text);
    font: inherit;
    font-weight: 900;
}

.hours-return-full-button:disabled {
    cursor: not-allowed;
    opacity: 0.46;
}

.system-settings-dialog {
    width: min(920px, 100%);
    max-height: min(86vh, 760px);
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow: hidden;
}

.settings-dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.settings-dialog-head strong {
    margin-bottom: 6px;
}

.settings-dialog-head p {
    margin: 0;
}

.settings-tabs {
    display: inline-grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    padding: 6px;
    border-radius: 16px;
    background: var(--field);
    border: 1px solid var(--border);
}

.settings-tabs button {
    min-height: 42px;
    padding: 0 14px;
    border-radius: 12px;
    color: var(--text-muted);
    font-weight: 800;
}

.settings-tabs button.is-active {
    color: var(--blue);
    background: var(--panel);
    box-shadow: inset 0 -2px 0 var(--blue);
}

.settings-panel {
    min-height: 0;
    overflow: auto;
    padding-right: 4px;
}

.settings-grade-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 14px;
}

.settings-card {
    display: grid;
    align-content: start;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--panel-alt);
}

.settings-card--wide {
    max-width: 720px;
}

.settings-card__head {
    display: grid;
    gap: 4px;
}

.settings-card__head h4 {
    margin: 0;
    color: var(--text-strong);
}

.settings-card__head span {
    color: var(--text-muted);
    font-size: 0.86rem;
}

.settings-table-wrap {
    overflow: auto;
}

.settings-table {
    width: 100%;
    border-collapse: collapse;
}

.settings-table th,
.settings-table td {
    padding: 8px 6px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.settings-table th {
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.settings-money-field {
    display: grid;
    grid-template-columns: auto minmax(96px, 1fr);
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 12px;
    background: var(--field);
    border: 1px solid var(--border);
}

.settings-money-field input {
    min-height: 30px;
    padding: 0;
    border: 0;
    background: transparent;
}

.settings-holiday-form {
    display: grid;
    grid-template-columns: minmax(150px, 0.7fr) minmax(220px, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.settings-holiday-form label {
    display: grid;
    gap: 6px;
}

.settings-holiday-form label span {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 800;
}

.settings-request-field {
    display: grid;
    max-width: 320px;
    gap: 8px;
    color: var(--text-soft);
    font-size: 0.88rem;
    font-weight: 700;
}

.settings-request-field input {
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--field);
    color: var(--text);
    font: inherit;
}

.settings-request-field small {
    color: var(--text-muted);
    font-weight: 600;
}

.settings-limit-field {
    display: grid;
    max-width: 340px;
    gap: 8px;
    margin-left: 44px;
    color: var(--text-soft);
    font-size: 0.86rem;
    font-weight: 800;
}

.settings-limit-field input {
    min-height: 40px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--field);
    color: var(--text);
    font: inherit;
}

.settings-signature-grid {
    display: grid;
    gap: 10px;
}

.settings-signature-field {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--field);
}

.settings-signature-field span {
    color: var(--text-soft);
    font-size: 0.86rem;
    font-weight: 850;
}

.settings-signature-field input {
    min-height: 40px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
    color: var(--text);
    font: inherit;
}

.settings-switch-grid {
    display: grid;
    gap: 10px;
}

.settings-switch {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--field);
    cursor: pointer;
}

.settings-switch.is-disabled {
    cursor: not-allowed;
    opacity: 0.66;
}

.settings-switch input {
    width: 20px;
    height: 20px;
    margin: 2px 0 0;
    accent-color: var(--blue);
}

.settings-switch span {
    display: grid;
    gap: 4px;
}

.settings-switch strong {
    color: var(--text-strong);
    font-size: 0.94rem;
    line-height: 1.25;
}

.settings-switch small {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 650;
    line-height: 1.35;
}

.settings-staffing-grid {
    display: grid;
    gap: 10px;
}

.settings-staffing-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 96px;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--field);
}

.settings-staffing-row span {
    display: grid;
    gap: 3px;
}

.settings-staffing-row strong {
    color: var(--text-strong);
    font-size: 0.92rem;
}

.settings-staffing-row small {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.settings-staffing-row input {
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
    color: var(--text);
    font: inherit;
    font-weight: 800;
    text-align: center;
}

.settings-users-list {
    display: grid;
    gap: 14px;
}

.settings-user-card {
    display: grid;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--field);
}

.settings-user-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.settings-user-card__head span {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.settings-user-card__head strong {
    color: var(--text-strong);
    font-size: 0.95rem;
}

.settings-user-card__head small {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.settings-user-card__head em {
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--panel-hover);
    color: var(--blue);
    font-size: 0.76rem;
    font-style: normal;
    font-weight: 850;
}

.settings-user-card__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.settings-user-delete {
    min-height: 28px;
    padding: 0 10px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.1);
    color: var(--red);
    font-size: 0.74rem;
    font-weight: 850;
}

.settings-user-delete:hover {
    background: rgba(239, 68, 68, 0.16);
}

.settings-user-delete:disabled {
    opacity: 0.55;
    cursor: wait;
}

.settings-permission-grid {
    display: grid;
    gap: 6px;
}

.settings-permission-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 58px 72px;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 6px 8px;
    border-radius: 10px;
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 750;
}

.settings-permission-row--head {
    color: var(--text-muted);
    font-size: 0.76rem;
    text-transform: uppercase;
}

.settings-permission-row:not(.settings-permission-row--head) {
    background: var(--panel);
}

.settings-permission-row input {
    width: 18px;
    height: 18px;
    justify-self: center;
    accent-color: var(--blue);
}

.settings-holiday-list {
    display: grid;
    gap: 8px;
    max-height: 280px;
    overflow: auto;
}

.settings-holiday-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--field);
}

.settings-holiday-item span {
    display: grid;
    gap: 2px;
}

.settings-holiday-item small {
    color: var(--text-muted);
}

.settings-holiday-item button {
    min-height: 32px;
    padding: 0 10px;
    border-radius: 10px;
    color: var(--red);
    background: rgba(239, 68, 68, 0.1);
}

.settings-empty {
    padding: 16px;
    border: 1px dashed var(--border-strong);
    border-radius: 14px;
    color: var(--text-muted);
    text-align: center;
}

.settings-actions {
    flex: 0 0 auto;
}

@media (max-width: 560px) {
    .system-settings-dialog {
        max-height: calc(100vh - 28px);
        padding: 18px;
        border-radius: 24px;
    }

    .settings-dialog-head {
        align-items: center;
    }

    .settings-tabs,
    .settings-grade-grid,
    .settings-holiday-form,
    .settings-signature-field,
    .settings-staffing-row,
    .firebase-dialog-grid,
    .firebase-linked-request,
    .firebase-workspace-actions,
    .settings-actions {
        grid-template-columns: 1fr;
    }

    .clock-mark-row {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .settings-limit-field {
        margin-left: 0;
        max-width: none;
    }
}

.green,
.blue,
.purple,
.lightgreen,
.yellow,
.half-morning,
.half-afternoon,
.eighteen,
.admin-day,
.half-admin-day,
.legal-day,
.legal-soft,
.comp-day,
.comp-soft,
.license-day,
.union-leave-day,
.professional-license-day,
.unpaid-leave-day,
.unjustified-absence-day,
.hours-return-day {
    color: #fff !important;
    border-color: transparent !important;
}

.green {
    background: linear-gradient(135deg, #1eb45a, #23c46c) !important;
}

.blue {
    background: linear-gradient(135deg, #1d6cff, #3084ff) !important;
}

.purple {
    background: linear-gradient(135deg, #7f2cc3, #a53ad7) !important;
}

.lightgreen {
    background: #0b8853 !important;
    color: #ffffff !important;
}

.yellow {
    background: linear-gradient(135deg, #f4b523, #ffcc4d) !important;
    color: #1c1c1c !important;
}

.half-morning {
    background: linear-gradient(135deg, #eab308, #facc15) !important;
    color: #1c1c1c !important;
}

.half-afternoon {
    background: linear-gradient(135deg, #f59e0b, #fb923c) !important;
    color: #1c1c1c !important;
}

.eighteen {
    background: linear-gradient(135deg, #6d28d9, #8b5cf6) !important;
}

.weekend:not(.green):not(.blue):not(.purple):not(.lightgreen):not(.yellow):not(.half-morning):not(.half-afternoon):not(.eighteen):not(.admin-day):not(.half-admin-day):not(.license-day):not(.union-leave-day):not(.professional-license-day):not(.unpaid-leave-day):not(.unjustified-absence-day):not(.hours-return-day):not(.legal-day):not(.comp-day),
.holiday:not(.green):not(.blue):not(.purple):not(.lightgreen):not(.yellow):not(.half-morning):not(.half-afternoon):not(.eighteen):not(.admin-day):not(.half-admin-day):not(.license-day):not(.union-leave-day):not(.professional-license-day):not(.unpaid-leave-day):not(.unjustified-absence-day):not(.hours-return-day):not(.legal-day):not(.comp-day) {
    background: rgba(255, 255, 255, 0.06);
}

body.theme-light .weekend:not(.green):not(.blue):not(.purple):not(.lightgreen):not(.yellow):not(.half-morning):not(.half-afternoon):not(.eighteen):not(.admin-day):not(.half-admin-day):not(.license-day):not(.union-leave-day):not(.professional-license-day):not(.unpaid-leave-day):not(.unjustified-absence-day):not(.hours-return-day):not(.legal-day):not(.comp-day),
body.theme-light .holiday:not(.green):not(.blue):not(.purple):not(.lightgreen):not(.yellow):not(.half-morning):not(.half-afternoon):not(.eighteen):not(.admin-day):not(.half-admin-day):not(.license-day):not(.union-leave-day):not(.professional-license-day):not(.unpaid-leave-day):not(.unjustified-absence-day):not(.hours-return-day):not(.legal-day):not(.comp-day) {
    background: rgba(17, 32, 56, 0.05);
}

.day.weekend::after,
.day.holiday::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 1.5px solid var(--inhabil-ring);
    border-radius: inherit;
    pointer-events: none;
}

.day.today::before {
    content: "";
    position: absolute;
    top: 5px;
    right: 5px;
    width: 22px;
    height: 22px;
    background: center / contain no-repeat url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2032%2032%22%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22r%22%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%221%22%20y2%3D%221%22%3E%3Cstop%20stop-color%3D%22%23ff8b8b%22%2F%3E%3Cstop%20offset%3D%22.38%22%20stop-color%3D%22%23ef2020%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23a90000%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22b%22%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%221%22%20y2%3D%220%22%3E%3Cstop%20stop-color%3D%22%23ff6b6b%22%2F%3E%3Cstop%20offset%3D%22.45%22%20stop-color%3D%22%23d90b0b%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23920000%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22m%22%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%221%22%20y2%3D%220%22%3E%3Cstop%20stop-color%3D%22%2366717c%22%2F%3E%3Cstop%20offset%3D%22.45%22%20stop-color%3D%22%23e6edf2%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%234b5660%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Cpath%20fill%3D%22url(%23m)%22%20d%3D%22m14.7%2020.2%201.2%2011.3%202.1-11.3z%22%2F%3E%3Cpath%20fill%3D%22url(%23b)%22%20d%3D%22M12.3%208.1h7.4l1.4%2010.7H10.9z%22%2F%3E%3Cellipse%20cx%3D%2216%22%20cy%3D%2219%22%20rx%3D%229.6%22%20ry%3D%224%22%20fill%3D%22url(%23r)%22%2F%3E%3Cellipse%20cx%3D%2216%22%20cy%3D%2218.1%22%20rx%3D%228.7%22%20ry%3D%223%22%20fill%3D%22%23ed1717%22%20opacity%3D%22.7%22%2F%3E%3Cellipse%20cx%3D%2216%22%20cy%3D%227.5%22%20rx%3D%228.4%22%20ry%3D%223.5%22%20fill%3D%22url(%23r)%22%2F%3E%3Cellipse%20cx%3D%2214.5%22%20cy%3D%226.7%22%20rx%3D%224.6%22%20ry%3D%221.2%22%20fill%3D%22%23ffd2d2%22%20opacity%3D%22.55%22%2F%3E%3Cpath%20d%3D%22M13.7%209.2h2l-1.4%208.2h-1.8z%22%20fill%3D%22%23ffb6b6%22%20opacity%3D%22.42%22%2F%3E%3C%2Fsvg%3E");
    filter: drop-shadow(0 2px 2px rgba(127, 29, 29, 0.34));
    transform: rotate(10deg);
    pointer-events: none;
}

.day.today .day-number {
    font-size: 1.22rem;
    font-weight: 800;
}

.inactive-selected {
    box-shadow: inset 0 0 0 2px var(--inhabil-ring);
}

.admin-day {
    background: linear-gradient(135deg, #f97316, #fb923c) !important;
}

.half-admin-day {
    background: linear-gradient(135deg, #f4b223, #ffd15c) !important;
    color: #1c1c1c !important;
}

.legal-day {
    background: linear-gradient(135deg, #0ea5a6, #1bc7bf) !important;
}

.legal-soft {
    background: linear-gradient(135deg, rgba(14, 165, 166, 0.65), rgba(27, 199, 191, 0.75)) !important;
}

.comp-day {
    background: linear-gradient(135deg, #8b2bd9, #ba52ec) !important;
}

.comp-soft {
    background: linear-gradient(135deg, rgba(139, 43, 217, 0.7), rgba(186, 82, 236, 0.82)) !important;
}

.license-day {
    background: linear-gradient(135deg, #e64747, #ff6767) !important;
}

.union-leave-day {
    background: linear-gradient(135deg, #dc2626, #fb7185) !important;
}

.professional-license-day {
    background: linear-gradient(135deg, #2563eb, #4f8cff) !important;
}

.unpaid-leave-day {
    background: linear-gradient(135deg, #6b7280, #9ca3af) !important;
}

.unjustified-absence-day {
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(239, 68, 68, 0.9)) !important;
}

.hours-return-day {
    background: linear-gradient(135deg, #0f766e, #14b8a6) !important;
}

.hours-return-day--partial {
    background: linear-gradient(135deg, #0f766e, #2dd4bf) !important;
}

.day.hours-return-day {
    box-shadow:
        inset 0 0 0 2px rgba(20, 184, 166, 0.72),
        0 10px 22px rgba(20, 184, 166, 0.14);
}

.legend-list {
    display: grid;
    gap: 10px;
}

.legend-action,
.legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    color: var(--text);
}

.legend-action {
    background: transparent;
    border: 1px solid transparent;
    text-align: left;
}

.legend-action span:last-child {
    font-weight: 800;
}

body[data-active-view="turnos"] .leave-panel .legend-action span:last-child {
    font-weight: 500;
}

.legend-action:hover {
    background: var(--panel-hover);
    border-color: var(--border);
}

.legend-action:disabled {
    color: var(--text-muted);
    background: var(--calendar-disabled);
    border-color: var(--border);
    cursor: not-allowed;
    filter: grayscale(1);
    opacity: 0.68;
}

.legend-action:disabled:hover {
    transform: none;
    background: var(--calendar-disabled);
    border-color: var(--border);
}

.legend-action:disabled .legend-dot {
    color: var(--text-muted);
}

.legend-item--static {
    opacity: 0.92;
}

.helper-note {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    color: var(--text-soft);
    background: var(--panel-alt);
    border: 1px dashed var(--border-strong);
}

.mode-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    min-width: 0;
    max-width: 100%;
    margin-bottom: 14px;
    padding: 14px 16px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(29, 108, 255, 0.2), rgba(13, 91, 240, 0.1));
    border: 1px solid rgba(29, 108, 255, 0.28);
}

.mode-banner span {
    flex: 1 1 260px;
    min-width: 0;
    overflow-wrap: anywhere;
}

.mode-banner button {
    flex: 0 0 auto;
    padding: 8px 12px;
    border-radius: 12px;
    color: #fff;
    background: rgba(29, 108, 255, 0.8);
}

.availability-list {
    display: grid;
    gap: 8px;
}

.availability-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
    font-size: 0.86rem;
}

.availability-item--wide {
    grid-column: 1 / -1;
}

.availability-item span {
    color: var(--text-soft);
    font-weight: 600;
}

.availability-item input {
    width: 110px;
    min-width: 0;
    padding: 8px 10px;
    border-radius: 10px;
    text-align: right;
}

.availability-note {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 0.76rem;
    line-height: 1.35;
}

.availability-empty {
    color: var(--text-muted);
    padding: 12px 0 6px;
}

.summary {
    display: grid;
    gap: 14px;
}

.summary-context {
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 700;
    text-transform: capitalize;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.summary-card {
    padding: 14px;
    border-radius: 16px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
    display: grid;
    gap: 8px;
}

.summary-label {
    color: var(--text-soft);
    font-weight: 600;
}

.summary-value {
    font-size: 1.45rem;
    letter-spacing: -0.04em;
}

.hhee-alert-warning {
    color: #f97316 !important;
    font-weight: 900 !important;
}

.hhee-alert-danger {
    color: #ef4444 !important;
    font-weight: 900 !important;
}

.summary-amount {
    color: var(--accent);
    font-weight: 800;
}

.summary-footnote {
    display: grid;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.replacement-log {
    display: grid;
    gap: 10px;
    margin-top: 4px;
}

.replacement-log > strong {
    color: var(--text-strong);
}

.replacement-log--empty {
    padding: 10px 12px;
    border-radius: 14px;
    background: var(--calendar-empty);
    color: var(--text-muted);
    font-weight: 700;
}

.replacement-log__item {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--field);
}

.replacement-log__item span {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-strong);
    font-weight: 800;
}

.replacement-log__item small {
    color: var(--text-muted);
    line-height: 1.35;
}

.hours-panel,
.hours-charts-panel,
.hhee-records-panel {
    min-width: 0;
}

.hours-charts-panel {
    display: grid;
    gap: 16px;
}

.hhee-monthbar,
.clockmarks-monthbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: -2px 0 16px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel-alt);
}

.hhee-monthbar strong,
.clockmarks-monthbar strong {
    min-width: 190px;
    text-align: center;
    color: var(--text-strong);
    letter-spacing: 0.02em;
}

.hhee-return-transfer {
    margin: 12px 0 4px;
    padding: 12px 14px;
    border: 1px solid rgba(20, 184, 166, 0.22);
    border-radius: 16px;
    background: rgba(20, 184, 166, 0.1);
}

.hhee-return-transfer > span:first-child {
    display: grid;
    gap: 3px;
}

.hhee-return-transfer strong {
    color: var(--text);
    font-size: 0.96rem;
}

.hhee-return-transfer small {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.35;
}

.hhee-chart-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.hhee-chart-controls label {
    display: grid;
    gap: 7px;
}

.hhee-chart-controls span {
    color: var(--text-soft);
    font-size: 0.86rem;
    font-weight: 800;
}

.hhee-chart-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

.hhee-chart-card {
    display: grid;
    gap: 14px;
    padding: 16px;
    border-radius: 18px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
}

.hhee-chart-card--profile {
    align-content: stretch;
    height: 100%;
}

.hhee-chart-card--profile > div:last-child {
    min-width: 0;
}

.hhee-chart-card__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.hhee-chart-card__head h4 {
    margin: 0;
    font-size: 1rem;
}

.hhee-chart-card__head span,
.hhee-chart-context {
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.hhee-chart-context {
    text-transform: capitalize;
}

.hhee-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--text-soft);
    font-size: 0.84rem;
    font-weight: 800;
}

.hhee-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.hhee-chart-legend i {
    width: 12px;
    height: 12px;
    border-radius: 999px;
}

.hhee-color-day,
.hhee-bar-day {
    background: linear-gradient(135deg, #facc15, #fb923c);
}

.hhee-color-night,
.hhee-bar-night {
    background: linear-gradient(135deg, #1d4ed8, #60a5fa);
}

.hhee-worker-bars {
    display: grid;
    gap: 11px;
}

.hhee-worker-row {
    display: grid;
    grid-template-columns: minmax(120px, 220px) minmax(0, 1fr) 64px;
    align-items: center;
    gap: 12px;
}

.hhee-worker-row strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hhee-worker-row small {
    color: var(--text-soft);
    font-weight: 900;
    text-align: right;
}

.hhee-stacked-bar {
    position: relative;
    overflow: hidden;
    display: flex;
    height: 28px;
    border-radius: 999px;
    background: var(--timeline-empty);
    border: 1px solid var(--border);
}

.hhee-stacked-bar span {
    min-width: 0;
}

.hhee-history-bars {
    display: flex;
    align-items: end;
    gap: 8px;
    min-height: 240px;
    overflow-x: auto;
    padding: 16px 4px 4px;
    border-radius: 16px;
    background: var(--calendar-empty);
    border: 1px solid var(--border);
}

.hhee-profile-history-bars {
    min-height: 280px;
}

.hhee-history-item {
    flex: 0 0 34px;
    display: grid;
    grid-template-rows: minmax(160px, 1fr) auto;
    align-items: end;
    gap: 8px;
    min-height: 220px;
}

.hhee-history-stack {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: end;
    width: 100%;
    min-height: 2px;
    border-radius: 10px 10px 4px 4px;
    background: var(--timeline-empty);
    border: 1px solid var(--border);
}

.hhee-history-stack span {
    width: 100%;
    min-height: 0;
}

.hhee-history-item small {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    justify-self: center;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: capitalize;
}

.hhee-profile-history-bars .hhee-history-item {
    flex: 1 1 0;
    min-width: 36px;
}

.hhee-records-panel {
    display: grid;
    gap: 14px;
}

.hhee-records-context {
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 700;
    text-transform: capitalize;
}

#teamTimeline {
    overflow: auto;
}

.timeline-shell {
    overflow: auto;
    --timeline-hhee-day-left: 160px;
    --timeline-hhee-night-left: 270px;
}

.timeline-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.timeline-table th,
.timeline-table td {
    border: 1px solid var(--border);
    text-align: center;
    white-space: nowrap;
}

.timeline-table th {
    background: var(--panel-alt);
    font-size: 0.82rem;
    padding: 10px 6px;
    color: var(--text-soft);
}

.timeline-name-head,
.namecol {
    position: sticky;
    left: 0;
    z-index: 2;
    width: 1%;
    min-width: max-content;
    padding: 10px 14px !important;
    text-align: left !important;
    background: var(--panel);
    font-weight: 700;
}

.timeline-name-head {
    background: var(--panel-alt);
    z-index: 4;
    overflow: visible;
}

.timeline-filter {
    position: relative;
    min-width: 174px;
}

.timeline-filter__trigger {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 34px;
    padding: 7px 9px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--field);
    color: var(--text);
    text-align: left;
}

.timeline-filter__trigger span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: calc(0.78rem - 1px);
    font-weight: 800;
}

.timeline-filter__trigger svg {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}

.timeline-filter__menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 12;
    display: none;
    width: min(280px, 78vw);
    max-height: 280px;
    overflow: auto;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel);
    box-shadow: var(--shadow-soft);
}

.timeline-filter.is-open .timeline-filter__menu {
    display: grid;
    gap: 4px;
}

.timeline-filter__option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 7px 8px;
    border-radius: 10px;
    color: var(--text);
    font-size: calc(0.8rem - 1px);
    font-weight: 700;
}

.timeline-filter__option:hover {
    background: var(--panel-hover);
}

.timeline-filter__option input {
    width: 16px;
    height: 16px;
}

.timeline-filter__option span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.timeline-filter__option small {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.timeline-filter__option.is-locked {
    color: var(--text-soft);
}

.timeline-profile-link {
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 800;
    padding: 0;
    text-align: left;
    cursor: pointer;
}

.timeline-profile-link:hover,
.timeline-profile-link:focus-visible {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.timeline-profile-link:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
    outline-offset: 3px;
    border-radius: 6px;
}

.timeline-hhee-head,
.timeline-hhee {
    position: sticky;
    z-index: 2;
    width: 1%;
    min-width: max-content;
    padding-inline: 10px;
    background: var(--panel);
    font-weight: 800;
}

.timeline-hhee-head {
    background: var(--panel-alt);
    z-index: 4;
}

.timeline-hhee--day {
    left: var(--timeline-hhee-day-left);
}

.timeline-hhee--night {
    left: var(--timeline-hhee-night-left);
}

.timeline-hhee-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.timeline-hhee-icon {
    width: 16px;
    height: 16px;
    color: var(--accent);
}

.mini {
    position: relative;
    width: 1%;
    min-width: 24px;
    height: 28px;
    background: var(--timeline-empty);
}

.mini.worker-blocked-mini:not(.needs-replacement):not(.needs-extra-reason):not(.contract-error-day):not(.replacement-day):not(.clock-incident-day):not(.clock-severe-day):not(.hours-return-mini):not(.honoraria-limit-day) {
    box-shadow: inset 0 0 0 2px rgba(100, 116, 139, 0.5);
}

.mini.needs-replacement {
    box-shadow: inset 0 0 0 2px rgba(239, 68, 68, 0.7);
    cursor: pointer;
}

.mini.needs-extra-reason {
    box-shadow: inset 0 0 0 2px rgba(245, 158, 11, 0.84);
    cursor: pointer;
}

.mini.contract-error-day {
    box-shadow: inset 0 0 0 2px rgba(220, 38, 38, 0.9);
    cursor: pointer;
}

.mini.replacement-day {
    box-shadow: inset 0 0 0 2px rgba(34, 197, 94, 0.72);
}

.mini.timeline-inhabil:not(.needs-replacement):not(.needs-extra-reason):not(.contract-error-day):not(.replacement-day):not(.clock-incident-day):not(.clock-severe-day):not(.hours-return-mini) {
    box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.14);
}

.timeline-replacement-marker {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    display: inline-grid;
    place-items: center;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.74rem;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.32);
}

.mini.replacement-day .timeline-replacement-marker {
    background: #16a34a;
}

.mini.honoraria-limit-day:not(.needs-replacement):not(.contract-error-day):not(.clock-severe-day) {
    box-shadow: inset 0 0 0 2px rgba(220, 38, 38, 0.9);
    cursor: pointer;
}

.mini.hours-return-mini {
    box-shadow: inset 0 0 0 2px rgba(20, 184, 166, 0.76);
}

.mini.hours-return-mini .timeline-replacement-marker {
    background: #0f766e;
    color: #fff;
    font-size: 0.62rem;
}

.mini.needs-extra-reason .timeline-replacement-marker {
    background: #f59e0b;
    color: #111827;
}

.mini.clock-incident-day .timeline-replacement-marker {
    background: #0ea5e9;
    color: #fff;
}

.mini.clock-severe-day .timeline-replacement-marker {
    min-width: 20px;
    background: #dc2626;
    color: #fff;
    font-size: 0.52rem;
}

.mini.contract-error-day .timeline-replacement-marker {
    background: #dc2626;
    color: #fff;
}

.secondary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 18px;
}

.turn-changes-view {
    min-width: 0;
}

.staff-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.staff-grid.is-collapsed {
    display: none;
}

.staffing-config-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.staffing-config-card {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
}

.staffing-config-card strong {
    font-size: 0.9rem;
    color: var(--text);
}

.staffing-config-card span {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.staff-grid > div {
    padding: 14px;
    border-radius: 16px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
}

.staff-grid label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-soft);
    font-weight: 600;
}

.mini.honoraria-limit-day:not(.needs-replacement):not(.contract-error-day):not(.clock-severe-day) .timeline-replacement-marker {
    background: #dc2626;
    color: #fff;
}

.timeline-hhee.honoraria-hhee-excess {
    color: #ef4444;
    font-weight: 900;
}

.staffing-applicants-panel {
    display: grid;
    gap: 16px;
    margin-bottom: 18px;
    padding: 16px;
    border-radius: 18px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
}

.staffing-weekly-calendar {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
    padding: 16px;
    border-radius: 18px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
}

.staffing-weekly-calendar--view {
    margin-bottom: 0;
}

.staffing-weekly-sticky {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    gap: 8px;
    margin: -16px -16px 0;
    padding: 12px 16px 10px;
    border-bottom: 1px solid var(--border);
    border-radius: 18px 18px 0 0;
    background: var(--panel-alt);
    box-shadow: 0 12px 24px rgba(17, 32, 56, 0.08);
}

.staffing-weekly-nav {
    display: inline-flex;
    align-items: center;
    justify-self: end;
    align-self: end;
    gap: 8px;
    margin-left: 0;
    transform: translateY(1px);
}

.staffing-weekly-nav .secondary-button {
    min-height: 34px;
    border-radius: 10px;
    padding: 0 12px;
    font-size: 0.82rem;
}

.staffing-weekly-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 220px)) minmax(0, 1fr);
    gap: 12px;
    align-items: end;
}

.staffing-weekly-filters label {
    display: grid;
    gap: 7px;
    min-width: 0;
    color: var(--text-soft);
    font-size: 0.84rem;
    font-weight: 800;
}

.staffing-weekly-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(146px, 1fr));
    gap: 8px;
}

.staffing-weekly-mobile-days {
    display: none;
}

.staffing-weekly-mobile-days-placeholder {
    display: none;
    height: 0;
}

.staffing-weekly-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(146px, 1fr));
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.staffing-weekly-day,
.staffing-weekly-cell {
    min-width: 0;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.staffing-weekly-day {
    display: flex;
    align-items: center;
    padding: 10px;
    color: var(--text);
    background: var(--field);
    text-transform: capitalize;
}

.staffing-weekly-day strong {
    white-space: nowrap;
}

.staffing-weekly-cell {
    --staffing-weekly-cell-bg: var(--field);
    --staffing-weekly-cell-border: var(--border);
    display: grid;
    grid-template-rows: auto minmax(82px, 1fr);
    align-content: start;
    padding: 10px;
    background: var(--staffing-weekly-cell-bg);
    border-color: var(--staffing-weekly-cell-border);
}

.staffing-weekly-day--inhabil {
    background: var(--inhabil-soft);
    border-color: rgba(248, 113, 113, 0.24);
}

.staffing-weekly-cell--diurno {
    --staffing-weekly-cell-bg: linear-gradient(135deg, rgba(11, 136, 83, 0.14), rgba(34, 197, 94, 0.06));
    --staffing-weekly-cell-border: rgba(11, 136, 83, 0.3);
}

.staffing-weekly-cell--larga {
    --staffing-weekly-cell-bg: linear-gradient(135deg, rgba(34, 197, 94, 0.14), rgba(34, 197, 94, 0.06));
    --staffing-weekly-cell-border: rgba(34, 197, 94, 0.3);
}

.staffing-weekly-cell--noche {
    --staffing-weekly-cell-bg: linear-gradient(135deg, rgba(29, 108, 255, 0.14), rgba(48, 132, 255, 0.06));
    --staffing-weekly-cell-border: rgba(29, 108, 255, 0.32);
}

.staffing-weekly-cell--leave {
    grid-template-rows: auto minmax(54px, 1fr);
}

.staffing-weekly-cell--leave-license {
    --staffing-weekly-cell-bg: linear-gradient(135deg, rgba(230, 71, 71, 0.14), rgba(255, 103, 103, 0.06));
    --staffing-weekly-cell-border: rgba(230, 71, 71, 0.3);
}

.staffing-weekly-cell--leave-professional-license {
    --staffing-weekly-cell-bg: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(79, 140, 255, 0.06));
    --staffing-weekly-cell-border: rgba(37, 99, 235, 0.3);
}

.staffing-weekly-cell--leave-union-leave {
    --staffing-weekly-cell-bg: linear-gradient(135deg, rgba(220, 38, 38, 0.14), rgba(251, 113, 133, 0.06));
    --staffing-weekly-cell-border: rgba(220, 38, 38, 0.28);
}

.staffing-weekly-cell--leave-admin {
    --staffing-weekly-cell-bg: linear-gradient(135deg, rgba(249, 115, 22, 0.14), rgba(251, 146, 60, 0.06));
    --staffing-weekly-cell-border: rgba(249, 115, 22, 0.3);
}

.staffing-weekly-cell--leave-legal,
.staffing-weekly-cell--leave-hour-return {
    --staffing-weekly-cell-bg: linear-gradient(135deg, rgba(14, 165, 166, 0.14), rgba(27, 199, 191, 0.06));
    --staffing-weekly-cell-border: rgba(14, 165, 166, 0.3);
}

.staffing-weekly-cell--leave-comp {
    --staffing-weekly-cell-bg: linear-gradient(135deg, rgba(139, 43, 217, 0.14), rgba(186, 82, 236, 0.06));
    --staffing-weekly-cell-border: rgba(139, 43, 217, 0.3);
}

.staffing-weekly-cell--leave-half-morning {
    --staffing-weekly-cell-bg: linear-gradient(135deg, rgba(234, 179, 8, 0.16), rgba(250, 204, 21, 0.07));
    --staffing-weekly-cell-border: rgba(234, 179, 8, 0.34);
}

.staffing-weekly-cell--leave-half-afternoon {
    --staffing-weekly-cell-bg: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(251, 146, 60, 0.07));
    --staffing-weekly-cell-border: rgba(245, 158, 11, 0.32);
}

.staffing-weekly-cell--leave-unpaid-leave {
    --staffing-weekly-cell-bg: linear-gradient(135deg, rgba(107, 114, 128, 0.14), rgba(156, 163, 175, 0.06));
    --staffing-weekly-cell-border: rgba(107, 114, 128, 0.3);
}

.staffing-weekly-cell--leave-unjustified-absence {
    --staffing-weekly-cell-bg: linear-gradient(135deg, rgba(15, 23, 42, 0.1), rgba(239, 68, 68, 0.11));
    --staffing-weekly-cell-border: rgba(239, 68, 68, 0.32);
}

.staffing-weekly-cell__shift {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 8px;
    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.staffing-weekly-cell__shift-icon {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
}

.staffing-weekly-people {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
}

.staffing-weekly-person {
    display: grid;
    gap: 1px;
    padding: 7px 8px;
    border-radius: 10px;
    background: var(--panel);
    border: 1px solid var(--border);
}

.staffing-weekly-person--needs-replacement {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    border-color: rgba(239, 68, 68, 0.28);
    background: rgba(248, 113, 113, 0.12);
}

.staffing-weekly-person__body {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.staffing-weekly-replacement-alert {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    grid-column: 2;
    grid-row: 1;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1;
}

.staffing-weekly-replacement-alert:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.staffing-weekly-replacement-slot {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7px 8px;
    border: 1px solid rgba(17, 24, 39, 0.42);
    border-radius: 10px;
    background: var(--panel);
}

.staffing-weekly-replacement-slot span {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 8px 18px rgba(239, 68, 68, 0.28);
}

.staffing-weekly-replacement-slot:hover {
    border-color: rgba(239, 68, 68, 0.48);
    background: rgba(248, 113, 113, 0.08);
    transform: translateY(-1px);
}

.staffing-weekly-person strong,
.staffing-weekly-person small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.staffing-weekly-person strong {
    color: var(--text);
    font-size: 0.82rem;
}

.staffing-weekly-person small,
.staffing-weekly-empty {
    color: var(--text-muted);
    font-size: 0.74rem;
}

.staffing-weekly-empty {
    padding: 8px;
    border-radius: 10px;
    background: var(--calendar-empty);
    border: 1px dashed var(--border);
}

.staffing-weekly-empty-state {
    grid-column: 1 / -1;
    padding: 18px;
    border-radius: 12px;
    background: var(--calendar-empty);
    border: 1px dashed var(--border);
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 700;
    text-align: center;
}

.task-assignment-panel {
    display: grid;
    min-width: 0;
    padding: 16px;
}

.task-assignment-shell {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.task-assignment-head {
    align-items: center;
    margin-bottom: 0;
}

.task-assignment-controls {
    display: grid;
    grid-template-columns: minmax(360px, 1fr) auto;
    align-items: end;
    gap: 12px;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel-alt);
}

.task-assignment-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    align-items: end;
    min-width: 0;
    padding-left: 12px;
    border-left: 1px solid var(--border);
}

.task-assignment-toolbar .secondary-button--small {
    min-height: 38px;
    padding: 0 14px;
    white-space: nowrap;
}

.task-assignment-view-filters,
.task-assignment-dialog__filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.task-assignment-view-filters {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    align-items: end;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.task-assignment-view-filters strong,
.task-assignment-dialog__filters strong {
    display: block;
    margin-bottom: 5px;
    color: var(--text);
    font-size: 0.74rem;
    font-weight: 800;
}

.task-assignment-dialog__filters strong {
    margin-bottom: 8px;
    font-size: 0.84rem;
}

.task-assignment-filter-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.task-assignment-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 6px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--field);
    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: 800;
}

.task-assignment-filter-chip input {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    padding: 0;
    accent-color: var(--accent);
}

.task-assignment-filter-chip span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-assignment-multiselect {
    position: relative;
    min-width: 0;
}

.task-assignment-multiselect summary {
    min-height: 38px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border: 1px solid var(--field-border);
    border-radius: 12px;
    background: var(--field);
    color: var(--text);
    cursor: pointer;
    list-style: none;
}

.task-assignment-multiselect summary::-webkit-details-marker {
    display: none;
}

.task-assignment-multiselect summary span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8rem;
    font-weight: 800;
}

.task-assignment-multiselect summary svg {
    width: 16px;
    height: 16px;
    color: var(--text-soft);
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.16s ease;
}

.task-assignment-multiselect[open] summary {
    border-color: rgba(29, 108, 255, 0.42);
    box-shadow: 0 0 0 3px rgba(29, 108, 255, 0.12);
}

.task-assignment-multiselect[open] summary svg {
    transform: rotate(180deg);
}

.task-assignment-multiselect__menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 20;
    display: grid;
    gap: 4px;
    max-height: min(260px, 42vh);
    overflow: auto;
    padding: 8px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: var(--panel);
    box-shadow: var(--shadow-soft);
}

.task-assignment-multiselect__option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 6px 8px;
    border-radius: 9px;
    color: var(--text-soft);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 800;
}

.task-assignment-multiselect__option:hover {
    background: var(--panel-hover);
    color: var(--text);
}

.task-assignment-multiselect__option input {
    width: 15px;
    height: 15px;
    padding: 0;
    accent-color: var(--accent);
}

.task-assignment-multiselect__option span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-assignment-section,
.task-assignment-events {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.task-assignment-section-title {
    justify-self: start;
    padding-left: 4px;
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 900;
    line-height: 1.15;
}

.task-assignment-board,
.task-assignment-events-grid {
    display: grid;
    grid-template-columns: minmax(230px, 270px) repeat(7, minmax(155px, 1fr));
    gap: 8px;
    min-width: 0;
    overflow-x: auto;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel-alt);
}

.task-assignment-task-head,
.task-assignment-day-head,
.task-assignment-task-cell,
.task-assignment-cell,
.task-assignment-events-head,
.task-assignment-event-day {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--field);
}

.task-assignment-task-head,
.task-assignment-events-head {
    position: sticky;
    left: 0;
    z-index: 2;
    display: grid;
    align-content: center;
    padding: 12px;
    box-shadow: 8px 0 18px rgba(15, 23, 42, 0.08);
}

.task-assignment-events-head {
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 900;
}

.task-assignment-task-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    gap: 6px;
    align-items: center;
}

.task-assignment-task-form input {
    min-height: 42px;
    border-radius: 10px;
}

.task-assignment-task-add {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: var(--accent);
    color: #fff;
    font-size: 1rem;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 10px 20px rgba(29, 108, 255, 0.2);
}

.task-assignment-task-add:hover {
    background: var(--accent-2);
    transform: translateY(-1px);
}

.task-assignment-day-head,
.task-assignment-event-day {
    display: grid;
    gap: 3px;
    align-content: start;
    padding: 10px;
}

.task-assignment-day-head {
    min-height: 62px;
}

.task-assignment-day-head strong,
.task-assignment-event-day > strong {
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 900;
    text-transform: capitalize;
}

.task-assignment-day-head span,
.task-assignment-event-day > span {
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 800;
}

.task-assignment-day-head--inhabil,
.task-assignment-cell--inhabil,
.task-assignment-event-day--inhabil {
    background: var(--inhabil-soft);
    border-color: rgba(248, 113, 113, 0.24);
}

body.theme-light .task-assignment-day-head--inhabil,
body.theme-light .task-assignment-cell--inhabil,
body.theme-light .task-assignment-event-day--inhabil {
    background: rgba(254, 226, 226, 0.72);
    border-color: rgba(220, 38, 38, 0.16);
}

.task-assignment-task-cell {
    min-height: 96px;
    padding: 8px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.task-assignment-task-cell.is-drag-over,
.task-assignment-cell.is-drag-over {
    border-color: rgba(20, 184, 166, 0.7);
    box-shadow: inset 0 0 0 3px rgba(20, 184, 166, 0.18);
}

.task-assignment-task-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    align-items: start;
}

.task-assignment-task-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.task-assignment-task-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
}

.task-assignment-drag {
    color: var(--text-muted);
    cursor: grab;
    font-weight: 900;
    letter-spacing: 0;
}

.task-assignment-task-card:active .task-assignment-drag {
    cursor: grabbing;
}

.task-assignment-task-card input {
    width: 100%;
    min-height: 36px;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 0.86rem;
}

.task-assignment-delete {
    width: 24px;
    min-width: 24px;
    max-width: 24px;
    height: 24px;
    min-height: 24px;
    max-height: 24px;
    aspect-ratio: 1 / 1;
    display: grid;
    place-items: center;
    padding: 0;
    border-radius: 6px;
    color: #dc2626;
    font-size: 0.9rem;
    line-height: 1;
}

.task-assignment-cell {
    display: grid;
    gap: 7px;
    align-content: start;
    min-height: 96px;
    padding: 9px;
}

.task-assignment-add {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    justify-self: end;
    border-radius: 7px;
    background: var(--accent);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 10px 20px rgba(29, 108, 255, 0.18);
}

.task-assignment-add:hover {
    background: var(--accent-2);
}

.task-assignment-cell-workers {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.task-assignment-worker-chip {
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 4px 3px 7px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--text);
    cursor: grab;
    font-size: 0.72rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.task-assignment-worker-chip__name {
    min-width: 0;
    overflow-wrap: anywhere;
}

.task-assignment-worker-edit {
    width: 18px;
    min-width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(29, 108, 255, 0.24);
    border-radius: 999px;
    background: var(--field);
    color: var(--accent);
    cursor: pointer;
    font-size: 0.62rem;
    font-weight: 900;
    line-height: 1;
}

.task-assignment-worker-edit.is-configured {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.task-assignment-worker-chip:active {
    cursor: grabbing;
}

.task-assignment-worker-chip.is-dragging {
    opacity: 0.55;
}

.task-assignment-cell p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.74rem;
    line-height: 1.35;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.task-assignment-empty-row {
    grid-column: 1 / -1;
    min-height: 90px;
    display: grid;
    place-items: center;
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: var(--field);
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 800;
}

.task-assignment-events-grid {
    grid-template-columns: minmax(230px, 270px) repeat(7, minmax(155px, 1fr));
}

.task-assignment-events-head {
    min-height: 92px;
}

.task-assignment-event-list {
    display: grid;
    gap: 6px;
    margin-top: 6px;
}

.task-assignment-event {
    display: block;
    padding: 6px 7px;
    border-radius: 9px;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.task-assignment-event--absence {
    background: rgba(248, 113, 113, 0.16);
    color: #b91c1c;
}

.task-assignment-event--birthday {
    background: rgba(34, 197, 94, 0.16);
    color: #15803d;
}

.task-assignment-event-empty {
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 800;
}

.task-assignment-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(2, 6, 23, 0.56);
    backdrop-filter: blur(10px);
}

.task-assignment-dialog {
    width: min(780px, 100%);
    max-height: min(760px, calc(100vh - 36px));
    display: grid;
    gap: 14px;
    overflow: auto;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel);
    box-shadow: var(--shadow-panel);
}

.task-assignment-dialog__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.task-assignment-dialog__head h3 {
    margin: 0;
    color: var(--text);
    font-size: 1.05rem;
}

.task-assignment-dialog__head span {
    display: block;
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: capitalize;
}

.task-assignment-candidates {
    display: grid;
    gap: 8px;
    max-height: 300px;
    overflow: auto;
    padding-right: 2px;
}

.task-assignment-candidate {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
}

.task-assignment-candidate[hidden] {
    display: none;
}

.task-assignment-candidate.is-free {
    border-color: rgba(34, 197, 94, 0.28);
    background: rgba(34, 197, 94, 0.14);
}

.task-assignment-candidate.is-busy {
    border-color: rgba(248, 113, 113, 0.3);
    background: rgba(248, 113, 113, 0.16);
}

.task-assignment-candidate input {
    width: 16px;
    height: 16px;
    padding: 0;
    accent-color: var(--accent);
}

.task-assignment-candidate span {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.task-assignment-candidate strong {
    overflow-wrap: anywhere;
    font-size: 0.86rem;
}

.task-assignment-candidate small {
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.task-assignment-note-field {
    display: grid;
    gap: 7px;
    color: var(--text-soft);
    font-size: 0.84rem;
    font-weight: 800;
}

.task-assignment-note-field textarea {
    min-height: 92px;
}

.task-assignment-default-worker-field {
    display: grid;
    gap: 7px;
    color: var(--text-soft);
    font-size: 0.84rem;
    font-weight: 800;
}

.task-assignment-default-worker-search {
    width: 100%;
    min-height: 42px;
    border-radius: 12px;
}

.task-assignment-default-worker-list {
    display: grid;
    gap: 8px;
    max-height: 340px;
    overflow: auto;
    padding-right: 2px;
}

.task-assignment-worker-default-dialog {
    max-width: 440px;
}

.task-assignment-worker-default-toggle,
.task-assignment-worker-default-field {
    display: grid;
    gap: 8px;
    color: var(--text-soft);
    font-size: 0.84rem;
    font-weight: 800;
}

.task-assignment-worker-default-toggle {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--field);
    color: var(--text);
}

.task-assignment-worker-default-toggle input {
    width: 16px;
    height: 16px;
    padding: 0;
    accent-color: var(--accent);
}

.task-assignment-worker-default-field select {
    width: 100%;
    min-height: 42px;
    border-radius: 12px;
}

.task-assignment-dialog__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

body.theme-dark .task-assignment-task-head,
body.theme-dark .task-assignment-events-head {
    box-shadow: 8px 0 18px rgba(0, 0, 0, 0.18);
}

body.theme-dark .task-assignment-event--absence {
    color: #fecaca;
}

body.theme-dark .task-assignment-event--birthday {
    color: #bbf7d0;
}

.kanban-panel {
    display: grid;
    gap: 12px;
    padding: 14px 18px 18px;
    min-width: 0;
}

.kanban-head {
    display: grid;
    min-width: 0;
}

.kanban-form {
    display: grid;
    grid-template-columns: minmax(220px, 0.95fr) minmax(300px, 1.3fr) minmax(160px, 0.58fr) minmax(110px, auto);
    gap: 10px;
    align-items: center;
    min-width: 0;
}

.kanban-form input,
.kanban-form select,
.kanban-form textarea {
    min-height: 38px;
    border-radius: 12px;
}

.kanban-form textarea {
    height: 38px;
    max-height: 82px;
    resize: vertical;
}

.kanban-add-button {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding-inline: 14px;
    white-space: nowrap;
}

.kanban-add-button svg {
    width: 16px;
    height: 16px;
}

.kanban-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 10px;
    min-height: 520px;
    padding: 12px;
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid rgba(17, 32, 56, 0.14);
    background:
        linear-gradient(180deg, rgba(17, 32, 56, 0.02), transparent 34%),
        #ffffff;
    box-shadow:
        inset 0 0 0 1px rgba(17, 32, 56, 0.04),
        inset 0 18px 28px rgba(17, 32, 56, 0.04);
}

.kanban-column {
    display: grid;
    grid-template-rows: auto 1fr;
    min-width: 0;
    border-radius: 6px;
    border: 1px solid rgba(17, 32, 56, 0.16);
    background: rgba(17, 32, 56, 0.03);
    transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.kanban-column.is-drag-over {
    border-color: rgba(20, 184, 166, 0.95);
    box-shadow: inset 0 0 0 3px rgba(20, 184, 166, 0.42);
}

.kanban-column__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 58px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(17, 32, 56, 0.16);
    color: var(--text-strong);
}

.kanban-column__head h4 {
    margin: 0;
    font-size: 0.96rem;
    font-weight: 800;
}

.kanban-column__head span {
    min-width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(17, 32, 56, 0.08);
    color: var(--text-strong);
    font-size: 0.82rem;
    font-weight: 800;
}

.kanban-column__cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 410px;
    padding: 14px;
}

.kanban-card {
    display: grid;
    gap: 8px;
    min-height: 98px;
    padding: 12px;
    border-radius: 8px;
    color: #122033;
    cursor: grab;
    box-shadow:
        0 12px 18px rgba(0, 0, 0, 0.23),
        inset 0 0 0 1px rgba(255, 255, 255, 0.22);
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.kanban-card:active {
    cursor: grabbing;
}

.kanban-card.is-dragging {
    opacity: 0.58;
    transform: rotate(1.5deg) scale(0.98);
}

.kanban-card--cyan {
    background: #19c4d8;
}

.kanban-card--yellow {
    background: #ffbd3c;
}

.kanban-card--green {
    background: #72d63c;
}

.kanban-card--coral {
    background: #ff6267;
}

.kanban-card__head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 8px;
}

.kanban-card strong {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 0.84rem;
    line-height: 1.25;
}

.kanban-card p {
    margin: 0;
    overflow-wrap: anywhere;
    color: rgba(18, 32, 51, 0.82);
    font-size: 0.76rem;
    line-height: 1.35;
    white-space: pre-wrap;
}

.kanban-card small {
    color: rgba(18, 32, 51, 0.65);
    font-size: 0.66rem;
    font-weight: 800;
}

.kanban-card__actions {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.kanban-card__edit,
.kanban-card__delete {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: rgba(18, 32, 51, 0.72);
    background: rgba(255, 255, 255, 0.3);
}

.kanban-card__edit:hover,
.kanban-card__delete:hover {
    background: rgba(255, 255, 255, 0.54);
}

.kanban-card__edit:hover {
    color: #1d4ed8;
}

.kanban-card__delete:hover {
    color: #7f1d1d;
}

.kanban-card__edit svg,
.kanban-card__delete svg {
    width: 15px;
    height: 15px;
}

.kanban-empty {
    min-height: 92px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    border: 1px dashed rgba(17, 32, 56, 0.2);
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 800;
}

body.theme-dark .kanban-board {
    border-color: rgba(255, 255, 255, 0.78);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 34%),
        #30333b;
    box-shadow:
        inset 0 0 0 1px rgba(0, 0, 0, 0.35),
        inset 0 18px 28px rgba(0, 0, 0, 0.16);
}

body.theme-dark .kanban-column {
    border-color: rgba(255, 255, 255, 0.7);
    background: rgba(15, 23, 42, 0.13);
}

body.theme-dark .kanban-column__head {
    border-bottom-color: rgba(255, 255, 255, 0.7);
    color: #f8fafc;
}

body.theme-dark .kanban-column__head span {
    background: rgba(255, 255, 255, 0.14);
    color: #f8fafc;
}

body.theme-dark .kanban-empty {
    border-color: rgba(255, 255, 255, 0.42);
    color: rgba(255, 255, 255, 0.68);
}

.agenda-panel {
    display: grid;
    gap: 16px;
    padding: 18px;
    min-width: 0;
}

.agenda-sidebar-actions {
    margin-bottom: 14px;
}

.agenda-sidebar-actions .primary-button {
    width: 100%;
    min-height: 42px;
}

.agenda-contact-list .profile-item {
    width: 100%;
    text-align: left;
    font: inherit;
}

.agenda-form {
    display: grid;
    gap: 16px;
    min-width: 0;
}

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

.agenda-field--wide {
    grid-column: 1 / -1;
}

.agenda-notes {
    min-height: 118px;
    resize: vertical;
}

.agenda-attachment-list {
    max-width: 760px;
}

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

.agenda-actions .primary-button,
.agenda-actions .secondary-button,
.agenda-actions .ghost-button {
    min-height: 40px;
}

.agenda-delete-button {
    margin-left: auto;
    color: #dc2626;
}

.applicant-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 220px)) minmax(0, 1fr);
    gap: 12px;
    align-items: end;
}

.applicant-toolbar label,
.applicant-form label {
    display: grid;
    gap: 7px;
    color: var(--text-soft);
    font-size: 0.84rem;
    font-weight: 800;
}

.applicant-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
    border-radius: 16px;
    background: var(--field);
    border: 1px solid var(--border);
}

.applicant-form label:nth-last-child(4),
.applicant-form label:nth-last-child(3),
.applicant-form label:nth-last-child(2) {
    grid-column: span 2;
}

.applicant-form textarea {
    min-height: 92px;
    resize: vertical;
}

.applicant-form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: end;
    grid-column: 1 / -1;
}

.applicant-list {
    display: grid;
    gap: 12px;
}

.applicant-card {
    display: grid;
    gap: 12px;
    padding: 14px;
    border-radius: 16px;
    background: var(--field);
    border: 1px solid var(--border);
}

.applicant-card__head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: start;
}

.applicant-card__title {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.applicant-card__title strong {
    color: var(--text-strong);
    font-size: 1rem;
}

.applicant-card__title span,
.applicant-card__meta span,
.applicant-card__notes small {
    color: var(--text-muted);
}

.applicant-card__meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    font-size: 0.84rem;
}

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

.applicant-card__notes div {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.applicant-card__notes p {
    margin: 0;
    color: var(--text);
    line-height: 1.45;
    white-space: pre-wrap;
}

.applicant-documents {
    display: grid;
    gap: 8px;
}

#staffingResult {
    margin-top: 14px;
    display: grid;
    gap: 12px;
}

.staffing-summary {
    padding: 16px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--panel-alt);
}

.staffing-summary--ok {
    color: #34d399;
}

.staffing-entry {
    padding: 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(17, 32, 56, 0.1);
}

.staffing-entry__day {
    margin-bottom: 10px;
    color: var(--text);
    font-size: 1.02rem;
    font-weight: 800;
}

.staffing-entry__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.staffing-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--text);
    font-size: 0.96rem;
    font-weight: 800;
    line-height: 1.25;
    white-space: normal;
}

button.staffing-pill {
    border: 0;
    font-family: var(--font-ui);
    text-align: left;
}

.staffing-pill--action {
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(17, 32, 56, 0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.staffing-pill--action:hover,
.staffing-pill--action:focus-visible {
    transform: translateY(-1px);
    filter: saturate(1.04);
    box-shadow:
        inset 0 0 0 1px rgba(17, 32, 56, 0.14),
        0 10px 18px rgba(17, 32, 56, 0.12);
}

.staffing-pill--bad {
    background: #ffe8ec;
    color: #9f1239;
}

.staffing-pill--warn {
    background: #fff4cc;
    color: #854d0e;
}

.staffing-pill--night {
    background: #f5edff;
    color: #581c87;
}

.staffing-pill--birthday {
    background: #e4f0ff;
    color: #1e3a8a;
}

.staffing-pill--reminder {
    background: #e8fff7;
    color: #0f766e;
}

.staffing-report-panel {
    min-height: 0;
}

.staffing-report-scroll {
    display: grid;
    gap: 10px;
    max-height: 430px;
    overflow-y: auto;
    padding-right: 6px;
}

.staffing-report-toolbar {
    position: sticky;
    top: 0;
    z-index: 4;
    display: flex;
    justify-content: flex-end;
    height: 0;
    padding: 8px 10px 0 0;
    pointer-events: none;
}

.staffing-report-reminder-button {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 10px;
    background: rgba(17, 24, 39, 0.72);
    color: #fff;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.18);
    font-size: 1rem;
    font-weight: 900;
    line-height: 1;
    pointer-events: auto;
}

.staffing-report-reminder-button:hover {
    transform: translateY(-1px);
    background: rgba(29, 108, 255, 0.92);
}

.staffing-report-day,
.staffing-report-empty {
    padding: 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(17, 32, 56, 0.1);
}

.staffing-report-day {
    display: grid;
    gap: 8px;
}

.staffing-report-day strong {
    color: var(--text-strong);
    font-size: 1rem;
}

.staffing-report-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.staffing-report-pills .staffing-pill {
    padding: 7px 10px;
    font-size: 0.84rem;
}

body[data-active-view="turnos"] .staffing-report-panel,
body[data-active-view="turnos"] .staffing-report-day strong,
body[data-active-view="turnos"] .staffing-report-pills .staffing-pill {
    font-weight: 500;
}

body[data-active-view="turnos"] .staffing-report-day strong {
    font-size: 0.82rem;
    line-height: 1.2;
}

.staffing-report-empty {
    color: var(--text-muted);
}

.staffing-reminder-dialog {
    width: min(480px, 100%);
}

.staffing-reminder-fields {
    display: grid;
    gap: 12px;
    margin: 16px 0 18px;
}

.staffing-reminder-field {
    display: grid;
    gap: 7px;
    color: var(--text-strong);
    font-size: 0.86rem;
    font-weight: 800;
}

.staffing-reminder-field textarea {
    min-height: 92px;
}

.staffing-reminder-actions {
    margin-top: 4px;
}

.staffing-contract-log {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.staffing-contract-log h4 {
    margin: 0;
    color: var(--text-strong);
}

.staffing-contract-log--empty {
    padding: 12px 14px;
    border-radius: 14px;
    color: var(--text-muted);
    background: var(--panel-alt);
    border: 1px dashed var(--border);
}

.staffing-contract-item {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--field);
}

.staffing-contract-item strong {
    color: var(--text-strong);
}

.staffing-contract-item span,
.staffing-contract-item small {
    color: var(--text-muted);
}

.audit-log-panel {
    display: grid;
    gap: 18px;
}

.audit-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.audit-month-filter {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-soft);
    font-size: 0.88rem;
    font-weight: 800;
}

.audit-month-filter input {
    width: 170px;
}

.audit-summary-card {
    position: relative;
    overflow: hidden;
    display: grid;
    align-content: center;
    gap: 2px;
    min-height: 66px;
    min-width: 0;
    padding: 7px 9px 7px 13px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel-alt);
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition:
        transform 0.16s ease,
        border-color 0.16s ease,
        background 0.16s ease,
        box-shadow 0.16s ease;
}

.audit-summary-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: var(--accent);
}

.audit-summary-card span {
    color: var(--text-soft);
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1.08;
}

.audit-summary-card strong {
    color: var(--text-strong);
    font-size: 1.08rem;
    line-height: 1;
}

.audit-summary-card small {
    color: var(--text-muted);
    font-size: 0.58rem;
    line-height: 1.12;
}

.audit-summary-card:hover {
    transform: translateY(-1px);
    border-color: rgba(29, 108, 255, 0.34);
    box-shadow: 0 12px 26px rgba(17, 32, 56, 0.08);
}

.audit-summary-card.is-active {
    border-color: rgba(29, 108, 255, 0.6);
    background:
        linear-gradient(135deg, rgba(29, 108, 255, 0.16), rgba(34, 197, 94, 0.08)),
        var(--panel);
    box-shadow:
        inset 0 0 0 1px rgba(29, 108, 255, 0.16),
        0 14px 28px rgba(29, 108, 255, 0.12);
}

.audit-summary-card.is-active span,
.audit-summary-card.is-active strong {
    color: var(--blue);
}

.audit-summary-card--orange::before,
.audit-chip--orange {
    background: rgba(249, 115, 22, 0.18);
    color: #fb923c;
}

.audit-summary-card--green::before,
.audit-chip--green {
    background: rgba(34, 197, 94, 0.18);
    color: #34d399;
}

.audit-summary-card--cyan::before,
.audit-chip--cyan {
    background: rgba(20, 184, 166, 0.18);
    color: #2dd4bf;
}

.audit-summary-card--blue::before,
.audit-chip--blue {
    background: rgba(59, 130, 246, 0.18);
    color: #60a5fa;
}

.audit-summary-card--violet::before,
.audit-chip--violet {
    background: rgba(168, 85, 247, 0.18);
    color: #d8b4fe;
}

.audit-summary-card--yellow::before,
.audit-chip--yellow {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
}

.audit-summary-card--red::before,
.audit-chip--red {
    background: rgba(239, 68, 68, 0.18);
    color: #fb7185;
}

.audit-summary-card--muted::before,
.audit-chip--muted {
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-muted);
}

.audit-summary-card--orange::before {
    background: #fb923c;
}

.audit-summary-card--green::before {
    background: #34d399;
}

.audit-summary-card--cyan::before {
    background: #2dd4bf;
}

.audit-summary-card--blue::before {
    background: #60a5fa;
}

.audit-summary-card--violet::before {
    background: #d8b4fe;
}

.audit-summary-card--yellow::before {
    background: #fbbf24;
}

.audit-summary-card--red::before {
    background: #fb7185;
}

.audit-summary-card--muted::before {
    background: #94a3b8;
}

.audit-feed {
    display: grid;
    gap: 10px;
}

.worker-requests-panel {
    display: grid;
    gap: 14px;
}

.memos-panel {
    display: grid;
    gap: 14px;
}

.clockmarks-view {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.clockmarks-sidebar {
    position: sticky;
    top: 18px;
}

.clockmarks-panel {
    display: grid;
    gap: 18px;
    align-content: start;
}

.clockmarks-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
    align-items: center;
    gap: 14px;
}

.clockmarks-topbar .clockmarks-monthbar {
    min-height: 56px;
    margin: 0;
}

.clockmarks-all-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 56px;
    padding: 10px 14px;
    border-radius: 16px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
}

.clockmarks-all-toggle span {
    display: grid;
    gap: 2px;
}

.clockmarks-all-toggle small {
    color: var(--text-muted);
    font-size: 0.76rem;
}

.clockmarks-all-toggle input {
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
}

.clockmarks-list {
    display: grid;
    gap: 12px;
}

.clockmark-record,
.clockmarks-empty {
    display: grid;
    gap: 10px;
    padding: 18px;
    border-radius: 18px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
}

.clockmark-record--warning {
    background:
        linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(245, 158, 11, 0.05)),
        var(--panel-alt);
    border-color: rgba(245, 158, 11, 0.34);
}

.clockmark-record--severe {
    background:
        linear-gradient(135deg, rgba(244, 63, 94, 0.13), rgba(244, 63, 94, 0.05)),
        var(--panel-alt);
    border-color: rgba(244, 63, 94, 0.24);
}

.clockmark-record.is-approved {
    border-color: rgba(34, 197, 94, 0.38);
}

.clockmark-record__main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.clockmark-record__main > div:first-child {
    display: grid;
    gap: 2px;
}

.clockmark-record__main strong {
    color: var(--text-strong);
    font-size: 1rem;
}

.clockmark-record__main span,
.clockmark-record__detail,
.clockmarks-empty {
    color: var(--text-muted);
}

.clockmark-record__detail {
    margin: 0;
    font-size: 0.9rem;
}

.clockmark-record__badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.clockmark-record__badges span {
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(29, 108, 255, 0.1);
    color: var(--blue);
    font-size: 0.72rem;
    font-weight: 800;
}

.clockmark-check {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-soft);
    font-weight: 700;
}

.clockmark-check input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.clockmark-note {
    display: grid;
    gap: 6px;
}

.clockmark-note span {
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 800;
}

.clockmark-note textarea {
    min-height: 74px;
    resize: vertical;
}

.clockmark-documents {
    display: grid;
    gap: 8px;
}

.clockmark-file {
    display: grid;
    gap: 6px;
}

.clockmark-file span {
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 800;
}

.clockmark-file input {
    width: 100%;
    min-height: 38px;
}

.worker-request-counter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(29, 108, 255, 0.1);
    color: var(--blue);
    font-size: 0.82rem;
    font-weight: 800;
}

.worker-request-head-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.worker-request-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.worker-request-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--panel-alt);
    color: var(--text-soft);
    font-weight: 800;
}

.worker-request-filter span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    min-height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.14);
    color: var(--text-muted);
    font-size: 0.76rem;
}

.worker-request-filter.is-active {
    border-color: rgba(29, 108, 255, 0.5);
    background: rgba(29, 108, 255, 0.1);
    color: var(--blue);
}

.worker-request-list {
    display: grid;
    gap: 10px;
}

.worker-request-card {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.04), transparent),
        var(--panel-alt);
}

.worker-request-card__main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: start;
}

.worker-request-card h4 {
    margin: 6px 0 4px;
    color: var(--text-strong);
    font-size: 1rem;
    letter-spacing: -0.02em;
}

.worker-request-card p,
.worker-request-card small {
    display: block;
    margin: 0;
    color: var(--text-muted);
    line-height: 1.45;
}

.worker-request-type,
.worker-request-status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 900;
}

.worker-request-type {
    background: rgba(29, 108, 255, 0.1);
    color: var(--blue);
}

.worker-request-status--pending {
    background: rgba(245, 158, 11, 0.14);
    color: #d97706;
}

.worker-request-status--accepted {
    background: rgba(34, 197, 94, 0.14);
    color: #16a34a;
}

.worker-request-status--completed {
    background: rgba(20, 184, 166, 0.14);
    color: #0f766e;
}

.worker-request-status--rejected,
.worker-request-status--canceled {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.worker-request-card__meta {
    display: grid;
    justify-items: end;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.worker-request-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.worker-request-reject-note {
    margin-top: 8px !important;
    color: #dc2626 !important;
    font-weight: 700;
}

.worker-request-footnote {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.84rem;
}

.worker-request-textarea {
    display: grid;
    gap: 8px;
    margin: 16px 0 18px;
}

.worker-request-textarea span {
    color: var(--text-soft);
    font-weight: 800;
}

.worker-request-textarea textarea {
    min-height: 110px;
    resize: vertical;
}

.memo-card.is-completed {
    opacity: 0.78;
}

.memo-card.is-completed h4,
.memo-card.is-completed p {
    text-decoration: line-through;
}

.memo-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 800;
}

.memo-check input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.memo-documents {
    display: grid;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.memo-documents small {
    color: var(--text-muted);
}

.memo-document-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.memo-document-button,
.memo-file-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(29, 108, 255, 0.34);
    border-radius: 999px;
    background: rgba(29, 108, 255, 0.08);
    color: var(--blue);
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
}

.memo-file-button {
    width: max-content;
}

.memo-file-button input {
    display: none;
}

.audit-feed__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 0 2px;
}

.audit-feed__head h4 {
    margin: 0;
    color: var(--text-strong);
}

.audit-feed__head span {
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.audit-entry {
    display: grid;
    gap: 8px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel-alt);
    cursor: pointer;
    transition:
        border-color 0.16s ease,
        background 0.16s ease,
        opacity 0.16s ease;
}

.audit-entry:hover,
.audit-entry.is-expanded {
    border-color: rgba(29, 108, 255, 0.34);
    background: var(--panel);
}

.audit-entry.is-canceled {
    opacity: 0.72;
}

.audit-entry.is-canceled strong,
.audit-entry.is-canceled p,
.audit-entry.is-canceled > small {
    text-decoration: line-through;
    text-decoration-thickness: 2px;
    text-decoration-color: rgba(239, 68, 68, 0.72);
}

.audit-entry__head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.audit-chip {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 900;
}

.audit-entry time,
.audit-entry small {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.audit-entry strong {
    color: var(--text-strong);
}

.audit-entry__canceled {
    display: grid;
    gap: 3px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    font-size: 0.82rem;
    font-weight: 800;
}

.audit-entry__canceled span {
    color: inherit;
    font-weight: 700;
}

.audit-entry__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.audit-entry__actions small {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.audit-entry p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.45;
}

.medical-chart-card {
    display: grid;
    gap: 14px;
    margin-top: 16px;
    padding: 16px;
    border-radius: 18px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
}

.medical-chart-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.medical-chart-head h4 {
    margin: 0 0 4px;
    font-size: 1rem;
}

.medical-chart-head p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.35;
}

.medical-chart-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, auto));
    gap: 8px;
    min-width: 260px;
}

.medical-chart-summary span {
    padding: 8px 10px;
    border-radius: 12px;
    background: var(--field);
    border: 1px solid var(--border);
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 800;
}

.medical-chart-summary strong {
    color: var(--text);
}

.medical-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 800;
}

.medical-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.medical-chart-legend i {
    display: inline-block;
    width: 14px;
    height: 10px;
    border-radius: 999px;
}

.medical-color-license,
.medical-stack--license {
    background: linear-gradient(135deg, #ef4444, #fb7185);
}

.medical-color-professional,
.medical-stack--professional {
    background: linear-gradient(135deg, #2563eb, #60a5fa);
}

.medical-line-average {
    height: 3px !important;
    background: #f97316;
}

.medical-line-mode {
    height: 3px !important;
    background: #22c55e;
}

.medical-chart-bars {
    display: flex;
    align-items: end;
    gap: 8px;
    min-height: 240px;
    overflow-x: auto;
    padding: 14px 4px 4px;
    border-radius: 16px;
    background: var(--calendar-empty);
    border: 1px solid var(--border);
}

.medical-chart-month {
    flex: 0 0 34px;
    display: grid;
    grid-template-rows: minmax(170px, 1fr) auto;
    align-items: end;
    gap: 8px;
    min-height: 220px;
}

.medical-chart-bar {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: end;
    width: 100%;
    height: 100%;
    min-height: 170px;
    border-radius: 10px 10px 4px 4px;
    background: var(--timeline-empty);
    border: 1px solid var(--border);
}

.medical-stack {
    display: block;
    width: 100%;
    min-height: 0;
}

.medical-ref {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    transform: translateY(1px);
    z-index: 2;
}

.medical-ref--average {
    background: #f97316;
}

.medical-ref--mode {
    background: #22c55e;
}

.medical-chart-month small {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    justify-self: center;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: capitalize;
}

#swapPanel select {
    margin-bottom: 12px;
}

.swap-readonly-worker {
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--field-border);
    background: var(--field);
    color: var(--text);
    font-weight: 700;
}

.swap-profile-item {
    width: 100%;
    border: 0;
    text-align: left;
}

.swap-monthbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    margin: -4px 0 18px;
}

.swap-month-trigger {
    appearance: none;
    min-width: 170px;
    padding: 4px 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    text-align: center;
    font-size: clamp(0.98rem, 1.55vw, 1.28rem);
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.18s ease, background 0.18s ease;
}

.swap-month-trigger:hover,
.swap-month-trigger:focus-visible {
    background: rgba(29, 108, 255, 0.1);
    color: var(--accent);
    outline: none;
}

.swap-month-button {
    min-width: 42px;
    height: 38px;
    border-radius: 12px;
    background: transparent;
    color: var(--text);
    font-size: 1.4rem;
    font-weight: 900;
}

.swap-month-button:hover {
    background: var(--panel-hover);
}

.swap-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
}

.mini-wrap {
    padding: 12px;
    border-radius: 16px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
}

.mini-wrap label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

.mini-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-auto-rows: minmax(42px, auto);
    gap: 6px;
}

.mini-day {
    min-height: 42px;
    padding: 6px 4px;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 0.8rem;
    user-select: none;
}

.mini-day span {
    color: inherit;
    font-weight: 900;
    line-height: 1;
}

.mini-day small {
    font-size: 0.68rem;
    color: inherit;
    font-weight: 900;
    letter-spacing: 0.02em;
}

.mini-spacer {
    visibility: hidden;
    pointer-events: none;
}

.mini-on {
    background: rgba(34, 197, 94, 0.18);
    color: #63d98f;
    cursor: pointer;
}

.mini-on.mini-turn-larga {
    border-color: rgba(34, 197, 94, 0.9);
    background: linear-gradient(135deg, #17a34a, #27c76f);
    color: #fff;
    box-shadow: 0 8px 18px rgba(34, 197, 94, 0.16);
}

.mini-on.mini-turn-noche {
    border-color: rgba(29, 108, 255, 0.92);
    background: linear-gradient(135deg, #1d6cff, #2788ff);
    color: #fff;
    box-shadow: 0 8px 18px rgba(29, 108, 255, 0.16);
}

.mini-off {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
}

body.theme-light .mini-off {
    background: rgba(17, 32, 56, 0.04);
}

body.theme-dark .staffing-entry,
body.theme-dark .staffing-report-day,
body.theme-dark .staffing-report-empty {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(148, 163, 184, 0.24);
    color: #fff;
}

body.theme-dark .staffing-entry__day,
body.theme-dark .staffing-report-day strong {
    color: #fff;
}

body.theme-dark .staffing-report-empty {
    color: rgba(255, 255, 255, 0.78);
}

body.theme-dark .staffing-report-pills .staffing-pill,
body.theme-dark .staffing-entry__list .staffing-pill {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.theme-dark .staffing-pill--bad {
    background: rgba(127, 29, 29, 0.78);
}

body.theme-dark .staffing-pill--warn {
    background: rgba(146, 64, 14, 0.78);
}

body.theme-dark .staffing-pill--night {
    background: rgba(88, 28, 135, 0.78);
}

body.theme-dark .staffing-pill--birthday {
    background: rgba(30, 58, 138, 0.78);
}

body.theme-dark .staffing-pill--reminder {
    background: rgba(15, 118, 110, 0.78);
}

body.theme-dark .staffing-report-reminder-button {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.mini-selected {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    cursor: pointer;
}

.mini-selected.mini-turn-larga {
    border-color: rgba(12, 74, 35, 0.56);
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #fff;
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.72),
        0 0 0 3px rgba(34, 197, 94, 0.32);
}

.mini-selected.mini-turn-noche {
    border-color: rgba(30, 64, 175, 0.58);
    background: linear-gradient(135deg, #1d4ed8, #1d6cff);
    color: #fff;
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.72),
        0 0 0 3px rgba(29, 108, 255, 0.32);
}

#saveSwapBtn {
    grid-column: 1 / -1;
}

.swap-item {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
    color: var(--text-soft);
}

.swap-item.is-canceled {
    color: var(--text-muted);
    text-decoration: line-through;
    text-decoration-thickness: 2px;
    opacity: 0.72;
    background: var(--calendar-disabled);
}

.empty-state {
    padding: 18px;
    border-radius: 16px;
    border: 1px dashed var(--border-strong);
    color: var(--text-muted);
    text-align: center;
    background: var(--calendar-empty);
}

.empty-state--compact {
    padding: 22px 16px;
}

body.mode-active .day.mpa-enabled {
    cursor: pointer;
    border-color: rgba(29, 108, 255, 0.26);
    box-shadow: inset 0 0 0 1px rgba(29, 108, 255, 0.1);
}

body.mode-active .day.mpa-enabled:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 18px 28px rgba(29, 108, 255, 0.24);
    border-color: rgba(29, 108, 255, 0.4);
}

body.mode-active .day.draft-selected {
    box-shadow:
        inset 0 0 0 2px rgba(29, 108, 255, 0.34),
        0 18px 28px rgba(29, 108, 255, 0.18);
}

.day.mpa-disabled {
    background: var(--calendar-disabled) !important;
    color: var(--text-muted) !important;
    border-color: var(--border) !important;
    opacity: 0.72;
    filter: grayscale(1) saturate(0.25);
    cursor: not-allowed;
    box-shadow: none !important;
}

.day.mpa-disabled:hover {
    transform: none;
    border-color: var(--border) !important;
    box-shadow: none !important;
}

body.calendar-direct-edit-off:not(.mode-active) .calendar-panel .day:not(.turn-change-day):not(.needs-replacement):not(.needs-extra-reason):not(.contract-error-day) {
    cursor: default;
}

.day.mpa-disabled:not(.today)::before,
.day.mpa-disabled::after {
    display: none;
}

.day.mpa-disabled .day-number,
.day.mpa-disabled .day-label {
    color: var(--text-muted) !important;
}

.day.inactive-profile-day {
    cursor: not-allowed;
    opacity: 0.68;
    filter: grayscale(0.7);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: var(--scrollbar);
}

::-webkit-scrollbar-track {
    background: transparent;
}

@media (min-width: 1321px) and (max-height: 1080px) {
    body {
        font-size: 0.86rem;
    }

    .app-shell {
        padding: 8px;
    }

    .topbar {
        gap: 10px;
        padding: 0 2px 6px;
    }

    .brand {
        gap: 8px;
    }

    .brand-mark {
        width: 34px;
        height: 34px;
        border-radius: 9px;
    }

    .brand-mark.brand-mark--wide {
        width: 210px;
        height: 42px;
    }

    .brand-copy strong {
        font-size: clamp(1.08rem, 1.28vw, 1.48rem);
    }

    .brand-copy span {
        font-size: 0.68rem;
    }

    .topbar-actions {
        gap: 8px;
    }

    .topbar .profile-viewer {
        gap: 6px;
        font-size: 0.72rem;
    }

    .topbar .profile-viewer__field {
        min-width: 190px;
        max-width: 230px;
        height: 30px;
        border-radius: 10px;
    }

    .topbar .profile-viewer__field input {
        padding-inline: 8px;
        font-size: 0.72rem;
    }

    .topbar .profile-viewer__button {
        width: 30px;
    }

    .theme-switch,
    .icon-button,
    .user-chip {
        height: 30px;
    }

    .theme-switch {
        gap: 5px;
        padding: 0 7px;
    }

    .icon-button {
        width: 30px;
        border-radius: 9px;
    }

    .user-chip {
        padding: 0 9px;
        font-size: 0.72rem;
    }

    .user-avatar {
        width: 22px;
        height: 22px;
    }

    .app-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
        margin-top: 7px;
    }

    .profile-view-layout {
        grid-template-columns: minmax(205px, 224px) minmax(0, 1fr);
        gap: 8px;
    }

    .dashboard {
        gap: 8px;
    }

    .sidebar {
        --sidebar-sticky-top: 8px;
        --sidebar-viewport-gap: 16px;
        padding: 10px;
    }

    .panel-title {
        margin-bottom: 8px;
        font-size: 0.78rem;
    }

    .field-shell {
        margin-bottom: 7px;
    }

    input,
    select,
    textarea {
        padding: 8px 10px;
        font-size: 0.8rem;
    }

    .profile-list {
        gap: 5px;
    }

    .profile-item {
        gap: 7px;
        padding: 7px 9px;
        border-radius: 11px;
    }

    .profile-item__avatar {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }

    .profile-item__content strong {
        font-size: 0.74rem;
    }

    .profile-item__content span {
        font-size: 0.64rem;
    }

    .actionbar {
        padding: 4px;
        gap: 4px;
        border-radius: 16px;
    }

    .nav-tile {
        min-height: 40px;
        gap: 3px;
        border-radius: 11px;
    }

    .nav-icon {
        width: 17px;
        height: 17px;
    }

    .nav-tile span {
        font-size: 0.58rem;
        white-space: nowrap;
    }

    .calendar-panel,
    .leave-panel,
    .availability-panel,
    .hours-panel,
    .hours-charts-panel,
    .hhee-records-panel,
    .staffing-report-panel,
    .timeline-panel,
    .staffing-panel,
    .swap-panel,
    .worker-requests-panel,
    .memos-panel,
    .agenda-panel,
    .audit-log-panel {
        padding: 10px;
        border-radius: 16px;
    }

    .primary-grid {
        gap: 8px;
    }

    body[data-active-view="turnos"] .primary-grid {
        grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.92fr);
    }

    .stacked-panels,
    body[data-active-view="turnos"] .stacked-panels {
        gap: 8px;
    }

    body[data-active-view="turnos"] .stacked-panels {
        grid-template-columns: minmax(210px, 0.7fr) minmax(0, 1fr);
    }

    .section-head {
        gap: 7px;
        margin-bottom: 7px;
    }

    .section-icon,
    .legend-dot {
        width: 16px;
        height: 16px;
    }

    .section-head h3 {
        font-size: 0.8rem;
        line-height: 1.05;
    }

    .calendar-header {
        grid-template-columns: minmax(0, 1fr) 28px minmax(144px, 220px) 28px minmax(0, 1fr);
        gap: 8px;
        margin-bottom: 7px;
    }

    .calendar-rotation-button {
        min-height: 28px;
        padding: 0 9px;
        font-size: 0.62rem;
    }

    .calendar-month-trigger {
        font-size: clamp(0.98rem, 1.12vw, 1.22rem);
    }

    .calendar-header .icon-button {
        width: 28px;
        height: 28px;
        border-radius: 9px;
    }

    .weekdays {
        gap: 5px;
        margin-bottom: 5px;
        font-size: 0.64rem;
    }

    .grid {
        gap: 5px;
    }

    .day {
        min-height: clamp(44px, 5.45vh, 52px);
        padding: 6px;
        border-radius: 10px;
        gap: 3px;
    }

    .day-number {
        font-size: 0.74rem;
    }

    .day-label {
        font-size: 0.62rem;
    }

    .day-badge {
        min-width: 15px;
        min-height: 15px;
        padding: 1px 4px;
        font-size: 0.48rem;
    }

    .day.replacement-day .day-badge {
        min-height: 14px;
        padding: 1px 4px;
        font-size: 0.42rem;
        letter-spacing: 0.02em;
    }

    .legend-list {
        gap: 5px;
    }

    .legend-action {
        gap: 6px;
        padding: 7px 8px;
        border-radius: 10px;
        font-size: 0.66rem;
        line-height: 1.1;
    }

    .legend-action span:last-child {
        white-space: nowrap;
    }

    .staffing-report-scroll {
        max-height: clamp(360px, calc(100vh - 310px), 560px);
    }

    .staffing-report-toolbar {
        padding: 5px 7px 0 0;
    }

    .staffing-report-reminder-button {
        width: 28px;
        height: 28px;
        min-width: 28px;
        border-radius: 8px;
        font-size: 0.9rem;
    }

    .staffing-report-day,
    .staffing-report-empty {
        padding: 7px;
        border-radius: 10px;
    }

    .staffing-report-day {
        gap: 6px;
    }

    .staffing-report-pills {
        gap: 5px;
    }

    .staffing-report-pills .staffing-pill {
        padding: 5px 7px;
        font-size: 0.7rem;
        line-height: 1.2;
    }

    .timeline-shell {
        --timeline-hhee-day-left: 116px;
        --timeline-hhee-night-left: 194px;
    }

    .timeline-table th {
        padding: 5px 4px;
        font-size: 0.6rem;
    }

    .timeline-name-head,
    .namecol {
        padding: 6px 8px !important;
        font-size: 0.66rem;
    }

    .timeline-hhee-head,
    .timeline-hhee {
        padding-inline: 6px;
        font-size: 0.64rem;
    }

    .mini {
        min-width: 17px;
        height: 20px;
    }
}

@media (max-width: 1320px) {
    .profile-layout,
    .profile-records-grid {
        grid-template-columns: 1fr;
    }

    .profile-side-column {
        grid-column: auto;
        grid-row: auto;
        top: 12px;
        width: 100%;
    }

    .profile-actions-card {
        justify-self: stretch;
        width: 100%;
        min-width: 0;
    }

    .overview-card__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .audit-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .overview-actions {
        grid-column: 1 / -1;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .actionbar {
        grid-template-columns: repeat(16, minmax(0, 1fr));
        gap: 4px;
    }

    .nav-tile {
        min-height: 56px;
        padding: 6px 3px;
        gap: 4px;
    }

    .nav-icon {
        width: 21px;
        height: 21px;
    }

    .nav-tile span {
        font-size: 0.66rem;
    }

    .secondary-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1100px) {
    .app-grid {
        grid-template-columns: 1fr;
    }

    .profile-view-layout {
        grid-template-columns: 1fr;
    }

    .turn-changes-view,
    .staffing-view,
    .hours-view,
    .reports-view,
    .agenda-view,
    .clockmarks-view,
    .hhee-overview-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .primary-grid {
        grid-template-columns: 1fr;
    }

    body[data-active-view="turnos"] .primary-grid,
    body[data-active-view="turnos"] .stacked-panels {
        grid-template-columns: 1fr;
    }

    .kanban-head,
    .kanban-form {
        grid-template-columns: 1fr;
    }

    .task-assignment-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .task-assignment-controls {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .task-assignment-toolbar {
        justify-content: flex-start;
        padding-left: 0;
        padding-top: 10px;
        border-left: 0;
        border-top: 1px solid var(--border);
    }
}

@media (max-width: 860px) {
    .topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar-actions {
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .topbar .profile-viewer {
        flex: 1 1 100%;
        justify-content: flex-end;
    }

    .topbar .profile-viewer__field {
        flex: 0 1 320px;
        max-width: 100%;
    }

    .medical-chart-head,
    .clockmarks-header,
    .clockmark-record__main,
    .applicant-toolbar,
    .staffing-weekly-filters,
    .task-assignment-view-filters,
    .task-assignment-dialog__filters,
    .kanban-board,
    .agenda-form-grid,
    .report-preview-heading,
    .report-worker-data-grid,
    .overview-card__grid,
    .contract-history-grid,
    .profile-form-grid,
    .record-form,
    .profile-editor__grid,
    .hhee-chart-controls,
    .medical-chart-summary,
    .audit-summary-grid,
    .staffing-config-summary,
    .staff-grid,
    .actionbar,
    .summary-grid,
    body[data-active-view="profile"] .stacked-panels,
    body[data-active-view="turnos"] .stacked-panels,
    .applicant-form,
    .applicant-card__meta,
    .applicant-card__notes,
    .swap-row {
        grid-template-columns: 1fr;
    }

    .metric-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .metric-row--field {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .replacement-dialog-toolbar {
        grid-template-columns: 1fr;
    }

    .worker-request-card__main,
    .clockmark-record__main,
    .memo-documents,
    .worker-request-actions {
        grid-template-columns: 1fr;
    }

    .worker-request-card__meta {
        justify-items: start;
    }

    .clockmarks-header,
    .clockmark-record__main {
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .clockmark-record__badges {
        justify-content: flex-start;
    }

    .worker-request-actions {
        display: grid;
    }

    .metric-input input {
        max-width: none;
    }

    .calendar-header {
        grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr) 36px minmax(0, 1fr);
    }

    .calendar-rotation-button {
        grid-column: 5;
        justify-self: end;
        min-height: 30px;
        padding: 0 10px;
        font-size: 0.66rem;
    }

    .calendar-profile-viewer {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .calendar-profile-viewer .profile-viewer__field {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 640px) {
    .app-shell {
        padding: 14px;
    }

    .panel,
    .card,
    .sidebar,
    .calendar-panel,
    .leave-panel,
    .availability-panel,
    .hours-panel,
    .timeline-panel,
    .staffing-panel,
    .task-assignment-panel,
    .swap-panel,
    .overview-card {
        border-radius: 20px;
    }

    .topbar-actions,
    .brand {
        gap: 10px;
    }

    .topbar .profile-viewer {
        justify-content: stretch;
    }

    .topbar .profile-viewer label {
        display: none;
    }

    .topbar .profile-viewer__field {
        flex: 1 1 100%;
        min-width: 0;
    }

    .user-chip {
        width: 100%;
        justify-content: center;
    }

    .day {
        min-height: 68px;
        padding: 10px;
    }

    .day-number {
        font-size: 0.95rem;
    }

    .day-label {
        font-size: 0.8rem;
    }

    .weekdays {
        gap: 6px;
        font-size: 0.8rem;
    }

    .grid {
        gap: 6px;
    }

    .timeline-table {
        min-width: 100%;
    }

    .hhee-worker-row {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .hhee-worker-row small {
        text-align: left;
    }
}

@media (max-width: 860px) {
    body {
        overflow-x: hidden;
    }

    .app-shell {
        max-width: 100%;
    }

    .actionbar {
        display: flex;
        grid-template-columns: none;
        gap: 8px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
    }

    .actionbar::-webkit-scrollbar,
    .profile-list::-webkit-scrollbar {
        display: none;
    }

    .nav-tile {
        flex: 0 0 92px;
        min-height: 64px;
        padding: 8px 6px;
        scroll-snap-align: start;
    }

    .nav-icon {
        width: 24px;
        height: 24px;
    }

    .nav-tile span {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.78rem;
    }
}

@media (max-width: 760px) {
    body {
        padding-bottom: calc(86px + env(safe-area-inset-bottom));
    }

    body::before,
    body::after {
        opacity: 0.28;
    }

    .app-shell {
        padding: 10px;
    }

    .topbar {
        position: sticky;
        top: 0;
        z-index: 50;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        margin: -10px -10px 10px;
        padding: 10px;
        background: var(--bg-top);
        background:
            linear-gradient(180deg, var(--bg-top), color-mix(in srgb, var(--bg-top) 72%, transparent));
        backdrop-filter: blur(18px);
    }

    .brand {
        min-width: 0;
        gap: 10px;
    }

    .brand-mark {
        width: 42px;
        height: 42px;
        border-radius: 12px;
    }

    .brand-mark.brand-mark--wide {
        width: clamp(170px, 36vw, 240px);
        height: 44px;
    }

    .brand-mark svg {
        width: 23px;
        height: 23px;
    }

    .brand-copy {
        min-width: 0;
    }

    .brand-copy strong {
        font-size: 1.2rem;
        white-space: nowrap;
    }

    .brand-copy span {
        display: none;
    }

    .topbar-actions {
        margin-left: auto;
        flex: 0 0 auto;
        justify-content: flex-end;
        gap: 8px;
    }

    .topbar .profile-viewer {
        display: none;
    }

    .theme-switch {
        width: 48px;
        padding: 0 6px;
        justify-content: center;
    }

    .theme-switch__icon {
        display: none;
    }

    .theme-switch__track {
        width: 34px;
        height: 20px;
    }

    .theme-switch__thumb {
        width: 14px;
        height: 14px;
    }

    body.theme-dark .theme-switch__thumb {
        transform: translateX(14px);
    }

    .user-chip {
        width: auto;
        height: 38px;
        padding: 0 6px;
    }

    .user-chip > span:last-child {
        display: none;
    }

    .user-avatar {
        width: 28px;
        height: 28px;
    }

    .icon-button {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .app-grid {
        display: block;
        margin-top: 10px;
    }

    .panel,
    .card {
        box-shadow: 0 14px 34px rgba(7, 13, 27, 0.16);
    }

    .sidebar {
        position: static;
        height: auto;
        max-height: none;
        overflow: visible;
        margin-bottom: 12px;
        padding: 14px;
    }

    .sidebar:has(.profile-list) {
        height: auto;
    }

    .panel-title {
        margin-bottom: 12px;
    }

    .field-shell {
        margin-bottom: 10px;
    }

    .sidebar-toggle {
        margin: 10px 0 12px;
    }

    .profile-list {
        display: flex;
        gap: 8px;
        margin: 0 -4px;
        padding: 0 4px 2px;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
    }

    .profile-item {
        flex: 0 0 min(78vw, 240px);
        scroll-snap-align: start;
    }

    .profile-item__avatar {
        width: 38px;
        height: 38px;
    }

    .dashboard {
        gap: 12px;
    }

    .actionbar {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: max(10px, env(safe-area-inset-bottom));
        z-index: 70;
        padding: 8px;
        border-radius: 22px;
        border: 1px solid var(--border-strong);
        background: var(--panel);
        background: color-mix(in srgb, var(--panel) 94%, transparent);
        box-shadow: 0 18px 44px rgba(7, 13, 27, 0.32);
        backdrop-filter: blur(20px);
    }

    .nav-tile {
        flex-basis: 76px;
        min-height: 58px;
        border-bottom: 0;
        border-radius: 16px;
        gap: 5px;
    }

    .nav-tile.is-active {
        border-bottom-color: transparent;
        box-shadow: inset 0 0 0 1px rgba(29, 108, 255, 0.34);
    }

    .nav-icon {
        width: 21px;
        height: 21px;
    }

    .nav-tile span {
        font-size: 0.68rem;
    }

    .primary-grid,
    .secondary-grid,
    .stacked-panels,
    body[data-active-view="profile"] .stacked-panels {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .overview-card,
    .calendar-panel,
    .leave-panel,
    .availability-panel,
    .hours-panel,
    .hhee-records-panel,
    .timeline-panel,
    .staffing-panel,
    .swap-panel {
        padding: 14px;
    }

    .overview-card__grid,
    .profile-layout,
    .profile-form-grid,
    .profile-records-grid,
    .record-form,
    .profile-availability-card .availability-list,
    .overview-actions {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .overview-actions {
        grid-column: auto;
    }

    .metric-row--field {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .metric-label {
        font-size: 0.88rem;
    }

    input,
    select {
        min-height: 44px;
        padding: 10px 12px;
        font-size: 0.95rem;
    }

    .calendar-header {
        grid-template-columns: 34px minmax(0, 1fr) 34px;
        gap: 8px;
        margin-bottom: 12px;
    }

    .calendar-header #prevBtn {
        grid-column: 1;
    }

    .calendar-header #monthYear {
        grid-column: 2;
    }

    .calendar-header #nextBtn {
        grid-column: 3;
    }

    .calendar-rotation-button {
        grid-column: 1 / -1;
        justify-self: end;
        width: auto;
        max-width: min(100%, 180px);
        min-height: 28px;
        padding: 0 9px;
        font-size: 0.6rem;
    }

    .calendar-month-trigger {
        font-size: 1.15rem;
        line-height: 1.1;
    }

    .weekdays {
        gap: 5px;
        margin-bottom: 8px;
        font-size: 0.72rem;
    }

    .grid {
        gap: 5px;
    }

    .day {
        min-height: clamp(48px, 13vw, 62px);
        padding: 7px;
        border-radius: 12px;
        gap: 4px;
    }

    .day-number {
        font-size: 0.86rem;
    }

    .day-label {
        font-size: 0.68rem;
        line-height: 1;
    }

    .day.weekend::after,
    .day.holiday::after {
        inset: 0;
        border-width: 1px;
        border-radius: inherit;
    }

    .day.today::before {
        top: 3px;
        right: 3px;
        width: 17px;
        height: 17px;
    }

    .mode-banner {
        align-items: stretch;
        padding: 12px;
        font-size: 0.9rem;
    }

    .mode-banner button {
        min-height: 38px;
    }

    .legend-list {
        gap: 6px;
    }

    .legend-action,
    .legend-item {
        padding: 9px 10px;
        border-radius: 12px;
        font-size: 0.86rem;
    }

    .section-icon,
    .legend-dot {
        width: 21px;
        height: 21px;
    }

    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .summary-card,
    .availability-item,
    .staff-grid > div,
    .staffing-entry,
    .mini-wrap,
    .swap-item {
        border-radius: 14px;
    }

    .timeline-shell,
    .hours-charts-panel,
    .staffing-panel,
    .swap-panel {
        overflow-x: auto;
    }

    .timeline-table th {
        padding: 8px 5px;
        font-size: 0.72rem;
    }

    .timeline-table td {
        font-size: 0.75rem;
    }

    .timeline-name-head,
    .namecol {
        padding: 8px 10px !important;
    }

    .timeline-hhee-head,
    .timeline-hhee {
        padding-inline: 8px;
    }

    .mini {
        min-width: 20px;
        height: 24px;
    }

    .swap-monthbar {
        gap: 10px;
        margin-bottom: 12px;
    }

    .swap-month-trigger {
        min-width: 0;
        flex: 1;
        font-size: 0.98rem;
    }

    .swap-month-button {
        min-width: 36px;
        height: 34px;
    }

    .mini-grid {
        grid-auto-rows: minmax(36px, auto);
    }

    .mini-day {
        min-height: 36px;
        border-radius: 10px;
        font-size: 0.72rem;
    }

    .mini-day small {
        font-size: 0.58rem;
    }
}

@media (max-width: 420px) {
    .app-shell {
        padding-inline: 8px;
    }

    .topbar {
        margin-inline: -8px;
        padding-inline: 8px;
    }

    .brand-copy strong {
        max-width: 96px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .theme-switch {
        display: none;
    }

    .actionbar {
        left: 8px;
        right: 8px;
    }

    .nav-tile {
        flex-basis: 68px;
        min-height: 54px;
    }

    .nav-tile span {
        font-size: 0.63rem;
    }

    .calendar-panel,
    .leave-panel,
    .availability-panel,
    .hours-panel,
    .hhee-records-panel,
    .timeline-panel,
    .staffing-panel,
    .swap-panel,
    .worker-requests-panel,
    .memos-panel,
    .agenda-panel,
    .task-assignment-panel,
    .overview-card,
    .sidebar {
        padding: 12px;
    }

    .day {
        min-height: 44px;
        padding: 5px;
        border-radius: 10px;
    }

    .day-number {
        font-size: 0.78rem;
    }

    .day-label {
        font-size: 0.58rem;
    }

    .weekdays {
        font-size: 0.64rem;
    }

    .legend-action,
    .legend-item {
        font-size: 0.8rem;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1101px) {
    body[data-active-view="turnos"] .primary-grid {
        align-items: start;
    }

    body[data-active-view="turnos"] .calendar-panel {
        display: flex;
        flex-direction: column;
        align-self: start;
        height: var(--turnos-side-panel-height, auto);
        max-height: var(--turnos-side-panel-height, none);
        min-height: 0;
        overflow: hidden;
    }

    body[data-active-view="turnos"] .calendar-panel.has-multiple-badge-days {
        height: auto;
        max-height: none;
        overflow: visible;
    }

    body[data-active-view="turnos"] .calendar-panel .grid {
        flex: 1 1 auto;
        min-height: 0;
        grid-auto-rows: minmax(0, 1fr);
    }

    body[data-active-view="turnos"] .calendar-panel.has-multiple-badge-days .grid {
        flex: 0 0 auto;
        min-height: auto;
        align-items: start;
        grid-auto-rows: auto;
    }

    body[data-active-view="turnos"] .calendar-panel .day {
        min-height: 0;
    }

    body[data-active-view="turnos"] .calendar-panel.has-multiple-badge-days .day {
        min-height: 78px;
        align-self: start;
    }

    body[data-active-view="turnos"] .calendar-panel .day.has-multiple-badges {
        min-height: auto;
    }

    body[data-active-view="turnos"] .stacked-panels {
        align-self: start;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
    }

    body[data-active-view="turnos"] .leave-panel {
        align-self: start;
        height: auto;
        width: fit-content;
        max-width: min(100%, 250px);
        padding-inline: 12px;
    }

    body.mode-active[data-active-view="turnos"] .leave-panel {
        max-width: min(100%, 340px);
    }

    body[data-active-view="turnos"] .leave-panel .legend-action {
        width: 100%;
        white-space: nowrap;
    }

    body[data-active-view="turnos"] .staffing-report-panel {
        display: flex;
        flex-direction: column;
        align-self: start;
        height: var(--turnos-side-panel-height, auto);
        max-height: var(--turnos-side-panel-height, none);
        min-height: 0;
        overflow: hidden;
    }

    body[data-active-view="turnos"] .staffing-report-scroll {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
    }
}

@media (max-width: 760px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    body {
        padding-bottom: max(14px, env(safe-area-inset-bottom));
    }

    .app-shell,
    .dashboard {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
    }

    .app-shell {
        padding-top: 0;
    }

    .topbar {
        z-index: 90;
        width: 100vw;
        max-width: 100vw;
        min-width: 0;
        margin-top: 0;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
        margin-bottom: 10px;
        box-sizing: border-box;
    }

    body[data-active-view="turnos"] .app-shell {
        padding: 0 4px 10px;
    }

    body[data-active-view="turnos"] .topbar {
        margin-top: 0;
        margin-bottom: 8px;
        padding: 8px;
    }

    body[data-active-view="turnos"] .app-grid {
        margin-top: 8px;
    }

    body[data-active-view="turnos"] .dashboard {
        gap: 8px;
    }

    .mobile-menu-toggle {
        display: grid;
    }

    body.mobile-menu-open .mobile-menu-toggle {
        color: var(--accent);
        background: var(--panel-hover);
        box-shadow: inset 0 0 0 1px rgba(29, 108, 255, 0.34);
    }

    .brand-mark.brand-mark--wide {
        width: clamp(132px, 34vw, 180px);
        height: 38px;
    }

    .actionbar {
        position: fixed;
        top: calc(62px + env(safe-area-inset-top));
        left: auto;
        right: 10px;
        bottom: auto;
        z-index: 80;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        width: min(360px, calc(100vw - 20px));
        max-height: min(72vh, calc(100dvh - 82px));
        padding: 10px;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        border-radius: 18px;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(-8px) scale(0.98);
        transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    }

    body.mobile-menu-open .actionbar {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0) scale(1);
    }

    .nav-tile {
        flex: initial;
        min-height: 58px;
        padding: 7px 5px;
        border-bottom: 0;
        border-radius: 14px;
        scroll-snap-align: none;
    }

    .nav-tile--mobile-only {
        display: grid;
    }

    .nav-tile span {
        white-space: normal;
        font-size: 0.66rem;
        line-height: 1.05;
    }

    body[data-active-view="turnos"] .primary-grid,
    body[data-active-view="turnos"] .stacked-panels {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    :is(body[data-active-view="turnos"], body[data-active-view="timeline"]) .timeline-panel,
    :is(body[data-active-view="turnos"], body[data-active-view="timeline"]) #teamTimeline,
    :is(body[data-active-view="turnos"], body[data-active-view="timeline"]) .timeline-shell {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    :is(body[data-active-view="turnos"], body[data-active-view="timeline"]) .timeline-panel,
    :is(body[data-active-view="turnos"], body[data-active-view="timeline"]) #teamTimeline {
        overflow-x: hidden;
    }

    :is(body[data-active-view="turnos"], body[data-active-view="timeline"]) .timeline-shell {
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x pan-y;
    }

    :is(body[data-active-view="turnos"], body[data-active-view="timeline"]) .timeline-name-head,
    :is(body[data-active-view="turnos"], body[data-active-view="timeline"]) .namecol {
        left: 0;
        z-index: 8;
        width: 140px;
        min-width: 140px;
        max-width: 140px;
        padding-inline: 6px !important;
        box-shadow: 8px 0 14px rgba(17, 32, 56, 0.08);
    }

    :is(body[data-active-view="turnos"], body[data-active-view="timeline"]) .timeline-name-head {
        z-index: 10;
        overflow: visible;
    }

    :is(body[data-active-view="turnos"], body[data-active-view="timeline"]) .namecol {
        overflow: hidden;
    }

    :is(body[data-active-view="turnos"], body[data-active-view="timeline"]) .timeline-filter {
        width: 100%;
        min-width: 0;
    }

    :is(body[data-active-view="turnos"], body[data-active-view="timeline"]) .timeline-filter__trigger {
        min-height: 30px;
        padding: 5px 7px;
    }

    :is(body[data-active-view="turnos"], body[data-active-view="timeline"]) .timeline-profile-link {
        display: block;
        width: 100%;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    :is(body[data-active-view="turnos"], body[data-active-view="timeline"]) .timeline-hhee-label > span {
        display: none;
    }

    :is(body[data-active-view="turnos"], body[data-active-view="timeline"]) .timeline-hhee-label {
        gap: 0;
    }

    :is(body[data-active-view="turnos"], body[data-active-view="timeline"]) .timeline-hhee-head,
    :is(body[data-active-view="turnos"], body[data-active-view="timeline"]) .timeline-hhee {
        position: static;
        width: 30px;
        min-width: 30px;
        max-width: 30px;
        padding-inline: 3px;
    }

    :is(body[data-active-view="turnos"], body[data-active-view="timeline"]) .timeline-hhee-icon {
        width: 15px;
        height: 15px;
    }

    .turn-change-dialog-backdrop {
        display: flex;
        align-items: stretch;
        justify-content: center;
        padding: 10px 8px max(10px, env(safe-area-inset-bottom));
        overflow: hidden;
    }

    .replacement-dialog {
        display: flex;
        flex-direction: column;
        width: min(100%, calc(100vw - 16px));
        max-height: calc(100dvh - 20px - env(safe-area-inset-bottom));
        min-height: 0;
        padding: 16px;
        border-radius: 18px;
        overflow: hidden;
    }

    .replacement-dialog > strong {
        flex: 0 0 auto;
        margin-bottom: 8px;
        font-size: 1rem;
    }

    .replacement-dialog > p {
        flex: 0 0 auto;
        margin-bottom: 10px;
        line-height: 1.32;
    }

    .replacement-dialog-toolbar {
        flex: 0 0 auto;
        gap: 8px;
        margin: 4px 0 10px;
    }

    .replacement-dialog-toolbar button {
        min-height: 38px;
        padding-inline: 10px;
        line-height: 1.18;
    }

    .replacement-request-toggle {
        flex: 0 0 auto;
        gap: 10px;
        margin: 2px 0 10px;
        padding: 10px 12px;
        border-radius: 14px;
    }

    .replacement-request-toggle input {
        width: 20px;
        height: 20px;
        min-height: 0;
    }

    .replacement-request-toggle strong {
        font-size: 0.82rem;
    }

    .replacement-candidate-list {
        flex: 1 1 auto;
        min-height: 160px;
        max-height: none;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        padding-right: 4px;
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }

    .replacement-candidate {
        gap: 10px;
        padding: 10px 12px;
        border-radius: 14px;
    }

    .replacement-dialog .turn-change-dialog__actions {
        flex: 0 0 auto;
        margin-top: 10px;
    }

    body[data-active-view="weekly"] .app-shell,
    body[data-active-view="weekly"] .app-grid,
    body[data-active-view="weekly"] .secondary-grid,
    body[data-active-view="weekly"] #staffingWeeklyCalendar,
    body[data-active-view="weekly"] .dashboard {
        overflow: visible;
    }

    body[data-active-view="weekly"] .staffing-weekly-sticky {
        position: static;
        z-index: auto;
    }

    body[data-active-view="weekly"] .staffing-weekly-sticky .staffing-weekly-days {
        display: none;
    }

    body[data-active-view="weekly"] .staffing-weekly-mobile-days {
        position: sticky;
        top: 0;
        z-index: 95;
        align-self: start;
        display: grid;
        gap: 8px;
        margin: -14px -16px 0;
        padding: 8px 16px 10px;
        border-bottom: 1px solid var(--border);
        background: var(--panel-alt);
        box-shadow: 0 12px 20px rgba(17, 32, 56, 0.1);
        grid-template-columns: repeat(7, minmax(150px, 150px));
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x pan-y;
        scrollbar-width: none;
    }

    body[data-active-view="weekly"] .staffing-weekly-mobile-days-placeholder {
        display: block;
        height: 0;
    }

    body[data-active-view="weekly"] .staffing-weekly-mobile-days--fixed {
        position: fixed;
        z-index: 120;
        margin: 0;
        box-sizing: border-box;
        border-radius: 0 0 14px 14px;
    }

    body[data-active-view="weekly"] .staffing-weekly-grid {
        grid-template-columns: repeat(7, minmax(150px, 150px));
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x pan-y;
    }

    body[data-active-view="weekly"] .staffing-weekly-mobile-days::-webkit-scrollbar {
        display: none;
    }

    body[data-active-view="weekly"] .staffing-weekly-day,
    body[data-active-view="weekly"] .staffing-weekly-cell {
        min-width: 150px;
    }

    body[data-active-view="turnos"] .calendar-panel {
        padding: 6px;
        border-radius: 14px;
    }

    body[data-active-view="turnos"] .calendar-profile-viewer {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px;
        margin-bottom: 6px;
        padding: 4px 6px;
        border-radius: 8px;
    }

    body[data-active-view="turnos"] .calendar-profile-viewer > label:not(.calendar-edit-toggle) {
        display: none;
    }

    body[data-active-view="turnos"] .calendar-profile-viewer .profile-viewer__field {
        width: 100%;
        min-width: 0;
        height: 30px;
        border-radius: 8px;
    }

    body[data-active-view="turnos"] .calendar-profile-viewer .profile-viewer__field input {
        padding-inline: 8px;
        font-size: 0.74rem;
    }

    body[data-active-view="turnos"] .calendar-profile-viewer .profile-viewer__button {
        width: 30px;
        height: 30px;
    }

    body[data-active-view="turnos"] .calendar-profile-viewer .profile-viewer__button svg {
        width: 12px;
        height: 12px;
    }

    body[data-active-view="turnos"] .calendar-edit-toggle {
        gap: 5px;
        min-width: 0;
        font-size: 0.58rem;
    }

    body[data-active-view="turnos"] .calendar-edit-switch {
        width: 32px;
        height: 18px;
    }

    body[data-active-view="turnos"] .calendar-edit-switch > span::after {
        width: 14px;
        height: 14px;
        top: 1px;
        left: 1px;
    }

    body[data-active-view="turnos"] .calendar-edit-switch input:checked + span::after {
        transform: translateX(14px);
    }

    body[data-active-view="turnos"] .calendar-header {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px;
        margin-bottom: 6px;
    }

    body[data-active-view="turnos"] .calendar-header #monthYear {
        grid-column: 1;
        justify-self: stretch;
        width: 100%;
        text-align: center;
    }

    body[data-active-view="turnos"] .calendar-rotation-button {
        grid-column: 2;
        justify-self: end;
        width: auto;
        max-width: min(42vw, 170px);
        min-height: 26px;
        padding: 0 8px;
        font-size: 0.58rem;
    }

    body[data-active-view="turnos"] .calendar-month-trigger {
        font-size: 0.84rem;
        line-height: 1.05;
        letter-spacing: 0;
    }

    body[data-active-view="turnos"] .calendar-header .icon-button {
        display: none;
    }

    body[data-active-view="turnos"] .weekdays {
        gap: 4px;
        margin-bottom: 5px;
        font-size: 0.58rem;
    }

    body[data-active-view="turnos"] .grid {
        gap: 3px;
        touch-action: pan-y;
    }

    body[data-active-view="turnos"] .day {
        min-height: clamp(55px, 17vw, 78px);
        padding: 5px;
        border-radius: 9px;
        gap: 2px;
    }

    body[data-active-view="turnos"] .day:hover {
        transform: none;
    }

    body[data-active-view="turnos"] .day-number {
        font-size: 0.68rem;
    }

    body[data-active-view="turnos"] .day-label {
        font-size: 0.52rem;
        line-height: 1;
    }

    body[data-active-view="turnos"] .day-badge {
        min-width: 14px;
        min-height: 14px;
        padding: 1px 4px;
        font-size: 0.44rem;
    }

    body[data-active-view="turnos"] .day.has-multiple-badges {
        min-height: clamp(66px, 18vw, 80px);
        gap: 2px;
        padding: 5px;
        justify-content: flex-start;
    }

    body[data-active-view="turnos"] .day.has-multiple-badges .day-badges {
        gap: 2px;
    }

    body[data-active-view="turnos"] .day.has-multiple-badges .day-badge {
        min-height: 13px;
        padding: 1px 4px;
        font-size: 0.4rem;
    }

    body[data-active-view="turnos"] .day.replacement-day .day-badge {
        min-height: 13px;
        font-size: 0.38rem;
    }

    body[data-active-view="turnos"] .mobile-panel-toggle {
        display: flex;
    }

    .mobile-panel-toggle {
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        min-height: 48px;
        padding: 0 14px;
        border: 1px solid var(--border-strong);
        border-radius: 14px;
        background: var(--field);
        color: var(--text);
        font-size: 0.94rem;
        font-weight: 800;
        box-shadow: var(--shadow-soft);
    }

    .mobile-panel-toggle svg {
        width: 18px;
        height: 18px;
        transition: transform 0.18s ease;
    }

    body.mobile-leave-open .mobile-leave-toggle svg {
        transform: rotate(180deg);
    }

    body.mobile-staffing-open .mobile-staffing-toggle svg {
        transform: rotate(180deg);
    }

    body[data-active-view="turnos"]:not(.mobile-leave-open) #leavePanel {
        display: none !important;
    }

    body[data-active-view="turnos"]:not(.mobile-staffing-open) #staffingReportPanel {
        display: none !important;
    }

    body[data-active-view="turnos"] .leave-panel,
    body[data-active-view="turnos"] .staffing-report-panel {
        padding: 10px;
        border-radius: 14px;
    }

    body[data-active-view="turnos"] .leave-panel .legend-list {
        gap: 6px;
    }

    body[data-active-view="turnos"] .leave-panel .legend-action {
        min-height: 38px;
        padding: 8px 10px;
        border-radius: 11px;
        font-size: 0.78rem;
    }

    body[data-active-view="turnos"] .leave-panel .legend-action span:last-child {
        white-space: normal;
    }

    body[data-active-view="turnos"] .staffing-report-scroll {
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    body[data-active-view="turnos"] .staffing-report-day,
    body[data-active-view="turnos"] .staffing-report-empty {
        padding: 8px;
        border-radius: 11px;
    }

    body[data-active-view="turnos"] .staffing-report-pills .staffing-pill {
        padding: 5px 7px;
        font-size: 0.68rem;
    }

    body[data-active-view="clockmarks"] #clockMarksPanel {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        gap: 10px;
        overflow-x: hidden;
    }

    body[data-active-view="clockmarks"] .clockmarks-sidebar,
    body[data-active-view="clockmarks"] .clockmarks-panel {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding: 12px;
        border-radius: 16px;
        overflow-x: hidden;
    }

    body[data-active-view="clockmarks"] .clockmarks-sidebar {
        position: static;
    }

    body[data-active-view="clockmarks"] .clockmarks-sidebar .profile-list {
        display: flex;
        gap: 8px;
        margin: 0 -4px;
        padding: 0 4px 2px;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
    }

    body[data-active-view="clockmarks"] .clockmarks-sidebar .profile-item {
        flex: 0 0 min(78vw, 240px);
        scroll-snap-align: start;
    }

    body[data-active-view="clockmarks"] .clockmarks-topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
        align-items: stretch;
    }

    body[data-active-view="clockmarks"] .clockmarks-all-toggle {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        width: 100%;
        min-width: 0;
        gap: 10px;
        padding: 10px 12px;
        border-radius: 14px;
    }

    body[data-active-view="clockmarks"] .clockmarks-all-toggle small {
        font-size: 0.7rem;
        line-height: 1.25;
    }

    body[data-active-view="clockmarks"] .clockmarks-monthbar {
        gap: 8px;
        margin: 0;
        padding: 8px;
        border-radius: 14px;
    }

    body[data-active-view="clockmarks"] .clockmarks-monthbar strong {
        min-width: 0;
        flex: 1 1 auto;
        font-size: 0.86rem;
        line-height: 1.15;
    }

    body[data-active-view="clockmarks"] .clockmarks-monthbar .swap-month-button {
        flex: 0 0 38px;
        width: 38px;
        min-width: 38px;
        height: 36px;
    }

    body[data-active-view="clockmarks"] .clockmarks-list {
        gap: 8px;
    }

    body[data-active-view="clockmarks"] .clockmark-record,
    body[data-active-view="clockmarks"] .clockmarks-empty {
        width: 100%;
        min-width: 0;
        padding: 12px;
        border-radius: 16px;
    }

    body[data-active-view="clockmarks"] .clockmark-record__main {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
        align-items: stretch;
    }

    body[data-active-view="clockmarks"] .clockmark-record__main > div:first-child,
    body[data-active-view="clockmarks"] .clockmark-record__main strong,
    body[data-active-view="clockmarks"] .clockmark-record__main span,
    body[data-active-view="clockmarks"] .clockmark-record__detail,
    body[data-active-view="clockmarks"] .clockmark-note,
    body[data-active-view="clockmarks"] .clockmark-documents {
        min-width: 0;
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    body[data-active-view="clockmarks"] .clockmark-record__main strong {
        font-size: 0.94rem;
        line-height: 1.18;
    }

    body[data-active-view="clockmarks"] .clockmark-record__main span,
    body[data-active-view="clockmarks"] .clockmark-record__detail,
    body[data-active-view="clockmarks"] .clockmark-note span,
    body[data-active-view="clockmarks"] .clockmarks-empty {
        font-size: 0.78rem;
        line-height: 1.35;
    }

    body[data-active-view="clockmarks"] .clockmark-record__badges {
        justify-content: flex-start;
        gap: 5px;
    }

    body[data-active-view="clockmarks"] .clockmark-record__badges span {
        padding: 5px 7px;
        font-size: 0.66rem;
        line-height: 1.1;
        white-space: normal;
    }

    body[data-active-view="clockmarks"] .clockmark-check {
        align-items: flex-start;
        gap: 9px;
        font-size: 0.78rem;
        line-height: 1.3;
    }

    body[data-active-view="clockmarks"] .clockmark-check input {
        flex: 0 0 18px;
        min-height: 0;
        margin-top: 1px;
    }

    body[data-active-view="clockmarks"] .clockmark-note textarea {
        min-height: 84px;
        font-size: 0.82rem;
    }

    body[data-active-view="clockmarks"] .attachment-item {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
        gap: 8px;
    }

    body[data-active-view="clockmarks"] .attachment-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    body[data-active-view="clockmarks"] .attachment-view,
    body[data-active-view="clockmarks"] .attachment-remove {
        width: 100%;
        min-height: 36px;
        padding-inline: 8px;
        font-size: 0.76rem;
    }

    body[data-active-view="log"] #auditLogPanel {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        gap: 12px;
        overflow-x: hidden;
        padding: 12px;
        border-radius: 16px;
    }

    body[data-active-view="log"] .section-head--with-action {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
        gap: 12px;
    }

    body[data-active-view="log"] .section-head__title {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 5px;
        min-width: 0;
    }

    body[data-active-view="log"] .section-head__title h3 {
        font-size: 1.05rem;
        line-height: 1.1;
        overflow-wrap: anywhere;
    }

    body[data-active-view="log"] .audit-month-filter {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        width: 100%;
        min-width: 0;
        gap: 8px;
        font-size: 0.8rem;
    }

    body[data-active-view="log"] .audit-month-filter input {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        font-size: 0.82rem;
    }

    body[data-active-view="log"] .audit-summary-grid {
        width: 100%;
        min-width: 0;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    body[data-active-view="log"] .audit-summary-card {
        min-width: 0;
        min-height: 60px;
        padding: 7px 8px 7px 12px;
        border-radius: 14px;
    }

    body[data-active-view="log"] .audit-summary-card span,
    body[data-active-view="log"] .audit-summary-card small {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    body[data-active-view="log"] .audit-summary-card span {
        font-size: 0.58rem;
        line-height: 1.1;
    }

    body[data-active-view="log"] .audit-summary-card strong {
        font-size: 0.98rem;
    }

    body[data-active-view="log"] .audit-summary-card small {
        font-size: 0.54rem;
        line-height: 1.15;
    }

    body[data-active-view="log"] .audit-feed,
    body[data-active-view="log"] .audit-entry {
        max-width: 100%;
        min-width: 0;
    }

    body[data-active-view="log"] .audit-feed__head {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
        gap: 4px;
    }

    body[data-active-view="log"] .audit-feed__head h4 {
        font-size: 0.95rem;
    }

    body[data-active-view="log"] .audit-feed__head span {
        font-size: 0.78rem;
        line-height: 1.3;
    }

    body[data-active-view="log"] .audit-entry {
        overflow-wrap: anywhere;
        padding: 12px;
        border-radius: 16px;
    }

    body[data-active-view="log"] .audit-entry__head {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
        gap: 6px;
    }

    body[data-active-view="log"] .audit-chip {
        width: fit-content;
        max-width: 100%;
        white-space: normal;
        font-size: 0.68rem;
        line-height: 1.15;
    }

    body[data-active-view="log"] .audit-entry time,
    body[data-active-view="log"] .audit-entry small,
    body[data-active-view="log"] .audit-entry p,
    body[data-active-view="log"] .audit-entry__actions small {
        font-size: 0.78rem;
        line-height: 1.35;
    }

    body[data-active-view="log"] .audit-entry strong {
        font-size: 0.9rem;
        line-height: 1.22;
    }

    body[data-active-view="log"] .audit-entry__canceled {
        padding: 10px;
        border-radius: 12px;
        font-size: 0.78rem;
        line-height: 1.35;
    }

    body[data-active-view="log"] .audit-entry__actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        justify-content: stretch;
        gap: 8px;
    }

    body[data-active-view="log"] .audit-entry__actions .secondary-button {
        width: 100%;
        min-height: 38px;
        padding-inline: 10px;
    }

    body[data-active-view="requests"] #workerRequestsPanel,
    body[data-active-view="memos"] #memosPanel {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
        padding: 12px;
    }

    body[data-active-view="requests"] .section-head--with-action,
    body[data-active-view="memos"] .section-head--with-action {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
        gap: 12px;
    }

    body[data-active-view="requests"] .section-head__title,
    body[data-active-view="memos"] .section-head__title {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 5px;
        min-width: 0;
    }

    body[data-active-view="requests"] .section-head__title h3,
    body[data-active-view="memos"] .section-head__title h3 {
        font-size: 1.05rem;
        line-height: 1.1;
    }

    body[data-active-view="requests"] .section-head__title small,
    body[data-active-view="memos"] .section-head__title small {
        max-width: 100%;
        color: var(--text-muted);
        font-size: 0.78rem;
        line-height: 1.35;
        overflow-wrap: anywhere;
    }

    body[data-active-view="requests"] .worker-request-head-actions,
    body[data-active-view="memos"] .worker-request-head-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        justify-content: stretch;
        width: 100%;
        min-width: 0;
        gap: 8px;
    }

    body[data-active-view="requests"] .audit-month-filter,
    body[data-active-view="memos"] .audit-month-filter {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        width: 100%;
        min-width: 0;
        gap: 8px;
        font-size: 0.8rem;
    }

    body[data-active-view="requests"] .audit-month-filter input,
    body[data-active-view="memos"] .audit-month-filter input {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        font-size: 0.82rem;
    }

    body[data-active-view="requests"] .worker-request-counter,
    body[data-active-view="memos"] .worker-request-counter {
        justify-content: center;
        width: 100%;
        min-width: 0;
        padding: 7px 10px;
        white-space: normal;
        text-align: center;
        font-size: 0.78rem;
        line-height: 1.2;
        overflow-wrap: anywhere;
    }

    body[data-active-view="requests"] .worker-request-filters,
    body[data-active-view="memos"] .worker-request-filters {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
        min-width: 0;
    }

    body[data-active-view="requests"] .worker-request-filter,
    body[data-active-view="memos"] .worker-request-filter {
        justify-content: center;
        min-width: 0;
        min-height: 36px;
        padding: 0 8px;
        border-radius: 14px;
        font-size: 0.78rem;
        line-height: 1.1;
        text-align: center;
        white-space: normal;
    }

    body[data-active-view="requests"] .worker-request-filter span,
    body[data-active-view="memos"] .worker-request-filter span {
        flex: 0 0 auto;
    }

    body[data-active-view="requests"] .worker-request-card,
    body[data-active-view="memos"] .worker-request-card {
        min-width: 0;
        padding: 12px;
        border-radius: 16px;
    }

    body[data-active-view="requests"] .worker-request-card__main,
    body[data-active-view="memos"] .worker-request-card__main {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        min-width: 0;
    }

    body[data-active-view="requests"] .worker-request-card__main > *,
    body[data-active-view="memos"] .worker-request-card__main > *,
    body[data-active-view="requests"] .worker-request-card h4,
    body[data-active-view="memos"] .worker-request-card h4,
    body[data-active-view="requests"] .worker-request-card p,
    body[data-active-view="memos"] .worker-request-card p,
    body[data-active-view="requests"] .worker-request-card small,
    body[data-active-view="memos"] .worker-request-card small {
        min-width: 0;
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    body[data-active-view="requests"] .worker-request-card h4,
    body[data-active-view="memos"] .worker-request-card h4 {
        font-size: 0.94rem;
        line-height: 1.18;
    }

    body[data-active-view="requests"] .worker-request-card p,
    body[data-active-view="memos"] .worker-request-card p,
    body[data-active-view="requests"] .worker-request-card small,
    body[data-active-view="memos"] .worker-request-card small,
    body[data-active-view="requests"] .worker-request-footnote,
    body[data-active-view="memos"] .worker-request-footnote {
        font-size: 0.78rem;
        line-height: 1.35;
    }

    body[data-active-view="requests"] .worker-request-card__meta,
    body[data-active-view="memos"] .worker-request-card__meta {
        justify-items: start;
        min-width: 0;
    }

    body[data-active-view="requests"] .memo-documents,
    body[data-active-view="memos"] .memo-documents {
        min-width: 0;
    }

    body[data-active-view="requests"] .memo-file-button,
    body[data-active-view="memos"] .memo-file-button,
    body[data-active-view="requests"] .memo-document-button,
    body[data-active-view="memos"] .memo-document-button {
        max-width: 100%;
        white-space: normal;
        text-align: center;
    }
}
