:root {
	--gesvasa-primary: #154C2B;
	--gesvasa-accent: #B9CE2B;
	--gesvasa-primary-soft: #eaf1ed;
	--gesvasa-accent-soft: #f3f8d9;
	--gesvasa-danger: #b12626;
}

/* Compact Modern Overview Widget */
.gesvasa-compact-overview-card {
    background: #ffffff;
    border: 1px solid #d5e5d7;
    border-radius: 12px;
    padding: 14px 18px;
    margin: 14px 0 16px 0;
    box-shadow: 0 2px 8px rgba(21, 76, 43, 0.05);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.gesvasa-compact-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    align-items: center;
}
.gesvasa-compact-kpi {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f8fcf8;
    border: 1px solid #e1eee2;
    border-radius: 9px;
}
.gesvasa-compact-kpi .kpi-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #e8f4eb;
    color: #154c2b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}
.gesvasa-compact-kpi .kpi-data {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.gesvasa-compact-kpi .kpi-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #587561;
}
.gesvasa-compact-kpi .kpi-value {
    font-size: 16px;
    font-weight: 800;
    color: #154c2b;
    line-height: 1.2;
}
.gesvasa-compact-kpi .kpi-unit {
    font-size: 11px;
    font-weight: 600;
    color: #728c7b;
}
.gesvasa-compact-kpi.kpi-link-box {
    background: transparent;
    border: none;
    padding: 0;
    justify-content: flex-end;
}
.kpi-action-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #f1f7e9;
    border: 1px solid #c9dfb4;
    border-radius: 8px;
    color: #1a4d2b !important;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none !important;
    transition: all 0.2s ease;
}
.kpi-action-link:hover {
    background: #154c2b;
    color: #ffffff !important;
    border-color: #154c2b;
}

.gesvasa-compact-dist-section {
    border-top: 1px solid #eef5ef;
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.dist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 700;
}
.dist-title {
    color: #154c2b;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.dist-total-text {
    color: #55725f;
    font-size: 11.5px;
}
.dist-stacked-bar {
    display: flex;
    width: 100%;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: #e8f0e9;
}
.dist-bar-segment {
    height: 100%;
    transition: width 0.3s ease;
}
.dist-chips-grid {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}
.dist-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f8faf8;
    border: 1px solid #dce8dd;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 11.5px;
}
.dist-chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.dist-chip-name {
    font-weight: 600;
    color: #213d29;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dist-chip-qty {
    font-weight: 700;
    color: #154c2b;
}
.dist-chip-pct {
    background: #e8f3e9;
    color: #1d522f;
    padding: 0 4px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
}
.dist-chip-more {
    font-size: 11px;
    font-weight: 600;
    color: #667f6f;
    padding: 3px 6px;
}

#residuo-popup-overlay {
    display: none;
    position: fixed !important;
    z-index: 10000 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.55) !important;
    backdrop-filter: blur(3px) !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    box-sizing: border-box !important;
}
#residuo-popup-overlay.is-open {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    animation: gesvasaFadeIn 0.2s ease-out;
}
#residuo-popup {
    background: #ffffff !important;
    width: 100% !important;
    max-width: 980px !important;
    border: none !important;
    border-radius: 14px !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35) !important;
    overflow: hidden !important;
    max-height: 90vh !important;
    display: flex !important;
    flex-direction: column !important;
    margin: auto !important;
    position: relative !important;
}
#residuo-popup.gesvasa-popup-wide { max-width:1660px !important; }
#residuo-popup .popup-header { display:flex; justify-content:space-between; align-items:center; background:linear-gradient(135deg, #154c2b 0%, #1c5e37 100%); color:#ffffff; border-bottom:3px solid #b9ce2b; padding:14px 20px; font-weight:700; flex-shrink:0; }
#residuo-popup .popup-header span { font-size:16px; letter-spacing:0.02em; display:flex; align-items:center; gap:8px; }
#residuo-popup .popup-body { padding:20px 24px; overflow-y:auto; flex:1; background:#ffffff; }
#residuo-popup .popup-close { display:inline-flex; align-items:center; justify-content:center; width:30px; height:30px; border:1px solid rgba(255,255,255,0.3); border-radius:8px; text-decoration:none; color:#ffffff; font-size:18px; font-weight:700; background:rgba(255,255,255,0.12); line-height:1; transition:background 0.2s ease; }
#residuo-popup .popup-close:hover { background:rgba(255,255,255,0.28); color:#fff; }

