/* ============================================
   돌봄케어24 — 실무형 운영 시스템 UI
   인디고/퍼플 기반 공공협업 디자인
   ============================================ */

:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #e0e7ff;
  --sidebar-bg: #0f172a;
  --sidebar-hover: #1e293b;
  --sidebar-active: #1e293b;
  --sidebar-border: #1e293b;
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #e2e8f0;
  --sidebar-width: 220px;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-sub: #475569;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --font: 'Noto Sans KR', -apple-system, sans-serif;

  /* 상태 색상 */
  --status-draft: #64748b;
  --status-submitted: #0ea5e9;
  --status-reviewing: #7c3aed;
  --status-pending: #d97706;
  --status-approved: #059669;
  --status-closed: #334155;

  --urgent: #dc2626;
  --high: #ea580c;
  --normal: #475569;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ==================== APP SHELL ==================== */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--sidebar-border);
  overflow: hidden;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  font-size: 15px;
  font-weight: 700;
  color: #e2e8f0;
  border-bottom: 1px solid #1e293b;
  letter-spacing: -0.3px;
}

.sidebar-logo i {
  color: #818cf8;
  font-size: 17px;
}

.sidebar-nav {
  flex: 1;
  padding: 10px 0;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  border-radius: 0;
  transition: background 0.12s, color 0.12s;
  position: relative;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-active);
}

.nav-item.active {
  background: #1e293b;
  color: #c7d2fe;
  font-weight: 500;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: #818cf8;
  border-radius: 0 2px 2px 0;
}

.nav-item i {
  width: 16px;
  text-align: center;
  font-size: 13px;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid #1e293b;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 30px;
  height: 30px;
  background: #3730a3;
  color: #c7d2fe;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.user-meta { flex: 1; min-width: 0; }
.user-name { font-size: 12px; font-weight: 500; color: #e2e8f0; }
.user-org { font-size: 11px; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ==================== MAIN CONTENT ==================== */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  background: var(--bg);
}

/* ==================== PAGE HEADER ==================== */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}

.page-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.4px;
  line-height: 1.3;
}

.page-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: var(--text); font-weight: 500; }
.breadcrumb i { font-size: 9px; }

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all 0.12s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.btn-secondary {
  background: white;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--bg); border-color: #94a3b8; }

.btn-ghost {
  background: transparent;
  color: var(--text-sub);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--bg); }

.btn-full { width: 100%; justify-content: center; }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.12s;
  text-decoration: none;
}
.btn-icon:hover { background: var(--bg); color: var(--primary); }
.btn-icon-warn:hover { color: var(--urgent); }
.btn-icon-ok:hover { color: var(--status-approved); }

.btn-group { display: flex; gap: 2px; }

/* ==================== STAT BAR ==================== */
.stat-bar {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 20px;
  margin-bottom: 20px;
  gap: 0;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 0 24px;
  flex: 1;
}

.stat-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

.stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
}

.highlight-reviewing .stat-num { color: var(--status-reviewing); }
.highlight-pending .stat-num { color: var(--status-pending); }
.highlight-urgent .stat-num { color: var(--urgent); }
.highlight-approved .stat-num { color: var(--status-approved); }

/* ==================== WORKSPACE GRID ==================== */
.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  align-items: start;
}

.workspace-main, .workspace-aside { min-width: 0; }

