/* Ajustes de composición sobre los componentes compartidos de HEMSA360. */
.container { width: min(1200px, 100%); margin: 0 auto; padding: 28px; font-size: 1.4rem; gap: 20px; }
.top-bar, .top-bar-actions, .filters { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.top-bar { justify-content: space-between; position: relative; padding-right: 36px; }
.top-bar h1 { margin: 0; }
.contactos-column-filters input, .contactos-column-filters select { width: 100%; min-width: 110px; box-sizing: border-box; margin: 0; }
.importacion-actions { margin-left: auto; justify-content: flex-end; }
.importacion-actions form { margin: 0; }
.importacion-actions .btn { width: auto; }
.user_info { display: flex; align-items: center; gap: 12px; }
header .logo { text-decoration: none; }
header .logo #logo_span { display: inline; }
.user_info form { margin: 0; }
.hemsa-workspace { flex: 1; }
.filters label, .detail-form label { display: flex; flex-direction: column; gap: 6px; }
input, select { font: inherit; min-height: 40px; padding: 8px 10px; border: 1px solid #c9d5dc; border-radius: 6px; background: white; color: #2e3033; max-width: 100%; }
.filters { align-items: flex-end; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 12px; border-bottom: 1px solid #dfe8e5; }
th { background: #f8faf9; }
.detail-form { border: 1px solid #c9d5dc; background: #fff; padding: 24px; border-radius: 9px; }
.form-section { display: flex; flex-direction: column; gap: 12px; max-width: 650px; }
[hidden] { display: none !important; }
.detail-form .checkbox { flex-direction: row; align-items: center; }
.form_actions { margin-top: 24px; }
.notice { padding: 12px; background: #e7f6f1; border: 1px solid #b8d9ce; border-radius: 6px; }
.usuario-page { gap: 0; }
.usuario-page .top-bar, .usuario-page .notice { margin-bottom: 20px; }
.top-bar .hemsa-detalle-close { top: 0; right: 0; width: 32px; height: 32px; }
.dashboard-section p { font-size: 1.4rem; margin-bottom: 16px; line-height: 1.6; }
.dashboard-page { height: auto; overflow: visible; min-height: calc(100vh - 104px); }
body:has(.dashboard-page) { overflow: auto; }
body:has(.dashboard-page) footer { display: flex; }
.dashboard-shell { height: auto; grid-template-rows: auto; }
.dashboard-grid { align-items: start; }
.login-form p { font-size: 1.3rem; }
.login-card .login-text { margin-top: 20px; margin-bottom: 0; }
.contactos-page h2 { font-size: 1.8rem; margin: 20px 0 12px; }
.contactos-page h3 { font-size: 1.5rem; }
.contactos-page p { line-height: 1.6; margin: 8px 0; }
.contactos-page fieldset { border: 0; min-width: 0; }
.contactos-page textarea { font: inherit; padding: 10px; border: 1px solid #c9d5dc; border-radius: 6px; resize: vertical; max-width: 100%; }
.contacto-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.contacto-wide { grid-column: 1 / -1; }
.contacto-section { margin-top: 20px; padding: 16px 0; border-top: 1px solid #dfe8e5; }
.contacto-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; max-height: 260px; overflow-y: auto; margin: 12px 0; }
.contacto-help { color: #52555b; font-size: 1.3rem; }
#contacto-ficha { width: 100%; }
.contacto-save-bar { display: flex; justify-content: flex-end; position: sticky; top: 0; z-index: 3; padding: 10px 0; background: #fff; }
.contacto-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.contacto-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.tags-page { width: 100%; }
.tags-top-bar { display: grid; grid-template-columns: 1fr minmax(180px, 400px) 1fr; gap: 20px; padding-right: 0; }
.tags-top-bar h1 { justify-self: start; }
.tags-top-bar > a { justify-self: end; }
.tags-search { width: 100%; box-sizing: border-box; }
@media (max-width: 640px) {
  .tags-top-bar { grid-template-columns: 1fr auto; }
  .tags-search { grid-column: 1 / -1; grid-row: 2; }
}
.tags-catalogo { min-height: 65vh; }
.tags-letter-group + .tags-letter-group { margin-top: 20px; padding-top: 16px; border-top: 1px solid #e3eae5; }
.tags-page .tags-letter { margin: 0 0 10px; color: #387357; font-size: 1.5rem; font-weight: 400; text-align: left; }
.tags-letter-group .contacto-tags { margin: 0; }
.tag-catalogo-link { text-decoration: none; padding: 10px 14px; gap: 12px; }
.tag-catalogo-link:hover { background: #d6e4d9; }
.tag-catalogo-link:focus-visible { outline: 2px solid #387357; outline-offset: 2px; }
.tag-count { border-radius: 12px; padding: 2px 8px; background: #fff; font-weight: 400; }
.tag-detalle-page { width: 100%; }
.tag-redes { display: flex; flex-wrap: wrap; gap: 12px; }
.contacto-tags-box { margin-top: 24px; border: 1px solid #d4ded8; border-radius: 8px; padding: 16px; min-height: 140px; background: #fcfdfc; }
.contacto-tags-header { display: flex; align-items: center; justify-content: space-between; }
.contacto-tags-header h2 { margin: 0; }
.tags-dialog-header button { width: 32px; height: 32px; border: 1px solid #d4ded8; border-radius: 6px; background: white; color: #387357; font-size: 2.2rem; cursor: pointer; }
.contacto-tag { display: inline-flex; align-items: center; gap: 8px; background: #edf3ee; color: #345c43; border: 1px solid #d8e4da; border-radius: 5px; padding: 5px 8px 5px 12px; overflow-wrap: anywhere; }
.contacto-tag button { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: #65806d; font-size: 1.8rem; cursor: pointer; }
.contacto-tag button:hover { background: #d6e4d9; color: #254c33; }
.contacto-tag button { pointer-events: auto; transition: font-size 120ms ease, background-color 120ms ease, color 120ms ease; }
.contacto-tag button:hover, .contacto-tag button:focus { font-size: 2.2rem; background: #d6e4d9; color: #254c33; }
.contacto-tag button:focus-visible { outline: 2px solid #387357; outline-offset: 2px; }
.contacto-tag button:active { transform: none; }
.contacto-tags-empty { color: #7a827c; }
.tags-dialog { position: fixed; inset: 0; margin: auto; width: min(440px, calc(100vw - 40px)); max-height: 80vh; padding: 24px; border: 1px solid #d6ddd7; border-radius: 12px; box-shadow: 0 20px 65px #0003; color: #2e3033; background: #fff; box-sizing: border-box; }
.tags-dialog::backdrop { background: #17241c66; }
.tags-dialog-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.tags-dialog-header h2 { margin: 0; }
.tags-dialog input { width: 100%; box-sizing: border-box; }
.tags-dialog-list { display: flex; flex-direction: column; gap: 3px; max-height: 40vh; overflow-y: auto; margin-top: 14px; }
.tags-dialog-list button { justify-content: flex-start; text-align: left; border: 0; border-radius: 5px; padding: 10px 12px; background: transparent; color: #345c43; font: inherit; cursor: pointer; }
.tags-dialog-list button:hover:not(:disabled) { background: #edf3ee; }
.tags-dialog-list button:disabled { color: #8a958d; cursor: default; }
.tags-manage-link { display: inline-block; margin-top: 18px; }
.contactos-page td { overflow-wrap: anywhere; }
.contactos-page .detalle-tabs { margin-top: 12px; }
@media(max-width: 640px) {
  .contacto-fields { grid-template-columns: 1fr; }
  .container { padding: 20px 16px 20px 28px; }
  .top-bar h1 { font-size: 2.2rem; }
  .user_info { gap: 4px; min-width: 0; margin-left: 4px; }
  header .logo #logo_span { font-size: 1.6rem; }
  .detail-form { padding: 16px; }
}

.red-social-row { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(0, 3fr) auto; gap: 12px; align-items: end; margin-bottom: 12px; }
.red-social-row label { min-width: 0; }
.red-social-enlace { min-width: 0; }
.red-social-enlace [data-vista-enlace] { display: flex; flex-direction: column; gap: 6px; }
.red-social-enlace a { display: flex; align-items: center; min-height: 40px; overflow-wrap: anywhere; text-decoration: underline; }
.red-social-actions { display: flex; align-items: center; gap: 8px; }
.red-social-actions .btn { width: auto; margin: 0; min-height: 40px; }
.red-social-actions .red-social-remove { width: 40px; padding: 0; background: #fce8e8; color: #a33131; border: 1px solid #efcaca; font-size: 2rem; }
.red-social-actions .red-social-remove:hover { background: #f7d4d4; }
@media(max-width: 640px) { .red-social-row { grid-template-columns: 1fr; } }

.contacto-row { cursor: pointer; transition: background-color 120ms ease; }
.contacto-row:hover { background-color: #edf8f4; }
.contacto-row:focus-within { background-color: #d9f1e8; outline: 2px solid #138f6f; outline-offset: -2px; }
.contacto-row-link { color: inherit; text-decoration: none; display: block; }
.contacto-row-link:focus-visible { outline: 2px solid #138f6f; outline-offset: 3px; border-radius: 2px; }

.contacto-form-header, .contacto-form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; flex-wrap: wrap; }
.contacto-form-header { margin-bottom: 16px; }
.contacto-form-header h2 { margin: 0 auto 0 0; }

.redes-sociales-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 0 12px; }
.redes-sociales-header h2 { margin: 0; }