/* Modern Friendly Form Grid */
.gesvasa-form-section { margin-bottom:18px; }
.gesvasa-form-section-header { display:flex; align-items:center; gap:8px; font-size:13px; font-weight:700; color:#154c2b; text-transform:uppercase; letter-spacing:0.05em; margin-bottom:12px; padding-bottom:6px; border-bottom:1.5px solid #e2ece3; }
.gesvasa-form-section-header i { color:#759b2c; font-size:14px; }
.gesvasa-form-grid { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:14px 18px; }
.gesvasa-col-span-2 { grid-column:span 2 / span 2; }
.gesvasa-col-span-1 { grid-column:span 1 / span 1; }

.gesvasa-form-group { display:flex; flex-direction:column; gap:5px; position:relative; }
.gesvasa-form-group label { font-size:12.5px; font-weight:700; color:#2c4835; display:flex; align-items:center; gap:4px; }
.gesvasa-form-group label .req-star { color:#c0392b; font-size:13px; }
.gesvasa-form-group label .hint-pill { font-size:10.5px; font-weight:600; color:#607968; background:#f0f5ee; border:1px solid #d5e5d3; border-radius:999px; padding:1px 6px; margin-left:auto; }

#residuo-popup input.flat, #residuo-popup select.flat, #residuo-popup textarea.flat { width:100% !important; border:1.5px solid #b2cbab !important; border-radius:8px !important; background:#ffffff !important; min-height:38px !important; padding:6px 12px !important; box-sizing:border-box !important; font-size:13.5px !important; color:#1b3323 !important; transition:border-color 0.2s, box-shadow 0.2s; }
#residuo-popup input.flat:focus, #residuo-popup select.flat:focus, #residuo-popup textarea.flat:focus { outline:none; border-color:#154c2b !important; box-shadow:0 0 0 3px rgba(185, 206, 43, 0.25) !important; background:#fcfffa !important; }

/* Date Picker Layout & Fix */
#residuo-popup .nowbutton,
#residuo-popup .dp-now,
#residuo-popup input[value="Ahora"],
#residuo-popup input[value="Now"],
#residuo-popup input[name*="_now"],
#residuo-popup button[name*="_now"],
#residuo-popup a[name*="_now"] {
    display: none !important;
}

#residuo-popup .nowrap {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
}

#residuo-popup .nowrap input.flat {
    flex: 1 !important;
    min-height: 38px !important;
    width: 100% !important;
}

#residuo-popup .nowrap select.flat {
    min-height: 38px !important;
    width: auto !important;
    flex: initial !important;
}

#residuo-popup .ui-datepicker-trigger {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    margin-left: 4px !important;
    vertical-align: middle !important;
}

#residuo-popup .select2-container { width:100% !important; max-width:none !important; }
#residuo-popup .select2-container--default .select2-selection--single { border:1.5px solid #b2cbab !important; border-radius:8px !important; min-height:38px !important; display:flex; align-items:center; background:#ffffff !important; transition:border-color 0.2s, box-shadow 0.2s; }
#residuo-popup .select2-container--default.select2-container--focus .select2-selection--single,
#residuo-popup .select2-container--default.select2-container--open .select2-selection--single { border-color:#154c2b !important; box-shadow:0 0 0 3px rgba(185, 206, 43, 0.25) !important; }
#residuo-popup .select2-container--default .select2-selection--single .select2-selection__rendered { line-height:36px; font-size:13px; color:#1b3323; padding-left:10px; padding-right:26px; font-weight:500; }
#residuo-popup .select2-container--default .select2-selection--single .select2-selection__arrow { height:36px; right:6px; }

#residuo-popup .popup-actions { display:flex; justify-content:flex-end; align-items:center; gap:12px; margin-top:20px; padding-top:16px; border-top:1px solid #e2ece3; flex-shrink:0; }
#residuo-popup .popup-actions .button { border-radius:8px; min-height:38px; padding:8px 20px; font-size:13.5px; font-weight:700; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; gap:6px; }
#residuo-popup .popup-actions .button-save { background:#154c2b !important; border:1px solid #154c2b !important; color:#fff !important; box-shadow:0 2px 6px rgba(21,76,43,0.2); }
#residuo-popup .popup-actions .button-save:hover { background:#103b21 !important; border-color:#103b21 !important; transform:translateY(-1px); }
#mainbody #residuo-popup .popup-actions .button-cancel { background:#e85656 !important; border:1px solid #e85656 !important; color:#ffffff !important; text-decoration:none; }
#mainbody #residuo-popup .popup-actions .button-cancel:hover { background:#cb3b3b !important; border-color:#cb3b3b !important; color:#ffffff !important; }

#popup-validation-errors { display:none; background:#fde8e8; border:1px solid #f5b0b0; border-left:4px solid #c0392b; border-radius:8px; padding:8px 14px; color:#902121; font-size:12.5px; font-weight:600; margin-right:auto; max-width:480px; }