.workspace-aside {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ==================== SECTION HEADER ==================== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.link-more {
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
}
.link-more:hover { color: var(--primary); }
.link-more i { font-size: 9px; }

/* ==================== TABLE ==================== */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.table-wrap .data-table {
  border: none;
  border-radius: 0;
}

.data-table-full { width: 100%; }

.data-table thead tr {
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  padding: 9px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-sub);
  white-space: nowrap;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
  word-break: keep-all;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.5;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr:hover td { background: #fafbff; }

.clickable-row { cursor: pointer; }

.empty-row {
  text-align: center;
  color: var(--text-muted);
  padding: 32px !important;
  font-size: 12.5px;
}

.text-muted { color: var(--text-muted) !important; }
.text-center { text-align: center !important; }
.text-mono { font-family: 'SF Mono', 'Monaco', monospace; font-size: 11.5px; }

/* ==================== BADGES ==================== */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.status-draft { background: #f1f5f9; color: var(--status-draft); }
.status-submitted { background: #e0f2fe; color: #0369a1; }
.status-reviewing { background: #ede9fe; color: #5b21b6; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-approved { background: #d1fae5; color: #065f46; }
.status-closed { background: #f1f5f9; color: #334155; }

.priority-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.priority-urgent { background: #fee2e2; color: #991b1b; }
.priority-high { background: #ffedd5; color: #9a3412; }
.priority-normal { background: #f1f5f9; color: #475569; }

.type-badge {
  display: inline-flex;
  padding: 2px 7px;
  background: #f1f5f9;
  color: var(--text-sub);
  border-radius: 3px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.grade-badge {
  display: inline-flex;
  padding: 2px 8px;
  background: #ede9fe;
  color: #5b21b6;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
}

.role-badge {
  display: inline-flex;
  padding: 2px 7px;
  background: #e0e7ff;
  color: #3730a3;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 500;
}

.dot-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
}

.dot-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.dot-active { color: var(--status-approved); }
.dot-active::before { background: var(--status-approved); }
.dot-inactive { color: var(--text-muted); }
.dot-inactive::before { background: var(--text-light); }

/* ==================== LINKS ==================== */
.req-id {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 12px;
  font-family: 'SF Mono', monospace;
}
.req-id:hover { text-decoration: underline; }

.link-client {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}
.link-client:hover { color: var(--primary); }

/* ==================== FILTER BAR ==================== */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 12px;
}

.filter-form {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.filter-input {
  flex: 1;
  max-width: 280px;
  padding: 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  font-size: 12.5px;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  outline: none;
}
.filter-input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }

.filter-select {
  padding: 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  font-size: 12.5px;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  outline: none;
  cursor: pointer;
}
.filter-select:focus { border-color: var(--primary); }

.filter-tabs {
  display: flex;
  gap: 0;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  flex-wrap: wrap;
  gap: 4px;
}

.filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11.5px;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.1s;
  border: 1px solid transparent;
}
.filter-tab:hover { background: var(--bg); color: var(--text); }
.filter-tab.active { background: var(--primary-light); color: var(--primary); border-color: #c7d2fe; font-weight: 500; }

.tab-count {
  background: var(--bg);
  color: var(--text-muted);
  padding: 0 5px;
  border-radius: 10px;
  font-size: 10.5px;
  font-weight: 600;
}
.filter-tab.active .tab-count { background: var(--primary); color: white; }

/* ==================== ASIDE BLOCKS ==================== */
.aside-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}

.aside-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* 처리필요 목록 */
.action-list { display: flex; flex-direction: column; gap: 8px; }

.action-item {
  display: block;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.12s;
}
.action-item:hover { border-color: #a5b4fc; background: #fafbff; }
.action-urgent { border-left: 3px solid var(--status-pending); }

.action-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.action-id { font-size: 11px; color: var(--text-muted); font-family: monospace; }
.action-name { font-size: 12.5px; font-weight: 500; color: var(--text); margin-bottom: 3px; }
.action-meta { font-size: 11px; color: var(--text-muted); }

/* 파이프라인 */
.pipeline-list { display: flex; flex-direction: column; gap: 7px; }

.pipeline-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pipeline-bar-wrap {
  flex: 1;
  height: 4px;
  background: var(--bg);
  border-radius: 2px;
  overflow: hidden;
}

.pipeline-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #818cf8);
  border-radius: 2px;
  min-width: 3px;
  transition: width 0.3s ease;
}

.pipeline-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  min-width: 18px;
  text-align: right;
}

/* ==================== DETAIL LAYOUT ==================== */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 20px;
  align-items: start;
}

.detail-main { min-width: 0; }

.detail-aside {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.detail-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.detail-hero-left { flex: 1; }
.detail-hero-right {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 200px;
}

.detail-id { font-size: 11px; color: var(--text-muted); font-family: monospace; margin-bottom: 4px; }
.detail-title { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 8px; letter-spacing: -0.3px; }
.detail-badges { display: flex; flex-wrap: wrap; gap: 5px; }

.meta-item { display: flex; align-items: baseline; gap: 8px; }
.meta-label { font-size: 11px; color: var(--text-muted); min-width: 44px; }
.meta-val { font-size: 12.5px; color: var(--text); font-weight: 500; }

/* 정보 그리드 */
.info-grid {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 14px;
  overflow: hidden;
}

.info-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  border-bottom: 1px solid var(--border);
  min-height: 40px;
}
.info-row:last-child { border-bottom: none; }
.info-row-full { grid-column: 1 / -1; }

.info-label {
  padding: 11px 16px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-sub);
  background: #f8fafc;
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.info-val {
  padding: 11px 16px;
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  word-break: keep-all;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.info-desc { align-items: flex-start; line-height: 1.6; word-break: keep-all; }

/* 처리 이력 */
.history-block, .block-title {
  margin-bottom: 0;
}

.history-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
}

.block-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.block-count {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg);
  padding: 1px 7px;
  border-radius: 10px;
}

.empty-text { font-size: 12px; color: var(--text-muted); }

/* 타임라인 */
.timeline { display: flex; flex-direction: column; gap: 0; }

.timeline-item {
  display: flex;
  gap: 12px;
  position: relative;
  padding-bottom: 14px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 18px;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid white;
  box-shadow: 0 0 0 1px var(--border);
  flex-shrink: 0;
  margin-top: 3px;
}

.timeline-content { flex: 1; }
.timeline-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 3px; }
.timeline-action { font-size: 12.5px; font-weight: 600; color: var(--text); }
.timeline-user { font-size: 11.5px; color: var(--text-sub); }
.timeline-date { font-size: 11px; color: var(--text-muted); margin-left: auto; }
.timeline-note { font-size: 12px; color: var(--text-muted); background: var(--bg); padding: 6px 10px; border-radius: 5px; margin-top: 4px; }

/* 처리 흐름 */
.status-flow { display: flex; flex-direction: column; gap: 0; }

.flow-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 5px;
  font-size: 12px;
  color: var(--text-muted);
  position: relative;
}

.flow-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 16px;
  bottom: -4px;
  width: 1px;
  height: 8px;
  background: var(--border);
}

.flow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--border-strong);
  flex-shrink: 0;
}

