:root { 
    --pistache: #A8C686; 
    --pistache-dark: #8fb06b;
    --dark: #000000; 
    --border: #222222;
    --text-muted: #aaaaaa;
    --shadow: 0 8px 30px rgba(0,0,0,0.6);
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Poppins', sans-serif; 
}

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

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

h1,
h2,
h3,
h4,
p,
label,
.logo,
.counter,
.nav-item,
.card-cliente,
.card-date,
.card-vendedor,
.sidebar-toggle-text,
.panel-toggle-text {
    overflow-wrap: anywhere;
}

body { 
    background: #000000; 
    color: #fff; 
    height: 100vh; 
    height: 100dvh;
    overflow: hidden; 
}

/* LOGIN */
.login-overlay { 
    position: fixed; inset: 0; background: #000; 
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
    z-index: 100000; 
}

.login-box { 
    background: #0a0a0a; padding: 40px; border-radius: 30px; 
    text-align: center; width: min(350px, 100%); border: 1px solid #222;
    box-shadow: var(--shadow);
    margin: auto;
}

.login-box input,
.login-box button {
    display: block;
    width: 100%;
    min-height: 48px;
    border-radius: 12px;
    font-size: 16px;
}

.login-box input {
    background: #111;
    border: 1px solid #333;
    color: #fff;
    margin-top: 12px;
    padding: 0 14px;
}

.login-box input:focus {
    border-color: var(--pistache);
    box-shadow: 0 0 0 3px rgba(168, 198, 134, .18);
    outline: none;
}

.login-box button {
    background: var(--pistache);
    border: 0;
    color: #071006;
    cursor: pointer;
    font-weight: 800;
    margin-top: 16px;
    padding: 0 16px;
    touch-action: manipulation;
}

.login-box button:disabled {
    cursor: wait;
    opacity: .7;
}

@media (max-width: 480px), (max-height: 560px) {
    .login-overlay {
        align-items: flex-start;
        justify-content: center;
    }

    .login-box {
        border-radius: 22px;
        padding: 28px 20px;
    }
}

/* ESTRUCTURA */
.main-wrapper { 
    display: flex; 
    flex-direction: column; 
    height: 100vh; 
    position: relative;
    padding-left: 60px;
}

.sidebar { 
    width: 100%; 
    background: #050505; 
    padding: 16px 20px; 
    border-bottom: 1px solid #222; 
    z-index: 20;
}

@media (min-width: 769px) {
    .main-wrapper { flex-direction: row; }
    .sidebar { 
        width: 240px; 
        border-bottom: none; 
        border-right: 1px solid #222; 
        padding: 20px;
    }
}

/* BARRA SUPERIOR */
#monthly-summary {
    padding: 12px 20px;
    background: #111111;
    border-bottom: 1px solid #222;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    min-width: 0;
}

#monthly-summary h3 {
    color: #A8C686;
    margin: 0;
    font-size: 1.1rem;
}

/* TABLERO - Más compacto y mejor uso del espacio */
.Pistacho-board { 
    display: flex; 
    gap: 10px; 
    padding: 10px; 
    overflow-x: auto; 
    height: calc(100vh - 185px); 
    background: #000000;
    flex: 1;
    scroll-behavior: smooth;
}

/* Columnas más anchas y compactas */
.Pistacho-col { 
    background: #0a0a0a; 
    min-width: 260px; 
    max-width: 280px;
    border-radius: 16px; 
    border: 1px solid #222; 
    display: flex; 
    flex-direction: column; 
    height: 100%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.Pistacho-col h3 { 
    padding: 12px 16px; 
    font-size: 0.8rem; 
    color: #aaaaaa; 
    text-transform: uppercase; 
    border-bottom: 1px solid #111;
    margin: 0;
}

/* Contenedor de tarjetas más compacto */
.container { 
    padding: 8px; 
    flex: 1; 
    overflow-y: auto; 
    gap: 8px;
    display: flex;
    flex-direction: column;
}

/* Tarjetas más compactas */
.Pistacho-card { 
    --card-panel-bg: rgba(65, 44, 10, 0.10);
    --card-panel-strong-bg: rgba(65, 44, 10, 0.14);
    --card-panel-border: rgba(76, 53, 16, 0.22);
    --card-panel-border-strong: rgba(76, 53, 16, 0.32);
    --card-panel-text: #231706;
    --card-panel-muted: #725315;
    --card-accent: #8b5e10;
    border-radius: 14px; 
    position: relative;
    padding: 14px; 
    margin-bottom: 10px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    color: #111111;
    font-size: 0.93rem;
}

.card-compact-top {
    align-items: flex-start;
    display: flex;
    gap: 8px;
    justify-content: space-between;
    margin: 2px 0 6px;
}

.card-event-pill,
.card-countdown,
.card-model-line,
.card-mini-line,
.card-color-row,
.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);
    font-size: .66rem;
    padding: 4px 7px;
    text-transform: uppercase;
}

.card-top-actions {
    align-items: flex-start;
    display: flex;
    flex: 0 1 62%;
    gap: 5px;
    justify-content: flex-end;
    min-width: 0;
}

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

.card-delete-quick {
    align-items: center;
    background: #fee2e2;
    border: 1px solid #ef4444;
    border-radius: 999px;
    color: #991b1b;
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: .7rem;
    font-weight: 900;
    height: 24px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    width: 24px;
}

.card-delete-quick:hover,
.card-delete-quick:focus-visible {
    background: #fecaca;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, .24);
    outline: none;
}

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

.card-countdown.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-color-row {
    align-items: center;
    color: var(--card-panel-muted);
    display: flex;
    font-size: .59rem;
    gap: 6px;
    justify-content: space-between;
    line-height: 1.1;
    margin: -1px 0 4px;
    min-width: 0;
    text-transform: uppercase;
}

.card-color-row > div {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    justify-content: flex-end;
    min-width: 0;
}

.card-color-chip,
.card-color-text {
    align-items: center;
    background: rgba(255,255,255,.45);
    border: 1px solid rgba(0,0,0,.1);
    border-radius: 999px;
    color: var(--card-panel-text);
    display: inline-flex;
    gap: 3px;
    max-width: 92px;
    overflow: hidden;
    padding: 2px 5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-color-copy {
    cursor: pointer;
    font: inherit;
    line-height: 1.1;
}

.card-color-copy:hover,
.card-color-copy:focus-visible {
    background: rgba(168, 198, 134, .28);
    border-color: rgba(0,0,0,.2);
    outline: none;
}

.card-color-copy.is-copied {
    background: rgba(168, 198, 134, .42);
    border-color: rgba(45, 88, 25, .35);
}

.card-color-chip i {
    background: var(--pedido-color, #fff);
    border: 1px solid rgba(0,0,0,.28);
    border-radius: 999px;
    display: inline-block;
    flex: 0 0 auto;
    height: 9px;
    width: 9px;
}

.card-mini-line {
    align-items: center;
    color: var(--card-panel-muted);
    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: var(--card-panel-text);
    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; }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
    font-size: 0.82rem;
}

.card-date { color: #555; font-weight: 500; }
.card-vendedor {
    background: #8957e5;
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.73rem;
    font-weight: 600;
}

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

.card-owner-row div {
    background: var(--card-panel-bg);
    border: 1px solid var(--card-panel-border);
    border-radius: 8px;
    padding: 7px 8px;
}

.card-owner-row span {
    display: block;
    color: var(--card-panel-muted);
    font-size: .66rem;
    font-weight: 800;
    text-transform: uppercase;
}

.card-owner-row strong {
    display: block;
    color: var(--card-panel-text);
    font-size: .83rem;
    overflow-wrap: anywhere;
}

.card-clave {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    background: var(--card-panel-strong-bg);
    border: 1px solid var(--card-panel-border-strong);
    color: var(--card-panel-text);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    word-break: break-word;
}

.card-meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.card-meta-line span {
    background: var(--card-panel-bg);
    border: 1px solid var(--card-panel-border);
    border-radius: 6px;
    color: var(--card-panel-text);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 7px;
}

.card-cliente {
    font-size: 1.12rem;
    font-weight: 700;
    margin: 6px 0 8px 0;
    color: #111;
}

.card-client-copy {
    align-items: center;
    background: transparent;
    border: 0;
    color: inherit;
    cursor: copy;
    display: inline-flex;
    font: inherit;
    font-weight: inherit;
    gap: 6px;
    max-width: 100%;
    padding: 0;
    text-align: left;
}

.card-client-copy::after {
    color: #64748b;
    content: '⧉';
    font-size: .92em;
    line-height: 1;
}

.card-client-copy:hover,
.card-client-copy:focus-visible {
    color: #14532d;
    outline: none;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.card-client-copy.is-copied::after {
    color: #15803d;
    content: '✓';
}

.card-client-copy:disabled {
    cursor: default;
    text-decoration: none;
}

.card-model-summary {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-width: 0;
}

.card-demo-badge {
    align-items: center;
    background: color-mix(in srgb, var(--demo-color) 15%, #fff);
    border: 1px solid color-mix(in srgb, var(--demo-color) 56%, #fff);
    border-radius: 999px;
    color: color-mix(in srgb, var(--demo-color) 82%, #111827);
    display: inline-flex;
    font-weight: 800;
    gap: 4px;
    max-width: 100%;
    overflow: hidden;
    padding: 3px 7px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-demo-badge i {
    background: var(--demo-color);
    border-radius: 999px;
    display: block;
    flex: 0 0 auto;
    height: 7px;
    width: 7px;
}

.card-pass-badge {
    background: #ecfccb;
    border: 1px solid #a3e635;
    border-radius: 999px;
    color: #365314;
    font-size: .59rem;
    font-weight: 900;
    letter-spacing: .02em;
    padding: 3px 6px;
    white-space: nowrap;
}

.card-pass-badge.is-assistant {
    background: #ede9fe;
    border-color: #c4b5fd;
    color: #5b21b6;
}

.card-model-context {
    color: var(--card-panel-muted);
    font-size: .63rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-info {
    font-size: 0.9rem;
    line-height: 1.45;
    margin-bottom: 10px;
    color: #222;
}

.card-operational-extra,
.card-payment-meta {
    display: grid;
    gap: 4px;
    background: rgba(14, 116, 144, 0.12);
    border-left: 3px solid #0e7490;
    border-radius: 6px;
    color: #0d3440;
    font-size: 0.84rem;
    font-weight: 600;
    margin: 8px 0 10px;
    padding: 8px 10px;
}

.card-payment-meta {
    background: rgba(21, 128, 61, 0.13);
    border-left-color: #15803d;
    color: #102114;
    margin: 8px 0 0;
}

.card-payment-meta a {
    color: inherit;
    font-weight: 800;
    text-decoration: underline;
}

.card-worker-mini {
    background: rgba(59, 130, 246, 0.10);
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 7px;
    padding: 5px 7px;
}

.card-worker-sync {
    display: grid;
    gap: 4px;
    background: rgba(59, 130, 246, 0.12);
    border-left: 3px solid #2563eb;
    border-radius: 6px;
    color: #102f62;
    font-size: 0.84rem;
    font-weight: 650;
    margin: 8px 0 10px;
    padding: 8px 10px;
}

.card-worker-sync > strong {
    color: #1d4ed8;
    font-size: .76rem;
    text-transform: uppercase;
}

.card-worker-sync p {
    margin: 0;
}

.card-photo-summary {
    display: grid;
    gap: 3px;
    background: rgba(168, 198, 134, 0.14);
    border-left: 3px solid #7fa85b;
    border-radius: 6px;
    color: #16220f;
    font-size: .8rem;
    margin: 7px 0;
    padding: 8px 10px;
}

.card-photo-summary strong {
    color: #31521f;
    font-size: .76rem;
    text-transform: uppercase;
}

.card-photo-summary small {
    opacity: .78;
}

.card-contact {
    font-size: 0.87rem;
    margin: 6px 0;
    color: #333;
}

.card-promo {
    background: rgba(21, 128, 61, 0.12);
    border-left: 3px solid #15803d;
    border-radius: 6px;
    color: #102114;
    font-size: .8rem;
    font-weight: 650;
    margin: 8px 0 10px;
    padding: 8px 10px;
}

.card-form-data {
    background: var(--card-panel-bg);
    border: 1px solid var(--card-panel-border);
    border-radius: 8px;
    color: #222;
    font-size: .82rem;
    margin: 8px 0 10px;
    padding: 8px 10px;
}

.card-note {
    background: rgba(124, 58, 237, 0.10);
    border-left: 3px solid #7c3aed;
    border-radius: 6px;
    color: #3f1d7a;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 10px;
    padding: 8px 10px;
}

.card-form-data summary {
    cursor: pointer;
    font-weight: 800;
}

.card-form-data dl,
.form-data-list {
    display: grid;
    gap: 6px;
    margin-top: 8px;
}

.form-data-row {
    display: grid;
    gap: 2px;
}

.form-data-row dt {
    font-size: .72rem;
    font-weight: 800;
    opacity: .72;
    text-transform: uppercase;
}

.form-data-row dd {
    margin: 0;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.card-actions {
    display: flex;
    gap: 8px;
}

.btn-edit {
    flex: 1;
    padding: 10px;
    background: #333;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
}

.btn-delete {
    flex: 1;
    padding: 10px;
    background: #ff5252;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
}

.btn-copy-link {
    flex: 1;
    padding: 10px;
    background: #8957e5;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
}

.btn-edit:hover { background: #444; }
.btn-delete:hover { background: #ff1744; }
.btn-copy-link:hover { background: #6f3fd4; }

/* Colores según evento */
.card-boda, .card-bodacivil, .card-xv, .card-xvanos { background: linear-gradient(180deg, #fff2bc 0%, #ffe28c 100%); border-left: 6px solid #d79716; }
.card-babyshower, .card-revelaciondeembarazo, .card-revelaciondegenero, .card-revelacion { background: linear-gradient(180deg, #ffe1ec 0%, #ffc0d6 100%); border-left: 6px solid #d9467f; }
.card-cumpleanos { background: linear-gradient(180deg, #e7f7d9 0%, #cbe9b1 100%); border-left: 6px solid #5f9f36; }
.card-bautizo, .card-presentacion { background: linear-gradient(180deg, #ffdced 0%, #ffb5d7 100%); border-left: 6px solid #db4d91; }
.card-graduacion { background: linear-gradient(180deg, #e3d2cc 0%, #c3aaa1 100%); border-left: 6px solid #7c5648; }
.card-invitacionescorporativas { background: linear-gradient(180deg, #eef3f5 0%, #d3dde2 100%); border-left: 6px solid #607d8b; }
.card-savethedatevideocorto, .card-savethedateinteractivo { background: linear-gradient(180deg, #ffefd6 0%, #ffd08f 100%); border-left: 6px solid #c57919; }
.card-pedidadepadrinos { background: linear-gradient(180deg, #fff8d7 0%, #f6e796 100%); border-left: 6px solid #c5a312; }
.card-tarjetadeagradecimientodigital { background: linear-gradient(180deg, #d7f7fb 0%, #aeeaf1 100%); border-left: 6px solid #18899a; }
.card-menudigital, .card-programa { background: linear-gradient(180deg, #edf7dc 0%, #d2ebb3 100%); border-left: 6px solid #79a83f; }
.card-dedicatoriasdigitales, .card-librodefirmas { background: linear-gradient(180deg, #ffe2ed 0%, #f8bfd3 100%); border-left: 6px solid #c43c75; }
.card-tarjetasdepresentaciondigitales { background: linear-gradient(180deg, #d8f0fc 0%, #adddf4 100%); border-left: 6px solid #2189bd; }
.card-modificaciondefotos { background: linear-gradient(180deg, #f2f2f2 0%, #dddddd 100%); border-left: 6px solid #777777; }
.card-otro, .card-default { background: #ffffff; border-left: 6px solid #9ca3af; }

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

.card-urgent-banner {
    background: #fee2e2;
    border: 1px solid #ef4444;
    border-radius: 9px;
    color: #991b1b;
    font-size: .76rem;
    font-weight: 900;
    letter-spacing: .04em;
    margin: 8px 0 10px;
    padding: 8px 10px;
    text-transform: uppercase;
}

.hq-extra-box {
    background: rgba(74,222,128,0.05);
    border: 1px solid #222;
    border-radius: 12px;
    margin: 15px 0;
    padding: 15px;
}

.hq-extra-box h4 {
    color: #4ade80;
    margin: 0 0 10px;
}

.checkbox-line {
    align-items: center;
    color: #ddd;
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.weekly-assignments {
    background: rgba(168,198,134,.06);
    border: 1px solid rgba(168,198,134,.18);
    border-radius: 12px;
    margin-top: 14px;
    padding: 12px;
}

.weekly-assignments h4 {
    color: #A8C686;
    margin: 0 0 8px;
}

.weekly-range,
.weekly-total,
.weekly-empty {
    color: #d7e5c8;
    font-size: .86rem;
    margin: 4px 0;
}

.weekly-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    margin-top: 10px;
}

.weekly-assignment-pill {
    align-items: center;
    background: #151515;
    border: 1px solid #2b2b2b;
    border-radius: 9px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
}

.weekly-assignment-pill span {
    color: #f4f8ee;
    font-size: .82rem;
    overflow-wrap: anywhere;
}

.weekly-assignment-pill strong {
    background: #A8C686;
    border-radius: 999px;
    color: #111;
    min-width: 28px;
    padding: 3px 8px;
    text-align: center;
}

/* MODALES */
.modal {
    position: fixed; inset: 0; background: rgba(0,0,0,0.92);
    display: none; align-items: center; justify-content: center;
    z-index: 200000;
}

.modal-content {
    background: #0a0a0a; padding: 25px; border-radius: 20px;
    width: 92%; max-width: 460px; border: 1px solid #222;
    max-height: 94vh;
    overflow-y: auto;
}

.modal-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.btn-save { flex: 2; background: var(--pistache); color: #000; border: none; padding: 13px; border-radius: 12px; font-weight: 700; }
.btn-cancel { flex: 1; background: transparent; color: #ff5252; border: 1px solid #ff5252; padding: 13px; border-radius: 12px; }

/* Animaciones */
@keyframes popExplosion { 
    0% { transform: scale(0); opacity: 0; } 
    60% { transform: scale(1.15); opacity: 1; } 
    100% { transform: scale(1); } 
}
.card-pop { animation: popExplosion 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
/* MEJOR VISUALIZACIÓN DE COLUMNAS */
.Pistacho-col {
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    transition: all 0.3s ease;
}

.Pistacho-col:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(168, 198, 134, 0.15);
}

.container {
    min-height: 400px;
}

/* Drag & Drop estilos */
.Pistacho-card.dragging {
    opacity: 0.4;
    transform: scale(0.95);
    cursor: grabbing;
    transition: none;
}

.drag-over {
    background: rgba(168, 198, 134, 0.15) !important;
    border: 2px dashed var(--pistache) !important;
}

.Pistacho-card.touch-dragging {
    opacity: .7;
    outline: 2px solid var(--pistache);
    outline-offset: 2px;
    cursor: grabbing;
    transition: none;
}

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

.is-touch-dragging-card .Pistacho-board,
.is-touch-dragging-card .Pistacho-board .container {
    overscroll-behavior: none;
    touch-action: none;
}

/* Scroll mejorado en móvil */
.Pistacho-board {
    scrollbar-width: thin;
    scrollbar-color: #555 #222;
}

.Pistacho-board::-webkit-scrollbar {
    height: 8px;
}

.Pistacho-board::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 10px;
}

/* Mejor scroll horizontal en móvil */
.Pistacho-board::-webkit-scrollbar {
    height: 6px;
}

.Pistacho-board::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 10px;
}

.Pistacho-board::-webkit-scrollbar-track {
    background: #222;
}

/* ====================== SIDEBAR COLAPSABLE ====================== */
.sidebar-collapsible {
    position: relative;
    display: flex;
    align-items: stretch;
    align-self: stretch;
    padding: 0;
    overflow: hidden;
    transition: width 0.32s ease, min-width 0.32s ease, max-width 0.32s ease, box-shadow 0.32s ease, min-height 0.32s ease, max-height 0.32s ease;
}

.sidebar-toggle {
    flex: 0 0 56px;
    width: 56px;
    border: none;
    border-right: 1px solid #222;
    background: linear-gradient(180deg, rgba(168, 198, 134, 0.16), rgba(168, 198, 134, 0.05));
    color: #dce9cf;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 14px 8px;
    transition: background 0.25s ease;
}

.sidebar-toggle:hover {
    background: linear-gradient(180deg, rgba(168, 198, 134, 0.24), rgba(168, 198, 134, 0.08));
}

.sidebar-toggle-text {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
}

.sidebar-toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: var(--pistache);
    font-size: 0.9rem;
}

.sidebar-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.sidebar-content .logo {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #ffffff;
}

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

#current-user-tag {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 12px 14px;
    color: #d9d9d9;
    line-height: 1.45;
    word-break: break-word;
}

.nav-item,
.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid #171717;
    background: #0b0b0b;
    color: #efefef;
}

.nav-item i,
.sidebar-footer i {
    color: var(--pistache);
}

.nav-item.active {
    background: rgba(168, 198, 134, 0.12);
    border-color: rgba(168, 198, 134, 0.2);
}

.sidebar-footer {
    margin-top: auto;
}

.sidebar-collapsible.is-collapsed {
    min-width: 56px;
    max-width: 56px;
    width: 56px;
}

.sidebar-collapsible.is-collapsed .sidebar-content {
    opacity: 0;
    pointer-events: none;
}

/* ====================== PANELES COLAPSABLES ====================== */
.header,
#monthly-summary {
    background: #050505;
    border-right: 1px solid #222;
}

.panel-column {
    position: relative;
    display: flex !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    align-self: stretch;
    min-width: 280px;
    max-width: 280px;
    width: 280px;
    overflow: hidden;
    padding: 0 !important;
    transition: width 0.32s ease, min-width 0.32s ease, max-width 0.32s ease, box-shadow 0.32s ease;
}

.panel-column .panel-toggle {
    flex: 0 0 56px;
    align-self: stretch;
    width: 56px;
    height: 100%;
    min-height: 100%;
    border: none;
    border-right: 1px solid #222;
    background: linear-gradient(180deg, rgba(168, 198, 134, 0.14), rgba(168, 198, 134, 0.05));
    color: #dce9cf;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-width: 0;
    overflow: hidden;
    padding: 14px 8px;
    transition: background 0.25s ease;
}

.panel-column .panel-toggle:hover {
    background: linear-gradient(180deg, rgba(168, 198, 134, 0.24), rgba(168, 198, 134, 0.08));
}

.panel-column .panel-toggle-text {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
}

.panel-column .panel-toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: var(--pistache);
    font-size: 0.9rem;
}

.panel-column .panel-content {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 18px;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.panel-column .panel-content > *,
#monthly-summary .panel-content > * {
    max-width: 100%;
    min-width: 0;
}

.panel-column.is-collapsed {
    min-width: 56px;
    max-width: 56px;
    width: 56px;
}

.panel-column.is-collapsed .panel-content {
    opacity: 0;
    pointer-events: none;
}

.sidebar-collapsible.is-collapsed,
.panel-column.is-collapsed {
    display: none !important;
}

.panel-summary {
    background: #111111 !important;
}

.panel-summary .panel-content {
    gap: 20px;
}

.hq-tab-rail {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 60px;
    padding: 76px 8px 16px;
    gap: 8px;
    background: #303030;
    border-right: 1px solid #414141;
}

.hq-tab-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #f4f4f4;
    cursor: pointer;
    font-size: 0.98rem;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.hq-tab-button:hover,
.hq-tab-button:focus-visible,
.hq-tab-button.is-active {
    outline: none;
    background: rgba(255,255,255,0.12);
    color: #ffffff;
}

.hq-tab-button:active {
    transform: scale(0.94);
}

.worker-supervision-panel[hidden] {
    display: none;
}

.worker-supervision-panel {
    background: #090909;
    color: #f4f4f4;
    display: flex;
    flex-direction: column;
    inset: 0;
    position: fixed;
    z-index: 1600;
}

.worker-supervision-header {
    align-items: center;
    background: linear-gradient(135deg, #131313, #1d2618);
    border-bottom: 1px solid rgba(168, 198, 134, .25);
    display: flex;
    gap: 18px;
    justify-content: space-between;
    padding: 16px 22px;
}

.worker-supervision-header h2 {
    color: #eaf5df;
    font-size: 1.2rem;
    margin: 2px 0 4px;
}

.worker-supervision-header p {
    color: #b6c7a9;
    font-size: .82rem;
    margin: 0;
}

.worker-supervision-eyebrow {
    color: #a8c686 !important;
    font-size: .68rem !important;
    font-weight: 800;
    letter-spacing: .1em;
}

.worker-supervision-close {
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 9px;
    color: #fff;
    cursor: pointer;
    font-weight: 800;
    padding: 10px 14px;
}

.worker-supervision-close:hover,
.worker-supervision-close:focus-visible {
    background: rgba(168, 198, 134, .18);
    border-color: #a8c686;
    outline: none;
}

.worker-supervision-layout {
    display: grid;
    flex: 1;
    grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
    min-height: 0;
}

.worker-supervision-list-pane {
    background: #111;
    border-right: 1px solid #282828;
    min-height: 0;
    overflow: auto;
    padding: 14px;
}

.worker-supervision-list-head {
    align-items: center;
    color: #dce9cf;
    display: flex;
    font-size: .82rem;
    justify-content: space-between;
    margin-bottom: 10px;
}

.worker-supervision-list-head span {
    align-items: center;
    background: rgba(168, 198, 134, .14);
    border-radius: 999px;
    display: inline-flex;
    justify-content: center;
    min-width: 24px;
    padding: 3px 7px;
}

.worker-supervision-list {
    display: grid;
    gap: 8px;
}

.worker-supervision-person {
    background: rgba(255, 255, 255, .035);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    display: grid;
    gap: 4px;
    padding: 11px 12px;
    text-align: left;
    width: 100%;
}

.worker-supervision-person:hover,
.worker-supervision-person:focus-visible,
.worker-supervision-person.is-selected {
    background: rgba(168, 198, 134, .14);
    border-color: rgba(168, 198, 134, .65);
    outline: none;
}

.worker-supervision-person-name {
    font-size: .9rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.worker-supervision-presence {
    align-items: center;
    color: #aeb6a6;
    display: inline-flex;
    font-size: .72rem;
    gap: 5px;
}

.worker-supervision-presence::before {
    background: currentColor;
    border-radius: 50%;
    content: '';
    height: 7px;
    width: 7px;
}

.worker-supervision-presence.is-active { color: #8ee68e; }
.worker-supervision-presence.is-away { color: #f5c66b; }
.worker-supervision-presence.is-offline { color: #9ca3af; }

.worker-supervision-empty {
    color: #aeb6a6;
    font-size: .82rem;
    line-height: 1.5;
    margin: 10px 0;
}

.worker-supervision-board-pane {
    background: #060606;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.worker-supervision-selected {
    border-bottom: 1px solid #232323;
    color: #dce9cf;
    font-size: .84rem;
    font-weight: 800;
    padding: 10px 14px;
}

#worker-supervision-frame {
    background: #080808;
    border: 0;
    flex: 1;
    min-height: 0;
    width: 100%;
}

.counter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 12px;
    background: rgba(168, 198, 134, 0.12);
    border: 1px solid rgba(168, 198, 134, 0.22);
    color: #f3f8ee;
    font-weight: 700;
}

@media (min-width: 769px) {
    .main-wrapper {
        flex-direction: row;
        align-items: stretch;
        padding-left: 60px;
        position: relative;
    }

    .sidebar-collapsible {
        flex: 0 0 240px;
        min-width: 240px;
        max-width: 240px;
        width: 240px;
        height: 100vh;
        border-right: 1px solid #222;
        border-bottom: none;
    }

    .sidebar-collapsible.is-collapsed {
        display: none !important;
    }

    .panel-column.is-collapsed {
        display: none !important;
    }

    .header,
    #monthly-summary,
    .Pistacho-board {
        height: 100vh;
    }

    .Pistacho-board {
        min-width: 0;
        flex: 1;
        height: 100vh;
        border-left: 1px solid #111;
    }
}

@media (max-width: 768px) {
    .worker-supervision-header {
        align-items: flex-start;
        padding: 13px 14px;
    }

    .worker-supervision-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr);
    }

    .worker-supervision-list-pane {
        border-bottom: 1px solid #282828;
        border-right: 0;
        max-height: 155px;
        padding: 10px 12px;
    }

    .worker-supervision-list {
        display: flex;
        overflow-x: auto;
    }

    .worker-supervision-person {
        flex: 0 0 190px;
    }

    .sidebar-collapsible {
        min-width: 100%;
        max-width: 100%;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #222;
    }

    .sidebar-toggle {
        flex: 0 0 54px;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #222;
        flex-direction: row;
        gap: 10px;
        justify-content: space-between;
        padding: 0 16px;
    }

    .sidebar-toggle-text {
        writing-mode: horizontal-tb;
        transform: none;
        letter-spacing: 0.08em;
        overflow-wrap: anywhere;
        text-align: left;
        white-space: normal;
    }

    .sidebar-collapsible:not(.is-collapsed) {
        min-height: 220px;
    }

    .sidebar-collapsible.is-collapsed {
        min-height: 54px;
        max-height: 54px;
    }

    .sidebar-collapsible.is-collapsed .sidebar-content {
        display: none;
    }

    .panel-column {
        min-width: 100%;
        max-width: 100%;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #222;
    }

    .panel-column .panel-toggle {
        flex: 0 0 54px;
        width: 100%;
        height: auto;
        min-height: 54px;
        border-right: none;
        border-bottom: 1px solid #222;
        flex-direction: row;
        gap: 10px;
        justify-content: space-between;
        padding: 0 16px;
    }

    .panel-column .panel-toggle-text {
        writing-mode: horizontal-tb;
        transform: none;
        letter-spacing: 0.08em;
        overflow-wrap: anywhere;
        text-align: left;
        white-space: normal;
    }

    .panel-column:not(.is-collapsed) {
        min-height: 148px;
    }

    .panel-column.is-collapsed {
        min-width: 100%;
        max-width: 100%;
        width: 100%;
        min-height: 54px;
        max-height: 54px;
    }

    .panel-column.is-collapsed .panel-content {
        display: none;
    }

    .Pistacho-board {
        min-height: 0;
        height: auto;
    }
}


/* ====================== MODAL MEJORADO ====================== */
.modal-content {
    background: #0a0a0a;
    padding: 28px;
    border-radius: 20px;
    width: 92%;
    max-width: 620px;
    border: 1px solid #333;
    max-height: 92vh;
    overflow-y: auto;
}

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

.edit-field.full {
    grid-column: 1 / -1;
}

.edit-field label {
    display: block;
    margin-bottom: 6px;
    color: #c084fc;
    font-weight: 600;
}

.dato-input {
    width: 100%;
    padding: 13px 15px;
    background: #111;
    border: 1px solid #444;
    border-radius: 12px;
    color: white;
}

.dato-input:focus {
    border-color: #a855f7;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.25);
}

.form-link-actions {
    align-items: center;
    background: rgba(168, 198, 134, .08);
    border: 1px solid rgba(168, 198, 134, .22);
    border-radius: 12px;
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr 120px;
    margin: 8px 0 14px;
    padding: 10px;
}

.btn-form-link {
    background: #4ade80;
    border: 0;
    border-radius: 10px;
    color: #061208;
    cursor: pointer;
    font-weight: 900;
    min-height: 40px;
    padding: 9px 12px;
}

.btn-form-link.secondary {
    background: #2a2a2a;
    color: #e8f5df;
}

.form-link-actions span {
    color: #b8d7aa;
    font-size: .78rem;
    grid-column: 1 / -1;
}

.clave-preview,
.payment-summary,
.wlv-details,
.form-data-preview,
.codex-data-preview {
    background: rgba(168, 198, 134, 0.1);
    border: 1px solid rgba(168, 198, 134, 0.25);
    border-radius: 12px;
    color: #e8f5df;
    padding: 12px 14px;
    margin: 10px 0 18px;
    font-size: 0.92rem;
}

.clave-preview strong,
.payment-summary strong {
    color: var(--pistache);
}

.payment-proof-link {
    color: #cbd5e1;
    font-size: .84rem;
    margin: 6px 0 10px;
}

.payment-paste-zone {
    background: rgba(74, 222, 128, .07);
    border: 1px dashed rgba(168, 198, 134, .55);
    border-radius: 12px;
    color: #dff7d7;
    cursor: pointer;
    display: grid;
    gap: 4px;
    margin: 8px 0 10px;
    padding: 12px 14px;
}

.payment-paste-zone:focus,
.payment-paste-zone.is-ready {
    border-color: #4ade80;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, .18);
    outline: none;
}

.payment-paste-zone strong {
    color: #8cff9a;
    font-size: .92rem;
}

.payment-paste-zone span,
.payment-paste-zone small {
    color: #b8d7aa;
    font-size: .8rem;
}

.payment-paste-zone.is-loaded {
    background: rgba(74, 222, 128, .14);
}

.payment-proof-link a {
    color: #93c5fd;
    font-weight: 800;
}

.wlv-details h4 {
    color: var(--pistache);
    margin: 0 0 12px;
}

.form-data-preview h4 {
    color: var(--pistache);
    margin: 0 0 12px;
}

.form-data-preview summary {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 3px;
    list-style-position: inside;
}

.form-data-preview summary span {
    color: var(--pistache);
    font-weight: 900;
}

.form-data-preview summary strong {
    background: rgba(168, 198, 134, .18);
    border-radius: 999px;
    color: #e8f5df;
    display: inline-block;
    font-size: .78rem;
    margin-left: 4px;
    padding: 2px 8px;
}

.form-data-preview summary small {
    color: #b8d7aa;
    font-size: .78rem;
}

@media (max-width: 560px) {
    .form-link-actions {
        grid-template-columns: 1fr;
    }
}

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

.codex-data-head h4 {
    color: var(--pistache);
    margin: 0;
}

.codex-data-text {
    font-family: Consolas, Monaco, monospace;
    font-size: 0.86rem;
    line-height: 1.45;
    min-height: 220px;
    resize: vertical;
    white-space: pre-wrap;
}

.codex-data-status {
    color: #b8d7aa;
    font-size: 0.82rem;
    margin-top: 8px;
}

.wlv-details label {
    margin-top: 10px;
}

.digital-forms-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 360px;
    overflow-y: auto;
}

.digital-form-card {
    background: #151515;
    border: 1px solid #262626;
    border-radius: 12px;
    padding: 12px;
}

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

.digital-form-head strong {
    color: #c084fc;
}

.digital-form-head span {
    background: rgba(168, 198, 134, .15);
    border-radius: 999px;
    color: #dce9cf;
    font-size: .78rem;
    padding: 4px 8px;
}

.digital-form-body {
    color: #dddddd;
    font-size: .86rem;
    line-height: 1.5;
    margin: 10px 0;
}

.digital-form-actions button {
    background: #8957e5;
    border: none;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    padding: 8px 10px;
}

.digital-form-actions button:last-child {
    background: #333;
}

.empty-admin {
    color: var(--text-muted);
    font-size: .9rem;
}

.modal-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.btn-save {
    flex: 2;
    background: #4ade80;
    color: #000;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-weight: 700;
}

.btn-cancel {
    flex: 1;
    background: transparent;
    color: #ff5252;
    border: 2px solid #ff5252;
    padding: 15px;
    border-radius: 12px;
}

.entrega-badge {
    position: absolute;
    top: -8px;
    right: 10px;
    font-size: 0.7rem;
    padding: 3px 10px;
    border-radius: 9999px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.entrega-badge.priority-alta {
    background: #ef4444;
    color: #fff;
}

.entrega-badge.priority-media {
    background: #facc15;
    color: #111;
}

.entrega-badge.priority-baja {
    background: #7c3aed;
    color: #fff;
}

.card-hq-grid {
    background: var(--card-panel-bg);
    border: 1px solid var(--card-panel-border);
    border-radius: 8px;
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 12px 0 10px;
    padding: 10px;
}

.card-hq-grid span {
    color: var(--card-panel-muted);
    display: block;
    font-size: .68rem;
    margin-bottom: 2px;
    text-transform: uppercase;
}

.card-hq-grid strong {
    color: var(--card-panel-text);
    display: block;
    font-size: .78rem;
    line-height: 1.25;
}

.card-priority,
.hq-readonly {
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 8px 10px;
}

.card-priority {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.card-priority.priority-alta {
    background: rgba(239, 68, 68, .16);
    border: 1px solid rgba(185, 28, 28, .24);
    color: #7f1d1d;
}

.card-priority.priority-media {
    background: rgba(202, 138, 4, .16);
    border: 1px solid rgba(161, 98, 7, .24);
    color: #713f12;
}

.card-priority.priority-baja {
    background: rgba(22, 163, 74, .13);
    border: 1px solid rgba(21, 128, 61, .22);
    color: #14532d;
}

.hq-readonly {
    background: rgba(124, 58, 237, .10);
    border: 1px solid rgba(91, 33, 182, .24);
    color: #3f1d7a;
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 720px) {
    .card-hq-grid,
    .hq-readonly {
        grid-template-columns: 1fr;
    }
}

/* Tablero dividido por grupos compactos */
.Pistacho-board.board-split {
    align-items: stretch;
    display: grid;
    gap: 12px;
    grid-auto-columns: max-content;
    grid-template-columns: repeat(6, max-content);
    grid-template-rows: auto minmax(0, 1fr);
    height: calc(100vh - 185px);
    overflow-x: auto;
    overflow-y: hidden;
}

.hq-board-toolbar {
    align-items: center;
    background: #070707;
    border: 1px solid #1f1f1f;
    border-radius: 14px;
    display: grid;
    gap: 8px;
    grid-column: 1 / -1;
    grid-template-columns: minmax(240px, 520px) 36px minmax(0, auto) max-content;
    min-width: 0;
    padding: 8px;
}

.hq-search-field {
    align-items: center;
    background: #101010;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    display: flex;
    gap: 8px;
    min-height: 38px;
    min-width: 0;
    padding: 0 11px;
}

.hq-search-field i {
    color: #A8C686;
    font-size: .9rem;
}

.hq-search-field input {
    background: transparent;
    border: 0;
    color: #f5f5f5;
    flex: 1;
    font: inherit;
    min-width: 0;
    outline: none;
}

.hq-search-field input::placeholder {
    color: #858585;
}

.hq-search-clear {
    align-items: center;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 10px;
    color: #f5f5f5;
    cursor: pointer;
    display: inline-flex;
    height: 38px;
    justify-content: center;
    width: 36px;
}

.hq-search-clear:hover,
.hq-search-clear:focus-visible {
    background: rgba(168, 198, 134, .16);
    border-color: rgba(168, 198, 134, .38);
    outline: none;
}

.hq-search-clear:disabled {
    cursor: default;
    opacity: .45;
}

.hq-search-status {
    color: #b8b8b8;
    font-size: .78rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hq-board-stats {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.hq-board-stats span {
    background: rgba(168, 198, 134, .12);
    border: 1px solid rgba(168, 198, 134, .26);
    border-radius: 999px;
    color: #dce9cf;
    font-size: .72rem;
    font-weight: 800;
    padding: 5px 8px;
    white-space: nowrap;
}

.hq-board-stats #hq-unpaid-counter {
    background: rgba(159, 53, 66, .22);
    border-color: rgba(159, 53, 66, .7);
    color: #fff4f5;
}

.board-stack {
    align-self: stretch;
    background: #050505;
    border: 1px solid #1f1f1f;
    border-radius: 16px;
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 9px;
    min-width: 300px;
    min-height: 0;
    overflow: hidden;
    padding: 8px;
    width: clamp(300px, 28vw, 430px);
}

.board-stack.is-collapsed {
    align-self: start;
    height: auto;
    max-width: 48px;
    min-width: 48px;
    padding: 8px 5px;
    width: 48px;
}

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

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

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

.board-stack-hidden {
    display: none;
}

.board-lane-title {
    color: #A8C686;
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .04em;
    padding: 0;
    text-transform: uppercase;
}

.board-stack-toggle,
.stack-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;
    min-width: 0;
    padding: 6px;
    text-align: left;
    width: 100%;
}

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

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

.board-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;
}

.Pistacho-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;
}

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

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

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

.board-collapse-icon::before,
.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;
}

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

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

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

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

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

.board-stack .Pistacho-col {
    border-radius: 12px;
    box-shadow: none;
    flex: 1 1 0;
    height: auto;
    max-width: none;
    min-height: 0;
    min-width: 0;
}

.board-stack .Pistacho-col:hover {
    transform: none;
}

.board-stack .Pistacho-col h3 {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: space-between;
    padding: 0;
}

.board-stack .Pistacho-col .stack-col-toggle {
    padding: 8px 10px;
}

.column-count {
    align-items: center;
    background: rgba(168, 198, 134, .18);
    border: 1px solid rgba(168, 198, 134, .36);
    border-radius: 999px;
    color: #dce9cf;
    display: inline-flex;
    font-size: .72rem;
    justify-content: center;
    min-width: 26px;
    padding: 2px 7px;
}

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

.board-stack .Pistacho-col.is-collapsed .container {
    display: none;
}

.board-stack .Pistacho-col.is-collapsed h3 {
    border-bottom: 0;
}

.board-stack .Pistacho-col.is-collapsed .stack-col-toggle {
    flex-direction: row;
    min-height: 0;
    padding: 8px 10px;
}

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

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

.board-stack .container {
    gap: 6px;
    min-height: 58px;
    padding: 6px;
}

.Pistacho-card {
    border-radius: 10px;
    cursor: pointer;
    font-size: .78rem;
    margin-bottom: 6px;
    padding: 9px;
}

.Pistacho-card:focus-visible {
    outline: 2px solid var(--pistache);
    outline-offset: 2px;
}

.Pistacho-card.is-keyboard-selected {
    box-shadow: 0 0 0 2px rgba(168, 198, 134, .72), 0 12px 22px rgba(0, 0, 0, .22);
}

.Pistacho-card .entrega-badge {
    font-size: .58rem;
    padding: 2px 7px;
    right: 7px;
    top: -7px;
}

.Pistacho-card .card-hq-grid {
    gap: 5px;
    margin: 7px 0;
    padding: 7px;
}

.Pistacho-card .card-hq-grid span {
    font-size: .56rem;
}

.Pistacho-card .card-hq-grid strong {
    font-size: .66rem;
}

.Pistacho-card .card-priority {
    margin-bottom: 6px;
    padding: 6px 7px;
}

.Pistacho-card .card-priority span {
    font-size: .66rem;
}

.Pistacho-card .card-owner-row {
    gap: 6px;
    margin: 6px 0;
}

.Pistacho-card .card-owner-row div {
    padding: 6px;
}

.Pistacho-card .card-header {
    font-size: .68rem;
    margin-bottom: 5px;
}

.Pistacho-card .card-cliente {
    font-size: .88rem;
    line-height: 1.15;
    margin: 4px 0;
}

.Pistacho-card .card-clave,
.Pistacho-card .card-meta-line {
    font-size: .66rem;
}

.card-expand-hint {
    background: rgba(0, 0, 0, .08);
    border: 1px solid rgba(0, 0, 0, .14);
    border-radius: 8px;
    color: inherit;
    cursor: pointer;
    font: inherit;
    font-size: .68rem;
    font-weight: 900;
    margin-top: 7px;
    padding: 5px 7px;
    width: 100%;
}

.card-assign-quick {
    background: rgba(255, 255, 255, .42);
    border: 1px solid rgba(0, 0, 0, .14);
    border-radius: 7px;
    color: inherit;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px;
    align-items: center;
    font: inherit;
    font-size: .65rem;
    font-weight: 900;
    margin-top: 5px;
    padding: 4px 6px;
    width: 100%;
}

.card-assign-quick span {
    text-transform: uppercase;
}

.card-assign-quick select {
    background: rgba(255, 255, 255, .88);
    border: 1px solid rgba(0, 0, 0, .14);
    border-radius: 5px;
    color: inherit;
    font: inherit;
    font-size: .68rem;
    min-width: 0;
    padding: 3px 5px;
    width: 100%;
}

.Pistacho-card.is-saving-assignment .card-assign-quick {
    opacity: .72;
}

.card-codex-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.card-codex-actions .btn-copy-link {
    flex: 1 1 120px;
    font-size: .68rem;
    padding: 6px 7px;
}

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

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

.Pistacho-card .card-info,
.Pistacho-card .card-note,
.Pistacho-card .card-contact,
.Pistacho-card .card-balance,
.Pistacho-card .card-actions {
    margin-top: 0;
}

.Pistacho-card .card-actions {
    gap: 5px;
    flex-wrap: wrap;
}

.Pistacho-card .card-actions button {
    flex: 1 1 92px;
    font-size: .68rem;
    padding: 6px 7px;
}

.hq-photo-downloads {
    background: rgba(168, 198, 134, .08);
    border: 1px solid rgba(168, 198, 134, .25);
    border-radius: 14px;
    margin-top: 14px;
    padding: 12px;
    transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease;
}

.hq-photo-downloads-highlight {
    border-color: rgba(168, 198, 134, .85);
    box-shadow: 0 0 0 3px rgba(168, 198, 134, .18), 0 14px 32px rgba(0, 0, 0, .22);
    transform: translateY(-2px);
}

.form-written-answer {
    background: rgba(168, 198, 134, .08);
    border: 1px solid rgba(168, 198, 134, .25);
    border-radius: 14px;
    margin: 12px 0 14px;
    padding: 12px;
}

.form-written-answer-head {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-bottom: 10px;
}

.form-written-answer-head h4 {
    color: #A8C686;
    font-size: .92rem;
    margin: 0;
}

.form-written-answer-text {
    line-height: 1.45;
    resize: vertical;
}

.form-written-answer-status {
    color: #b8c7aa;
    font-size: .76rem;
    margin: 8px 0 0;
}

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

.hq-photo-downloads-head strong {
    color: #A8C686;
    font-size: .92rem;
}

.hq-photo-downloads-head span {
    color: #b8c7aa;
    font-size: .78rem;
}

.hq-photo-downloads-alert {
    background: rgba(248, 113, 113, .10);
    border: 1px solid rgba(248, 113, 113, .30);
    border-radius: 10px;
    color: #ffd0d0;
    line-height: 1.45;
    padding: 10px;
}

.hq-photo-downloads-actions {
    margin-bottom: 10px;
}

.hq-photo-download-all,
.hq-photo-download-card button {
    background: #A8C686;
    border: 0;
    border-radius: 10px;
    color: #111;
    cursor: pointer;
    font-weight: 900;
    padding: 10px 12px;
}

.hq-photo-download-all {
    width: 100%;
}

.hq-photo-download-all:disabled,
.hq-photo-download-card button:disabled {
    cursor: wait;
    opacity: .65;
}

.hq-photo-download-grid {
    display: grid;
    gap: 10px;
}

.hq-photo-download-card {
    align-items: center;
    background: rgba(0, 0, 0, .18);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    display: grid;
    gap: 10px;
    grid-template-columns: 72px minmax(0, 1fr);
    padding: 10px;
}

.hq-photo-download-card img {
    background: #111;
    border-radius: 10px;
    height: 72px;
    object-fit: cover;
    width: 72px;
}

.hq-photo-download-card div {
    min-width: 0;
}

.hq-photo-download-card strong,
.hq-photo-download-card small {
    display: block;
    overflow-wrap: anywhere;
}

.hq-photo-download-card strong {
    color: #f2f7e7;
    font-size: .84rem;
}

.hq-photo-download-card small {
    color: #bbb;
    font-size: .76rem;
}

.hq-photo-download-card button {
    grid-column: 1 / -1;
}

@media (min-width: 720px) {
    .hq-photo-download-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .modal-btns button,
    .btn-save,
    .btn-cancel {
        flex: 1 1 100%;
        width: 100%;
    }
}

@media (max-width: 1100px) {
    .hq-board-toolbar {
        grid-template-columns: minmax(0, 1fr) 36px;
    }

    .hq-search-status {
        grid-column: 1 / -1;
    }

    .hq-board-stats {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .Pistacho-board.board-split {
        grid-template-columns: repeat(6, max-content);
    }
}

/* En móvil, la columna abierta ocupa el alto disponible y sus tarjetas se desplazan dentro. */
@media (max-width: 768px) {
    .Pistacho-board.board-split {
        align-items: stretch;
        height: 100dvh;
        min-height: 100dvh;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 12px;
    }

    .Pistacho-board.board-split .board-stack:not(.is-collapsed) {
        align-self: stretch;
        min-height: 0;
    }

    .Pistacho-board.board-split .board-stack:not(.is-collapsed) .Pistacho-col {
        min-height: 0;
    }
}

/* En pantallas amplias, cada sección conserva su ancho real para que al colapsar se recorran. */
@media (min-width: 1101px) {
    .Pistacho-board.board-split {
        grid-template-columns: repeat(6, max-content);
    }

    .Pistacho-board.board-split .board-stack {
        width: clamp(300px, 28vw, 430px);
    }

    .Pistacho-board.board-split .board-stack.is-collapsed {
        width: 48px;
    }
}

/* El tablero de escritorio también ocupa el alto disponible de la ventana. */
@media (min-width: 769px) {
    .Pistacho-board.board-split {
        height: calc(100dvh - 12px);
    }
}
