/* =============================================
   Verdi CRM — Sales Materials v4.27.0
   ============================================= */

/* ── 로딩 / 에러 ── */
.mat-loading,
.mat-error {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 80px 24px;
  color: #7E879A;
  font-size: 15px;
}

/* ── 툴바 (검색 + 버튼) ── */
.mat-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.mat-search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.mat-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #7E879A;
  pointer-events: none;
  font-size: 14px;
}

.mat-search-input {
  width: 100%;
  padding: 9px 36px 9px 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(14,21,48,0.55);
  color: #F3F7FF;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.mat-search-input::placeholder {
  color: rgba(243,247,255,0.40);
}
.mat-search-input:focus {
  border-color: var(--accent);
}

.mat-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #7E879A;
  padding: 4px;
  line-height: 1;
  border-radius: 4px;
}
.mat-search-clear:hover { color: #F3F7FF; }

.mat-btn-new {
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── 빈 상태 ── */
.mat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 80px 24px;
  color: #7E879A;
  font-size: 15px;
}
.mat-empty i {
  font-size: 36px;
  opacity: 0.35;
}

/* ── 그룹 ── */
.mat-group {
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-card);
}

.mat-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  background: var(--bg-sidebar, rgba(255,255,255,0.04));
  user-select: none;
  transition: background 0.12s;
}
.mat-group-header:hover {
  background: rgba(99,102,241,0.08);
}

.mat-group-chevron {
  color: #7E879A;
  font-size: 13px;
  transition: transform 0.2s;
  display: flex;
  align-items: center;
}
.mat-group-chevron.open {
  transform: rotate(90deg);
}

.mat-group-name {
  font-weight: 600;
  font-size: 14px;
  color: #F3F7FF;
  flex: 1;
}

.mat-group-count {
  background: rgba(99,102,241,0.15);
  color: var(--accent);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
  min-width: 24px;
  text-align: center;
}

.mat-group-body {
  border-top: 1px solid var(--border);
}
.mat-group-body.collapsed {
  display: none;
}

/* ── 자료 행 ── */
.mat-row {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.mat-row:last-child { border-bottom: none; }
.mat-row:hover { background: rgba(99,102,241,0.04); }

.mat-row-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mat-row-title {
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  flex: 1;
  min-width: 120px;
  text-decoration: none;
}
.mat-row-title:hover {
  text-decoration: underline;
}

.mat-row-type {
  font-size: 12px;
  color: #7E879A;
  background: var(--bg-body, rgba(255,255,255,0.06));
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  white-space: nowrap;
}

.mat-row-owner {
  font-size: 13px;
  color: #AAB4C8;
  white-space: nowrap;
}

.mat-row-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}

.mat-row-actions {
  margin-top: 4px;
  display: flex;
  gap: 6px;
}

/* ── 태그 chip (공용) ── */
.mat-tag {
  display: inline-flex;
  align-items: center;
  background: rgba(99,102,241,0.12);
  color: var(--accent);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 500;
}

/* ── 검색 하이라이트 ── */
.mat-highlight {
  background: #fef08a;
  color: #1e1b4b;
  border-radius: 2px;
  padding: 0 1px;
}

/* ── 검색 결과 평면 목록 ── */
.mat-search-results {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-card);
}

.mat-prod-badge {
  font-size: 11px;
  background: rgba(16,185,129,0.12);
  color: #10b981;
  border-radius: 4px;
  padding: 2px 7px;
  font-weight: 600;
  white-space: nowrap;
}

/* ── 열기 버튼 ── */
.mat-btn-open {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  color: #AAB4C8;
  cursor: pointer;
  transition: all 0.12s;
  text-decoration: none;
}
.mat-btn-open:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(99,102,241,0.06);
}

/* ── 등록/수정 폼 ── */
.mat-form-wrap {
  max-width: 640px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.mat-form-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-sidebar, rgba(255,255,255,0.04));
}
.mat-form-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #F3F7FF;
}

