/* 이메일 주소록 (2026-08-11) — 워크스페이스 > 이메일 > 주소록 (email_contacts_co)
 *
 * 이메일 목록(.eml-*)과 같은 톤이지만 그 스타일은 뷰 인라인 <style> 자산이라 재사용하지 않고
 * (개발규칙 1 — 신규 뷰는 컴포넌트 CSS), 주소록 전용 .ecb-* 로 둔다.
 */

.ecb-wrap { display: flex; flex-direction: column; gap: 14px; }

/* ── 툴바 ── */
.ecb-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ecb-toolbar-left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ecb-title { display: flex; align-items: center; gap: 11px; }
.ecb-title-icon { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 18px; background: #eef2ff; }
.ecb-title-text { font-size: 18px; font-weight: 800; color: #0f172a; letter-spacing: -0.01em; }
.ecb-count { font-size: 12px; font-weight: 700; color: #475569; background: #eef2f7; border-radius: 999px; padding: 2px 9px; }

.ecb-tabs { display: inline-flex; gap: 3px; padding: 3px; background: #f1f5f9; border-radius: 9px; }
.ecb-tab { padding: 6px 14px; border-radius: 6px; font-size: 13px; font-weight: 600; color: #64748b; text-decoration: none; transition: all .12s; }
.ecb-tab.active { background: #fff; color: #1e3a8a; box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.ecb-toolbar-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ecb-ctl { height: 40px; box-sizing: border-box; }
.ecb-select { padding: 0 12px; border: 1px solid #e2e8f0; border-radius: 10px; font-size: 13px; background: #fff; max-width: 220px; color: #334155; cursor: pointer; }
.ecb-search { display: flex; align-items: center; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 0 6px 0 4px; min-width: 220px; transition: border-color .12s, box-shadow .12s; }
.ecb-search:focus-within { border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.ecb-search-btn { display: flex; align-items: center; justify-content: center; width: 30px; height: 100%; border: none; background: transparent; color: #94a3b8; cursor: pointer; }
.ecb-search-btn:hover { color: #3b82f6; }
.ecb-search input { border: none; outline: none; padding: 0 4px; font-size: 13px; flex: 1; min-width: 0; background: transparent; height: 100%; }
.ecb-btn { display: inline-flex; align-items: center; gap: 6px; padding: 0 16px; border: none; border-radius: 10px; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; transition: filter .12s, transform .05s; }
.ecb-btn:active { transform: translateY(1px); }
.ecb-btn:hover { filter: brightness(1.05); }
.ecb-btn-primary { background: #10b981; color: #fff; box-shadow: 0 1px 2px rgba(16,185,129,.3); }

/* ── 칩 바 (그룹·즐겨찾기) ── */
.ecb-chips-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ecb-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ecb-chip { padding: 5px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: #475569; background: #fff; border: 1px solid #e2e8f0; text-decoration: none; white-space: nowrap; transition: all .12s; }
.ecb-chip:hover { border-color: #93c5fd; color: #2563eb; }
.ecb-chip.active { background: #4338ca; border-color: #4338ca; color: #fff; }
.ecb-chip-none { color: #94a3b8; }
.ecb-chip-none.active { background: #64748b; border-color: #64748b; color: #fff; }
.ecb-chip-fav.active { background: #b45309; border-color: #b45309; color: #fff; }
.ecb-chip-count { font-size: 11px; font-weight: 600; color: #94a3b8; }
.ecb-chip.active .ecb-chip-count { color: rgba(255,255,255,.75); }
.ecb-chip-divider { width: 1px; height: 20px; background: #e2e8f0; }
.ecb-groups-gear { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; color: #94a3b8; cursor: pointer; transition: all .12s; }
.ecb-groups-gear:hover { border-color: #93c5fd; color: #2563eb; }

/* ── 안내 (다른 회원 열람 중) ── */
.ecb-notice { padding: 9px 13px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; font-size: 12.5px; color: #92400e; font-weight: 600; }

/* ── 목록 ── */
.ecb-list { background: #fff; border: 1px solid #e8edf3; border-radius: 13px; overflow: hidden; box-shadow: 0 1px 3px rgba(15,23,42,.04); }
.ecb-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #f1f5f9; cursor: pointer; transition: background .1s; }
.ecb-row:last-child { border-bottom: none; }
.ecb-row:hover { background: #f8fafc; }

.ecb-star { flex-shrink: 0; display: flex; align-items: center; }
.ecb-star form { display: inline; margin: 0; line-height: 0; }
.ecb-star-btn { border: none; background: transparent; cursor: pointer; font-size: 16px; line-height: 1; padding: 4px; color: #cbd5e1; transition: transform .1s; }
.ecb-star-btn:hover { transform: scale(1.15); }
.ecb-star-btn.on { color: #f59e0b; }
.ecb-star-static { font-size: 16px; padding: 4px; color: #f59e0b; }
.ecb-star-static.off { color: #e2e8f0; }

.ecb-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ecb-name-line { display: flex; align-items: center; gap: 7px; min-width: 0; flex-wrap: wrap; }
.ecb-name { font-size: 13.5px; font-weight: 700; color: #0f172a; }
.ecb-org { font-size: 12px; color: #64748b; }
.ecb-badge { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; border-radius: 6px; padding: 1px 7px; height: 19px; line-height: 1; white-space: nowrap; }
.ecb-badge-group { color: #4338ca; background: #eef2ff; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.ecb-sub-line { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.ecb-email { font-size: 12.5px; color: #2563eb; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ecb-memo { font-size: 12px; color: #a3acba; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1 1 0; min-width: 0; }
.ecb-phone { flex-shrink: 0; font-size: 12px; color: #475569; font-variant-numeric: tabular-nums; }

.ecb-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 60px 20px; background: #fff; border: 1px dashed #d8dee9; border-radius: 13px; }
.ecb-empty-icon { font-size: 38px; opacity: .55; }
.ecb-empty p { margin: 0; font-size: 13.5px; color: #94a3b8; }

/* ── 등록/수정 모달 필드 ── */
.ecb-f { display: grid; gap: 12px; padding: 16px 20px; }
.ecb-f-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ecb-f label { display: block; font-size: 12px; font-weight: 600; color: #475569; margin-bottom: 4px; }
.ecb-f label .req { color: #ef4444; }
.ecb-f input[type="text"], .ecb-f input[type="email"], .ecb-f input[type="tel"], .ecb-f select, .ecb-f textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 13px;
  box-sizing: border-box; background: #fff; color: #0f172a;
}
.ecb-f input:disabled, .ecb-f select:disabled, .ecb-f textarea:disabled { background: #f8fafc; color: #475569; cursor: default; }
.ecb-f textarea { min-height: 72px; resize: vertical; }
.ecb-f-hint { margin: 3px 0 0; font-size: 11px; color: #94a3b8; line-height: 1.5; }
.ecb-f-fav { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #334155; font-weight: 600; }

/* 폼 안 「＋ 그룹 추가」 입력 행 — select 에서 추가 항목 선택 시에만 노출 */
.ecb-g-addrow { display: flex; gap: 6px; margin-top: 6px; }
.ecb-g-addrow[hidden] { display: none; }
.ecb-g-addrow input { flex: 1; min-width: 0; }
.ecb-g-cancel { padding: 8px 12px; border: 1px solid #e2e8f0; border-radius: 6px; background: #fff; color: #64748b; font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.ecb-g-cancel:hover { background: #f8fafc; }
.ecb-f-kind { display: inline-flex; gap: 3px; padding: 3px; background: #f1f5f9; border-radius: 9px; }
.ecb-f-kind label { display: inline-flex; align-items: center; gap: 5px; margin: 0; padding: 6px 14px; border-radius: 6px; font-size: 13px; font-weight: 600; color: #64748b; cursor: pointer; }
.ecb-f-kind input { display: none; }
.ecb-f-kind label:has(input:checked) { background: #fff; color: #1e3a8a; box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* ── 그룹 관리 모달 ── */
.ecb-g-list { display: flex; flex-direction: column; gap: 8px; padding: 16px 20px; }
.ecb-g-row { display: flex; align-items: center; gap: 8px; }
.ecb-g-row form { display: flex; align-items: center; gap: 8px; flex: 1; margin: 0; }
.ecb-g-row input[type="text"] { flex: 1; padding: 8px 11px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 13px; box-sizing: border-box; }
.ecb-g-save { padding: 8px 12px; border: 1px solid #c7d2fe; border-radius: 6px; background: #eef2ff; color: #4338ca; font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.ecb-g-save:hover { background: #e0e7ff; }
.ecb-g-del { padding: 8px 12px; border: 1px solid #fecaca; border-radius: 6px; background: #fff; color: #dc2626; font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.ecb-g-del:hover { background: #fef2f2; }
.ecb-g-count { flex-shrink: 0; font-size: 11.5px; color: #94a3b8; font-weight: 600; min-width: 34px; text-align: right; }
.ecb-g-add { border-top: 1px dashed #e2e8f0; padding-top: 12px; margin-top: 4px; }
.ecb-g-add-btn { padding: 8px 14px; border: none; border-radius: 6px; background: #4338ca; color: #fff; font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.ecb-g-add-btn:hover { background: #3730a3; }
.ecb-g-empty { font-size: 12.5px; color: #94a3b8; padding: 6px 0; }

/* ── 모바일 ── */
@media (max-width: 768px) {
  .ecb-toolbar-right { width: 100%; justify-content: flex-end; }
  .ecb-search { order: -1; flex-basis: 100%; min-width: 0; }
  .ecb-row { padding: 11px 12px; gap: 9px; }
  .ecb-memo { display: none; }
  .ecb-phone { display: none; }
  .ecb-f-row2 { grid-template-columns: 1fr; }
  .ecb-pc-text { display: none; }
}
@media (min-width: 769px) { .ecb-mobile-text { display: none; } }
