:root {
    --bg: #080808;
    --panel: #111;
    --line: #242424;
    --pistache: #a8c686;
    --text: #f7f7f2;
    --muted: #a3a3a3;
    --danger: #dc2626;
}

* { box-sizing: border-box; }

button,
input,
select,
textarea {
    max-width: 100%;
}

button {
    line-height: 1.2;
    min-width: 0;
    overflow-wrap: anywhere;
    text-align: center;
    white-space: normal;
}

.logo,
h1,
h2,
h3,
h4,
p,
label,
.header-actions span {
    overflow-wrap: anywhere;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: "Poppins", sans-serif;
    margin: 0;
}

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

.login-overlay {
    align-items: center;
    background: radial-gradient(circle at top, rgba(168,198,134,.16), #050505 52%);
    display: flex;
    inset: 0;
    justify-content: center;
    min-height: 100vh;
    padding: 22px;
    position: fixed;
    z-index: 20;
}

.login-box {
    background: #101010;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 18px 60px rgba(0,0,0,.45);
    max-width: 380px;
    padding: 26px;
    width: 100%;
}

.logo {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: .08em;
}

.logo span { color: var(--pistache); }

.login-box input,
.dato-input {
    background: #050505;
    border: 1px solid #2d2d2d;
    border-radius: 9px;
    color: #fff;
    margin: 6px 0 12px;
    padding: 11px 12px;
    width: 100%;
}

.login-box button,
.btn-save {
    background: var(--pistache);
    border: 0;
    border-radius: 9px;
    color: #111;
    cursor: pointer;
    font-weight: 800;
    padding: 12px 16px;
}

.login-error {
    color: #fca5a5;
    min-height: 20px;
}

.main-wrapper {
    min-height: 100vh;
    padding: 18px;
}

.worker-header {
    align-items: center;
    background: #101010;
    border: 1px solid var(--line);
    border-radius: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    justify-content: space-between;
    margin-bottom: 18px;
    padding: 16px;
}

.worker-header > div {
    min-width: 0;
}

.worker-header > div:first-child {
    flex: 1 1 220px;
}

#worker-user-tag {
    color: var(--muted);
    margin: 4px 0 0;
}

.worker-supervision-notice {
    background: rgba(168, 198, 134, .12);
    border: 1px solid rgba(168, 198, 134, .35);
    border-radius: 9px;
    color: #e8f5d9;
    font-size: .78rem;
    line-height: 1.45;
    margin: 10px 0 0;
    max-width: 700px;
    padding: 8px 10px;
}

.worker-supervision-notice.is-error {
    background: rgba(127, 29, 29, .35);
    border-color: rgba(248, 113, 113, .55);
    color: #fee2e2;
}

body.is-supervision-mode #btn-logout,
body.is-supervision-mode .worker-card-actions {
    display: none !important;
}

.header-actions {
    align-items: center;
    display: flex;
    flex: 0 1 auto;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    min-width: 0;
}

.header-actions span {
    background: rgba(168,198,134,.1);
    border: 1px solid rgba(168,198,134,.22);
    border-radius: 999px;
    color: #dce9cf;
    font-size: .86rem;
    font-weight: 700;
    padding: 7px 10px;
}

.header-actions button,
.btn-cancel {
    background: transparent;
    border: 1px solid #ef4444;
    border-radius: 9px;
    color: #fecaca;
    cursor: pointer;
    padding: 10px 14px;
}

#btn-logout {
    background: rgba(127, 29, 29, .28);
    border-color: rgba(239, 68, 68, .68);
    border-radius: 999px;
    color: #fecaca;
    font-size: .86rem;
    font-weight: 700;
    padding: 7px 10px;
}

#btn-logout:hover,
#btn-logout:focus-visible {
    background: rgba(153, 27, 27, .48);
    border-color: #ef4444;
    color: #fff1f2;
    outline: none;
}

.worker-board {
    align-items: start;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(5, max-content);
    grid-template-rows: auto;
    min-height: 0;
    overflow-x: auto;
    overflow-y: visible;
    padding-bottom: 0;
}

.worker-stack {
    align-self: start;
    background: #090909;
    border: 1px solid var(--line);
    border-radius: 14px;
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 9px;
    min-width: 275px;
    overflow: hidden;
    padding: 8px;
    width: clamp(275px, 26.5vw, 370px);
}

.worker-stack.is-collapsed {
    align-self: start;
    flex: 0 0 48px;
    max-width: 48px;
    min-width: 48px;
    padding: 8px 5px;
    width: 48px;
}

.worker-stack.is-collapsed .worker-stack-toggle {
    flex-direction: column;
    min-height: 142px;
    padding: 8px 5px;
}

.worker-stack.is-collapsed .worker-stack-toggle span:first-child {
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    transform: rotate(180deg);
    writing-mode: vertical-rl;
}

.worker-stack.is-collapsed .worker-stack-count {
    margin: 0;
    min-width: 24px;
    padding: 2px 5px;
}

.worker-lane-title {
    color: var(--pistache);
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.worker-stack-toggle,
.worker-col-toggle {
    align-items: center;
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    display: flex;
    font: inherit;
    font-weight: inherit;
    gap: 8px;
    justify-content: space-between;
    padding: 6px;
    text-align: left;
    width: 100%;
}

.worker-stack-toggle:hover,
.worker-stack-toggle:focus-visible,
.worker-col-toggle:hover,
.worker-col-toggle:focus-visible {
    color: #dce9cf;
    outline: none;
}

.worker-stack-count,
.column-count {
    align-items: center;
    background: rgba(168,198,134,.12);
    border: 1px solid rgba(168,198,134,.28);
    border-radius: 999px;
    color: #dce9cf;
    display: inline-flex;
    font-size: .7rem;
    justify-content: center;
    margin-left: auto;
    min-width: 24px;
    padding: 2px 7px;
}

.worker-stack-count.has-items,
.column-count.has-items {
    background: #1f5c3a;
    border-color: #347a52;
    box-shadow: 0 0 0 2px rgba(52, 122, 82, .16);
    color: #f2fff7;
}

.worker-col[data-estado="Sin pagar"] .column-count.has-items {
    background: #671f28;
    border-color: #9f3542;
    box-shadow: 0 0 0 2px rgba(159, 53, 66, .18);
    color: #fff4f5;
}

.worker-stack[aria-label="Pagos"] .worker-stack-count.payment-negative {
    background: #671f28;
    border-color: #9f3542;
    box-shadow: 0 0 0 2px rgba(159, 53, 66, .18);
    color: #fff4f5;
}

.worker-stack[aria-label="Pagos"] .worker-stack-count.payment-warning {
    background: #765019;
    border-color: #b27a2b;
    box-shadow: 0 0 0 2px rgba(178, 122, 43, .2);
    color: #fff7df;
}

.worker-collapse-icon,
.worker-col-collapse-icon {
    display: inline-flex;
    flex: 0 0 12px;
    height: 12px;
    justify-content: center;
    position: relative;
    width: 12px;
}

.worker-collapse-icon::before,
.worker-col-collapse-icon::before {
    border: solid currentColor;
    border-width: 0 2px 2px 0;
    content: "";
    display: inline-block;
    height: 6px;
    position: absolute;
    top: 2px;
    transform: rotate(-135deg);
    transition: transform .18s ease;
    width: 6px;
}

.worker-col-collapse-icon::before {
    transform: rotate(135deg);
}

.worker-stack.is-collapsed .worker-collapse-icon::before {
    transform: rotate(45deg);
}

.worker-col.is-collapsed .worker-col-collapse-icon::before {
    transform: rotate(-45deg);
}

.worker-stack-body {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 9px;
    min-height: 0;
}

.worker-stack.is-collapsed .worker-stack-body {
    display: none;
}

.worker-col {
    background: #101010;
    border: 1px solid var(--line);
    border-radius: 12px;
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    height: auto;
    max-width: none;
    min-height: 0;
    min-width: 0;
    padding: 0;
}

.worker-col h3 {
    align-items: center;
    border-bottom: 1px solid #1a1a1a;
    color: var(--pistache);
    display: flex;
    gap: 8px;
    font-size: .98rem;
    justify-content: space-between;
    margin: 0;
    padding: 0;
}

.worker-col .worker-col-toggle {
    padding: 8px 10px;
}

.worker-col.is-collapsed {
    align-self: stretch;
    flex: 0 0 auto;
    max-width: none;
    min-width: 0;
    padding: 0;
    width: 100%;
}

.worker-col.is-collapsed .container {
    display: none;
}

.worker-col.is-collapsed h3 {
    border-bottom: 0;
    margin: 0;
}

.worker-col.is-collapsed .worker-col-toggle {
    flex-direction: row;
    min-height: 0;
    padding: 6px;
}

.worker-col.is-collapsed .worker-col-toggle span:first-child {
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    transform: none;
    white-space: nowrap;
    writing-mode: horizontal-tb;
}

.worker-col.is-collapsed .column-count {
    margin-left: auto;
    min-width: 24px;
    padding: 2px 7px;
}

.container {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 6px;
    min-height: 58px;
    overflow-y: visible;
    padding: 6px;
}

.worker-card {
    background: #f7f7f2;
    border-left: 6px solid var(--pistache);
    border-radius: 12px;
    color: #111;
    margin-bottom: 10px;
    overflow: hidden;
    padding: 13px;
    position: relative;
    box-shadow: 0 8px 22px rgba(0,0,0,.28);
}

.worker-card h4 {
    font-size: 1rem;
    margin: 9px 0;
}

.worker-card p {
    font-size: .84rem;
    margin: 5px 0;
}

.card-badge-row {
    align-items: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
    margin: 22px 0 7px;
}

.card-event-pill,
.card-countdown,
.card-model-line,
.card-mini-line,
.card-chip-row span {
    border-radius: 7px;
    font-weight: 800;
}

.card-event-pill {
    background: rgba(255,255,255,.58);
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 12px 7px 7px 7px;
    display: inline-flex;
    font-size: .72rem;
    left: 0;
    line-height: 1.2;
    max-width: 48%;
    overflow: hidden;
    padding: 5px 8px;
    position: absolute;
    text-overflow: ellipsis;
    top: 0;
    text-transform: uppercase;
    white-space: nowrap;
}

.worker-card > .delivery-badge {
    border-radius: 7px 12px 7px 7px;
    margin: 0;
    max-width: 48%;
    overflow: hidden;
    position: absolute;
    right: 0;
    text-overflow: ellipsis;
    top: 0;
    white-space: nowrap;
}

.card-countdown {
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(0,0,0,.12);
    color: #1f2937;
    font-size: .66rem;
    line-height: 1.2;
    margin-left: 0;
    max-width: 52%;
    padding: 4px 7px;
    text-align: right;
}

.card-countdown.priority-alta,
.delivery-badge.priority-alta {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
}

.card-countdown.priority-media,
.delivery-badge.priority-media {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}

.card-model-line {
    align-items: center;
    background: rgba(255,255,255,.55);
    border: 1px solid rgba(0,0,0,.11);
    color: #1f2937;
    display: flex;
    font-size: .74rem;
    gap: 6px;
    justify-content: space-between;
    line-height: 1.25;
    margin: 0 0 5px;
    padding: 5px 6px;
}

.card-model-line span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-total-pill {
    background: rgba(17,24,39,.9);
    border-radius: 999px;
    color: #fff;
    flex: 0 0 auto;
    font-size: .7rem;
    padding: 3px 7px;
}

.card-mini-line {
    align-items: center;
    color: rgba(17,24,39,.72);
    display: flex;
    font-size: .62rem;
    gap: 6px;
    justify-content: space-between;
    line-height: 1.16;
    margin: 3px 0;
    text-transform: uppercase;
}

.card-mini-line strong {
    color: #111;
    font-size: .64rem;
}

.card-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 6px 0 0;
}

.card-chip-row span {
    border: 1px solid rgba(0,0,0,.12);
    font-size: .61rem;
    padding: 3px 6px;
}

.chip-form { background: #dbeafe; color: #1e3a8a; }
.chip-origin { background: #ede9fe; color: #4c1d95; }
.chip-pay { background: #ffedd5; color: #9a3412; }
.chip-change { background: #fce7f3; color: #9d174d; }
.chip-urgent { background: #fee2e2; color: #991b1b; }

.worker-card-actions {
    display: grid;
    gap: 6px;
    grid-template-columns: 1fr;
    margin-top: 8px;
}

.worker-card-actions button {
    margin-top: 0;
}

.delivery-badge,
.urgent-banner {
    background: #1f2937;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #fff;
    display: inline-flex;
    font-size: .72rem;
    font-weight: 800;
    margin-bottom: 8px;
    padding: 5px 8px;
}

.worker-card.card-boda,
.worker-card.card-xv,
.worker-card.card-xvanos {
    background: linear-gradient(180deg, #fff2bc 0%, #ffe28c 100%);
    border-left-color: #d79716;
}

.worker-card.card-babyshower {
    background: linear-gradient(180deg, #ffe1ec 0%, #ffc0d6 100%);
    border-left-color: #d9467f;
}

.worker-card.card-cumpleanos {
    background: linear-gradient(180deg, #e7f7d9 0%, #cbe9b1 100%);
    border-left-color: #5f9f36;
}

.worker-card.card-bautizo {
    background: linear-gradient(180deg, #ffdced 0%, #ffb5d7 100%);
    border-left-color: #db4d91;
}

.worker-card.card-graduacion {
    background: linear-gradient(180deg, #e3d2cc 0%, #c3aaa1 100%);
    border-left-color: #7c5648;
}

.worker-card.card-invitacionescorporativas {
    background: linear-gradient(180deg, #eef3f5 0%, #d3dde2 100%);
    border-left-color: #607d8b;
}

.worker-card.card-savethedateinteractivo {
    background: linear-gradient(180deg, #ffefd6 0%, #ffd08f 100%);
    border-left-color: #c57919;
}

.worker-card.card-dedicatoriasdigitales {
    background: linear-gradient(180deg, #ffe2ed 0%, #f8bfd3 100%);
    border-left-color: #c43c75;
}

.urgent-banner {
    background: #fee2e2;
    border: 1px solid #ef4444;
    color: #991b1b;
    display: block;
}

.card-owner-row {
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr 1fr;
    margin: 4px 0 10px;
}

.card-owner-row div,
.meta span,
.payment-mini {
    background: rgba(0,0,0,.08);
    border: 1px solid rgba(0,0,0,.11);
    border-radius: 8px;
    padding: 7px 8px;
}

.card-owner-row span {
    display: block;
    font-size: .63rem;
    font-weight: 800;
    text-transform: uppercase;
}

.card-owner-row strong {
    display: block;
    font-size: .8rem;
    overflow-wrap: anywhere;
}

.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}

.meta span {
    font-size: .72rem;
    font-weight: 700;
}

.payment-mini {
    display: grid;
    font-size: .78rem;
    gap: 3px;
    margin: 9px 0;
}

.btn-edit {
    background: #111;
    border: 0;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    font-size: .82rem;
    font-weight: 700;
    margin-top: 8px;
    padding: 7px 10px;
    width: 100%;
}

.card-urgent-delivery {
    box-shadow: inset 0 0 0 2px rgba(239,68,68,.5), 0 8px 20px rgba(127,29,29,.24);
}

.card-details {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}

.card-details[hidden] {
    display: none;
}

.dragging {
    opacity: .45;
    transform: scale(.96);
}

.drag-over {
    background: rgba(168,198,134,.14);
    outline: 2px dashed var(--pistache);
}

.touch-dragging {
    opacity: .7;
    outline: 2px solid var(--pistache);
    outline-offset: 2px;
}

.is-touch-dragging-card {
    user-select: none;
}

.modal {
    align-items: center;
    background: rgba(0,0,0,.9);
    inset: 0;
    justify-content: center;
    padding: 18px;
    position: fixed;
    z-index: 30;
}

.modal-content {
    background: #101010;
    border: 1px solid var(--line);
    border-radius: 14px;
    max-height: 94vh;
    max-width: 520px;
    overflow-y: auto;
    padding: 22px;
    width: 100%;
}

.readonly-summary,
.modal-section {
    background: rgba(168,198,134,.08);
    border: 1px solid rgba(168,198,134,.18);
    border-radius: 11px;
    margin: 12px 0;
    padding: 12px;
}

.worker-data-preview {
    background: rgba(168,198,134,.08);
    border: 1px solid rgba(168,198,134,.18);
    border-radius: 11px;
    margin: 12px 0;
    padding: 12px;
}

.worker-data-head {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-bottom: 8px;
}

.worker-data-head h4 {
    color: var(--pistache);
    font-size: .86rem;
    margin: 0;
}

.worker-data-head button {
    background: #8b5cf6;
    border: 0;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    font-size: .76rem;
    font-weight: 800;
    padding: 7px 10px;
}

.worker-data-text {
    min-height: 240px;
    resize: vertical;
    white-space: pre-wrap;
}

.worker-data-status {
    color: #a8c686;
    font-size: .78rem;
    margin: 6px 0 0;
}

.worker-photo-downloads-head {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: space-between;
    margin-bottom: 10px;
}

.worker-photo-downloads-head strong {
    color: var(--pistache);
    font-size: .88rem;
}

.worker-photo-downloads-head span {
    background: rgba(168, 198, 134, .14);
    border-radius: 999px;
    color: #dce9cf;
    font-size: .72rem;
    font-weight: 800;
    padding: 4px 8px;
    white-space: nowrap;
}

.worker-photo-downloads-empty {
    color: #b8b8b8;
    font-size: .82rem;
    margin: 0;
}

.worker-photo-downloads-actions {
    display: flex;
    margin-bottom: 10px;
}

.worker-photo-downloads-actions button,
.worker-photo-download-card button {
    background: #4ade80;
    border: 0;
    border-radius: 8px;
    color: #07120a;
    cursor: pointer;
    font: inherit;
    font-size: .76rem;
    font-weight: 900;
    padding: 8px 10px;
}

.worker-photo-downloads-actions button:disabled,
.worker-photo-download-card button:disabled {
    cursor: wait;
    opacity: .65;
}

.worker-photo-download-grid {
    display: grid;
    gap: 9px;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
}

.worker-photo-download-card {
    background: #121212;
    border: 1px solid #2b2b2b;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: hidden;
    padding: 8px;
}

.worker-photo-download-card img {
    aspect-ratio: 1 / 1;
    background: #090909;
    border-radius: 7px;
    object-fit: cover;
    width: 100%;
}

.worker-photo-download-card.is-horizontal-client-photo {
    grid-column: 1 / -1;
}

.worker-photo-download-card.is-horizontal-client-photo img {
    aspect-ratio: 16 / 9;
}

.worker-photo-download-card strong,
.worker-photo-download-card small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.worker-photo-download-card strong {
    color: #f4f8ee;
    font-size: .78rem;
}

.worker-photo-download-card small {
    color: #a8a8a8;
    font-size: .7rem;
    margin-top: 3px;
}

.modal-section h4 {
    color: var(--pistache);
    margin: 0 0 10px;
}

.locked-note {
    color: #fca5a5;
    font-size: .82rem;
}

.modal-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.modal-btns button {
    flex: 1 1 150px;
}

@media (min-width: 761px) {
    body {
        overflow-x: hidden;
        overflow-y: auto;
    }

    .main-wrapper {
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: 100dvh;
        overflow: visible;
        padding: 12px;
    }

    .worker-header {
        flex: 0 0 auto;
        margin-bottom: 12px;
    }

    .worker-board {
        flex: 0 0 auto;
        height: auto;
    }

}

@media (max-width: 760px) {
    .worker-header {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .header-actions span,
    .header-actions button {
        flex: 1 1 100%;
        width: 100%;
    }

    .worker-board {
        grid-template-columns: repeat(5, max-content);
        height: auto;
        overflow-y: visible;
        padding-bottom: 12px;
    }

    .worker-stack {
        min-width: 230px;
        width: 82vw;
    }

    .worker-col .container {
        min-height: 65vh;
    }
}