.flow-active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}
.flow-active .flow-dot { background: var(--primary); border-color: var(--primary); }

.quick-actions { display: flex; flex-direction: column; gap: 6px; }

/* 요약 */
.summary-items { display: flex; flex-direction: column; gap: 8px; }
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
}
.summary-row span { color: var(--text-sub); }
.summary-row strong { color: var(--text); font-weight: 600; }

/* ==================== FORM ==================== */
.form-layout {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 20px;
  align-items: start;
}

.form-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
}

.form-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-readonly-note {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 3px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 16px;
}

.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-field-full { grid-column: 1 / -1; }

.form-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-sub);
}

.form-label.required::after {
  content: ' *';
  color: var(--urgent);
}

.form-input, .form-textarea, .form-select {
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  font-size: 13px;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.form-input:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.form-input-readonly {
  background: #f8fafc;
  color: var(--text-muted);
  cursor: not-allowed;
}

.form-textarea { resize: vertical; line-height: 1.6; }

.readonly-section .form-input { background: #f8fafc; color: var(--text-muted); }

.field-hint { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.input-with-btn { display: flex; gap: 6px; }
.input-with-btn .form-input { flex: 1; }

.file-upload-area {
  border: 1.5px dashed var(--border-strong);
  border-radius: 6px;
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.12s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.file-upload-area:hover { border-color: var(--primary); background: #fafbff; }

.form-actions {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* 가이드 패널 */
.form-guide { display: flex; flex-direction: column; gap: 14px; }

.guide-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}

.guide-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}

.guide-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.guide-list li {
  font-size: 12px;
  color: var(--text-sub);
  padding-left: 14px;
  position: relative;
  line-height: 1.5;
}

.guide-list li::before {
  content: '·';
  position: absolute;
  left: 4px;
  color: var(--text-muted);
}

/* 처리 단계 흐름 */
.step-flow { display: flex; flex-direction: column; align-items: flex-start; gap: 0; }

.step-item {
  font-size: 12px;
  color: var(--text-sub);
  padding: 4px 10px;
  background: var(--bg);
  border-radius: 4px;
  width: 100%;
}

.step-arrow { color: var(--border-strong); font-size: 11px; margin: 2px 0 2px 14px; }

/* ==================== 계정/기관 관리 ==================== */
.account-layout { position: relative; }

/* 슬라이드 패널 */
.slide-panel {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 360px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 20px rgba(0,0,0,0.08);
  transform: translateX(100%);
  transition: transform 0.22s ease;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.slide-panel.open { transform: translateX(0); }

.slide-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.slide-panel-header h3 { font-size: 14px; font-weight: 600; }

.slide-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.slide-panel-actions { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); }

/* ==================== 흐름도 ==================== */
.flow-pipeline {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 20px;
  gap: 4px;
  overflow-x: auto;
}

.pipeline-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 16px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  min-width: 90px;
  transition: all 0.12s;
}

.pipeline-stage-active { background: #ede9fe; border-color: #c4b5fd; }
.pipeline-stage-warn { background: #fef3c7; border-color: #fcd34d; }
.pipeline-stage-ok { background: #d1fae5; border-color: #6ee7b7; }
.pipeline-stage-done { background: #f1f5f9; border-color: #94a3b8; }

.pipeline-stage-label { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.pipeline-stage-num { font-size: 20px; font-weight: 700; color: var(--text); line-height: 1; }
.pipeline-stage-active .pipeline-stage-num { color: var(--status-reviewing); }
.pipeline-stage-warn .pipeline-stage-num { color: var(--status-pending); }
.pipeline-stage-ok .pipeline-stage-num { color: var(--status-approved); }

.pipeline-arrow { color: var(--text-muted); font-size: 13px; flex-shrink: 0; padding: 0 4px; }

/* 기관별 카드 그리드 */
.flow-org-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.flow-org-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.flow-org-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.flow-org-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.flow-org-name i { color: var(--text-muted); font-size: 12px; }

.flow-org-stats {
  display: flex;
  gap: 14px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 6px;
}

.flow-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.flow-stat-n { font-size: 17px; font-weight: 700; color: var(--text); line-height: 1; }
.flow-stat-l { font-size: 10px; color: var(--text-muted); }
.flow-n-blue { color: var(--status-reviewing); }
.flow-n-warn { color: var(--status-pending); }
.flow-n-ok { color: var(--status-approved); }
.flow-n-urgent { color: var(--urgent); }

.flow-req-list { display: flex; flex-direction: column; gap: 5px; }

.flow-req-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all 0.1s;
  font-size: 11.5px;
}
.flow-req-item:hover { border-color: #a5b4fc; background: #fafbff; }

.flow-req-id { font-family: monospace; color: var(--text-muted); font-size: 10.5px; }
.flow-req-name { flex: 1; font-weight: 500; color: var(--text); }

.flow-more {
  font-size: 11px;
  color: var(--primary);
  text-decoration: none;
  text-align: right;
  padding: 4px 0;
}

.flow-empty { font-size: 12px; color: var(--text-muted); text-align: center; padding: 8px 0; }

/* SVG 다이어그램 */
.flow-diagram-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}

.flow-diagram {
  margin-top: 14px;
  background: #0f172a;
  border-radius: 8px;
  padding: 20px;
  overflow-x: auto;
}

.flow-svg { width: 100%; height: auto; min-width: 700px; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1200px) {
  .workspace-grid { grid-template-columns: 1fr; }
  .workspace-aside { display: grid; grid-template-columns: repeat(2, 1fr); }
  .flow-org-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .detail-layout { grid-template-columns: 1fr; }
  .form-layout { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

/* ==================== MISC ==================== */
a { text-decoration: none; }
button { font-family: var(--font); cursor: pointer; }
select { cursor: pointer; appearance: auto; }

.section-title { font-size: 13px; font-weight: 600; color: var(--text); }

/* ==================== LOGIN PAGE ==================== */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f172a;
}

.login-card {
  background: #ffffff;
  border-radius: 10px;
  padding: 40px 36px;
  width: 420px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.login-logo i {
  font-size: 22px;
}

.login-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

.login-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  font-size: 12.5px;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.login-accounts-hint {
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.hint-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 10px;
}

.hint-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hint-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.12s, background 0.12s;
  font-family: var(--font);
}

.hint-item:hover {
  border-color: var(--primary);
  background: #f0f4ff;
}

.hint-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  min-width: 60px;
}

.hint-role {
  font-size: 11.5px;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 8px;
  border-radius: 20px;
  min-width: 60px;
  text-align: center;
}

.hint-org {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* ==================== LOGOUT BUTTON ==================== */
.user-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 6px;
  color: var(--sidebar-text);
  font-size: 12px;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
  border: 1px solid #1e293b;
}

.logout-btn:hover {
  background: #1e293b;
  color: #e2e8f0;
  border-color: #334155;
}

.logout-btn i {
  font-size: 13px;
}

/* ==================== ACCOUNT LAYOUT ==================== */
.account-layout {
  position: relative;
}

/* ==================== MY INFO MODAL ==================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: var(--surface);
  border-radius: 10px;
  width: 420px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0,0,0,0.22);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.modal-body {
  padding: 20px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

/* 비밀번호 변경 섹션 */
.pw-change-section {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.pw-section-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pw-msg {
  font-size: 12.5px;
  padding: 9px 13px;
  border-radius: 6px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.pw-msg-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
}
.pw-msg-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
}

/* 사이드바 사용자 정보 클릭 */
.user-info-btn {
  cursor: pointer;
  border-radius: 7px;
  padding: 6px 8px;
  transition: background 0.12s;
  position: relative;
}
.user-info-btn:hover {
  background: #1e293b;
}
.user-info-btn:hover .user-gear-icon {
  opacity: 1;
}
.user-gear-icon {
  font-size: 12px;
  color: var(--sidebar-text);
  opacity: 0;
  transition: opacity 0.15s;
  margin-left: auto;
  flex-shrink: 0;
}

/* ==================== MODAL TAB ==================== */
.modal-tab {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.modal-tab:hover { background: var(--bg); color: var(--text); }
.modal-tab.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}