#delete-movement-modal { display:none; position:fixed; z-index:10001; left:0; top:0; width:100%; height:100%; overflow:auto; background-color:rgba(0,0,0,0.48); backdrop-filter:blur(2px); }
#delete-movement-modal .modal-content { background:#fff; margin:10% auto; padding:22px; border:none; width:440px; border-radius:14px; box-shadow:0 20px 50px rgba(0,0,0,0.25); border-top:4px solid #c53f3f; }
#delete-movement-modal .modal-title { margin:0 0 8px 0; color:#273729; font-weight:700; font-size:17px; }
#delete-movement-modal .modal-desc { margin:0 0 12px 0; color:#4d5b4f; font-size:13px; }
#delete-movement-modal .modal-box { padding:10px 14px; background:#f5faf0; border:1px solid #d8e7c8; border-radius:8px; color:#2f5f2f; font-weight:600; word-break:break-all; font-size:13px; }
#delete-movement-modal .modal-note { margin:12px 0 0 0; color:#888888; font-size:12px; }
#delete-movement-modal .modal-actions { text-align:right; margin-top:18px; display:flex; justify-content:flex-end; gap:8px; }
#mainbody #delete-movement-modal .button-delete { background:#c53f3f !important; border-color:#c53f3f !important; color:#fff !important; font-weight:700; border-radius:6px; padding:6px 14px; }
#mainbody #delete-movement-modal .button-delete:hover { background:#a83333 !important; border-color:#a83333 !important; }