.mat-form-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mat-form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mat-form-row label {
  font-size: 13px;
  font-weight: 500;
  color: #AAB4C8;
}
.mat-form-row.required label::after {
  content: ' *';
  color: #ef4444;
}
.mat-form-row input[type="text"],
.mat-form-row input[type="url"],
.mat-form-row select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(14,21,48,0.55);
  color: #F3F7FF;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
.mat-form-row input[type="text"]::placeholder,
.mat-form-row input[type="url"]::placeholder {
  color: rgba(243,247,255,0.40);
}
.mat-form-row input:focus,
.mat-form-row select:focus {
  border-color: var(--accent);
}
.mat-form-row select option {
  background: #0E1530;
  color: #F3F7FF;
}

/* 담당자 힌트 */
.mat-owner-hint {
  font-size: 12px;
  color: #7E879A;
  margin-top: 3px;
}
.mat-owner-hint.unregistered {
  color: #f59e0b;
}

/* 해시태그 입력 영역 */
.mat-tag-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mat-tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 32px;
}
.mat-tag-input-row {
  display: flex;
  gap: 8px;
}
.mat-tag-input-row input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(14,21,48,0.55);
  color: #F3F7FF;
  font-size: 14px;
  outline: none;
}
.mat-tag-input-row input::placeholder {
  color: rgba(243,247,255,0.40);
}
.mat-tag-input-row input:focus {
  border-color: var(--accent);
}
.mat-btn-tag-add {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: #AAB4C8;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}
.mat-btn-tag-add:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* 칩 */
.mat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(99,102,241,0.15);
  color: var(--accent);
  border-radius: 999px;
  padding: 3px 10px 3px 12px;
  font-size: 13px;
}
.mat-chip-del {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--accent);
  opacity: 0.6;
  padding: 0;
  line-height: 1;
  font-size: 11px;
  display: flex;
  align-items: center;
}
.mat-chip-del:hover { opacity: 1; }

.mat-form-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  background: var(--bg-sidebar, rgba(255,255,255,0.04));
}
.mat-btn-cancel {
  background: transparent;
  border: 1px solid var(--border);
  color: #AAB4C8;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.12s;
}
.mat-btn-cancel:hover {
  border-color: #F3F7FF;
  color: #F3F7FF;
}

/* ── 상세 화면 ── */
.mat-detail-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mat-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: #7E879A;
  cursor: pointer;
  font-size: 13px;
  padding: 4px 0;
  transition: color 0.12s;
}
.mat-detail-back:hover { color: var(--accent); }

.mat-detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  max-width: 720px;
}

.mat-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-sidebar, rgba(255,255,255,0.04));
  flex-wrap: wrap;
}

.mat-detail-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #F3F7FF;
  flex: 1;
}

.mat-detail-header-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.mat-detail-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: transparent;
  color: #AAB4C8;
  cursor: pointer;
  transition: all 0.12s;
}
.mat-detail-edit-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.mat-detail-delete-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  padding: 7px 14px;
  border: 1px solid #ef444433;
  border-radius: 7px;
  background: transparent;
  color: #ef4444;
  cursor: pointer;
  transition: all 0.12s;
}
.mat-detail-delete-btn:hover {
  background: rgba(239,68,68,0.1);
  border-color: #ef4444;
}

.mat-detail-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mat-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.mat-detail-label {
  font-size: 13px;
  font-weight: 500;
  color: #AAB4C8;
  min-width: 110px;
  flex-shrink: 0;
  padding-top: 1px;
}

.mat-detail-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 14px;
  text-decoration: none;
}
.mat-detail-link:hover { text-decoration: underline; }

.mat-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mat-email-link {
  color: var(--accent);
  font-size: 13px;
  text-decoration: none;
  margin-left: 4px;
}
.mat-email-link:hover { text-decoration: underline; }

.mat-unregistered {
  font-size: 12px;
  color: #f59e0b;
  margin-left: 6px;
}

/* ── 반응형 ── */
@media (max-width: 600px) {
  .mat-toolbar { flex-direction: column; align-items: stretch; }
  .mat-btn-new { width: 100%; justify-content: center; }
  .mat-detail-label { min-width: 80px; }
  .mat-form-wrap { border-radius: 0; border-left: none; border-right: none; }
}
