.contacts-privacy-note { margin: 0 0 16px; line-height: 1.9; }
.contacts-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; margin-bottom: 15px; }
.contact-metric { display: flex; min-width: 0; align-items: center; gap: 11px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(145deg, #fff, #f8fbfc); box-shadow: var(--shadow); }
.contact-metric-icon, .contacts-panel-icon { display: grid; flex: 0 0 auto; place-items: center; width: 36px; height: 36px; border-radius: 11px; color: #278e84; background: #e6f5f2; }
.contact-metric-icon.green { color: #27896d; background: #e6f5ee; }
.contact-metric-icon.amber { color: #ad792b; background: #fff4df; }
.contact-metric-icon.rose { color: #bd5861; background: #fbecee; }
.contact-metric-icon .ui-icon, .contacts-panel-icon .ui-icon { width: 18px; height: 18px; }
.contact-metric > span:last-child { min-width: 0; }
.contact-metric small, .contact-metric strong { display: block; }
.contact-metric small { color: #8694a4; font-size: 10px; }
.contact-metric strong { color: #263950; font-size: 20px; line-height: 1.4; }
.contacts-top-grid { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 14px; align-items: start; margin-bottom: 14px; }
.contacts-groups-panel, .contact-editor-panel, .contacts-import-panel, .contacts-list-panel { min-width: 0; margin-bottom: 14px; }
.contacts-top-grid .panel { height: 100%; }
.contacts-panel-icon { color: #5279c4; background: #edf2fc; }
.contact-group-form { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 7px; margin-bottom: 12px; }
.contact-group-form input, .contact-form input, .contact-form select, .contact-form textarea, .contacts-import-controls select, .contacts-toolbar input, .contacts-toolbar select { min-width: 0; width: 100%; border: 1px solid #dfe6ed; border-radius: 8px; color: #354960; background: #fff; font: inherit; font-size: 11px; padding: 9px 10px; }
.contact-group-form .button { padding: 8px 11px; }
.contact-group-list { display: grid; gap: 7px; max-height: 335px; overflow: auto; padding-left: 2px; }
.contact-group-row { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 8px; border: 1px solid #e8edf1; border-radius: 11px; background: #fbfcfd; transition: border-color .15s ease, background .15s ease; }
.contact-group-row.active { border-color: #a9dbd4; background: #f0faf8; }
.contact-group-filter { display: flex; flex: 1; min-width: 0; align-items: center; gap: 9px; padding: 0; border: 0; color: inherit; background: transparent; text-align: right; }
.group-symbol { display: grid; flex: 0 0 auto; place-items: center; width: 31px; height: 31px; border-radius: 9px; color: #428f87; background: #e8f5f2; }
.group-symbol .ui-icon { width: 16px; height: 16px; }
.contact-group-filter > span:last-child { display: block; min-width: 0; }
.contact-group-filter strong, .contact-group-filter small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-group-filter strong { color: #40536a; font-size: 11px; }
.contact-group-filter small { color: #92a0ae; font-size: 9px; }
.group-total { color: #8897a8; font-size: 9px; white-space: nowrap; }
.contact-group-actions { display: flex; align-items: center; gap: 4px; }
.group-send-button, .group-edit-button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; border: 1px solid #dce7eb; border-radius: 7px; padding: 5px 7px; color: #42877e; background: #fff; font-size: 9px; white-space: nowrap; }
.group-send-button:hover, .group-edit-button:hover { border-color: #b5ddd5; background: #f4fbf9; }
.group-send-button:disabled { color: #aab4bf; background: #f4f6f8; cursor: not-allowed; }
.group-send-button .ui-icon, .group-edit-button .ui-icon { width: 13px; height: 13px; }
.contact-groups-empty { padding: 14px; border: 1px dashed #dfe6ec; border-radius: 10px; color: #94a1b0; font-size: 10px; text-align: center; }
.contact-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 11px; }
.contact-form > label { display: grid; align-content: start; gap: 5px; color: #617288; font-size: 10px; font-weight: 700; }
.contact-form input, .contact-form select, .contact-form textarea { font-weight: 400; }
.contact-form select[multiple] { min-height: 75px; padding: 5px; }
.contact-form label small { color: #99a5b2; font-size: 8px; font-weight: 400; }
.contact-notes-field { grid-column: 1 / -1; }
.contact-form textarea { resize: vertical; }
.contact-form-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 2px; }
.contact-form-actions .button { min-height: 37px; }
.contact-form-actions > span { color: #97a3b0; font-size: 9px; }
.contacts-import-panel .panel-heading { margin-bottom: 10px; }
.contacts-import-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.contacts-import-controls > span { color: #909cab; font-size: 9px; }
.contacts-import-controls .button { min-height: 34px; }
.contacts-import-controls input[type=file] { display: none; }
.contacts-import-group-label { margin-right: auto; color: #718198; font-size: 9px; }
.contacts-import-controls select { width: min(230px, 40vw); padding: 7px 9px; }
.contacts-import-summary { margin-top: 9px; color: #8795a4; font-size: 9px; line-height: 1.8; }
.contacts-import-preview { margin-top: 10px; }
.contacts-import-preview .button { margin-top: 9px; }
.import-preview-table { min-width: 520px !important; }
.contacts-list-panel { padding-bottom: 12px; }
.suppression-panel { padding-bottom: 12px; }
.suppression-table { min-width: 560px; }
.consent-history-dialog { width: min(850px, calc(100vw - 32px)); max-height: min(80vh, 720px); padding: 20px; border: 1px solid #dce6ec; border-radius: 15px; color: #34495e; background: #fff; box-shadow: 0 24px 80px #172a3d3d; }
.consent-history-dialog::backdrop { background: #10243d73; backdrop-filter: blur(3px); }
.consent-history-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.consent-history-header h2 { margin: 2px 0 0; font-size: 16px; }
.consent-history-content { min-height: 120px; max-height: calc(80vh - 110px); overflow: auto; }
.consent-history-table { min-width: 660px; }
.consent-history-table td small { display: block; margin-top: 4px; color: #8998a7; }
.contacts-count-tools { display: flex; align-items: center; gap: 7px; }
.contacts-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.contacts-toolbar input { flex: 1 1 200px; max-width: 300px; }
.contacts-toolbar select { width: auto; min-width: 145px; }
.contacts-toolbar .button { min-height: 34px; font-size: 10px; }
.contacts-table { width: 100%; min-width: 940px; border-collapse: collapse; }
.contacts-table th { padding: 9px 8px; color: #8391a0; font-size: 9px; font-weight: 700; background: #f7f9fb; text-align: right; white-space: nowrap; }
.contacts-table td { padding: 9px 8px; border-bottom: 1px solid #edf0f3; color: #53657a; font-size: 10px; vertical-align: middle; }
.contacts-table tbody tr:hover { background: #f9fcfc; }
.contacts-table .select-column { width: 53px; text-align: center; }
.contacts-table input[type=checkbox] { width: 16px; height: 16px; accent-color: #159c8f; cursor: pointer; }
.contacts-table input[type=checkbox]:disabled { cursor: not-allowed; opacity: .45; }
.contact-name, .contact-email { display: block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-name { color: #3e5269; font-size: 10px; }
.contact-email { color: #99a5b1; font-size: 8px; direction: ltr; text-align: right; }
.contact-phone { color: #435970 !important; font: 10px Consolas, monospace !important; white-space: nowrap; }
.contact-group-chips { display: flex; flex-wrap: wrap; gap: 4px; max-width: 190px; }
.contact-group-chip { display: inline-flex; padding: 2px 6px; border-radius: 999px; color: #567d76; background: #edf7f4; font-size: 8px; white-space: nowrap; }
.contact-no-group, .contact-updated { color: #9aa6b3 !important; font-size: 9px !important; white-space: nowrap; }
.contact-consent { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 999px; color: #8b743c; background: #fff5df; font-size: 8px; white-space: nowrap; }
.contact-consent i { width: 6px; height: 6px; border-radius: 50%; background: #d4a044; }
.contact-consent.subscribed { color: #268066; background: #e7f5ee; }
.contact-consent.subscribed i { background: #38a780; }
.contact-consent.unsubscribed { color: #b24e57; background: #fbecee; }
.contact-consent.unsubscribed i { background: #ce6870; }
.contact-row-actions { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.contact-edit-action, .contact-consent-action { border: 0; padding: 3px 2px; color: #45867f; background: transparent; font-size: 9px; }
.contact-edit-action:hover, .contact-consent-action:hover { text-decoration: underline; }
.contact-consent-action.optout { color: #b85c63; }
.contact-target-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 13px; padding: 12px 14px; border: 1px solid #bde4dc; border-radius: 12px; color: #31796f; background: linear-gradient(105deg,#effaf7,#f8fcfb); }
.contact-target-banner strong, .contact-target-banner small { display: block; }
.contact-target-banner strong { font-size: 11px; }
.contact-target-banner small { color: #7d9a96; font-size: 9px; }
.contact-target-banner .button { min-height: 32px; font-size: 9px; }
.merge-tag-help { margin: -3px 0 9px; color: #8191a2; font-size: 9px; }
.merge-tag-help code { display: inline-block; margin: 0 2px; padding: 1px 5px; border-radius: 5px; color: #477c75; background: #edf7f4; direction: ltr; }
.bulk-contact-name { display: block; color: #8a98a8; font: 8px Tahoma, sans-serif; text-align: right; }
body.density-compact .contact-metric { padding: 10px 12px; }
body.font-scale-large .contact-metric small, body.font-scale-large .contact-group-filter small, body.font-scale-large .contacts-table td, body.font-scale-large .contacts-toolbar .button { font-size: 11px; }
html.theme-dark .contact-metric, html.theme-dark .contact-group-row, html.theme-dark .contact-group-row.active, html.theme-dark .contact-group-form input, html.theme-dark .contact-form input, html.theme-dark .contact-form select, html.theme-dark .contact-form textarea, html.theme-dark .contacts-import-controls select, html.theme-dark .contacts-toolbar input, html.theme-dark .contacts-toolbar select, html.theme-dark .contacts-table th { color: #d4dfeb; background: #142338; border-color: #2a3b51; }
html.theme-dark .contact-metric strong, html.theme-dark .contact-group-filter strong, html.theme-dark .contact-name, html.theme-dark .contact-phone { color: #dbe5ef !important; }
html.theme-dark .contact-group-row.active { background: #15332f; }
html.theme-dark .group-send-button, html.theme-dark .group-edit-button { color: #9cd3c8; background: #1a2d43; border-color: #34475e; }
html.theme-dark .contacts-table tbody tr:hover { background: #17283c; }
html.theme-dark .contacts-table td { color: #c2d0df; border-color: #2a3b51; }
html.theme-dark .consent-history-dialog { color: #d4dfeb; background: #101d2d; border-color: #2a3b51; }
html.theme-dark .contact-group-chip { color: #a3d0c5; background: #18362f; }
html.theme-dark .contact-consent.unknown { color: #e2c37d; background: #382f1e; }
html.theme-dark .contact-consent.subscribed { color: #88d8b8; background: #17362f; }
html.theme-dark .contact-consent.unsubscribed { color: #ed9da4; background: #3b252d; }
html.theme-dark .contact-target-banner { color: #a8ddd2; background: #16332f; border-color: #2d5b54; }
html.theme-dark .contact-target-banner small { color: #9abdb7; }
html.theme-dark .merge-tag-help code { color: #a6d8cd; background: #18362f; }
@media (max-width: 1100px) {
  .contacts-top-grid { grid-template-columns: 1fr; }
  .contacts-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .contacts-metrics { gap: 8px; }
  .contact-metric { padding: 10px; gap: 8px; }
  .contact-metric-icon { width: 31px; height: 31px; }
  .contact-metric strong { font-size: 17px; }
  .contact-group-form { grid-template-columns: minmax(0, 1fr) auto; }
  .contact-group-form .button:last-child { grid-column: 2; }
  .group-total { display: none; }
  .group-send-button { font-size: 0; width: 31px; height: 31px; padding: 0; }
  .group-send-button .ui-icon { width: 15px; height: 15px; }
  .contact-group-actions { gap: 3px; }
  .contact-form { grid-template-columns: 1fr; }
  .contact-notes-field, .contact-form-actions { grid-column: auto; }
  .contacts-import-controls { align-items: stretch; }
  .contacts-import-controls .button, .contacts-import-controls > span { flex: 1 1 100%; }
  .contacts-import-group-label { flex: 0 0 auto !important; align-self: center; }
  .contacts-import-controls select { flex: 1 1 55%; width: auto; }
  .contacts-toolbar input, .contacts-toolbar select, .contacts-toolbar .button { max-width: none; width: 100%; }
  .contact-target-banner { align-items: flex-start; flex-direction: column; }
  .contact-target-banner .button { align-self: flex-start; }
}
