@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap');

* { box-sizing: border-box; }

html:has(body.contacts-page) {
  min-height: 100%;
  background: #eaf7f3;
}

body.contacts-page {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  overflow-x: hidden;
  color: #183437;
  background: #eaf7f3;
  font-family: 'DM Sans', sans-serif;
}

body.contacts-page::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  content: '';
  pointer-events: none;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 4%, rgba(91, 214, 190, .25), transparent 28%),
    radial-gradient(circle at 92% 96%, rgba(255, 189, 112, .2), transparent 30%),
    linear-gradient(135deg, #eaf7f3 0%, #f8fbf6 48%, #fff3e6 100%);
}

body.contacts-page main {
  position: relative;
  background: transparent;
}

.contacts-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 48px 0 64px; }
.contacts-header, .contacts-toolbar, .contacts-summary, .contact-card, .contact-form-card {
  border: 1px solid rgba(255, 255, 255, .82);
  background: rgba(255, 255, 255, .58);
  box-shadow: 0 22px 60px rgba(24, 52, 55, .1), inset 0 1px rgba(255,255,255,.8);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}
.contacts-header { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 34px 38px; border-radius: 26px; }
.contacts-header-actions { display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; flex: 0 0 auto; }
.contacts-eyebrow { display: block; color: #138b78; font-size: .72rem; font-weight: 800; letter-spacing: .13em; }
.contacts-header h1 { margin: 7px 0 5px; color: #123b3b; font-family: 'Manrope', sans-serif; font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: 0; }
.contacts-header p { margin: 0; color: #5b7271; }
.contacts-back-link, .contacts-import-link, .contacts-primary, .contacts-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border-radius: 15px; font-weight: 700; text-decoration: none; transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease; }
.contacts-back-link, .contacts-import-link { position: relative; overflow: hidden; padding: 11px 15px; border: 1px solid rgba(255,255,255,.82); box-shadow: 0 8px 20px rgba(24,52,55,.08), inset 0 1px rgba(255,255,255,.9); }
.contacts-back-link::after, .contacts-import-link::after { position: absolute; inset: 1px; border: 1px solid rgba(255,255,255,.22); border-radius: 13px; content: ''; pointer-events: none; }
.contacts-back-link { color: #176f68; background: rgba(255,255,255,.72); }
.contacts-back-link:hover { background: rgba(255,255,255,.92); box-shadow: 0 10px 22px rgba(24,52,55,.12); }
.contacts-import-link { color: #fff; background: linear-gradient(135deg, #087878 0%, #0ea5a0 70%, #36b8ae 100%); box-shadow: 0 10px 24px rgba(1,69,79,.2), inset 0 1px rgba(255,255,255,.28); }
.contacts-import-link:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(22,138,121,.28), inset 0 1px rgba(255,255,255,.35); }
.contacts-back-link:focus-visible, .contacts-import-link:focus-visible { outline: 3px solid rgba(22,138,121,.3); outline-offset: 3px; }
.contacts-back-link:hover, .contacts-primary:hover { transform: translateY(-2px); }
.contacts-toolbar { display: flex; gap: 14px; align-items: center; margin: 18px 0; padding: 14px; border-radius: 18px; }
.contacts-search { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; padding: 0 14px; color: #4f7772; }
.contacts-search input { width: 100%; border: 0; outline: 0; background: transparent; color: #183437; font: inherit; padding: 11px 0; }
.contacts-filter { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; min-height: 41px; padding: 0 11px; border: 1px solid rgba(49,105,98,.16); border-radius: 11px; color: #4f7772; background: rgba(245,252,249,.68); }
.contacts-filter select { min-width: 142px; border: 0; outline: 0; color: #315c59; background: transparent; font: inherit; cursor: pointer; }
.contacts-filter select option { color: #234b4a; background: #f4fbf8; }
.contacts-clear-search { display: grid; flex: 0 0 auto; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 9px; color: #5b7772; background: rgba(222,243,236,.7); cursor: pointer; transition: color .2s ease, background .2s ease, transform .2s ease; }
.contacts-clear-search:hover { color: #fff; background: #168a79; transform: translateY(-1px); }
.contacts-clear-search[hidden] { display: none; }
.contacts-view-toggle { display: inline-flex; flex: 0 0 auto; gap: 3px; padding: 3px; border: 1px solid rgba(49, 105, 98, .14); border-radius: 11px; background: rgba(224, 239, 234, .62); }
.contacts-view-button { display: grid; place-items: center; width: 35px; height: 35px; border: 0; border-radius: 8px; color: #5d7773; background: transparent; cursor: pointer; }
.contacts-view-button.is-active { color: #fff; background: #168a79; box-shadow: 0 5px 12px rgba(22,138,121,.2); }
.contacts-primary { border: 0; padding: 12px 18px; color: #fff; background: #168a79; box-shadow: 0 10px 20px rgba(22,138,121,.2); cursor: pointer; }
.contacts-secondary { border: 1px solid rgba(30, 98, 91, .18); padding: 11px 17px; color: #28625e; background: rgba(255,255,255,.65); cursor: pointer; }
.contacts-content { display: grid; gap: 16px; }
.contacts-groups-section { display: grid; gap: 16px; margin-top: 20px; }
.contacts-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 6px 4px; }
.contacts-section-heading h2 { margin: 4px 0 3px; color: #183f3e; font-family: 'Manrope', sans-serif; font-size: 1.35rem; }
.contacts-section-heading p { margin: 0; color: #718582; font-size: .88rem; }
.contact-groups-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.contact-group-card { display: flex; align-items: center; gap: 13px; padding: 18px; border: 1px solid rgba(255,255,255,.72); border-radius: 18px; color: #204847; background: linear-gradient(135deg, rgba(255,255,255,.68), rgba(244,252,248,.42)); box-shadow: 0 18px 44px rgba(24,52,55,.08), inset 0 1px rgba(255,255,255,.9); backdrop-filter: blur(18px) saturate(125%); -webkit-backdrop-filter: blur(18px) saturate(125%); }
.contact-group-card strong, .contact-group-card small { display: block; }
.contact-group-card small { margin-top: 4px; color: #718582; }
.contact-group-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: #fff; background: linear-gradient(145deg, #168a79, #67b99d); font-size: 1.1rem; }
.contact-group-modal { position: fixed; inset: 0; z-index: 21; display: none; place-items: center; overflow-y: auto; padding: 20px; background: rgba(13, 44, 44, .42); backdrop-filter: blur(8px) saturate(115%); -webkit-backdrop-filter: blur(8px) saturate(115%); }
.contact-group-modal.is-visible { display: grid; }
.contact-group-card[role="dialog"] { position: relative; display: block; width: min(520px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto; padding: 30px; background: linear-gradient(145deg, rgba(255,255,255,.92), rgba(239,250,245,.86)); box-shadow: 0 30px 90px rgba(6,48,48,.3), inset 0 1px rgba(255,255,255,.98); }
.contact-group-name-field { margin-bottom: 0; }
.contact-group-name-field input { border-color: rgba(22,138,121,.3); background: rgba(255,255,255,.86); box-shadow: 0 6px 16px rgba(22,138,121,.07), inset 0 1px rgba(255,255,255,.96); }
.group-members-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-top: 27px; padding-top: 20px; border-top: 1px solid rgba(49,105,98,.14); color: #53706e; font-size: .88rem; font-weight: 700; }
.group-members-heading > div { display: grid; gap: 4px; }
.group-members-kicker { color: #138b78; font-size: .66rem; font-weight: 800; letter-spacing: .12em; }
.group-members-heading strong { color: #168a79; }
.group-members-search { display: flex; align-items: center; gap: 9px; margin: 12px 0 10px; padding: 0 13px; border: 1px solid rgba(22,138,121,.3); border-radius: 13px; color: #168a79; background: rgba(232,249,242,.76); box-shadow: 0 7px 18px rgba(22,138,121,.08), inset 0 1px rgba(255,255,255,.9); transition: border-color .2s ease, box-shadow .2s ease, background .2s ease; }
.group-members-search:focus-within { border-color: #168a79; background: rgba(247,255,251,.94); box-shadow: 0 0 0 3px rgba(22,138,121,.12), 0 8px 20px rgba(22,138,121,.1); }
.group-members-search input { width: 100%; border: 0; outline: 0; padding: 11px 0; background: transparent; font: inherit; }
.group-members-list { display: grid; gap: 8px; max-height: 260px; overflow-y: auto; padding: 3px; }
.group-member-item { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 11px; border: 1px solid rgba(49,105,98,.14); border-radius: 13px; cursor: pointer; background: rgba(255,255,255,.68); box-shadow: 0 5px 14px rgba(24,52,55,.07), inset 0 1px rgba(255,255,255,.9); transition: border-color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s ease; }
.group-member-item:hover { border-color: rgba(22,138,121,.38); background: rgba(247,255,251,.9); box-shadow: 0 8px 18px rgba(24,52,55,.1), inset 0 1px rgba(255,255,255,.95); transform: translateY(-1px); }
.group-member-item:has(input:checked) { border-color: rgba(22,138,121,.58); background: linear-gradient(135deg, rgba(224,248,239,.96), rgba(255,255,255,.86)); box-shadow: 0 8px 20px rgba(22,138,121,.14), inset 0 0 0 1px rgba(22,138,121,.08); }
.group-member-item input { flex: 0 0 auto; width: 17px; height: 17px; accent-color: #168a79; }
.contact-picker-avatar { display: grid; flex: 0 0 34px; place-items: center; width: 34px; height: 34px; border-radius: 11px; color: #fff; background: linear-gradient(145deg, #168a79, #67b99d); font-family: 'Manrope', sans-serif; font-size: .9rem; font-weight: 800; box-shadow: 0 5px 12px rgba(22,138,121,.18); }
.group-member-item span:last-child { min-width: 0; }
.group-member-item strong, .group-member-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-member-item small { margin-top: 2px; color: #718582; font-size: .76rem; }
.contacts-summary { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-radius: 18px; }
.contacts-summary-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: #fff; background: #e28a52; font-size: 1.2rem; }
.contacts-summary strong, .contacts-summary small { display: block; }
.contacts-summary strong { color: #234b4a; }
.contacts-summary small { margin-top: 3px; color: #718684; }
.contacts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.contacts-table-wrapper { display: none; overflow-x: auto; border: 1px solid rgba(255,255,255,.82); border-radius: 18px; background: rgba(255,255,255,.55); box-shadow: 0 22px 60px rgba(24,52,55,.08); backdrop-filter: blur(18px); }
.contacts-table-wrapper:not([hidden]) { display: block; }
.contacts-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.contacts-table thead { border-bottom: 1px solid rgba(80,122,115,.18); background: rgba(235,244,240,.62); }
.contacts-table th { padding: 14px 16px; color: #607b76; font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.contacts-table td { padding: 13px 16px; border-bottom: 1px solid rgba(90,128,120,.1); color: #456360; font-size: .88rem; white-space: nowrap; }
.contacts-table tbody tr:last-child td { border-bottom: 0; }
.contacts-table tbody tr:hover { background: rgba(255,255,255,.55); }
.table-contact-name { display: flex; align-items: center; gap: 11px; min-width: 220px; }
.table-contact-name .contact-avatar { width: 38px; height: 38px; border-radius: 11px; font-size: 1rem; }
.table-contact-name strong, .table-contact-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-contact-name strong { color: #204847; }
.table-contact-name small { margin-top: 3px; color: #8a9896; font-size: .74rem; }
.contacts-table .table-actions { text-align: right; white-space: nowrap; }
.contacts-table .table-actions .contact-icon-action { display: inline-grid; margin-left: 3px; }
.contact-card { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; gap: 14px 13px; min-width: 0; padding: 18px; border-radius: 18px; transition: transform .2s ease, background .2s ease; }
.contact-card:hover { transform: translateY(-3px); background: rgba(255,255,255,.78); }
.contact-avatar { display: grid; flex: 0 0 44px; place-items: center; width: 44px; height: 44px; border-radius: 15px; color: #fff; background: linear-gradient(145deg, #1a9b87, #77c9a9); font-family: 'Manrope', sans-serif; font-size: 1.1rem; }
.contact-card-copy { min-width: 0; flex: 1; }
.contact-card-copy strong, .contact-card-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-card-copy strong { display: inline-block; max-width: 100%; color: #204847; vertical-align: middle; }
.contact-card-copy span { margin-top: 4px; color: #708684; font-size: .88rem; }
.contact-card-copy span + span { margin-top: 2px; }
.contact-card-copy .contact-bsuid { margin-top: 3px; color: #32847a; font-size: .74rem; }
.contact-card-copy .contact-official-name { display: inline-flex; max-width: 100%; margin: 0 0 0 7px; overflow: hidden; padding: 3px 7px; border: 1px solid rgba(119, 145, 141, .16); border-radius: 7px; color: #71827f; background: rgba(235, 241, 239, .62); font-size: .72rem; vertical-align: middle; }
.contact-card-actions { grid-column: 1 / -1; display: inline-flex; justify-content: flex-end; gap: 6px; width: 100%; padding-top: 11px; border-top: 1px solid rgba(90, 128, 120, .12); white-space: nowrap; }
.contacts-grid.contacts-list-view { display: grid; grid-template-columns: 1fr; gap: 8px; }
.contacts-grid.contacts-list-view .contact-card { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto; gap: 13px; padding: 13px 16px; border-radius: 14px; }
.contacts-grid.contacts-list-view .contact-card-actions { grid-column: auto; padding-top: 0; border-top: 0; }
.contacts-grid.contacts-list-view .contact-card-copy .contact-official-name { margin-left: 6px; }
.contacts-grid.contacts-list-view .contact-card-copy .contact-bsuid { display: inline-block; margin-left: 8px; }
.contact-icon-action, .contact-form-close { display: grid; place-items: center; border: 0; border-radius: 10px; width: 34px; height: 34px; color: #34736c; background: rgba(222, 243, 236, .72); cursor: pointer; }
.contact-icon-action:hover, .contact-form-close:hover { color: #fff; background: #168a79; }
.contacts-loading, .contacts-empty { grid-column: 1 / -1; display: grid; place-items: center; gap: 7px; min-height: 180px; padding: 32px; color: #6c8380; text-align: center; }
.contacts-empty i { font-size: 2rem; color: #e28a52; }
.contact-form-modal { position: fixed; inset: 0; z-index: 20; display: none; place-items: center; overflow-y: auto; padding: 20px; background: rgba(13, 44, 44, .42); backdrop-filter: blur(8px) saturate(115%); -webkit-backdrop-filter: blur(8px) saturate(115%); }
.contact-form-modal.is-visible { display: grid; }
.contact-form-backdrop { position: absolute; inset: 0; }
.contact-form-card { position: relative; width: min(440px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto; padding: 30px; border-radius: 24px; background: linear-gradient(145deg, rgba(255,255,255,.84), rgba(239,250,245,.7)); box-shadow: 0 30px 90px rgba(6, 48, 48, .28), inset 0 1px rgba(255,255,255,.98); backdrop-filter: blur(30px) saturate(135%); -webkit-backdrop-filter: blur(30px) saturate(135%); }
.contact-form-close { position: absolute; top: 18px; right: 18px; }
.contact-form-card h2 { margin: 7px 0 24px; color: #183f3e; font-family: 'Manrope', sans-serif; }
.contact-field { display: grid; gap: 7px; margin: 16px 0; color: #53706e; font-size: .88rem; font-weight: 700; }
.contact-field input { width: 100%; border: 1px solid rgba(49, 105, 98, .2); border-radius: 11px; outline: 0; padding: 12px 13px; color: #183437; background: rgba(255,255,255,.68); font: inherit; box-shadow: inset 0 1px 2px rgba(22, 67, 63, .04); transition: border-color .2s ease, box-shadow .2s ease, background .2s ease; }
.contact-field input:focus { border-color: #168a79; background: rgba(255,255,255,.88); box-shadow: 0 0 0 3px rgba(22,138,121,.14), inset 0 1px 2px rgba(22, 67, 63, .04); }
.phone-input-row { display: flex; gap: 8px; }
.phone-input-row select { width: 152px; min-width: 152px; border: 1px solid rgba(49, 105, 98, .2); border-radius: 11px; outline: 0; padding: 0 32px 0 11px; color: #315c59; background-color: rgba(255,255,255,.7); background-image: linear-gradient(45deg, transparent 50%, #168a79 50%), linear-gradient(135deg, #168a79 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-repeat: no-repeat; background-size: 5px 5px, 5px 5px; font: inherit; cursor: pointer; appearance: none; transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease; }
.phone-input-row select:focus { border-color: #168a79; background-color: rgba(255,255,255,.9); box-shadow: 0 0 0 3px rgba(22,138,121,.14); }
.phone-input-row select option { color: #234b4a; background: #f4fbf8; }
.phone-input-row input { flex: 1; min-width: 0; }
.phone-input-row select:disabled { color: #687777; background: rgba(226, 232, 232, .72); cursor: not-allowed; }
.contact-field input:disabled,
.contact-field input[readonly] { border-color: rgba(113, 128, 128, .2); color: #687777; background: rgba(226, 232, 232, .72); box-shadow: inset 0 1px 2px rgba(38, 57, 57, .05); cursor: not-allowed; }
.contact-field-hint { color: #7a8988; font-size: .75rem; font-weight: 500; }
.contact-form-actions { display: flex; justify-content: end; gap: 9px; margin-top: 24px; }
.import-contacts-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 18px; margin-top: 18px; }
.import-panel, .import-guide { border: 1px solid rgba(255,255,255,.78); border-radius: 24px; background: linear-gradient(145deg, rgba(255,255,255,.78), rgba(244,252,248,.58)); box-shadow: 0 22px 60px rgba(24,52,55,.1), inset 0 1px rgba(255,255,255,.9); backdrop-filter: blur(22px) saturate(125%); -webkit-backdrop-filter: blur(22px) saturate(125%); }
.import-panel { padding: 30px; }
.import-panel-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.import-panel-heading h2, .import-guide h2 { margin: 0; color: #183f3e; font-family: 'Manrope', sans-serif; }
.import-panel-heading p { margin: 5px 0 0; color: #718582; }
.import-panel-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; color: #fff; background: linear-gradient(145deg, #168a79, #67b99d); box-shadow: 0 10px 20px rgba(22,138,121,.2); font-size: 1.3rem; }
.import-dropzone { display: grid; place-items: center; gap: 8px; min-height: 190px; padding: 24px; border: 1px dashed rgba(22,138,121,.45); border-radius: 18px; color: #53706e; background: rgba(231,249,242,.54); cursor: pointer; text-align: center; transition: border-color .2s ease, background .2s ease, transform .2s ease, box-shadow .2s ease; }
.import-dropzone > i { color: #168a79; font-size: 2.3rem; }
.import-dropzone strong { color: #204847; font-size: 1rem; }
.import-dropzone span { color: #718582; font-size: .82rem; }
.import-dropzone:hover, .import-dropzone.is-dragging, .import-dropzone.has-file { border-color: #168a79; background: rgba(220,247,237,.82); box-shadow: 0 10px 24px rgba(22,138,121,.1); transform: translateY(-1px); }
.import-submit { width: 100%; margin-top: 14px; }
.import-status { margin-top: 14px; padding: 12px 14px; border-radius: 12px; font-size: .86rem; font-weight: 700; }
.import-status[hidden] { display: none; }
.import-status.is-loading { color: #52706c; background: rgba(224,239,234,.75); }
.import-status.is-success { color: #176f68; background: rgba(215,247,232,.85); }
.import-status.is-error { color: #934f42; background: rgba(255,230,214,.85); }
.import-preview-panel { display: grid; grid-column: 1 / -1; gap: 16px; width: 100%; margin-top: 18px; padding: 26px; border: 1px solid rgba(255,255,255,.72); border-radius: 24px; background: rgba(255,255,255,.68); box-shadow: 0 22px 60px rgba(15,23,42,.08), inset 0 1px rgba(255,255,255,.9); backdrop-filter: blur(22px) saturate(125%); -webkit-backdrop-filter: blur(22px) saturate(125%); }
.import-preview-panel[hidden] { display: none; }
.import-preview-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.import-preview-heading h2 { margin: 5px 0 3px; color: #014651; font-family: 'Manrope', sans-serif; font-size: 1.35rem; }
.import-preview-heading p { margin: 0; color: #6b7280; font-size: .86rem; }
.import-preview-heading > strong { color: #014651; white-space: nowrap; }
.import-preview-list { display: grid; gap: 9px; max-height: 520px; overflow-y: auto; padding: 2px; }
.import-preview-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: end; gap: 12px; padding: 12px; border: 1px solid rgba(226,232,240,.9); border-radius: 14px; background: rgba(255,255,255,.78); box-shadow: 0 5px 14px rgba(15,23,42,.05), inset 0 1px rgba(255,255,255,.8); }
.import-preview-row.is-invalid { border-color: rgba(220,107,77,.4); background: rgba(255,247,243,.88); }
.import-preview-fields { display: grid; grid-template-columns: minmax(180px, .9fr) minmax(220px, 1.1fr); gap: 10px; min-width: 0; }
.import-preview-fields label { display: grid; gap: 5px; color: #64748b; font-size: .72rem; font-weight: 800; }
.import-preview-fields input { width: 100%; min-width: 0; border: 1px solid rgba(226,232,240,.95); border-radius: 9px; padding: 9px 10px; outline: 0; color: #111b21; background: rgba(255,255,255,.9); font: inherit; }
.import-preview-fields input:focus { border-color: #0ea5a0; box-shadow: 0 0 0 3px rgba(14,165,160,.12); }
.import-preview-state { grid-column: 1 / -1; color: #64748b; font-size: .74rem; font-weight: 800; }
.import-preview-state.is-valid { color: #15803d; }
.import-preview-state.is-invalid { color: #c2412d; }
.import-preview-remove { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid rgba(220,107,77,.25); border-radius: 10px; color: #b4533e; background: rgba(255,244,237,.78); cursor: pointer; }
.import-preview-remove:hover { color: #fff; background: #dc6b4d; }
.import-preview-empty { margin: 0; color: #64748b; text-align: center; }
.import-preview-submit { justify-self: end; }
.import-preview-submit:disabled { opacity: .52; box-shadow: none; cursor: not-allowed; transform: none; }
.import-status-report { display: grid; gap: 12px; color: #334155; background: rgba(255,255,255,.78); }
.import-report-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.import-report-summary strong { color: #014651; font-size: .95rem; }
.import-report-summary span { color: #64748b; font-size: .8rem; }
.import-export-errors { justify-self: start; display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid rgba(220,107,77,.3); border-radius: 10px; color: #934f42; background: rgba(255,244,237,.82); cursor: pointer; font: inherit; font-size: .78rem; font-weight: 800; }
.import-export-errors:hover { border-color: #dc6b4d; background: rgba(255,232,218,.95); }
.import-log { overflow: hidden; border: 1px solid rgba(226,232,240,.9); border-radius: 12px; background: rgba(255,255,255,.7); }
.import-log summary { display: flex; align-items: center; gap: 7px; padding: 10px 12px; color: #014651; cursor: pointer; font-weight: 800; list-style: none; }
.import-log summary::-webkit-details-marker { display: none; }
.import-log summary i { color: #16a34a; }
.import-log-error summary { color: #934f42; }
.import-log-error summary i { color: #dc6b4d; }
.import-log ul { display: grid; gap: 6px; max-height: 250px; margin: 0; padding: 0 10px 10px; overflow-y: auto; list-style: none; }
.import-log li { display: flex; align-items: flex-start; gap: 9px; padding: 8px; border-top: 1px solid rgba(226,232,240,.72); }
.import-log li > div { display: grid; min-width: 0; gap: 3px; }
.import-log li strong, .import-log li small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-log li strong { color: #1e293b; }
.import-log li small { color: #64748b; font-size: .76rem; }
.import-log-line { flex: 0 0 auto; padding: 3px 6px; border-radius: 6px; color: #64748b; background: #f1f5f9; font-size: .68rem; font-weight: 800; }
.import-repair-error { display: inline-flex; align-items: center; flex: 0 0 auto; gap: 5px; margin-left: auto; padding: 6px 9px; border: 1px solid rgba(0,125,144,.26); border-radius: 9px; color: #014651; background: rgba(255,255,255,.8); cursor: pointer; font: inherit; font-size: .72rem; font-weight: 800; }
.import-repair-error:hover { border-color: #0ea5a0; background: #e8fbf8; }
.import-error-editor { display: grid; gap: 10px; margin-top: 4px; padding: 14px; border: 1px solid rgba(0,125,144,.25); border-radius: 14px; background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(176,247,239,.22)); box-shadow: 0 10px 24px rgba(1,69,79,.1); }
.import-error-editor > strong { color: #014651; font-size: .86rem; }
.import-error-editor label { display: grid; gap: 5px; color: #64748b; font-size: .75rem; font-weight: 800; }
.import-error-editor input { width: 100%; border: 1px solid rgba(226,232,240,.95); border-radius: 9px; padding: 9px 10px; outline: 0; color: #111b21; background: rgba(255,255,255,.9); font: inherit; }
.import-error-editor input:focus { border-color: #0ea5a0; box-shadow: 0 0 0 3px rgba(14,165,160,.12); }
.import-error-editor > div { display: flex; justify-content: flex-end; gap: 8px; }
.import-repair-cancel, .import-repair-save { border-radius: 9px; padding: 8px 10px; cursor: pointer; font: inherit; font-size: .75rem; font-weight: 800; }
.import-repair-cancel { border: 1px solid rgba(226,232,240,.95); color: #64748b; background: rgba(255,255,255,.78); }
.import-repair-save { border: 1px solid rgba(255,255,255,.3); color: #fff; background: linear-gradient(135deg, #087878, #0ea5a0); }
.import-guide { padding: 30px; }
.import-guide h2 { margin-top: 8px; font-size: 1.45rem; }
.import-format { display: grid; gap: 4px; margin-top: 22px; padding-top: 16px; border-top: 1px solid rgba(49,105,98,.14); }
.import-format strong { color: #168a79; font-size: .78rem; letter-spacing: .1em; }
.import-format span, .import-note span { color: #667d79; font-size: .86rem; line-height: 1.5; }
.import-note { display: flex; align-items: flex-start; gap: 9px; margin-top: 25px; padding: 13px; border-radius: 13px; color: #168a79; background: rgba(224,248,239,.72); }
.import-note i { margin-top: 2px; }
.import-contacts-page .contacts-header { align-items: center; }
@media (max-width: 760px) {
  .import-contacts-layout { grid-template-columns: 1fr; }
  .import-panel, .import-guide { padding: 22px; }
  .import-preview-panel { padding: 22px; }
  .import-preview-heading { align-items: start; flex-direction: column; }
  .import-preview-fields { grid-template-columns: 1fr; }
  .import-preview-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .import-preview-submit { width: 100%; }
}

@media (max-width: 640px) {
  .contacts-shell { width: min(100% - 24px, 560px); padding: 18px 0 36px; }
  .contacts-header { align-items: start; flex-direction: column; padding: 25px 22px; }
  .contacts-header-actions { width: 100%; justify-content: stretch; }
  .contacts-header-actions > a { flex: 1 1 0; }
  .contacts-toolbar { align-items: stretch; flex-direction: column; }
  .contacts-filter { width: 100%; }
  .contacts-filter select { flex: 1; min-width: 0; }
  .contacts-clear-search { align-self: flex-end; }
  .contacts-view-toggle { align-self: flex-start; }
  .contacts-primary { width: 100%; }
  .contacts-grid { grid-template-columns: 1fr; }
  .contacts-table-wrapper:not([hidden]) { display: block; }
  .contact-form-modal { place-items: start center; padding: 12px; }
  .contact-form-card { max-height: calc(100dvh - 24px); margin: 0; padding: 26px 22px; -webkit-overflow-scrolling: touch; }
  .contact-group-modal { place-items: start center; padding: 12px; }
  .contact-group-card[role="dialog"] { max-height: calc(100dvh - 24px); padding: 26px 22px; -webkit-overflow-scrolling: touch; }
}

/* Palette shared with the conversations workspace. */
body.contacts-page {
  color: #111b21;
  background: #edf2f7;
}
body.contacts-page::before {
  background: radial-gradient(circle at top left, rgba(135,206,255,.16), transparent 24%), radial-gradient(circle at bottom right, rgba(59,130,246,.12), transparent 24%), linear-gradient(180deg, #edf2f7 0%, #f8fafc 35%, #eef2ff 100%);
}
.contacts-header, .contacts-toolbar, .contacts-summary, .contact-card {
  border-color: rgba(255,255,255,.72);
  background: rgba(255,255,255,.68);
  box-shadow: 0 22px 60px rgba(15,23,42,.08), inset 0 1px rgba(255,255,255,.9);
}
.contacts-header h1, .contacts-section-heading h2, .contact-form-card h2 { color: #014651; }
.contacts-header p, .contacts-section-heading p { color: #6b7280; }
.contacts-eyebrow, .group-members-kicker { color: #087878; }
.contacts-primary { background: linear-gradient(135deg, #087878, #0ea5a0); box-shadow: 0 10px 22px rgba(1,69,79,.16), inset 0 1px rgba(255,255,255,.24); }
.contacts-primary:hover { box-shadow: 0 13px 26px rgba(1,69,79,.22), inset 0 1px rgba(255,255,255,.3); }
.contacts-back-link { color: #014651; background: rgba(255,255,255,.72); }
.contacts-import-link { background: linear-gradient(135deg, #087878 0%, #0ea5a0 70%, #36b8ae 100%); box-shadow: 0 10px 22px rgba(1,69,79,.16), inset 0 1px rgba(255,255,255,.24); }
.contacts-search, .group-members-search { color: #6b7280; }
.contacts-filter, .contacts-clear-search { border-color: rgba(226,232,240,.78); color: #64748b; background: rgba(255,255,255,.72); }
.contacts-filter select { color: #334155; }
.contacts-summary-icon { background: linear-gradient(135deg, #087878, #0ea5a0); }
.contact-avatar, .contact-picker-avatar, .contact-group-icon { background: linear-gradient(135deg, #087878, #0ea5a0); }
.contact-card:hover, .contact-group-card:hover { background: rgba(255,255,255,.82); }
.contact-form-card, .contact-group-card[role="dialog"] { border-color: rgba(255,255,255,.78); background: rgba(255,255,255,.88); box-shadow: 0 30px 80px rgba(15,23,42,.18), inset 0 1px rgba(255,255,255,.95); }
.contact-field input, .phone-input-row select { border-color: rgba(226,232,240,.9); color: #111b21; background: rgba(255,255,255,.86); }
.contact-field input:focus, .phone-input-row select:focus { border-color: #0ea5a0; box-shadow: 0 0 0 3px rgba(14,165,160,.14); }
.group-members-search { border-color: rgba(0,125,144,.32); background: linear-gradient(135deg, rgba(255,255,255,.72), rgba(176,247,239,.3)); }
.group-member-item { border-color: rgba(226,232,240,.9); background: rgba(255,255,255,.82); box-shadow: inset 0 0 0 1px rgba(255,255,255,.6), 0 5px 14px rgba(15,23,42,.06); }
.group-member-item:hover { border-color: rgba(0,125,144,.32); background: rgba(255,255,255,.94); }
.group-member-item:has(input:checked) { border-color: rgba(0,125,144,.42); background: linear-gradient(135deg, rgba(255,255,255,.82), rgba(176,247,239,.3)); box-shadow: 0 10px 22px rgba(1,69,79,.12), inset 3px 0 0 #36b8ae; }
.import-panel, .import-guide { border-color: rgba(255,255,255,.72); background: rgba(255,255,255,.68); box-shadow: 0 22px 60px rgba(15,23,42,.08), inset 0 1px rgba(255,255,255,.9); }
.import-panel-icon { background: linear-gradient(135deg, #087878, #0ea5a0); }
.import-dropzone { border-color: rgba(0,125,144,.32); background: linear-gradient(135deg, rgba(255,255,255,.68), rgba(176,247,239,.3)); }
.import-dropzone:hover, .import-dropzone.is-dragging, .import-dropzone.has-file { border-color: #0ea5a0; background: rgba(255,255,255,.88); }
