/* ============================================================
   조회서 관리 모듈 스타일
   기존 .btn / .btn-primary / .btn-secondary 등은 style.css 재사용
   ============================================================ */

#auditSection { display: none; }

.audit-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  align-items: start;
}

/* ─── 사이드바 ─── */
.audit-sidebar {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}
.audit-sidebar-header { padding-bottom: 4px; }
.audit-kicker { font-size: 11px; font-weight: 700; color: #2563eb; letter-spacing: 0.04em; }
.audit-title { font-size: 22px; font-weight: 700; color: #0f172a; margin-top: 2px; }
.audit-subtitle { font-size: 12px; color: #64748b; margin-top: 2px; }

.audit-stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.audit-stat {
  border-radius: 10px;
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 2px;
}
.audit-stat-blue { background: #eef4ff; }
.audit-stat-green { background: #f0fdf4; }
.audit-stat-label { font-size: 11px; color: #64748b; }
.audit-stat-value { font-size: 20px; font-weight: 700; color: #0f172a; }

.audit-action-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.audit-btn-add { padding: 10px 12px !important; font-size: 13px !important; }
.audit-btn-danger {
  padding: 10px 12px; font-size: 13px; font-weight: 600; font-family: inherit;
  background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca;
  border-radius: 8px; cursor: pointer; transition: all 0.15s;
}
.audit-btn-danger:hover { background: #fee2e2; }

.audit-action-card,
.audit-list-card,
.audit-status-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  background: #fcfdff;
}
.audit-card-title {
  font-size: 13px; font-weight: 600; color: #1e293b;
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.audit-count-badge {
  font-size: 11px; font-weight: 700; color: #2563eb;
  background: #dbeafe; padding: 2px 10px; border-radius: 999px;
}

.audit-action-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}
.audit-menu-btn {
  padding: 9px 8px; border-radius: 7px; border: 1px solid #cbd5e1;
  background: #fff; color: #334155; font-size: 12px; font-weight: 500;
  font-family: inherit; cursor: pointer; transition: all 0.15s;
}
.audit-menu-btn:hover { border-color: #2563eb; color: #1d4ed8; background: #eff6ff; }
.audit-menu-btn-wide { grid-column: span 2; }

.audit-client-list { display: flex; flex-direction: column; gap: 4px; max-height: 360px; overflow-y: auto; }
.audit-client-row {
  width: 100%;
  display: grid; grid-template-columns: auto 1fr auto; gap: 8px;
  align-items: center;
  padding: 8px 10px; border-radius: 7px;
  border: 1px solid transparent;
  background: #fff; text-align: left;
  font-family: inherit; font-size: 12px; cursor: pointer;
  transition: all 0.15s;
}
.audit-client-row:hover { border-color: #cbd5e1; background: #f8fafc; }
.audit-client-row.active { border-color: #2563eb; background: #eff6ff; }
.audit-currency-tag {
  background: #e8eeff; color: #1d4ed8; font-weight: 600;
  font-size: 10px; padding: 2px 6px; border-radius: 5px;
}
.audit-client-row.active .audit-currency-tag { background: #dbeafe; }
.audit-client-name { font-weight: 600; color: #1e293b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-client-doc { font-size: 11px; color: #64748b; }
.audit-empty { font-size: 13px; color: #94a3b8; text-align: center; padding: 16px 0; }

.audit-status-card { background: #f8fafc; }
.audit-status-label { font-size: 12px; color: #64748b; font-weight: 600; margin-bottom: 4px; }
.audit-status-message { font-size: 13px; color: #1e293b; }

/* ─── 메인 영역 ─── */
.audit-main {
  display: flex; flex-direction: column; gap: 16px;
  min-width: 0;
}
.audit-section-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px;
}
.audit-section-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  margin-bottom: 12px;
}
.audit-section-title { font-size: 18px; font-weight: 700; color: #0f172a; margin-bottom: 2px; }
.audit-section-sub { font-size: 12px; color: #64748b; }
.audit-pill {
  font-size: 11px; font-weight: 600; color: #2563eb;
  background: #eef4ff; padding: 4px 12px; border-radius: 999px;
  white-space: nowrap;
}

/* 폼 그리드 */
.audit-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
}
.audit-form-row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: center; }
.audit-form-row-full { grid-column: 1 / -1; }
.audit-form-label { font-size: 12px; color: #475569; font-weight: 500; }
.audit-form-input {
  padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 6px;
  font-size: 13px; font-family: inherit; outline: none; background: #fff;
  transition: border-color 0.15s;
  width: 100%;
  box-sizing: border-box;
}
.audit-form-input:focus { border-color: #2563eb; }
.audit-amount-input { text-align: right; font-variant-numeric: tabular-nums; }

.audit-zip-row { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.audit-zip-btn { padding: 6px 14px !important; font-size: 12px !important; }

/* 채권/채무 카드 */
.audit-amount-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}
.audit-amount-card {
  border: 1px solid; border-radius: 10px; padding: 12px;
}
.audit-amount-asset { background: #f8fbff; border-color: #dbe8ff; }
.audit-amount-liab { background: #fff8f8; border-color: #f6d3d3; }
.audit-amount-title { font-weight: 700; margin-bottom: 8px; }
.audit-amount-asset .audit-amount-title { color: #2563eb; }
.audit-amount-liab .audit-amount-title { color: #dc2626; }
.audit-amount-item {
  display: grid; grid-template-columns: 1fr 130px; gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}
.audit-amount-label { font-size: 12px; color: #475569; }
.audit-save-wide {
  width: 100%; margin-top: 12px;
}

/* ─── 모달 ─── */
.audit-modal-backdrop {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(15, 23, 42, 0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.audit-modal {
  background: #fff; border-radius: 14px;
  width: 100%; max-width: 640px;
  padding: 22px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.35);
}
.audit-modal-header {
  display: flex; justify-content: space-between; align-items: center;
}
.audit-modal-header h3 { font-size: 18px; font-weight: 700; color: #0f172a; }
.audit-modal-close {
  border: none; background: transparent; font-size: 26px; line-height: 1;
  cursor: pointer; color: #64748b; padding: 4px 8px;
}
.audit-modal-close:hover { color: #1e293b; }
.audit-modal-sub { font-size: 12px; color: #64748b; margin-top: 4px; }
.audit-modal-tabs { display: flex; gap: 4px; border-bottom: 2px solid #e2e8f0; margin-top: 14px; }
.audit-modal-tab {
  padding: 8px 16px; border: none; background: none;
  font-family: inherit; font-size: 13px; font-weight: 500; color: #64748b;
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all 0.15s;
}
.audit-modal-tab:hover { color: #1e293b; }
.audit-modal-tab.active { color: #2563eb; border-bottom-color: #2563eb; }
.audit-modal-body { padding: 16px 0; }
.audit-account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.audit-account-col-title { font-size: 12px; font-weight: 600; color: #64748b; margin-bottom: 8px; }
.audit-account-col input { margin-bottom: 6px; }
.audit-modal-actions { display: flex; justify-content: flex-end; padding-top: 8px; }

/* 반응형 */
@media (max-width: 1100px) {
  .audit-layout { grid-template-columns: 1fr; }
  .audit-sidebar { position: static; max-height: none; }
  .audit-form-grid { grid-template-columns: 1fr; }
  .audit-amount-row { grid-template-columns: 1fr; }
}
