* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: #e5e8ec;
    color: #2f3439;
    height: 100vh;
    overflow: hidden;
}

.login-screen {
    height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #1f2c30, #3f98bf);
}

.login-card {
    width: 380px;
    background: white;
    border-radius: 4px;
    padding: 30px;
    box-shadow: 0 18px 50px rgba(0,0,0,.28);
}

.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

.login-logo img {
    display: block;
    width: 190px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.login-card h1 {
    margin: 0 0 4px;
    font-weight: 500;
}

.login-card p {
    margin: 0 0 22px;
    color: #7f8c96;
}

.login-card small {
    display: block;
    margin-top: 14px;
    color: #9aa0a6;
}

.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 6px 0 14px;
}

.login-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #4b5760;
}

.login-option input {
    margin: 0;
}

.app-shell {
    height: 100vh;
    display: flex;
    overflow: hidden;
}

.sidebar {
    width: 250px;
    background: #1f2c30;
    color: #dbe7ec;
    flex-shrink: 0;
    transition: width .2s ease;
}

.app-shell.sidebar-collapsed .sidebar {
    width: 62px;
}

.logo {
    height: 52px;
    background: #fff;
    display: flex;
    align-items: center;
    padding: 7px 16px;
    overflow: hidden;
}

.logo img {
    display: block;
    width: 150px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.app-shell.sidebar-collapsed .logo {
    padding: 9px 8px;
}

.app-shell.sidebar-collapsed .logo img {
    width: 46px;
    max-width: none;
}

.profile {
    height: 82px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: #1b272b;
}

.avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #3d9ac2;
    color: white;
    border: 1px solid rgba(255,255,255,.4);
    flex-shrink: 0;
}

.avatar.small {
    width: 30px;
    height: 30px;
    font-size: 12px;
}

.profile strong {
    display: block;
    color: white;
    font-size: 14px;
}

.profile span {
    color: #5db1d0;
    font-size: 12px;
}

.app-shell.sidebar-collapsed .profile-text,
.app-shell.sidebar-collapsed .nav-label,
.app-shell.sidebar-collapsed .nav-item span {
    display: none;
}

nav {
    padding-top: 12px;
    height: calc(100vh - 134px);
    display: flex;
    flex-direction: column;
}

.nav-label {
    color: #508196;
    font-size: 12px;
    letter-spacing: 2px;
    padding: 20px 10px 8px;
}

.nav-spacer {
    flex: 1;
}

.nav-item {
    width: 100%;
    border: 0;
    background: transparent;
    color: #b9ccd4;
    text-align: left;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 15px;
    white-space: nowrap;
}

.nav-item:hover,
.nav-item.active {
    background: #26383d;
    color: white;
}

.nav-item span {
    display: inline-block;
}

.app {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.topbar {
    height: 52px;
    background: #4496bb;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 18px;
    box-shadow: 0 2px 4px rgba(0,0,0,.18);
}

.hamburger {
    background: none;
    border: 0;
    color: white;
    font-size: 23px;
    cursor: pointer;
}

.top-icons {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 14px;
}

.main {
    flex: 1;
    padding: 14px 22px 22px;
    overflow: auto;
}

.page-title {
    background: white;
    height: 48px;
    border-bottom: 1px solid #d1d6dc;
    margin: -14px -22px 22px;
    padding: 0 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.page-title h1 {
    font-size: 22px;
    font-weight: 500;
    margin: 0;
}

.breadcrumb {
    color: #7f8c96;
    font-size: 13px;
}

.view { display: none; }
.view.active { display: block; }

.grid.two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

.planilla-lock-button {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
    background: transparent;
    color: #ffffff;
    transition: transform .15s ease, filter .15s ease;
}

.planilla-lock-button:hover:not(.lock-readonly) {
    transform: scale(1.06);
}

.planilla-lock-button.lock-open {
    color: #9bc53d;
}

.planilla-lock-button.lock-closed {
    color: #ff4757;
}

.planilla-lock-button.lock-readonly {
    cursor: default;
}

.lock-state-icon {
    display: block;
    width: 30px;
    height: 30px;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .18));
}

.lock-state-icon circle {
    fill: currentColor;
}

.lock-fill {
    fill: #ffffff;
}

.lock-mark {
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.lock-open-art,
.lock-closed-art {
    display: none;
}

.lock-open .lock-open-art,
.lock-closed .lock-closed-art {
    display: block;
}

.grid.three {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    align-items: stretch;
}

.grid.three > .panel {
    height: 100%;
}

#dashboard > .grid.three {
    margin-bottom: 18px;
}

#dr-import-btn,
#services-import-btn {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.catalog-create-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 18px;
}

.catalog-create-form.adjustment-catalog-form {
    grid-template-columns: minmax(170px, 1fr) minmax(170px, auto) auto;
}

.catalog-create-form input,
.catalog-create-form select {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.catalog-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 36px;
}

.catalog-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 10px;
    border: 1px solid #d8e0e8;
    border-radius: 4px;
    background: #f8fafc;
}

.catalog-list-item span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.new-liquidation-modal-box {
    width: min(760px, 94vw) !important;
    max-height: 92vh;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.new-liquidation-list {
    border: 1px solid #ccd6df;
    border-radius: 4px;
    background: white;
    max-height: 180px;
    overflow: auto;
}

.new-liquidation-list.compact-list {
    max-height: 120px;
}

.new-liquidation-list.activities-list {
    height: min(260px, 30vh);
    min-height: 180px;
    max-height: 260px;
    flex: 0 0 auto;
}

.new-liquidation-list label {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    padding: 9px 12px;
    border-bottom: 1px solid #edf1f4;
    cursor: pointer;
    text-align: left;
}

.new-liquidation-list label input[type="checkbox"] {
    appearance: auto;
    width: 16px;
    height: 16px;
    min-width: 16px;
    margin: 0;
    padding: 0;
}

.new-liquidation-list label span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.new-liquidation-list label:last-child {
    border-bottom: 0;
}

.new-liquidation-list label:hover {
    background: #edf5fa;
}

.new-liquidation-list .muted,
.new-liquidation-list .new-liquidation-muted {
    display: block;
    padding: 12px;
}

.new-liquidation-worker-picker input {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 6px;
}

#new-liquidation-activity-search {
    width: 100%;
    height: 44px;
    min-height: 44px;
    flex: 0 0 44px;
    box-sizing: border-box;
    margin-bottom: 6px;
    padding: 10px 12px;
    font-size: 16px;
}

@media (max-width: 900px) {
    .catalog-create-form,
    .catalog-create-form.adjustment-catalog-form {
        grid-template-columns: 1fr;
    }
}

.panel {
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,.14);
    margin-bottom: 22px;
    overflow: hidden;
}

.search-filter-panel {
    overflow: visible;
    position: relative;
    z-index: 40;
}

.panel-title {
    color: white;
    font-weight: 700;
    padding: 12px 16px;
}

.panel-title.dark { background: #29405a; }
.panel-title.cyan { background: #4298be; }

.panel-body {
    padding: 16px;
}

.search-filter-panel .panel-body {
    overflow: visible;
    position: relative;
    z-index: 40;
}

.panel-body.no-padding {
    padding: 0;
}

label {
    display: grid;
    gap: 6px;
    font-size: 13px;
    color: #5f6870;
    margin-bottom: 12px;
}

select,
input {
    height: 36px;
    border: 1px solid #cfd6dc;
    border-radius: 3px;
    background: white;
    padding: 0 10px;
}

.file-input {
    border: 1px dashed #a9b5bd;
    background: #f7f9fb;
    padding: 14px;
    cursor: pointer;
    display: block;
}

.file-input input {
    display: none;
}

.upload-card {
    min-height: 120px;
    border: 2px dashed #c9d3da;
    border-radius: 8px;
    background: #fcfcfd;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    color: #51606d;
    transition: border-color .2s ease, background .2s ease;
}

.upload-card:hover {
    border-color: #3f98bf;
    background: #f2f8fc;
}

.upload-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #bcc3ca;
    line-height: 1.35;
}

.upload-card-browse {
    min-width: 156px;
    height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    border: 2px solid #c9cdd2;
    border-radius: 6px;
    background: linear-gradient(#f7f7f7, #e8e8e8);
    color: #565b60;
    font-size: 18px;
}

.upload-card-status {
    color: #6c7884;
    font-size: 13px;
    line-height: 1.35;
}

.upload-card.has-file .upload-card-title,
.upload-card.is-imported .upload-card-title {
    color: #33414d;
}

.upload-card.has-file .upload-card-browse,
.upload-card.is-imported .upload-card-browse {
    display: none;
}

.upload-card.is-imported {
    border-color: #7dc48c;
    background: #f5fcf7;
}

.upload-card.is-imported .upload-card-status {
    color: #2f7a3e;
    font-weight: 600;
}

.upload-card.has-file .upload-card-status::before,
.upload-card.is-imported .upload-card-status::before {
    content: "\2714  ";
    color: #2aa44f;
    font-weight: 800;
}

.panel-body > .btn[id$="-import-btn"] {
    margin-top: 10px;
}

.btn {
    border: 0;
    padding: 9px 13px;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 600;
}

.btn.primary {
    background: #3f98bf;
    color: white;
}

.btn.secondary {
    background: #f4f6f8;
    color: #3c4650;
    border: 1px solid #cfd6dc;
}

.btn.full {
    width: 100%;
}

.small-btn {
    padding: 5px 9px;
    font-size: 12px;
}

.erp-table {
    width: 100%;
    border-collapse: collapse;
}

.erp-table th {
    text-align: left;
    color: #3f4650;
    border-bottom: 2px solid #ddd;
    padding: 11px;
}

.erp-table td {
    padding: 11px;
    border-bottom: 1px solid #e7e7e7;
}

.tag {
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

.blue-tag { background: #d8edf7; color: #2b7797; }
.green-tag { background: #dff0d8; color: #3c763d; }

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

.filters,
.actions,
.search-grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: end;
}

.actions.left {
    justify-content: flex-start;
}

.rates-filter-bar {
    align-items: flex-end;
}

.rates-filter-bar label {
    margin-bottom: 0;
}

.rate-action-control {
    display: flex;
    align-items: flex-end;
}

.rate-action-control .btn {
    height: 36px;
    box-sizing: border-box;
}

.action-menu { position: relative; }
.action-menu > summary { list-style: none; cursor: pointer; }
.action-menu > summary::-webkit-details-marker { display: none; }
.action-menu > summary::after { content: " ▾"; font-size: 11px; }
.action-menu-panel {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    z-index: 30;
    min-width: 185px;
    padding: 5px;
    border: 1px solid #cbd6dd;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(27, 53, 68, .18);
}
.action-menu-panel button {
    display: block;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #264757;
    text-align: left;
    cursor: pointer;
}
.action-menu-panel button:hover:not(:disabled) { background: #eaf4f8; }
.action-menu-panel button:disabled { color: #9aa9b1; cursor: not-allowed; }

#search-btn,
#search-export-menu,
#search-email-menu {
    width: 150px;
}

.search-filter-panel .actions {
    margin-top: 12px;
}

#search-btn,
#search-export-menu > summary,
#search-email-menu > summary {
    height: 36px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 18px;
}

#search-export-menu > summary,
#search-email-menu > summary {
    width: 100%;
}

.ipc-history {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.ipc-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 12px;
    border-left: 5px solid #4aa3c7;
    border-radius: 5px;
    background: #edf6fa;
}

.ipc-history-item > div:first-child {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ipc-history-item small { color: #607985; }

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

.search-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.checklist-summary {
    min-height: 38px;
    padding: 9px 11px;
    border: 1px solid #cfd6dc;
    border-radius: 3px;
    background: #f8fafb;
    color: #3f4650;
    display: flex;
    align-items: center;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.checklist-box {
    border: 1px solid #cfd6dc;
    border-radius: 3px;
    background: #fff;
    padding: 8px 10px;
    display: grid;
    gap: 8px;
    box-shadow: 0 10px 24px rgba(0,0,0,.12);
}

.multi-select {
    position: relative;
    margin-top: 8px;
}

.dropdown-toggle::after {
    content: "▼";
    margin-left: auto;
    font-size: 11px;
    color: #6c7884;
}

.dropdown-panel {
    position: fixed;
    z-index: 1000;
    max-height: 280px;
    overflow: auto;
    min-width: 260px;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: 400;
}

.checklist-item-all {
    padding-bottom: 6px;
    border-bottom: 1px solid #e7edf1;
    font-weight: 700;
}

.checklist-item-filter {
    padding-left: 18px;
    color: #31566b;
}

.checklist-item-filter:nth-of-type(3) {
    padding-bottom: 6px;
    border-bottom: 1px solid #e7edf1;
}

.checklist-empty {
    color: #7f8c96;
    font-style: italic;
    padding: 4px 0;
}

input.checklist-summary {
    cursor: text;
    background-image: linear-gradient(45deg, transparent 50%, #6c7884 50%), linear-gradient(135deg, #6c7884 50%, transparent 50%);
    background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 28px;
}

.result-stack {
    display: grid;
    gap: 16px;
    padding: 0;
}

.stack-cycle-group {
    display: grid;
    gap: 12px;
}

.stack-cycle-title {
    margin: 0;
    color: #29405a;
    font-size: 18px;
}

.stack-settlement-card {
    border: 1px solid #d8dee4;
    border-radius: 4px;
    background: #fff;
    overflow: hidden;
}

.stack-settlement-card .settlement-meta {
    margin: 0;
    padding: 12px 14px;
    border-bottom: 1px solid #e7edf1;
}

.stack-settlement-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: auto;
}

.muted {
    color: #7f8c96;
    margin-top: -8px;
}

.holiday-panel {
    display: grid;
    gap: 4px;
    padding-top: 6px;
    padding-bottom: 6px;
}

.holiday-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

#holiday-month-label {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    text-align: center;
    font-size: 13px;
    line-height: 1.2;
}

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

.holiday-weekday,
.holiday-day {
    border-radius: 5px;
    border: 1px solid #d9e0e6;
    background: #fff;
    box-sizing: border-box;
    padding: 1px 2px;
    height: 22px;
    min-height: 22px;
}

.holiday-weekday {
    height: 20px;
    min-height: 20px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    background: #f3f7fa;
    padding: 3px 2px;
}

.holiday-day.empty {
    background: #f8fafc;
    border-style: dashed;
}

.holiday-day-number {
    font-size: 12px;
    font-weight: 700;
    color: #31414f;
    margin-bottom: 0;
}

.holiday-day.holiday-active {
    background: #fff8df;
    border-color: #e4d18b;
}

.holiday-day.today {
    box-shadow: inset 0 0 0 1px #3f98bf;
}

.holiday-badges {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 5px;
}

.holiday-badge {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    padding: 0;
    background: #c9b15f;
    color: transparent;
    overflow: hidden;
    font-size: 0;
}

.holiday-form-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.holiday-active-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.holiday-actions {
    display: flex;
    justify-content: flex-end;
}

.context-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.context-tab {
    border: 1px solid #cfd6dc;
    background: #f4f6f8;
    color: #3c4650;
    border-radius: 3px;
    padding: 9px 12px;
    cursor: pointer;
    font-weight: 600;
}

.context-tab.active {
    background: #29405a;
    border-color: #29405a;
    color: white;
}

.settlement-meta {
    display: flex;
    gap: 24px;
    align-items: center;
    background: #f5f7f8;
    border: 1px solid #d8dee4;
    padding: 10px 12px;
    margin-bottom: 10px;
}

.spreadsheet {
    overflow: auto;
    max-height: calc(100vh - 190px);
    border: 1px solid #111;
    background: white;
}

.sheet-zoom-controls {
    display: inline-flex;
    align-items: center;
    gap: 0;
    margin-left: auto;
    border: 1px solid #b8c5d1;
    border-radius: 4px;
    overflow: hidden;
    background: white;
    flex-shrink: 0;
}

.sheet-zoom-controls button {
    height: 30px;
    border: 0;
    border-right: 1px solid #d6dee6;
    background: white;
    color: #29405a;
    cursor: pointer;
    font-weight: 700;
}

.sheet-zoom-controls button:last-child {
    border-right: 0;
}

.sheet-zoom-controls button:hover {
    background: #edf4f8;
}

.sheet-zoom-btn {
    width: 34px;
    font-size: 18px;
}

.sheet-zoom-value {
    min-width: 58px;
    padding: 0 8px;
    font-size: 12px;
}

body.sheet-fullscreen-open {
    overflow: hidden;
}

.sheet-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    z-index: 3000 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    display: flex !important;
    flex-direction: column;
    background: white;
}

.sheet-fullscreen > .panel-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.sheet-fullscreen .spreadsheet {
    flex: 1;
    min-height: 0;
    max-height: none;
}

.sheet-fullscreen .settlement-meta {
    flex-shrink: 0;
    flex-wrap: nowrap;
    gap: 8px;
    min-height: 40px;
    margin: 0;
    padding: 5px 8px;
    font-size: 12px;
    border-width: 0 0 1px;
}

.sheet-fullscreen .settlement-meta > span {
    display: none;
}

.sheet-fullscreen .settlement-meta > strong {
    flex: 1;
    min-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sheet-fullscreen > .panel-title,
.sheet-fullscreen#liquidation-sheet-panel .toolbar {
    display: none;
}

.sheet-fullscreen > .panel-body {
    padding: 0;
}

.sheet-fullscreen .btn.small-btn {
    min-height: 28px;
    padding: 4px 9px;
    font-size: 12px;
}

.fullscreen-only {
    display: none;
}

.sheet-fullscreen .fullscreen-only {
    display: inline-flex;
}

.sheet-table {
    border-top: 1px solid #111;
    border-left: 1px solid #111;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
    zoom: var(--sheet-zoom, 1);
    min-width: 1480px;
    width: max-content;
}

.sheet-table th,
.sheet-table td {
    border-right: 1px solid #111;
    border-bottom: 1px solid #111;
    height: 24px;
    padding: 2px 4px;
    text-align: center;
    white-space: nowrap;
}

.sheet-table th {
    background: #bdd7ee;
    font-weight: 800;
}

.sheet-table .fixed {
    position: sticky;
    left: 0;
    z-index: 4;
    background: #f2f2f2;
    text-align: left;
    min-width: 225px;
    max-width: 225px;
    border-left: 1px solid #111;
    box-shadow: inset -1px 0 #111;
}

.sheet-table .units {
    position: sticky;
    left: 225px;
    z-index: 4;
    min-width: 82px;
    background: #9dc3e6;
    font-weight: 700;
    box-shadow: inset -1px 0 #111;
}

.sheet-table .rate {
    position: sticky;
    left: 307px;
    z-index: 4;
    min-width: 54px;
    background: #d9d9d9;
    box-shadow: inset -1px 0 #111;
}

.sheet-table .total {
    position: sticky;
    left: 361px;
    z-index: 4;
    min-width: 78px;
    background: #d9d9d9;
    font-weight: 700;
    box-shadow: inset -1px 0 #111;
}

.sheet-table thead .fixed,
.sheet-table thead .units,
.sheet-table thead .rate,
.sheet-table thead .total {
    z-index: 7;
}

/* Mantiene visibles Fecha, Dia y Estado durante el desplazamiento vertical. */
.sheet-table thead {
    position: sticky;
    top: 0;
    z-index: 8;
    box-shadow: 0 -24px 0 24px #fff;
}

.sheet-table thead tr:first-child > th {
    height: 82px;
    box-sizing: border-box;
}

.sheet-table thead tr:nth-child(2) > th {
    height: 34px;
    box-sizing: border-box;
}

.sheet-table thead tr.status-row > th {
    height: 95px;
    box-sizing: border-box;
    background: #bdd7ee;
    border-bottom: 2px solid #111;
}

.sheet-table thead tr > .fixed,
.sheet-table thead tr > .units,
.sheet-table thead tr > .rate,
.sheet-table thead tr > .total,
.sheet-table thead tr.status-row > .fixed,
.sheet-table thead tr.status-row > .units,
.sheet-table thead tr.status-row > .rate,
.sheet-table thead tr.status-row > .total {
    z-index: 10;
}

.sheet-table .date-head,
.sheet-table .status-head {
    width: 58px;
    min-width: 58px;
    max-width: 58px;
    box-sizing: border-box;
    background: #bdd7ee;
    font-weight: 800;
    font-family: "Segoe UI", Calibri, sans-serif;
    font-size: 11px;
    letter-spacing: .15px;
    overflow: hidden;
}

.sheet-table .vertical-label,
.sheet-table .status-input {
    display: inline-block;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-family: "Segoe UI", Calibri, sans-serif;
}

.sheet-table th:nth-child(n+5),
.sheet-table td:nth-child(n+5) {
    width: 58px;
    min-width: 58px;
    max-width: 58px;
    box-sizing: border-box;
}

.worker-heading span,
.worker-heading small {
    display: block;
}

.worker-heading small {
    margin-top: 5px;
    font-size: 10px;
    font-weight: 600;
}

.sheet-table .date-head { height: 82px; }
.sheet-table .status-head { height: 90px; }

.sheet-table .holiday-head,
.sheet-table .holiday-cell {
    background: #fff6dc;
}

.sheet-table .weekend-head,
.sheet-table .weekend-cell {
    background: #fff6dc;
}

.sheet-table thead tr.status-row > th.holiday-head,
.sheet-table thead tr.status-row > th.weekend-head {
    background: #fff6dc;
}

.sheet-table thead tr.status-row > th.missing-status-head {
    background: #f8cccc;
}

.sheet-table .missing-status-head,
.sheet-table .missing-status-cell {
    background: #f8cccc;
}

.sheet-table .blue { background: #bdd7ee; }

.sheet-table .section {
    background: #e6e6e6 !important;
    font-weight: 800;
    text-align: left;
}

.sheet-table .total-row td {
    background: #d9d9d9;
    font-weight: 800;
}

.sheet-table .summary-label {
    background: #efefef;
    font-weight: 800;
    text-align: left;
}

.sheet-table input.cell-input,
.sheet-table input.rate-input {
    width: 100%;
    max-width: 100%;
    height: 20px;
    box-sizing: border-box;
    padding: 0 2px;
    border: 1px solid #3f98bf;
    text-align: center;
    font-size: 12px;
}

.hidden { display: none !important; }

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: grid;
    place-items: center;
    z-index: 999;
}

.modal-box {
    background: white;
    width: 430px;
    padding: 22px;
    border-radius: 4px;
    box-shadow: 0 14px 45px rgba(0,0,0,.35);
}

.modal-box.wide {
    width: 640px;
}

.modal-box.extra-wide {
    width: min(1320px, 97vw);
}

#user-password-modal .modal-box {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: min(520px, 92vw);
    max-height: 90vh;
    overflow-y: auto;
}

#user-password-modal h2,
#user-password-modal p {
    margin: 0;
}

#user-password-modal .form-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

#user-password-modal .form-grid label,
#user-password-modal .form-grid input,
#user-password-modal .form-grid select {
    width: 100%;
    box-sizing: border-box;
}

#user-password-modal .actions {
    margin-top: 2px;
    align-items: center;
}

.user-password-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid #d8e0e6;
}

.user-password-section h3 {
    margin: 0;
}

.user-password-section > .btn {
    align-self: flex-start;
}

.user-edit-actions .action-spacer {
    flex: 1;
}

.btn.danger {
    background: #c94b4b;
    color: #fff;
}

.btn.danger:hover {
    background: #ae3939;
}

.audit-filter {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 20px;
}

.audit-filter label {
    width: 220px;
    margin-bottom: 0;
}

.audit-filter input {
    width: 100%;
    height: 40px;
    box-sizing: border-box;
}

.audit-filter > .btn {
    height: 40px;
    box-sizing: border-box;
    align-self: flex-end;
}

.audit-table th:nth-child(1) { width: 260px; }
.audit-table th:nth-child(2) { width: 180px; }
.audit-table th:nth-child(1),
.audit-table td:nth-child(1) {
    white-space: nowrap;
}

.status-modal-box {
    width: min(460px, 92vw);
    text-align: center;
}

.status-spinner {
    width: 34px;
    height: 34px;
    margin: 0 auto 14px;
    border: 4px solid #d9e7ef;
    border-top-color: #3f98bf;
    border-radius: 50%;
    animation: status-spin 0.8s linear infinite;
}

.status-spinner.hidden {
    display: none !important;
}

@keyframes status-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.editable-liquidation-modal {
    height: min(92vh, 880px);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
}

.modal-title-row .btn {
    margin-left: auto;
}

.modal-title-row h2 {
    margin: 0;
}

.editable-liquidation-modal .settlement-meta {
    flex-shrink: 0;
}

#search-edit-spreadsheet {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

#search-edit-spreadsheet .sheet-table {
    min-width: max-content;
}

#search-edit-spreadsheet .sheet-table th,
#search-edit-spreadsheet .sheet-table td {
    padding: 2px 3px;
}

#search-edit-spreadsheet .sheet-table .fixed {
    min-width: 205px;
    max-width: 205px;
}

#search-edit-spreadsheet .sheet-table .units {
    left: 205px;
    min-width: 68px;
    max-width: 68px;
}

#search-edit-spreadsheet .sheet-table .rate {
    left: 273px;
    min-width: 48px;
    max-width: 48px;
}

#search-edit-spreadsheet .sheet-table .total {
    left: 321px;
    min-width: 70px;
    max-width: 70px;
}

#search-edit-spreadsheet .sheet-table th:nth-child(n+5),
#search-edit-spreadsheet .sheet-table td:nth-child(n+5) {
    min-width: 58px;
    max-width: 58px;
    width: 58px;
}

#search-edit-spreadsheet .sheet-table .date-head,
#search-edit-spreadsheet .sheet-table .status-head {
    min-width: 58px;
}

#search-edit-spreadsheet .sheet-table input.cell-input {
    width: 48px;
    min-width: 48px;
}

.editable-liquidation-modal .actions {
    flex-shrink: 0;
    justify-content: flex-end;
    background: white;
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px solid #e5edf2;
}

.worker-modal-box {
    width: min(560px, 94vw);
}

.worker-form-grid {
    grid-template-columns: 1.5fr 1fr;
}

.rate-form-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
}

.modal .add-activity-modal-box {
    width: min(760px, 94vw);
    min-width: min(680px, 94vw);
    height: min(90vh, 900px);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.add-activity-title-row {
    flex-shrink: 0;
}

.add-activity-title-row .actions {
    margin-left: auto;
    justify-content: flex-end;
}

.add-activity-form-grid {
    flex-shrink: 0;
    grid-template-columns: 1fr 1fr;
}

.add-activity-modal-box .table-wrap {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid #d8dee4;
    border-radius: 4px;
    margin-top: 12px;
}

.add-activity-modal-box table {
    width: 100%;
    table-layout: fixed;
}

.add-activity-modal-box th,
.add-activity-modal-box td {
    padding: 8px 14px;
    vertical-align: middle;
}

.add-activity-modal-box th:nth-child(1),
.add-activity-modal-box td:nth-child(1) {
    width: 38%;
}

.add-activity-modal-box th:nth-child(2),
.add-activity-modal-box td:nth-child(2) {
    width: 15%;
}

.add-activity-modal-box th:nth-child(3),
.add-activity-modal-box td:nth-child(3),
.add-activity-modal-box th:nth-child(4),
.add-activity-modal-box td:nth-child(4) {
    width: 15%;
}

.add-activity-modal-box th:nth-child(5),
.add-activity-modal-box td:nth-child(5) {
    width: 17%;
    text-align: right;
}

.add-activity-row.selected {
    background: #d8edf7;
    outline: 2px solid #3f98bf;
    outline-offset: -2px;
}

.add-activity-row {
    cursor: pointer;
}

.add-activity-select-btn.selected {
    background: #3f98bf;
    border-color: #3f98bf;
    color: #fff;
}

.adjustment-form-grid.compact {
    grid-template-columns: 1.1fr 1fr 1fr 0.7fr 0.7fr 1.2fr;
    gap: 10px;
}

.adjustment-form-grid.compact label {
    min-width: 0;
}

.adjustment-form-grid.compact input,
.adjustment-form-grid.compact select {
    width: 100%;
}

.adjustment-layout {
    display: block;
    margin-top: 18px;
}

.radio-group {
    display: grid;
    gap: 10px;
    margin: 16px 0;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.rate-readonly {
    color: #7f8c96;
    font-style: italic;
}

footer {
    height: 48px;
    background: white;
    color: #9aa0a6;
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid #d8dee4;
    font-size: 13px;
}

@media (max-width: 1000px) {
    .grid.two,
    .search-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

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

    .sidebar {
        display: none;
    }
}
