/* TST: retain green identity, apply one geometry to public pages and admin.
   Full-bleed layouts, charts, logos and joined inner edges remain structural. */
:root { --tst-radius-card: 16px; --tst-radius-control: 12px; --tst-radius-small: 8px; }
body { --tst-field-bg: #fff; --tst-field-ink: #133e35; --tst-field-line: #cadbd5; --tst-field-muted: #526c63; --tst-field-selected: #d5eee3; --tst-field-hover: #bce5d3; --tst-field-ring: #21785a; }
body.tst-public-home:not(.tst-store-page):not(.tst-login-page) { --tst-field-bg: #123d34; --tst-field-ink: #f4fff9; --tst-field-line: #538e7a; --tst-field-muted: #b6d9cb; --tst-field-selected: #215b48; --tst-field-hover: #2e6a53; --tst-field-ring: #a8ebd0; }
body.admin-system-page { --admin-card-radius: var(--tst-radius-card); --admin-control-radius: var(--tst-radius-control); }

/* Real container and dropdown selectors work for both legacy and new selects. */
body.tst-ui .select2-container { max-width: 100%; min-width: 0; font-family: Inter, sans-serif; font-size: .88rem; }
body.tst-ui .select2-container[hidden] { display: none !important; }
body.tst-ui .select2-container .select2-selection {
  box-sizing: border-box; display: flex; align-items: center; min-height: 44px !important; height: auto !important;
  border: 1px solid var(--tst-field-line); border-radius: var(--tst-radius-control) !important;
  background: var(--tst-field-bg) !important; color: var(--tst-field-ink) !important;
}
body.tst-ui .select2-container .select2-selection--single .select2-selection__rendered { flex: 1; min-width: 0; padding: .65rem 2rem .65rem .8rem !important; line-height: 1.4 !important; color: var(--tst-field-ink) !important; }
body.tst-ui .select2-container .select2-selection .select2-selection__arrow { position: absolute; right: 12px !important; top: 50% !important; width: 16px !important; height: 16px !important; min-height: 0; padding: 0 !important; border: 0 !important; background: transparent !important; transform: translateY(-50%); }
body.tst-ui .select2-selection__arrow::after { content: ''; position: absolute; width: 7px; height: 7px; left: 3px; top: 2px; border-right: 2px solid var(--tst-field-muted); border-bottom: 2px solid var(--tst-field-muted); transform: rotate(45deg); }
body.tst-ui .select2-selection__arrow b { display: none; }
body.tst-ui .select2-container--open .select2-selection__arrow::after { top: 6px; transform: rotate(225deg); }
body.tst-ui .select2-container--focus .select2-selection, body.tst-ui .select2-container--open .select2-selection { outline: 2px solid var(--tst-field-ring); outline-offset: 2px; }
body.tst-ui .select2-container .select2-selection .select2-selection__placeholder { color: var(--tst-field-muted); }
body.tst-ui .select2-selection--multiple { flex-wrap: wrap; padding: .3rem .4rem; }
body.tst-ui .select2-selection--multiple .select2-selection__rendered { display: flex; flex-wrap: wrap; gap: .3rem; margin: 0; padding: 0; }
body.tst-ui .select2-selection__choice { max-width: 100%; margin: 0; border: 1px solid var(--tst-field-line); border-radius: 8px; background: var(--tst-field-selected); color: var(--tst-field-ink); }
body.tst-ui .select2-selection__choice__remove { border-color: var(--tst-field-line); color: var(--tst-field-ink); }
body.tst-ui .select2-container--disabled .select2-selection { opacity: .6; cursor: not-allowed; }
body.tst-ui .select2-dropdown { box-sizing: border-box; border: 1px solid var(--tst-field-line); border-radius: var(--tst-radius-control); overflow: hidden; background: var(--tst-field-bg); color: var(--tst-field-ink); box-shadow: 0 14px 34px #092c292b; }
body.tst-ui > .select2-container--open { z-index: 20000; }
body.tst-ui dialog .select2-container--open { z-index: 10; }
body.tst-ui dialog.tst-select2-open { overflow: visible !important; }
body.tst-ui .select2-search--dropdown { padding: .6rem; }
body.tst-ui .select2-dropdown .select2-search__field { box-sizing: border-box; width: 100%; min-height: 42px; padding: .55rem .7rem; border: 1px solid var(--tst-field-line); border-radius: 8px; background: var(--tst-field-bg); color: var(--tst-field-ink); font: inherit; }
body.tst-ui .select2-dropdown .select2-search__field:focus { outline: 2px solid var(--tst-field-ring); outline-offset: -2px; }
body.tst-ui .select2-dropdown .select2-search__field::placeholder { color: var(--tst-field-muted); opacity: 1; }
body.tst-ui .select2-results__options { max-height: 280px; overflow-y: auto; overscroll-behavior: contain; }
body.tst-ui .select2-results__option { padding: .65rem .8rem; background: var(--tst-field-bg); color: var(--tst-field-ink); overflow-wrap: anywhere; }
body.tst-ui .select2-results__option--selected, body.tst-ui .select2-results__option[aria-selected=true] { background: var(--tst-field-selected); color: var(--tst-field-ink); font-weight: 600; }
body.tst-ui .select2-results__option--highlighted[aria-selected] { background: var(--tst-field-hover); color: var(--tst-field-ink); }
body.tst-ui .select2-results__option--disabled { color: var(--tst-field-muted); }

/* Inputs/buttons: preserve native circles, switches, range sliders and badges. */
body input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=range]), body select, body textarea { border-radius: var(--tst-radius-control) !important; max-width: 100%; min-width: 0; }
body :is(button, .btn, .admin-create-btn, .inv-action, .pros-btn, .expense-edit, .form-submit, .store-btn) { border-radius: var(--tst-radius-control); }
body :is(input, select, textarea, button):focus-visible { outline-offset: 3px; }
body :is(.card, .card-panel, .admin-card, .module-card, .module-section, .module-filter,
 .stat, .stat-card, .kpi, .panel, .summary-card, .filter-panel, .filter-bar, .filters,
 .inv-card, .inv-panel, .expense-card, .user-card, .bank-card, .pros-card,
 .client-card, .task-card, .act-item, .accounting-note, .system-resource,
 .service-card, .project-card, .project-gallery-slide, .reconocimiento-item, .campanas-item,
 .home-store-card, .store-card, .product-card, .store-product, .home-store-empty,
 .login-card, .auth-card, .review-band, .cat-card, .cat-row, .cat-head, .cat-filters, .ob-front,
 .ob-box, .ob-plan, .ob-band, .faq-item, .pd-feature-card, .pd-benefit-card) {
  border-radius: var(--tst-radius-card) !important;
}
body :is(.modal-content, dialog:not(:fullscreen), .admin-dialog-content) { border-radius: var(--tst-radius-card); }
body :is(.project-gallery-slide, .reconocimiento-item, .campanas-item, .home-store-image) { overflow: clip; }
body :is(.table-container, .table-wrap, .admin-table-wrap, .table-responsive) { border-radius: var(--tst-radius-control); }
body :is(.form-group, .field, .inv-field, .filter-field) { min-width: 0; }
body :is(.badge, .tag, .chip, .cat-chip, .cat-save-state, .filter-chip) { border-radius: var(--tst-radius-small); }
body input[type=file]::file-selector-button { border-radius: 8px; }

/* Bordered public controls replace the former square underline-only inputs. */
body.tst-public-home #contacto .form-control { border: 1px solid #75b59d !important; border-radius: 12px !important; padding: .8rem 1rem !important; background: #0b302b !important; color: #fff !important; }
@media (pointer: coarse), (max-width: 820px) {
  body.tst-ui .select2-container .select2-selection, body.tst-ui .select2-dropdown .select2-search__field { font-size: 16px; }
}