.select2-drop, .select2-dropdown, .select2-container--open .select2-dropdown { z-index:10050 !important; border:1.5px solid #9cb46a !important; border-radius:8px !important; box-shadow:0 8px 24px rgba(0,0,0,0.15) !important; }
#residuo-popup-overlay .select2-drop, #residuo-popup-overlay .select2-dropdown { z-index:10060 !important; }
.select2-results__group { display:none !important; }
.select2-results__option, .select2-results .select2-result-label, .select2-results li { padding:9px 12px !important; font-size:13px !important; line-height:1.45 !important; word-break:break-word !important; white-space:normal !important; border-bottom:1px solid #f0f4f0 !important; background:#ffffff !important; color:#1b3323 !important; }

/* Normal State for Badges on White */
.select2-residuo-item { display:flex; flex-direction:column; gap:4px; padding:2px 0; }
.select2-residuo-top { display:flex; align-items:center; justify-content:space-between; gap:8px; font-weight:700; color:#183b23; font-size:13.5px; }
.select2-residuo-name { flex:1; color:#183b23; }
.select2-residuo-ler { background:#e8f4eb; color:#1b5e20; border:1px solid #c8e6c9; border-radius:4px; padding:1px 6px; font-size:10.5px; font-weight:700; white-space:nowrap; }
.select2-residuo-sub { display:flex; align-items:center; flex-wrap:wrap; gap:6px; font-size:11.5px; margin-top:2px; }
.select2-badge-tip { background:#eef6ff; color:#155799; border:1px solid #cce4ff; border-radius:4px; padding:1px 7px; font-weight:600; display:inline-flex; align-items:center; gap:4px; }
.select2-badge-tip i { font-size:10px; color:#2980b9; }
.select2-badge-fam { background:#f4f7f4; color:#3d5a45; border:1px solid #dbe6dc; border-radius:4px; padding:1px 7px; font-weight:500; display:inline-flex; align-items:center; gap:4px; }
.select2-badge-fam i { font-size:10px; color:#52785d; }
.select2-badge-stock { margin-left:auto; background:#fef9e7; color:#856404; border:1px solid #ffeeba; border-radius:4px; padding:1px 7px; font-weight:700; display:inline-flex; align-items:center; gap:4px; }
.select2-badge-stock i { font-size:10px; color:#d4ac0d; }

/* HOVER / HIGHLIGHTED STATE - Clear, high-contrast, beautiful */
.select2-results__option--highlighted, .select2-results .select2-highlighted,
.select2-results__option--highlighted[aria-selected], .select2-results .select2-highlighted[aria-selected] { background-color:#154c2b !important; color:#ffffff !important; }
.select2-results__option--highlighted .select2-residuo-top, .select2-results .select2-highlighted .select2-residuo-top { color:#ffffff !important; }
.select2-results__option--highlighted .select2-residuo-ler, .select2-results .select2-highlighted .select2-residuo-ler { background:#b9ce2b !important; color:#10381e !important; border-color:#b9ce2b !important; font-weight:800 !important; }
.select2-results__option--highlighted .select2-badge-tip, .select2-results .select2-highlighted .select2-badge-tip { background:#ffffff !important; color:#0b4f8a !important; border-color:#ffffff !important; font-weight:700 !important; }
.select2-results__option--highlighted .select2-badge-tip i, .select2-results .select2-highlighted .select2-badge-tip i { color:#0b4f8a !important; }
.select2-results__option--highlighted .select2-badge-fam, .select2-results .select2-highlighted .select2-badge-fam { background:rgba(255, 255, 255, 1) !important; border-color:rgba(255, 255, 255, 0.38) !important; font-weight:600 !important; }
.select2-results__option--highlighted .select2-badge-fam i, .select2-results .select2-highlighted .select2-badge-fam i { color:#b9ce2b !important; }
.select2-results__option--highlighted .select2-badge-stock, .select2-results .select2-highlighted .select2-badge-stock { background:#ffd54f !important; color:#5d4037 !important; border-color:#ffd54f !important; font-weight:800 !important; }
#residuo-popup .select2-container--default .select2-selection--single .select2-selection__rendered { line-height:32px; font-size:13px; color:#294434; padding-left:8px; padding-right:24px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* Dynamic Multi-line Waste Cards */
#gesvasa-waste-lines-container { display:flex; flex-direction:column; gap:14px; margin-bottom:12px; }
.gesvasa-waste-line-card { background:#ffffff; border:1.5px solid #cce0ce; border-radius:12px; padding:16px; box-shadow:0 2px 8px rgba(21,76,43,0.06); transition:border-color 0.2s, box-shadow 0.2s; position:relative; }
.gesvasa-waste-line-card:hover { border-color:#99c29d; box-shadow:0 4px 14px rgba(21,76,43,0.1); }
.waste-line-top-bar { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; padding-bottom:10px; border-bottom:1px solid #eef5ef; }
.waste-line-badge { font-size:13.5px; font-weight:800; color:#154c2b; background:#e8f4eb; border:1px solid #c3e2c7; border-radius:999px; padding:3px 12px; display:inline-flex; align-items:center; gap:6px; }
.btn-remove-waste-line { background:#fff1f1; border:1px solid #f5c2c2; color:#b72222; border-radius:6px; padding:4px 10px; font-size:12px; font-weight:700; cursor:pointer; display:inline-flex; align-items:center; gap:5px; transition:all 0.2s; }
.btn-remove-waste-line:hover { background:#d32f2f; color:#ffffff; border-color:#d32f2f; }

.waste-lines-actions-bar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; margin-top:8px; padding:10px 0 4px 0; }
.btn-add-waste-line { background:#f2f9f3 !important; border:1.5px dashed #154c2b !important; color:#154c2b !important; border-radius:8px; padding:8px 16px; font-size:13px; font-weight:700; cursor:pointer; display:inline-flex; align-items:center; gap:7px; transition:all 0.2s; }
.btn-add-waste-line:hover { background:#154c2b !important; color:#ffffff !important; border-style:solid !important; transform:translateY(-1px); box-shadow:0 4px 10px rgba(21,76,43,0.18); }
.waste-lines-summary-pill { background:#fbfdfb; border:1px solid #d0e4d2; border-radius:999px; padding:5px 14px; font-size:12.5px; font-weight:700; color:#234f31; display:inline-flex; align-items:center; gap:6px; margin-left:auto; }

/* Tipologia Photo Card Preview */
.tipologia-photo-card {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    padding: 8px 12px;
    background: #f7faf7;
    border: 1px solid #d2e4d4;
    border-radius: 10px;
    transition: all 0.2s ease;
}
.tipologia-photo-card.is-visible {
    display: flex !important;
}
.tipologia-photo-card .tip-card-img {
    width: 64px !important;
    height: 64px !important;
    min-width: 64px !important;
    min-height: 64px !important;
    max-width: 64px !important;
    max-height: 64px !important;
    border-radius: 8px;
    overflow: hidden;
    background-color: #e2ede4;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 1px solid #c2dac5;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.tipologia-photo-card .tip-card-img img {
    width: 100% !important;
    height: 100% !important;
    max-width: 64px !important;
    max-height: 64px !important;
    object-fit: cover !important;
    display: block !important;
}
.tipologia-photo-card .tip-card-img .no-photo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #799781;
    font-size: 10px;
    gap: 2px;
}
.tipologia-photo-card .tip-card-img .no-photo i {
    font-size: 16px;
}
.tipologia-photo-card .tip-card-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.tipologia-photo-card .tip-card-title {
    font-size: 13px;
    font-weight: 700;
    color: #1a4d2b;
    word-break: break-word;
}
.tipologia-photo-card .tip-card-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.tipologia-photo-card .tip-card-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 4px;
    background: #eef6ee;
    color: #235433;
    border: 1px solid #cfe2d2;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.tipologia-photo-card .tip-card-code {
    background: #fdf5e6;
    color: #7d5a15;
    border-color: #f1dfb9;
}

.gesvasa-dashboard-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(220px, 1fr)); gap:14px; margin:16px 0 20px 0; }
.gesvasa-kpi { border:1px solid #d9e4db; border-radius:12px; background:linear-gradient(180deg, #fbfdf9 0%, #f3f8f2 100%); padding:16px; }
.gesvasa-kpi-label { color:#58705f; font-size:13px; margin-bottom:6px; text-transform:uppercase; letter-spacing:0.04em; }
.gesvasa-kpi-value { color:#153b24; font-size:28px; font-weight:700; line-height:1.1; }
.gesvasa-kpi-note { color:#6d7f72; font-size:12px; margin-top:6px; }
.gesvasa-two-columns { display:grid; grid-template-columns:2fr 1fr; gap:16px; margin-top:16px; }
.gesvasa-three-columns { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:16px; margin-top:16px; }
.gesvasa-panel { border:1px solid #d8e4d8; border-radius:12px; background:#fff; overflow:hidden; }
.gesvasa-panel-title { background:#154C2B; color:#fff; padding:12px 14px; font-weight:700; border-bottom:1px solid #BFD23F; }
.gesvasa-panel-body { padding:14px; }
.gesvasa-breadcrumb { margin:16px 0 4px 0; display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.gesvasa-breadcrumb-item { display:inline-flex; align-items:center; gap:8px; }
.gesvasa-breadcrumb-link { display:inline-flex; align-items:center; border:1px solid #cad8cb; background:#fff; color:#23452f !important; border-radius:999px; padding:4px 10px; text-decoration:none; font-size:12px; font-weight:700 !important; text-transform:uppercase; }
.gesvasa-breadcrumb-link:hover { background:#f0f6ec; border-color:#b7c9b8; }
.gesvasa-breadcrumb-current { display:inline-flex; align-items:center; border:1px solid #89a98f; background:#e8f3e6; color:#1f4f2f; border-radius:999px; padding:4px 10px; font-size:12px; font-weight:700; }
.gesvasa-breadcrumb-sep { color:#7a8d7f; font-size:13px; }
.gesvasa-filterbar { margin-top:14px; border:1px solid #cfddd0; border-radius:18px; overflow:hidden; background:linear-gradient(135deg, #173f2a 0%, #245338 56%, #f0f6de 56%, #f8fbf1 100%); box-shadow:0 14px 34px rgba(24, 59, 39, 0.12); }
.gesvasa-filter-shell { display:grid; grid-template-columns:minmax(220px, 320px) 1fr; }
.gesvasa-filter-aside { padding:20px; color:#f4fbf5; border-right:1px solid #BFD23F; }
.gesvasa-filter-kicker { font-size:12px; text-transform:uppercase; letter-spacing:0.12em; opacity:0.72; margin-bottom:8px; }
.gesvasa-filter-title { font-size:28px; line-height:1.05; font-weight:700; margin:0 0 10px 0; }
.gesvasa-filter-note { font-size:13px; line-height:1.5; color:rgba(244,251,245,0.82); max-width:240px; }
.gesvasa-filter-period { display:inline-flex; align-items:center; gap:8px; margin-top:14px; padding:8px 12px; border-radius:999px; background:rgba(255,255,255,0.12); font-size:12px; font-weight:600; }
.gesvasa-filter-main { padding:20px; background:linear-gradient(180deg, rgba(255,255,255,0.92) 0%, #f8fbf1 100%); }
.gesvasa-filter-fields { display:grid; grid-template-columns:repeat(auto-fit, minmax(160px, 1fr)); gap:14px; }
.gesvasa-field label { display:block; margin-bottom:6px; color:#395643; font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:0.05em; }
.gesvasa-field select.flat { width:100%; min-height:40px; border:1px solid #b8ccb9; border-radius:12px; padding:0 10px; background:#fff; }
.gesvasa-filter-actions { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:16px; flex-wrap:wrap; }
.gesvasa-filter-hint { color:#6d7f72; font-size:12px; }
.gesvasa-filter-buttons { display:flex; gap:10px; flex-wrap:wrap; }
.gesvasa-filter-buttons .button { border-radius:999px; padding:8px 16px; }
.gesvasa-filter-buttons .button-cancel { background:#fff !important; color:#21452d !important; border:1px solid #b8ccb9 !important; }
.gesvasa-filter-buttons .button-quick-reset { background:#fdf1cf !important; border:1px solid #e6c778 !important; color:#6f5019 !important; }
.gesvasa-filter-origin { margin-top:10px; display:flex; align-items:center; gap:8px; flex-wrap:wrap; font-size:12px; }
.gesvasa-filter-origin .tag { background:#fff7de; border:1px solid #e6c778; color:#73521e; border-radius:999px; padding:4px 10px; font-weight:700; }
.gesvasa-detail-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:12px; }
.gesvasa-detail-search { min-width:280px; flex:1; max-width:420px; }
.gesvasa-detail-search input { width:100%; min-height:40px; border:1px solid #c8d7c8; border-radius:12px; padding:0 14px; background:#fff; }
.gesvasa-detail-status { color:#6d7f72; font-size:12px; }
.gesvasa-detail-table td, .gesvasa-detail-table th { white-space:nowrap; }
.gesvasa-detail-table th.gesvasa-sortable { cursor:pointer; user-select:none; position:relative; padding-right:20px; }
.gesvasa-detail-table th.gesvasa-sortable:after { content:"\2195"; position:absolute; right:8px; color:#7d8f81; font-size:11px; }
.gesvasa-detail-table th.gesvasa-sort-asc:after { content:"\2191"; color:#2a5b3b; }
.gesvasa-detail-table th.gesvasa-sort-desc:after { content:"\2193"; color:#2a5b3b; }
.gesvasa-amount-in { color:#1f6d3d; font-weight:600; }
.gesvasa-amount-out { color:#a63b32; font-weight:600; }
.gesvasa-amount-treatment { color:#2f5f9a; font-weight:700; }
.gesvasa-balance { color:#1d3557; font-weight:700; }
.gesvasa-chart-wrap { position:relative; height:280px; width:100%; overflow:hidden; }
.gesvasa-chart-wrap canvas { width:100% !important; height:100% !important; display:block; }
.gesvasa-chart-note { margin-top:10px; color:#425b4b; font-size:12px; min-height:18px; }
.gesvasa-view-controls { margin:14px 0 0 0; display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; }
.gesvasa-view-buttons { display:flex; gap:8px; flex-wrap:wrap; }
.gesvasa-view-buttons .button { border-radius:999px; font-weight:700; }
#mainbody a.button:not(.buttongen):not(.bordertransp):not(.gesvasa-view-buttons .button.gesvasa-active) { background:#154C2B !important; color:#fff !important; border-color:#154C2B !important; }
.gesvasa-view-note { color:#5f7668; font-size:12px; }
.gesvasa-secondary-hidden { display:none; }
.gesvasa-op-links { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:12px; margin-top:16px; }
.gesvasa-op-link { display:block; border:1px solid #d5e2d7; border-radius:12px; padding:14px; text-decoration:none !important; background:linear-gradient(180deg, #fff 0%, #f3f8f2 100%); }
.gesvasa-op-link-title { color:#17492c; font-size:15px; font-weight:700; margin-bottom:6px; }
.gesvasa-op-link-desc { color:#5a7363; font-size:12px; line-height:1.4; }
.gesvasa-percent-switch { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:10px; }
.gesvasa-percent-switch .button { border-radius:999px; }
.gesvasa-percent-switch .button.gesvasa-active { background:#154C2B !important; color:#fff !important; border-color:#154C2B !important; }

@media (max-width: 1100px) {
	.gesvasa-two-columns, .gesvasa-three-columns, .gesvasa-filter-shell, .gesvasa-filter-fields, .gesvasa-op-links { grid-template-columns:1fr; }
}

@media (max-width: 960px) {
	.gesvasa-mini-grid { grid-template-columns:1fr; }
}

@media (max-width: 768px) {
	#residuo-popup-overlay.is-open { padding:2vh 8px; }
	#residuo-popup .popup-body { padding:12px; }
	#residuo-popup table.border .titlefield { width:130px; }
	#residuo-popup .popup-actions { flex-direction:column-reverse; align-items:stretch; }
	.gesvasa-hierarchy-grid { grid-template-columns:1fr !important; }
}

/* ==================== CLASIFICACIÓN DE RESIDUOS (HIERARCHY EXPLORER) ==================== */
.gesvasa-crumb-bar { background:#f4f9ee; border:1px solid #d4e5bc; border-radius:10px; padding:10px 16px; margin-bottom:16px; font-size:13px; color:#2c4b31; display:flex; align-items:center; flex-wrap:wrap; gap:6px; }
.gesvasa-crumb-bar .crumb-title { font-weight:700; color:#154c2b; }
.gesvasa-crumb-bar .crumb-item { font-weight:600; }

.gesvasa-hierarchy-grid { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:14px; margin-bottom:24px; align-items:stretch; }
.gesvasa-hierarchy-col { background:#ffffff; border:1px solid #dce7df; border-radius:12px; display:flex; flex-direction:column; overflow:hidden; box-shadow:0 3px 12px rgba(0,0,0,0.03); min-height:480px; max-height:72vh; }
.gesvasa-col-header { background:#154c2b; color:#ffffff; padding:10px 12px; display:flex; justify-content:space-between; align-items:center; border-bottom:2px solid #b9ce2b; }
.gesvasa-col-title { font-size:14px; font-weight:700; }
.gesvasa-col-header .badge-count { background:rgba(255,255,255,0.22); color:#fff; font-size:11px; padding:2px 8px; border-radius:999px; font-weight:700; }
.button-action-add { background:#b9ce2b !important; color:#154c2b !important; border:none !important; border-radius:6px !important; font-size:11px !important; font-weight:700 !important; padding:3px 8px !important; cursor:pointer; }
.button-action-add:hover { background:#d4e84b !important; }

.gesvasa-col-search { padding:8px 10px; background:#f8fcf8; border-bottom:1px solid #e2ece3; }
.gesvasa-col-search input { width:100%; border:1px solid #c7dac9 !important; border-radius:6px !important; padding:4px 8px !important; font-size:12px !important; box-sizing:border-box; }
.gesvasa-col-list { flex:1; overflow-y:auto; padding:8px; display:flex; flex-direction:column; gap:6px; }

.gesvasa-tree-item { display:flex; flex-direction:column; background:#ffffff; border:1px solid #dce8dd; border-radius:9px; padding:9px 11px; text-decoration:none !important; color:#223326 !important; transition:all 0.15s ease; position:relative; box-shadow:0 1px 3px rgba(0,0,0,0.02); gap:4px; }
.gesvasa-tree-item:hover { border-color:#93b364; background:#f7fbf5; box-shadow:0 2px 6px rgba(0,0,0,0.05); }
.gesvasa-tree-item.is-active { border-color:#154c2b; background:#edf6e8; border-left:4px solid #154c2b; box-shadow:0 3px 8px rgba(21,76,43,0.12); }

.gesvasa-tree-item .item-header { display:flex; justify-content:space-between; align-items:center; gap:6px; flex-wrap:wrap; }
.gesvasa-tree-item .item-ref-title { font-weight:700; font-size:12.5px; color:#154c2b; font-family:monospace; }
.gesvasa-tree-item .item-badges { display:flex; align-items:center; gap:4px; flex-wrap:wrap; }

.gesvasa-tree-item .item-clickable { flex:1; text-decoration:none !important; color:inherit; min-width:0; cursor:pointer; padding-right:48px; }
.gesvasa-tree-item .item-title { font-weight:700; font-size:12.5px; line-height:1.25; color:#154c2b; word-break:break-word; }
.gesvasa-tree-item .item-label { font-weight:600; font-size:12px; color:#27432f; line-height:1.3; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; word-break:break-word; }
.gesvasa-tree-item .item-desc { font-size:11px; color:#556d5b; line-height:1.35; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; word-break:break-word; background:#f5f9f4; border-left:2px solid #b2cdb1; padding:2px 6px; border-radius:0 4px 4px 0; margin-top:2px; }
.gesvasa-tree-item .item-meta { display:flex; gap:4px; flex-wrap:wrap; font-size:10.5px; margin-top:2px; }

.badge-ler { background:#e8f4ec; color:#185a30; border:1px solid #beddc6; font-size:10px; padding:1px 5px; border-radius:4px; font-weight:700; }
.badge-code { background:#f4f6fa; color:#40516b; border:1px solid #d5dce6; font-size:10px; padding:1px 5px; border-radius:4px; font-weight:600; }
.badge-pill { background:#eef6e8; color:#2d5727; padding:1px 6px; border-radius:999px; font-weight:600; font-size:10.5px; border:1px solid #d0e4c6; }
.badge-leaf { color:#758a79; font-style:italic; }

.gesvasa-tree-item .item-actions { display:none; gap:3px; align-items:center; position:absolute; top:8px; right:8px; background:rgba(255,255,255,0.92); border-radius:4px; padding:1px 3px; box-shadow:0 1px 4px rgba(0,0,0,0.1); }
.gesvasa-tree-item:hover .item-actions { display:flex; }
.gesvasa-tree-item.is-active .item-actions { display:flex; }
.gesvasa-tree-item .action-btn { border:1px solid transparent; background:transparent; border-radius:4px; width:22px; height:22px; display:inline-flex; align-items:center; justify-content:center; cursor:pointer; font-size:13px; line-height:1; }
.gesvasa-tree-item .edit-btn { color:#2e6b41; }
.gesvasa-tree-item .edit-btn:hover { background:#e4efe2; border-color:#bed5ba; }
.gesvasa-tree-item .del-btn { color:#b93a3a; font-weight:700; }
.gesvasa-tree-item .del-btn:hover { background:#fde8e8; border-color:#f5c2c2; }

.empty-hint { padding:24px 14px; text-align:center; color:#6d8373; font-size:12px; line-height:1.4; }

/* Custom Hierarchy Modals */
.gesvasa-custom-modal-overlay { display:none; position:fixed; z-index:10000; inset:0; background:rgba(0,0,0,0.45); align-items:center; justify-content:center; padding:16px; backdrop-filter: blur(2px); }
.gesvasa-custom-modal-overlay.is-open { display:flex; animation: gesvasaFadeIn 0.2s ease-out; }
.gesvasa-custom-modal { background:#ffffff; width:100%; max-width:540px; border-radius:12px; box-shadow:0 18px 45px rgba(0,0,0,0.22); overflow:hidden; }
.gesvasa-custom-modal .modal-header { background:#154c2b; color:#fff; padding:12px 16px; font-weight:700; display:flex; justify-content:space-between; align-items:center; border-bottom:2px solid #b9ce2b; }
.gesvasa-custom-modal .modal-close { color:#fff; text-decoration:none; font-size:20px; font-weight:700; line-height:1; }
.gesvasa-custom-modal .modal-body { padding:18px; display:flex; flex-direction:column; gap:12px; max-height:calc(85vh - 120px); overflow-y:auto; }
.gesvasa-custom-modal .form-group label { display:block; margin-bottom:4px; font-weight:700; font-size:12px; color:#294434; }
.gesvasa-custom-modal .form-group input.flat, .gesvasa-custom-modal .form-group select.flat { width:100%; min-height:34px; border:1px solid #9cb46a; border-radius:6px; padding:0 8px; box-sizing:border-box; }
.gesvasa-custom-modal .modal-footer { padding:12px 18px; background:#f8fcf8; border-top:1px solid #e2ece3; display:flex; justify-content:flex-end; gap:8px; }
.gesvasa-custom-modal .button-save { background:#154c2b !important; color:#fff !important; border:1px solid #154c2b !important; border-radius:6px; padding:6px 14px; font-weight:700; cursor:pointer; }
.gesvasa-custom-modal .button-delete { background:#c53f3f !important; color:#fff !important; border:1px solid #c53f3f !important; border-radius:6px; padding:6px 14px; font-weight:700; cursor:pointer; }
.gesvasa-custom-modal .button-cancel { background:#e8f0e8 !important; color:#294434 !important; border:1px solid #c0d4c0 !important; border-radius:6px; padding:6px 14px; text-decoration:none; cursor:pointer; }

/* Tipología Photo Elements */
.gesvasa-tree-item.with-photo .item-clickable.flex-row-photo { display:flex; align-items:center; gap:10px; }
.tip-photo-thumb { width:42px; height:42px; min-width:42px; border-radius:8px; background-size:cover; background-position:center; background-repeat:no-repeat; border:2px solid #d4e5bc; box-shadow:0 2px 5px rgba(0,0,0,0.06); transition:transform 0.2s ease, box-shadow 0.2s ease; cursor:pointer; }
.tip-photo-thumb:hover { transform:scale(1.12); box-shadow:0 4px 10px rgba(21,76,43,0.2); }
.tip-photo-placeholder { width:42px; height:42px; min-width:42px; border-radius:8px; background:#eef6e8; border:1px dashed #bed5ba; display:flex; align-items:center; justify-content:center; color:#5c8365; font-size:16px; }
.tip-content-info { flex:1; min-width:0; }

/* Photo Upload Box in Modals */
.gesvasa-upload-box { border:2px dashed #9cb46a; border-radius:8px; padding:10px; background:#f9fcf8; text-align:center; transition:border-color 0.2s, background 0.2s, transform 0.15s; position:relative; }
.gesvasa-upload-box:hover { border-color:#154c2b; background:#f2f7ef; }
.gesvasa-upload-box.drag-hover { border-color:#154c2b !important; background:#e8f4ec !important; box-shadow:0 0 12px rgba(21,76,43,0.2) !important; transform:scale(1.01); }
.upload-dropzone { display:block !important; cursor:pointer !important; padding:12px 8px; width:100%; box-sizing:border-box; user-select:none; }
.upload-dropzone .upload-icon { font-size:28px; color:#154c2b; margin-bottom:6px; display:block; }
.upload-dropzone .upload-text { font-size:12.5px; font-weight:700; color:#154c2b; }
.upload-dropzone .upload-subtext { font-size:11px; color:#6d8373; margin-top:3px; }
.upload-dropzone .file-hidden, .file-hidden-input { display:none !important; }
.upload-preview-wrap { position:relative; display:inline-block; max-width:200px; margin:0 auto; border-radius:8px; overflow:hidden; border:2px solid #154c2b; box-shadow:0 3px 10px rgba(0,0,0,0.12); }
.upload-preview-wrap img { width:100%; height:120px; object-fit:cover; display:block; }
.upload-preview-wrap .btn-remove-photo { position:absolute; top:4px; right:4px; background:#c53f3f; color:#fff; border:none; border-radius:50%; width:24px; height:24px; font-size:16px; font-weight:bold; line-height:1; cursor:pointer; display:flex; align-items:center; justify-content:center; box-shadow:0 2px 5px rgba(0,0,0,0.25); }
.upload-preview-wrap .btn-remove-photo:hover { background:#a32626; transform:scale(1.1); }

/* Dynamic Tipología Preview Card in addStock / removeStock */
.tipologia-photo-card { display:none; margin-top:8px; background:linear-gradient(135deg, #f7faf5 0%, #edf6e8 100%); border:1px solid #cde0c5; border-left:4px solid #154c2b; border-radius:10px; padding:10px 14px; box-shadow:0 4px 14px rgba(21,76,43,0.06); animation:gesvasaSlideFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.tipologia-photo-card.is-visible { display:flex; align-items:center; gap:14px; }
.tipologia-photo-card .tip-card-img { width:68px; height:68px; min-width:68px; border-radius:8px; background-size:cover; background-position:center; background-repeat:no-repeat; border:2px solid #ffffff; box-shadow:0 3px 8px rgba(0,0,0,0.12); cursor:pointer; transition:transform 0.2s ease; }
.tipologia-photo-card .tip-card-img:hover { transform:scale(1.08); }
.tipologia-photo-card .tip-card-info { flex:1; min-width:0; }
.tipologia-photo-card .tip-card-title { font-weight:700; font-size:13.5px; color:#154c2b; line-height:1.3; }
.tipologia-photo-card .tip-card-badges { display:flex; gap:6px; margin-top:4px; align-items:center; flex-wrap:wrap; }
.tipologia-photo-card .tip-card-badge { font-size:10.5px; font-weight:600; padding:2px 8px; border-radius:999px; background:#ffffff; color:#2c5035; border:1px solid #bed7b9; }

@keyframes gesvasaFadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes gesvasaSlideFadeIn { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }

