/* =============================================
   FlowBridge — Office Pages
   login.html · admin.html · work.html
   Page-specific styles only (base.css inherited)
   ============================================= */

/* ── Icon utility ──────────────────────────── */
.icon-sm { width: 16px; height: 16px; flex-shrink: 0; }
.icon-md { width: 20px; height: 20px; flex-shrink: 0; }

/* ── Utility spacing classes ───────────────── */
.w-full { width: 100%; }
.mt-2   { margin-top: 0.5rem; }
.mt-3   { margin-top: 0.75rem; }
.mb-4   { margin-bottom: 1rem; }
.actions-bar   { margin-top: 1rem; display: flex; gap: 0.5rem; }
.btn-group     { display: flex; gap: 0.5rem; }
.hint-text     { font-size: var(--font-xs); color: var(--color-text-muted); margin-top: 0.35rem; }
.panel__body--flush { padding: 0; }
.upload-filename { color: var(--color-primary); margin-top: 0.5rem; }
.approval-form-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border-light);
}

/* ═══════════════════════════════════════════
   LOGIN
   ═══════════════════════════════════════════ */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(215, 25, 31, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(137, 110, 74, 0.03) 0%, transparent 50%),
    linear-gradient(160deg, #faf9f7 0%, #f6f5f3 40%, #f1eee9 100%);
}

.login-card {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: var(--radius-xl);
  box-shadow:
    0 4px 6px -1px rgba(0,0,0,0.05),
    0 10px 30px -5px rgba(0,0,0,0.08),
    0 0 0 1px rgba(0,0,0,0.03);
  padding: 2.75rem 2.25rem;
  width: 100%;
  max-width: 420px;
  animation: fadeInScale 500ms cubic-bezier(0.34,1.56,0.64,1) both;
}

.login-card h1 {
  font-size: var(--font-xl);
  font-weight: var(--fw-bold);
  background: linear-gradient(135deg, var(--color-primary), var(--color-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.25rem;
}

.login-card .sub {
  color: var(--color-text-muted);
  font-size: var(--font-base);
  margin-bottom: 2rem;
}

.login-card .btn--primary {
  width: 100%;
  padding: 0.75rem;
  font-size: var(--font-md);
  margin-top: 0.5rem;
}

/* ═══════════════════════════════════════════
   APP SHELL LAYOUT
   ═══════════════════════════════════════════ */
.app-shell {
  display: flex;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 20%, rgba(215, 25, 31, 0.02) 0%, transparent 45%),
    radial-gradient(circle at 90% 80%, rgba(137, 110, 74, 0.02) 0%, transparent 45%),
    var(--color-bg);
}

/* ── Sidebar ───────────────────────────────── */
.sidebar {
  width: 260px;
  background: var(--color-surface);
  border-right: 1px solid rgba(226, 232, 240, 0.8);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.015);
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--color-primary);
}

.sidebar__brand {
  padding: 1.75rem 1.5rem 1.25rem;
  border-bottom: 1px solid var(--color-border-light);
}

.sidebar__brand h1 {
  font-size: var(--font-lg);
  font-weight: var(--fw-bold);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.sidebar__brand h1 i,
.sidebar__brand h1 svg {
  color: var(--color-primary);
}

.sidebar__brand p {
  font-size: var(--font-xs);
  color: var(--color-text-muted);
  margin-top: 0.15rem;
}

.sidebar__user {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border-light);
  font-size: var(--font-sm);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar__user strong {
  display: block;
  font-weight: var(--fw-semibold);
}

.sidebar__user span {
  color: var(--color-text-muted);
  font-size: var(--font-xs);
}

.sidebar__user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary-light), #f5efe6);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(215, 25, 31, 0.06);
  border: 1px solid rgba(215, 25, 31, 0.1);
}

/* ── Navigation ────────────────────────────── */
.sidebar__nav {
  flex: 1;
  padding: 1.25rem 0.85rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: nowrap;
  width: 100%;
  text-align: left;
  padding: 0.75rem 1rem;
  border: none;
  background: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--font-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition:
    background var(--ease-base),
    color var(--ease-base),
    box-shadow var(--ease-base),
    transform var(--ease-spring);
  position: relative;
  margin-bottom: 0.35rem;
}

.nav-item:hover {
  background: var(--color-bg-alt);
  color: var(--color-text);
  transform: translateX(3px);
}

.nav-item.active {
  background: linear-gradient(135deg, var(--color-primary-light), rgba(215, 25, 31, 0.01));
  color: var(--color-primary);
  font-weight: var(--fw-semibold);
  box-shadow: 0 4px 12px rgba(215, 25, 31, 0.03);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 25%;
  height: 50%;
  width: 3px;
  background: var(--color-primary);
  border-radius: 0 4px 4px 0;
}

.nav-item i, .nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar__footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--color-border-light);
}

/* ── Main Area ─────────────────────────────── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--color-bg);
}

.topbar {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.01);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

.topbar h2 {
  font-size: var(--font-lg);
  font-weight: var(--fw-semibold);
  color: var(--color-text);
}

.content {
  flex: 1;
  padding: 1.5rem 1.75rem;
  overflow: auto;
}

/* ═══════════════════════════════════════════
   PIPELINE STEPS (admin)
   ═══════════════════════════════════════════ */
.pipeline-steps {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 2rem;
  position: relative;
  padding: 0.5rem 0;
}

.pipeline-steps::before {
  content: '';
  position: absolute;
  left: 50px;
  right: 50px;
  top: 50%;
  height: 2px;
  background: var(--color-border);
  z-index: 1;
  transform: translateY(-50%);
}

.step-chip {
  flex: 1;
  min-width: 120px;
  padding: 0.65rem 1rem;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  text-align: center;
  font-size: var(--font-xs);
  font-weight: var(--fw-semibold);
  color: var(--color-text-secondary);
  transition: all var(--ease-base);
  position: relative;
  z-index: 2;
  box-shadow: var(--shadow-sm);
}

.step-chip.active {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-glow), var(--shadow-md);
  animation: breathe 2.5s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 3px var(--color-primary-glow), var(--shadow-sm); }
  50%      { box-shadow: 0 0 0 6px rgba(79, 70, 229, 0.15), var(--shadow-md); }
}

.step-chip.done {
  background: var(--color-success-light);
  border-color: var(--color-success);
  color: var(--color-success);
  box-shadow: var(--shadow-sm);
}

/* ═══════════════════════════════════════════
   UPLOAD ZONE
   ═══════════════════════════════════════════ */
.upload-zone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  text-align: center;
  cursor: pointer;
  background: var(--color-surface);
  transition:
    border-color var(--ease-base),
    background var(--ease-base),
    box-shadow var(--ease-base);
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  box-shadow: 0 0 0 4px var(--color-primary-glow);
}

.upload-zone strong {
  display: block;
  color: var(--color-text);
  font-size: var(--font-base);
}

.upload-zone p {
  color: var(--color-text-muted);
  font-size: var(--font-sm);
  margin-top: 0.4rem;
}

/* ═══════════════════════════════════════════
   DETAIL VIEW (work)
   ═══════════════════════════════════════════ */
.detail-header { margin-bottom: 0.85rem; }

.detail-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
}

.detail-header__title {
  font-weight: var(--fw-semibold);
  font-size: var(--font-md);
}

.detail-duo {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1rem;
  align-items: stretch;
}

@media (max-width: 1100px) {
  .detail-duo {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .detail-duo__card {
    height: 480px !important; /* 상하 적층 배치될 때는 고정 높이 부여 */
  }
}

.detail-duo__card {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 380px);
  min-height: 400px;
  min-width: 0;      /* 그리드 셀이 콘텐츠에 의해 밀려 넓어지는 것 방지 */
  overflow: hidden;
}

.detail-duo__card > .panel__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.detail-duo__scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.detail-grid--compact {
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border-light);
}

.detail-grid--compact .detail-field {
  padding: 0.4rem 0;
}

.detail-field {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border-light);
}

.detail-field__label {
  font-size: var(--font-xs);
  color: var(--color-text-muted);
  font-weight: var(--fw-medium);
}

.case-req-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-bottom: 0.85rem;
  padding: 0.65rem 0.85rem;
  background: var(--color-primary-light);
  border: 1px solid rgba(215, 25, 31, 0.12);
  border-radius: var(--radius-md);
}

.case-req-toolbar__hint {
  flex: 1;
  margin: 0;
  font-size: var(--font-xs);
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.case-req-save-msg {
  font-size: var(--font-xs);
  color: #059669;
}

.case-req-save-msg--error {
  color: #dc2626;
}

.case-req-section {
  margin-bottom: 1.25rem;
}

.case-req-section__title {
  font-size: var(--font-sm);
  font-weight: var(--fw-semibold);
  margin: 0 0 0.5rem;
  color: var(--color-text);
}

.case-req-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-xs);
}

.case-req-table th,
.case-req-table td {
  border: 1px solid var(--color-border-light);
  padding: 0.55rem 0.65rem;
  vertical-align: top;
  text-align: left;
}

.case-req-table thead th,
.case-req-table tbody th[scope="row"] {
  background: var(--color-bg-alt);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
  width: 9.5rem;
  color: var(--color-text-secondary);
}

.case-req-table tbody td {
  color: var(--color-text);
  line-height: 1.5;
  word-break: break-word;
}

.case-req-table--pairs {
  table-layout: auto;
  width: 100%;
}

/* 키 열: 라벨 전체가 보이도록 최소 폭만 차지 */
.case-req-table--pairs thead th:nth-child(1),
.case-req-table--pairs thead th:nth-child(3),
.case-req-table--pairs tbody th[scope="row"] {
  width: 0.1%;
  white-space: nowrap;
  padding: 0.55rem 0.75rem;
  overflow: visible;
  background: var(--color-bg-alt);
  font-weight: var(--fw-semibold);
  color: var(--color-text-secondary);
}

/* 값 열: 남은 너비 활용 */
.case-req-table--pairs thead th:nth-child(2),
.case-req-table--pairs thead th:nth-child(4),
.case-req-table--pairs tbody td {
  width: auto;
  min-width: 5rem;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.case-req-table--pairs .req-input,
.case-req-table--pairs textarea.req-input {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.case-req-table--pairs textarea.req-input {
  resize: vertical;
  min-height: 2.5rem;
}

.case-req-readonly {
  display: block;
  font-weight: var(--fw-medium);
  color: var(--color-text);
}

.case-req-officer-grid--stack {
  grid-template-columns: 1fr;
}

.case-req-period-grid--stack {
  grid-template-columns: 1fr;
  gap: 0.25rem;
}

.case-req-period-grid--stack .case-req-period-sep {
  text-align: center;
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

.case-req-table .req-input {
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: var(--font-xs);
  background: var(--color-surface);
}

.case-req-table .req-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-glow);
}

.case-req-table .req-input--sm {
  margin-bottom: 0.35rem;
}

.case-req-table .req-input--sm:last-child {
  margin-bottom: 0;
}

.case-req-officer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
}

@media (max-width: 720px) {
  .case-req-officer-grid {
    grid-template-columns: 1fr;
  }
}

.case-req-period-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.35rem;
  align-items: center;
}

.case-req-duo {
  display: grid;
  grid-template-columns: minmax(220px, 38%) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

@media (max-width: 900px) {
  .case-req-duo {
    grid-template-columns: 1fr;
  }
}

.case-req-duo__doc {
  position: sticky;
  top: 0.5rem;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  background: var(--color-bg-alt);
  overflow: hidden;
}

.case-req-doc-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.55rem;
  font-size: 0.72rem;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border-light);
  background: var(--color-surface);
}

.case-req-doc-nav button {
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  font: inherit;
  font-size: 0.72rem;
  cursor: pointer;
}

.case-req-doc-nav button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.case-req-doc-stage {
  max-height: min(72vh, 640px);
  overflow: auto;
  padding: 0.5rem;
  background: #f1f5f9;
}

.case-req-doc-stage img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.case-req-doc-empty {
  padding: 2rem 1rem;
  text-align: center;
  font-size: var(--font-xs);
  color: var(--color-text-muted);
}

.case-req-duo__form {
  min-width: 0;
}

.detail-field__value {
  font-size: var(--font-base);
  margin-top: 0.15rem;
  word-break: break-word;
  color: var(--color-text);
}

/* ═══════════════════════════════════════════
   APPROVAL TIMELINE
   ═══════════════════════════════════════════ */
.approval-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.approval-item {
  display: grid;
  grid-template-columns: 80px 60px 80px 1fr;
  gap: 0.5rem;
  padding: 0.7rem 0.85rem;
  background: var(--color-bg);
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  border: 1px solid var(--color-border-light);
  border-left: 4px solid var(--color-border);
  transition: background var(--ease-fast), transform var(--ease-fast);
}

.approval-item:hover {
  background: var(--color-surface-hover);
}

.approval-item.done {
  border-left-color: var(--color-success);
  background: var(--color-success-light);
}

.approval-item.wait {
  border-left-color: var(--color-warning);
  background: var(--color-warning-light);
}

.approval-item.reject {
  border-left-color: var(--color-danger);
  background: var(--color-danger-light);
}

/* ═══════════════════════════════════════════
   TODO CARDS
   ═══════════════════════════════════════════ */
.todo-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
  background: var(--color-warning-light);
  border-left: 4px solid var(--color-warning);
  cursor: pointer;
  transition:
    background var(--ease-fast),
    transform var(--ease-fast),
    box-shadow var(--ease-fast);
}

.todo-card:hover {
  background: #fef3c7;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.grace-due-card {
  background: var(--color-success-light);
  border-left-color: var(--color-success);
}

.grace-due-card:hover {
  background: #d1fae5;
}

/* ═══════════════════════════════════════════
   OCR VERIFICATION
   ═══════════════════════════════════════════ */
.ocr-verify__image {
  background-color: #f8fafc; /* 밝은 바탕 */
  background-image: radial-gradient(#cbd5e1 1.5px, transparent 1.5px); /* 회색 모눈 무늬 */
  background-size: 16px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: auto;
  box-shadow: inset 0 4px 16px rgba(0,0,0,0.4);
  min-height: 0;
  position: relative;
}

.ocr-placeholder {
  color: var(--color-text-muted);
  font-size: var(--font-xs);
  padding: 1.5rem 0.5rem;
  text-align: center;
}

.ocr-stage {
  position: relative;
  display: inline-block;
  line-height: 0;
  flex-shrink: 0;
}

.ocr-stage img {
  width: 100%;
  height: 100%;
  display: block;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  object-fit: fill;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.ocr-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ocr-overlay rect {
  fill: rgba(255, 255, 255, 0.01);
  stroke-width: 1.5px;
  stroke-dasharray: 4 2;
  opacity: 0.5;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ocr-overlay.has-active rect:not(.active) {
  opacity: 0.15;
  filter: blur(0.5px);
}

.ocr-overlay rect.active {
  opacity: 1;
  stroke-width: 3px;
  stroke-dasharray: none;
  fill: rgba(215, 25, 31, 0.15); /* BNK Red */
  filter: drop-shadow(0 0 10px rgba(215, 25, 31, 0.8));
}

/* Floating Navigation */
.ocr-floating-nav {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 10;
  color: white;
}

.ocr-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.ocr-nav-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.ocr-nav-label {
  font-size: var(--font-xs);
  font-weight: var(--fw-semibold);
  min-width: 3.5rem;
  text-align: center;
  letter-spacing: 0.5px;
}

/* Zoom Toolbar (inline in panel__head) */
.ocr-zoom-bar {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.15rem 0.35rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-left: auto;
}

.ocr-zoom-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.ocr-zoom-btn:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

.ocr-zoom-btn.active {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.ocr-zoom-divider {
  width: 1px;
  height: 14px;
  background: var(--color-border);
  margin: 0 0.1rem;
}

.ocr-zoom-label {
  font-size: 0.68rem;
  font-weight: var(--fw-semibold);
  min-width: 2.5rem;
  text-align: center;
  letter-spacing: 0.3px;
  color: var(--color-text);
  user-select: none;
}

.ocr-verify__hint {
  font-size: var(--font-xs);
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.ocr-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.75rem;
  margin-bottom: 0;
  flex-shrink: 0;
}

.ocr-legend-chip {
  font-size: 0.7rem;
  padding: 0.22rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
  transition:
    background var(--ease-fast),
    border-color var(--ease-fast);
}

.ocr-legend-chip:hover {
  background: var(--color-primary-light);
}

.ocr-legend-chip.active {
  font-weight: var(--fw-semibold);
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

/* Structured Data Grouping */
.ocr-data-group {
  margin-bottom: 1rem;
}

.ocr-data-group__title {
  font-size: 0.75rem;
  font-weight: var(--fw-bold);
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.ocr-extract-item {
  position: relative;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  margin-bottom: 0.45rem;
  cursor: pointer;
  background: var(--color-surface);
  font-size: var(--font-xs);
  transition: all var(--ease-base);
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
  display: flex;
  flex-direction: column;
}

.ocr-extract-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  background: var(--chip-color, var(--color-primary));
}

.ocr-extract-item:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-border);
}

.ocr-extract-item.active {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(215, 25, 31, 0.08);
}

.ocr-extract-copy {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  opacity: 0;
  transition: opacity 0.2s, background 0.2s, color 0.2s;
}

.ocr-extract-item:hover .ocr-extract-copy {
  opacity: 1;
}

.ocr-extract-copy:hover {
  background: rgba(0,0,0,0.05);
  color: var(--color-text);
}

/* Custom Scrollbar for detail-duo__scroll */
.detail-duo__scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.detail-duo__scroll::-webkit-scrollbar-track {
  background: transparent;
}
.detail-duo__scroll::-webkit-scrollbar-thumb {
  background-color: var(--color-border);
  border-radius: 10px;
}
.detail-duo__scroll::-webkit-scrollbar-thumb:hover {
  background-color: var(--color-text-muted);
}

.ocr-extract-item__label {
  font-size: 10px;
  font-weight: var(--fw-semibold);
  color: var(--color-text-muted);
  text-transform: uppercase;
}

.ocr-extract-item__value {
  margin-top: 0.1rem;
  font-size: var(--font-sm);
  font-weight: var(--fw-medium);
  color: var(--color-text);
  word-break: break-word;
}

.ocr-raw-details {
  margin-top: 0.75rem;
  font-size: var(--font-xs);
}

.ocr-raw-details summary {
  cursor: pointer;
  color: var(--color-text-muted);
  transition: color var(--ease-fast);
}

.ocr-raw-details summary:hover {
  color: var(--color-primary);
}

.ocr-raw-details pre {
  margin-top: 0.5rem;
  padding: 0.65rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  font-size: var(--font-xs);
  max-height: 140px;
  overflow: auto;
  white-space: pre-wrap;
}

.page-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--font-xs);
}

/* ═══════════════════════════════════════════
   PROVISION BLOCK
   ═══════════════════════════════════════════ */
.provision-block {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  margin-bottom: 0.75rem;
  background: var(--color-bg);
}

.provision-block h4 {
  font-size: var(--font-sm);
  margin-bottom: 0.35rem;
  color: var(--color-text);
}

.provision-pre {
  font-size: var(--font-xs);
  max-height: 160px;
  overflow: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  padding: 0.55rem;
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
}

/* ═══════════════════════════════════════════
   GRACE WAIT NOTICE
   ═══════════════════════════════════════════ */
.grace-wait-notice {
  padding: 1.1rem 1.25rem;
  background: var(--color-warning-light);
  border: 1px solid var(--color-warning-border);
  border-radius: var(--radius-md);
  font-size: var(--font-base);
  line-height: 1.7;
}

.grace-wait-notice ul {
  margin: 0.65rem 0 0 1.25rem;
}

.grace-wait-notice li { margin-bottom: 0.25rem; }

/* ═══════════════════════════════════════════
   REPLY DOCUMENT (대외 회신 양식 — 인쇄용)
   ═══════════════════════════════════════════ */
.reply-document-wrap {
  background: #fff;
  padding: 0;
  overflow: auto;
}

.reply-document {
  max-width: 820px;
  margin: 0 auto;
  padding: 2rem 2.5rem;
  background: #fff;
  border: 1px solid #d1d5db;
  font-size: 0.9rem;
  line-height: 1.7;
  color: #111827;
}

.reply-header {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #111827;
}

.reply-org-name { font-size: 1.1rem; font-weight: 700; }
.reply-org-dept { font-size: 0.85rem; color: #4b5563; }

.reply-meta-table { font-size: 0.8rem; border-collapse: collapse; }
.reply-meta-table th {
  text-align: right; padding: 0.15rem 0.5rem 0.15rem 0;
  color: #6b7280; font-weight: 600; white-space: nowrap;
}
.reply-meta-table td { padding: 0.15rem 0; font-weight: 500; }

.reply-title {
  text-align: center; font-size: 1.35rem; font-weight: 700;
  letter-spacing: 0.15em; margin: 1.25rem 0 1.5rem;
}

.reply-salutation { font-weight: 600; margin-bottom: 1rem; }
.reply-lead { text-indent: 1em; margin-bottom: 1.5rem; }
.reply-section { margin-bottom: 1.5rem; }

.reply-section h3 {
  font-size: 0.95rem; font-weight: 700; margin-bottom: 0.65rem;
  padding-left: 0.5rem; border-left: 3px solid #2563eb;
}

.reply-section h4 {
  font-size: 0.88rem; font-weight: 600;
  margin: 1rem 0 0.4rem; color: #374151;
}

.reply-count { font-weight: 400; color: #6b7280; font-size: 0.8rem; }

.reply-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; margin-bottom: 0.5rem; }
.reply-table th, .reply-table td { border: 1px solid #d1d5db; padding: 0.4rem 0.55rem; text-align: left; }
.reply-table thead th { background: #f3f4f6; font-weight: 600; text-align: center; }
.reply-table--info th { width: 140px; background: #f9fafb; font-weight: 600; vertical-align: top; }
.reply-empty { color: #9ca3af; font-size: 0.85rem; padding: 0.5rem 0; }
.reply-notes { margin-left: 1.25rem; font-size: 0.85rem; color: #374151; }
.reply-notes li { margin-bottom: 0.35rem; }

.reply-footer {
  margin-top: 2rem; padding-top: 1.5rem;
  border-top: 1px solid #d1d5db; text-align: center;
}

.reply-closing { margin-bottom: 1rem; }
.reply-org-footer { font-size: 1.05rem; font-weight: 700; margin-bottom: 1rem; }

.reply-approvals {
  display: flex; justify-content: center; gap: 1.5rem;
  flex-wrap: wrap; font-size: 0.8rem; color: #6b7280;
}

.reply-sign { padding: 0.25rem 0.5rem; border: 1px solid #e5e7eb; border-radius: 4px; }

/* ═══════════════════════════════════════════
   DM (명의인 통보) — 인쇄용
   ═══════════════════════════════════════════ */
.dm-panel-hint {
  font-size: var(--font-sm);
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.dm-document-wrap { background: #f3f4f6; padding: 1rem; overflow: auto; }
.dm-packages { display: flex; flex-direction: column; gap: 2.5rem; }

.dm-package__label {
  font-size: 0.85rem; font-weight: 700; color: #374151;
  margin-bottom: 1rem; padding-left: 0.5rem; border-left: 3px solid #059669;
}

.dm-envelope { max-width: 520px; margin: 0 auto 1.5rem; }

.dm-envelope__frame {
  position: relative; background: #fff; border: 2px solid #9ca3af; border-radius: 2px;
  padding: 1.75rem 2rem 2.5rem; min-height: 240px; box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.dm-envelope__label {
  display: inline-block; font-size: 0.7rem; font-weight: 700;
  color: #6b7280; letter-spacing: 0.08em; margin-bottom: 0.35rem;
}

.dm-envelope__sender {
  font-size: 0.78rem; color: #4b5563; margin-bottom: 1.5rem;
  padding-bottom: 1rem; border-bottom: 1px dashed #d1d5db;
}

.dm-envelope__org { font-weight: 600; color: #111827; }
.dm-envelope__addr { line-height: 1.5; margin-top: 0.25rem; }
.dm-envelope__stamp-area { position: absolute; top: 1.25rem; right: 1.5rem; }

.dm-envelope__stamp {
  display: inline-block; padding: 0.35rem 0.75rem;
  border: 2px solid #dc2626; color: #dc2626;
  font-size: 0.85rem; font-weight: 700; border-radius: 4px;
}

.dm-envelope__recipient { margin-top: 0.5rem; }
.dm-envelope__name { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.5rem; }
.dm-envelope__name span { font-size: 0.95rem; font-weight: 500; }
.dm-envelope__phone { font-size: 0.82rem; color: #6b7280; margin-top: 0.35rem; }

.dm-envelope__barcode {
  position: absolute; bottom: 0.75rem; right: 1.5rem;
  font-size: 0.72rem; color: #9ca3af; font-family: monospace;
}

.dm-notice-document {
  max-width: 720px; margin: 0 auto; padding: 2rem 2.25rem;
  background: #fff; border: 1px solid #d1d5db;
  font-size: 0.88rem; line-height: 1.7; color: #111827;
}

.dm-notice-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 2px solid #111827;
}

.dm-notice-org { font-weight: 700; font-size: 1rem; }
.dm-notice-ref { font-size: 0.8rem; color: #6b7280; }

.dm-notice-title {
  text-align: center; font-size: 1.25rem; font-weight: 700;
  letter-spacing: 0.12em; margin: 1rem 0 1.25rem;
}

.dm-notice-salutation { font-weight: 600; margin-bottom: 0.85rem; }
.dm-notice-lead { text-indent: 1em; margin-bottom: 1.25rem; }
.dm-notice-section { margin-bottom: 1.25rem; }

.dm-notice-section h3 {
  font-size: 0.92rem; font-weight: 700; margin-bottom: 0.55rem;
  padding-left: 0.5rem; border-left: 3px solid #059669;
}

.dm-notice-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.dm-notice-table th, .dm-notice-table td {
  border: 1px solid #d1d5db; padding: 0.45rem 0.6rem; text-align: left; vertical-align: top;
}
.dm-notice-table th { width: 130px; background: #f9fafb; font-weight: 600; }
.dm-notice-sub { font-size: 0.72rem; font-weight: 400; color: #6b7280; }
.dm-notice-notes { margin-left: 1.25rem; font-size: 0.82rem; color: #374151; }
.dm-notice-notes li { margin-bottom: 0.3rem; }

.dm-notice-footer {
  margin-top: 1.75rem; padding-top: 1.25rem;
  border-top: 1px solid #d1d5db; text-align: center;
}

.dm-notice-date { margin-bottom: 0.75rem; }
.dm-notice-sign { font-size: 1rem; font-weight: 700; }

/* ═══════════════════════════════════════════
   PRINT STYLES
   ═══════════════════════════════════════════ */
@media print {
  body * { visibility: hidden; }

  body[data-print-target="dm"] .dm-document-wrap,
  body[data-print-target="dm"] .dm-document-wrap * {
    visibility: visible;
  }
  body[data-print-target="dm"] .dm-document-wrap {
    position: absolute; left: 0; top: 0;
    width: 100%; background: #fff; padding: 0;
  }
  body[data-print-target="dm"] .dm-package { page-break-after: always; }
  body[data-print-target="dm"] .dm-package:last-child { page-break-after: auto; }

  body:not([data-print-target="dm"]) .reply-document-wrap,
  body:not([data-print-target="dm"]) .reply-document-wrap * {
    visibility: visible;
  }
  body:not([data-print-target="dm"]) .reply-document-wrap {
    position: absolute; left: 0; top: 0; width: 100%;
  }
}

/* ═══════════════════════════════════════════
   CHATBOT WIDGET
   ═══════════════════════════════════════════ */
.chat-widget {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: var(--z-modal);
}

.chat-toggle {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--color-primary), var(--color-gold));
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(215, 25, 31, 0.3);
  transition:
    transform var(--ease-base),
    box-shadow var(--ease-base);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.chat-toggle--notify {
  animation: chatToggleRing 1.2s ease-in-out 3;
}

.chat-toggle__badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.15rem;
  text-align: center;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.45);
}

@keyframes chatToggleRing {
  0%, 100% { box-shadow: 0 6px 20px rgba(215, 25, 31, 0.3); }
  50% { box-shadow: 0 0 0 8px rgba(215, 25, 31, 0.2), 0 6px 20px rgba(215, 25, 31, 0.35); }
}

.chat-toast-host {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: calc(var(--z-modal) + 5);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-width: min(360px, calc(100vw - 2rem));
  pointer-events: none;
}

.chat-toast {
  pointer-events: auto;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.85rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  animation: chatToastIn 400ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
  cursor: pointer;
}

.chat-toast--success { border-left-color: #10b981; }
.chat-toast--error { border-left-color: #ef4444; }

.chat-toast__icon {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 0.9rem;
}

.chat-toast--success .chat-toast__icon {
  background: #d1fae5;
  color: #059669;
}

.chat-toast--error .chat-toast__icon {
  background: #fee2e2;
  color: #dc2626;
}

.chat-toast__body { flex: 1; min-width: 0; }

.chat-toast__title {
  font-size: var(--font-sm);
  font-weight: var(--fw-semibold);
  color: var(--color-text);
  margin-bottom: 0.2rem;
}

.chat-toast__text {
  font-size: var(--font-xs);
  color: var(--color-text-muted);
  line-height: 1.45;
}

.chat-toast__close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

@keyframes chatToastIn {
  from { opacity: 0; transform: translateX(1.5rem) scale(0.95); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

.provision-not-customer,
.reply-not-customer {
  padding: 0.65rem 0;
  font-size: var(--font-sm);
}

.chat-toggle::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--color-primary);
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.3s, transform 0.3s;
  animation: chatPulse 2s infinite;
}

@keyframes chatPulse {
  0% { transform: scale(0.95); opacity: 0.5; }
  100% { transform: scale(1.15); opacity: 0; }
}

.chat-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(215, 25, 31, 0.4);
}

.chat-toggle--active {
  transform: scale(0.92);
}

.chat-panel {
  position: absolute;
  right: 0;
  bottom: 4.5rem;
  width: 380px;
  max-width: calc(100vw - 2rem);
  height: 520px;
  max-height: calc(100vh - 6rem);
  background: var(--color-surface);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: chatSlideUp 350ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.chat-panel.hidden {
  display: none !important;
}

.chat-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border-light);
  background: linear-gradient(135deg, var(--color-primary-light), rgba(215, 25, 31, 0.01));
}

.chat-panel__head strong {
  display: block;
  font-size: var(--font-base);
  color: var(--color-text);
}

.chat-panel__role {
  display: block;
  font-size: var(--font-xs);
  color: var(--color-text-muted);
  margin-top: 0.15rem;
}

.chat-panel__close {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0 0.25rem;
  transition: color var(--ease-fast);
}

.chat-panel__close:hover { color: var(--color-text); }

.chat-panel__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}

.chat-dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 0.65rem 0.75rem 0;
  padding: 0.45rem 0.65rem;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.72rem;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: border-color var(--ease-fast), background var(--ease-fast), color var(--ease-fast);
}

.chat-dropzone:hover,
.chat-dropzone--active,
.chat-messages--drag {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.chat-panel__messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.chat-msg { display: flex; }
.chat-msg--user { justify-content: flex-end; }
.chat-msg--bot  { justify-content: flex-start; }

.chat-bubble {
  max-width: 88%;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-lg);
  font-size: var(--font-sm);
  line-height: 1.55;
}

.chat-msg--user .chat-bubble {
  background: linear-gradient(135deg, var(--color-primary), var(--color-gold));
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(215, 25, 31, 0.15);
}

.chat-msg--bot .chat-bubble {
  background: var(--color-bg-alt);
  color: var(--color-text);
  border-bottom-left-radius: 4px;
}

.chat-ai-badge,
.chat-job-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  margin-right: 0.4rem;
  vertical-align: middle;
}

.chat-ai-badge {
  background: linear-gradient(135deg, #6366f1, #2563eb);
}

.chat-job-badge {
  background: linear-gradient(135deg, #059669, #10b981);
}

.chat-job-progress {
  margin-top: 0.55rem;
  height: 3px;
  background: var(--color-border-light);
  border-radius: 2px;
  overflow: hidden;
}

.chat-job-progress__bar {
  display: block;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-gold));
  border-radius: 2px;
  animation: chatJobBar 1.2s ease-in-out infinite;
}

@keyframes chatJobBar {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

.chat-links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.chat-link {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font: inherit;
  font-size: var(--font-xs);
  cursor: pointer;
  color: var(--color-primary);
  transition: background var(--ease-fast);
}

.chat-link:hover { background: var(--color-primary-light); }

.chat-link__status {
  color: var(--color-text-muted);
  font-size: 0.7rem;
  margin-left: 0.35rem;
}

.chat-panel__form {
  display: flex;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--color-border-light);
  background: var(--color-surface);
}

.chat-panel__form input {
  flex: 1;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font: inherit;
  font-size: var(--font-sm);
  transition: border-color var(--ease-fast), box-shadow var(--ease-fast);
}

.chat-panel__form input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-glow);
}

.chat-panel__form .btn { flex-shrink: 0; width: auto; }

/* ═══════════════════════════════════════════
   HINT BOX
   ═══════════════════════════════════════════ */
.hint-box {
  margin-top: 1.25rem;
  padding: 0.85rem;
  background: var(--color-bg-alt);
  border-radius: var(--radius-md);
  font-size: var(--font-xs);
  color: var(--color-text-muted);
}

.hint-box code {
  background: var(--color-surface);
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
}

/* ═══════════════════════════════════════════
   DETAIL STEP SCHEMATIC & TABS
   ═══════════════════════════════════════════ */
.detail-steps {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.detail-steps__track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
}

.detail-step-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  transition: transform var(--ease-base), color var(--ease-base);
  color: var(--color-text-secondary);
  position: relative;
  z-index: 2;
  min-width: 100px;
}

.detail-step-btn:hover {
  transform: translateY(-2px);
  color: var(--color-text);
}

.detail-step-btn__num {
  position: relative;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--color-bg-alt);
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--fw-bold);
  font-size: var(--font-sm);
  color: var(--color-text-muted);
  transition: all var(--ease-base);
  box-shadow: var(--shadow-xs);
}

.step-num-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 9px;
  font-weight: var(--fw-bold);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--ease-base);
  z-index: 3;
}

.detail-step-btn.active .step-num-badge {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

.detail-step-btn.done .step-num-badge {
  background: var(--color-success);
  border-color: var(--color-success);
  color: white;
}

.detail-step-btn__label {
  font-size: var(--font-xs);
  font-weight: var(--fw-semibold);
  transition: color var(--ease-base);
  white-space: nowrap;
}

.detail-step-btn.active .detail-step-btn__num {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-glow), var(--shadow-sm);
}

.detail-step-btn.active .detail-step-btn__label {
  color: var(--color-primary);
}

.detail-step-btn.done .detail-step-btn__num {
  background: var(--color-success-light);
  border-color: var(--color-success);
  color: var(--color-success);
  box-shadow: var(--shadow-xs);
}

.detail-step-btn.done .detail-step-btn__label {
  color: var(--color-success);
}

.detail-step-line {
  flex: 1;
  height: 2px;
  background: var(--color-border);
  position: relative;
  z-index: 1;
  transition: background var(--ease-base);
}

.detail-step-line.done {
  background: var(--color-success);
}

.tab-pane.hidden {
  display: none !important;
}

@media print {
  .tab-pane {
    display: block !important;
  }
}

.sidebar__nav-section {
  font-size: 0.6875rem;
  text-transform: uppercase;
  font-weight: var(--fw-bold);
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
  padding: 0.85rem 1rem 0.35rem;
}

/* ═══════════════════════════════════════════
   WORK DASHBOARD — 업무 한눈에
   ═══════════════════════════════════════════ */
.nav-item__badge {
  margin-left: auto;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: var(--fw-bold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.nav-item__badge--warn { background: var(--color-warning); }
.nav-item__badge--ok   { background: var(--color-success); }

.work-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #fff 0%, #faf9f7 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.work-hero__text h3 {
  font-size: var(--font-lg);
  font-weight: var(--fw-bold);
  margin-bottom: 0.25rem;
}
.work-hero__text p {
  font-size: var(--font-sm);
  color: var(--color-text-secondary);
}
.work-hero__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.work-pipeline {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}
.work-pipeline__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: none;
  cursor: pointer;
  font-family: inherit;
  min-width: 4.5rem;
  transition: background var(--ease-fast), border-color var(--ease-fast);
}
.work-pipeline__step:hover {
  background: var(--color-bg-alt);
  border-color: var(--color-border);
}
.work-pipeline__step--urgent {
  background: var(--color-warning-light);
  border-color: rgba(217, 119, 6, 0.25);
}
.work-pipeline__label {
  font-size: 0.68rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}
.work-pipeline__count {
  font-size: var(--font-md);
  font-weight: var(--fw-bold);
  color: var(--color-text);
}
.work-pipeline__arrow {
  color: var(--color-text-muted);
  opacity: 0.5;
  flex-shrink: 0;
}

.stat-grid--compact .stat-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
}
.stat-card--click { cursor: pointer; }
.stat-card__icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-md);
  background: var(--color-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.stat-card--warn .stat-card__icon { background: var(--color-warning-light); color: var(--color-warning); }
.stat-card--ok .stat-card__icon   { background: var(--color-success-light); color: var(--color-success); }

.work-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 900px) {
  .work-action-grid { grid-template-columns: 1fr; }
}

.work-action-panel--urgent .panel__head {
  border-bottom-color: rgba(217, 119, 6, 0.15);
}
.work-action-panel--dm .panel__head {
  border-bottom-color: rgba(5, 150, 105, 0.15);
}

.panel__head-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn--ghost {
  background: transparent;
  border: none;
  color: var(--color-primary);
  padding: 0.25rem 0.5rem;
  font-size: var(--font-xs);
  cursor: pointer;
}
.btn--ghost:hover { text-decoration: underline; }
.btn--xs { padding: 0.2rem 0.45rem; font-size: var(--font-xs); }

.work-action-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  margin-bottom: 0.45rem;
  cursor: pointer;
  transition: background var(--ease-fast), box-shadow var(--ease-fast);
  background: var(--color-surface);
}
.work-action-card:hover {
  box-shadow: var(--shadow-sm);
  background: var(--color-bg-alt);
}
.work-action-card--urgent {
  border-left: 3px solid var(--color-warning);
}
.grace-due-card {
  border-left: 3px solid var(--color-success);
}
.work-action-card__main {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.work-action-card__doc {
  font-weight: var(--fw-semibold);
  font-size: var(--font-sm);
}
.work-action-card__agency {
  font-size: var(--font-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.work-action-card__meta {
  font-size: 0.68rem;
  color: var(--color-text-muted);
}

.work-empty {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--color-text-muted);
  font-size: var(--font-sm);
}
.work-empty__icon {
  width: 28px;
  height: 28px;
  margin: 0 auto 0.5rem;
  opacity: 0.4;
}

.work-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.65rem 1rem 0;
  border-bottom: 1px solid var(--color-border-light);
  overflow-x: auto;
}
.work-tab {
  padding: 0.5rem 0.85rem;
  border: none;
  background: none;
  font-family: inherit;
  font-size: var(--font-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color var(--ease-fast), border-color var(--ease-fast);
}
.work-tab:hover { color: var(--color-text); }
.work-tab.active {
  color: var(--color-primary);
  font-weight: var(--fw-semibold);
  border-bottom-color: var(--color-primary);
}
.work-tab__count {
  display: inline-block;
  margin-left: 0.3rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  font-size: 0.65rem;
  background: var(--color-bg-alt);
  color: var(--color-text-secondary);
}
.work-tab.active .work-tab__count {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.work-recent-table tbody tr {
  cursor: pointer;
  transition: background var(--ease-fast);
}
.work-recent-table tbody tr:hover {
  background: var(--color-bg-alt);
}
.work-recent-date {
  font-size: var(--font-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
}
.work-recent-empty {
  text-align: center;
  color: var(--color-text-muted);
  padding: 1.5rem !important;
}
.work-recent-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--color-border-light);
  text-align: right;
}
