/* ===== RESET & ROOT ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sidebar-w: 256px;
  --topbar-h: 58px;

  --primary: #1e40af;
  --primary-light: #3b82f6;
  --primary-bg: #eff6ff;
  --primary-border: #bfdbfe;

  --success: #166534;
  --success-bg: #dcfce7;
  --success-border: #bbf7d0;

  --warning: #92400e;
  --warning-bg: #fef3c7;
  --warning-border: #fde68a;

  --danger: #991b1b;
  --danger-bg: #fee2e2;
  --danger-border: #fecaca;

  --sidebar-bg: #0f172a;
  --sidebar-hover: rgba(255,255,255,0.06);
  --sidebar-active: rgba(59,130,246,0.18);

  --bg: #f0f4f8;
  --card: #ffffff;
  --border: #e2e8f0;
  --border-light: #f1f5f9;

  --text-1: #0f172a;
  --text-2: #334155;
  --text-3: #64748b;
  --text-4: #94a3b8;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);

  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
}

html { font-size: 14px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', 'Apple SD Gothic Neo', sans-serif;
  background: var(--bg);
  color: var(--text-2);
  line-height: 1.55;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===== APP SHELL ===== */
#app { display: flex; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-logo {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.logo-icon {
  width: 38px; height: 38px;
  background: var(--primary);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo-text { font-size: 15px; font-weight: 700; color: #fff; line-height: 1.2; }
.logo-sub  { font-size: 10px; color: #64748b; margin-top: 1px; }

.sidebar-section { padding: 14px 0 6px; }
.sidebar-section-title {
  font-size: 10px; font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 0 20px 6px;
}
.sidebar-bottom {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.07);
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all .14s;
  border-left: 3px solid transparent;
  cursor: pointer;
}
.sidebar-nav a:hover { background: var(--sidebar-hover); color: #e2e8f0; }
.sidebar-nav a.active {
  background: var(--sidebar-active);
  color: #fff;
  border-left-color: var(--primary-light);
}
.nav-icon { width: 16px; height: 16px; flex-shrink: 0; opacity: .7; }
.sidebar-nav a.active .nav-icon { opacity: 1; }
.nav-badge {
  margin-left: auto;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

/* ===== MAIN WRAPPER ===== */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== TOPBAR ===== */
.topbar {
  height: var(--topbar-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 17px; font-weight: 700; color: var(--text-1); }
.topbar-subtitle { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.company-tag {
  font-size: 12px; font-weight: 600;
  background: var(--primary-bg);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--primary-border);
}

/* ===== CONTENT ===== */
.content { flex: 1; padding: 22px 24px; }
.loading { text-align: center; padding: 60px; color: var(--text-3); }

/* ===== CARD ===== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title { font-size: 14px; font-weight: 700; color: var(--text-1); }
.card-subtitle { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.card-body { padding: 18px; }
.card-body-flush { padding: 0; }

/* ===== STAT GRID ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
@media (max-width: 1100px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}
.stat-icon {
  width: 38px; height: 38px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.stat-label { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--text-1); line-height: 1.1; margin: 4px 0; }
.stat-value span { font-size: 14px; font-weight: 500; color: var(--text-3); }
.stat-desc { font-size: 11px; color: var(--text-3); }

/* ===== GRID LAYOUTS ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ===== PROGRESS ===== */
.progress-bar {
  height: 7px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .5s ease;
}
.fill-blue   { background: #3b82f6; }
.fill-purple { background: #8b5cf6; }
.fill-green  { background: #22c55e; }
.fill-amber  { background: #f59e0b; }
.fill-red    { background: #ef4444; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 11px; font-weight: 600;
  white-space: nowrap;
}
.badge-todo     { background: #f1f5f9; color: #475569; }
.badge-progress { background: #dbeafe; color: #1d4ed8; }
.badge-done     { background: #dcfce7; color: #15803d; }
.badge-na       { background: #f3f4f6; color: #6b7280; }
.badge-high     { background: #fee2e2; color: #b91c1c; }
.badge-med      { background: #fef3c7; color: #b45309; }
.badge-low      { background: #f0fdf4; color: #15803d; }
.badge-info     { background: #eff6ff; color: #1d4ed8; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  cursor: pointer; border: none;
  transition: all .13s;
  text-decoration: none;
  line-height: 1;
}
.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #1e3a8a; }
.btn-success  { background: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger   { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-outline  { background: #fff; color: var(--text-2); border: 1px solid var(--border); }
.btn-outline:hover { background: #f8fafc; }
.btn-ghost    { background: transparent; color: var(--text-3); }
.btn-ghost:hover { background: var(--border-light); color: var(--text-2); }
.btn-sm { padding: 5px 11px; font-size: 12px; }

/* ===== TABS ===== */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 18px;
}
.tab {
  padding: 9px 18px;
  font-size: 13px; font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .13s;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.tab:hover { color: var(--text-1); background: #f8fafc; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  background: #f8fafc;
  padding: 9px 14px;
  text-align: left;
  font-size: 11px; font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-2);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafbfc; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 14px; }
label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
input[type="text"],
input[type="date"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-1);
  background: #fff;
  transition: border-color .13s, box-shadow .13s;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}
textarea { resize: vertical; min-height: 80px; }

.status-select {
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  background: #fff;
  cursor: pointer;
}

/* ===== ALERTS ===== */
.alert {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: flex; align-items: flex-start; gap: 10px;
  border-left: 3px solid;
}
.alert + .alert { margin-top: 8px; }
.alert-info    { background: var(--primary-bg); color: #1e40af; border-color: var(--primary-light); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: #f59e0b; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: #22c55e; }
.alert-danger  { background: var(--danger-bg);  color: var(--danger);  border-color: #ef4444; }

/* ===== PHASE TIMELINE ===== */
.phase-timeline {
  display: flex;
  align-items: flex-start;
  padding: 10px 0 4px;
}
.phase-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.phase-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 23px;
  left: calc(50% + 24px);
  right: calc(-50% + 24px);
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.phase-step.done:not(:last-child)::after  { background: #3b82f6; }
.phase-step.curr:not(:last-child)::after  { background: #f59e0b; }

.phase-circle {
  width: 46px; height: 46px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
  position: relative; z-index: 1;
  background: #f1f5f9; color: var(--text-3);
  transition: all .3s;
  border: 2px solid var(--border);
}
.phase-step.done .phase-circle { background: #3b82f6; color: #fff; border-color: #3b82f6; }
.phase-step.curr .phase-circle { background: #f59e0b; color: #fff; border-color: #f59e0b; box-shadow: 0 0 0 5px rgba(245,158,11,.15); }

.phase-name { font-size: 11px; font-weight: 600; text-align: center; color: var(--text-3); margin-top: 8px; }
.phase-step.done .phase-name,
.phase-step.curr .phase-name { color: var(--text-1); }
.phase-icon-label { font-size: 11px; color: var(--text-4); text-align: center; margin-top: 2px; }

/* ===== DOMAIN PROGRESS ===== */
.domain-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.domain-row:last-child { margin-bottom: 0; }
.domain-row-header { display: flex; justify-content: space-between; font-size: 12px; }
.domain-row-name { font-weight: 600; color: var(--text-2); }
.domain-row-count { color: var(--text-3); }

/* ===== CHECKLIST ===== */
.cl-item {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}
.cl-item:last-child { border-bottom: none; }
.cl-item input[type="checkbox"] {
  width: 16px; height: 16px;
  margin-top: 1px;
  cursor: pointer;
  accent-color: var(--primary);
  flex-shrink: 0;
}
.cl-content { flex: 1; }
.cl-title { font-size: 13px; font-weight: 500; color: var(--text-1); }
.cl-item.checked .cl-title { text-decoration: line-through; color: var(--text-4); }
.cl-desc { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* ===== PROCESS TASK GRID ===== */
.task-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 700px) { .task-grid { grid-template-columns: 1fr; } }

.task-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fafbfc;
  transition: background .12s;
}
.task-item.done { background: #f0fdf4; border-color: #bbf7d0; }
.task-item input[type="checkbox"] {
  width: 15px; height: 15px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--primary);
  flex-shrink: 0;
}
.task-title { font-size: 13px; font-weight: 500; color: var(--text-1); }
.task-item.done .task-title { text-decoration: line-through; color: var(--text-3); }
.task-desc { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* ===== PROCESS PHASE CARD ===== */
.phase-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  border-left: 4px solid var(--border);
}
.phase-card.status-done { border-left-color: #22c55e; }
.phase-card.status-curr { border-left-color: #f59e0b; }
.phase-card.status-todo { border-left-color: #e2e8f0; }
.phase-card-header {
  padding: 14px 18px;
  display: flex; align-items: center; gap: 14px;
}
.phase-card-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.phase-card-body { padding: 0 18px 18px; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.55);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
}
.modal {
  background: var(--card);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 540px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  max-height: 90vh;
  display: flex; flex-direction: column;
}
.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.modal-title { font-size: 15px; font-weight: 700; color: var(--text-1); }
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-3); padding: 4px; border-radius: 6px;
  display: flex; align-items: center;
  transition: all .12s;
}
.modal-close:hover { background: var(--border-light); color: var(--text-1); }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
  flex-shrink: 0;
}

/* ===== FILTER BAR ===== */
.filter-bar {
  display: flex; gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-bar input[type="text"] { min-width: 200px; max-width: 260px; }
.filter-bar select { min-width: 130px; max-width: 170px; }
.filter-count { margin-left: auto; font-size: 12px; color: var(--text-3); }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-4); }
.empty-icon { font-size: 44px; margin-bottom: 10px; }

/* ===== AUDIT TIMELINE ===== */
.audit-timeline { display: flex; flex-direction: column; gap: 14px; }
.audit-tl-item { display: flex; gap: 14px; }
.audit-tl-badge {
  min-width: 68px;
  text-align: center;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 700;
  color: #fff; flex-shrink: 0;
  margin-top: 1px;
}
.audit-tl-content { padding-left: 14px; border-left: 2px solid var(--border); flex: 1; padding-bottom: 6px; }
.audit-tl-title { font-size: 13px; font-weight: 600; color: var(--text-1); }
.audit-tl-desc  { font-size: 11px; color: var(--text-3); margin-top: 3px; }

/* ===== TIP CARDS ===== */
.tip-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 900px) { .tip-grid { grid-template-columns: 1fr 1fr; } }
.tip-card { padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.tip-num { font-size: 26px; font-weight: 800; color: #dbeafe; line-height: 1; margin-bottom: 6px; }
.tip-title { font-size: 13px; font-weight: 600; color: var(--text-1); margin-bottom: 4px; }
.tip-desc  { font-size: 11px; color: var(--text-3); line-height: 1.5; }

/* ===== WARN/GOOD GRID ===== */
.warn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 700px) { .warn-grid { grid-template-columns: 1fr; } }
.warn-item {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid;
}
.warn-item.bad  { background: var(--danger-bg);  border-color: var(--danger-border); }
.warn-item.good { background: var(--success-bg); border-color: var(--success-border); }
.warn-emoji { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.warn-title { font-size: 12px; font-weight: 600; }
.warn-desc  { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* ===== POST MGMT ===== */
.cycle-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.cycle-badge {
  min-width: 62px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 10px; font-weight: 700;
  text-align: center; color: #fff;
}

/* ===== SETTINGS ===== */
.settings-wrap { max-width: 580px; }

/* ===== UTILITY ===== */
.mb-0 { margin-bottom: 0 !important; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.mb-6 { margin-bottom: 24px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.text-xs  { font-size: 11px; }
.text-sm  { font-size: 12px; }
.text-muted { color: var(--text-3); }
.font-600 { font-weight: 600; }
.font-700 { font-weight: 700; }

/* ===== DOTS ===== */
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot-blue   { background: #3b82f6; }
.dot-amber  { background: #f59e0b; }
.dot-red    { background: #ef4444; }
.dot-gray   { background: #94a3b8; }
.dot-green  { background: #22c55e; }

/* ===== MODE TAG (topbar) ===== */
.mode-tag {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px; font-weight: 700;
  cursor: pointer;
  border: 1.5px solid;
  transition: all .15s;
  white-space: nowrap;
}
.mode-tag:hover { opacity: .85; }
.mode-tag-full {
  background: #eff6ff; color: #1d4ed8;
  border-color: #bfdbfe;
}
.mode-tag-simple {
  background: #fef3c7; color: #b45309;
  border-color: #fde68a;
}

/* ===== SIMPLE CERT PAGE ===== */
.sc-type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
@media (max-width: 900px) { .sc-type-grid { grid-template-columns: 1fr; } }

.sc-type-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  cursor: pointer;
  transition: all .15s;
  position: relative;
}
.sc-type-card:hover { border-color: #f59e0b; box-shadow: var(--shadow-md); }
.sc-type-card.selected {
  border-color: #f59e0b;
  background: #fffbeb;
  box-shadow: 0 0 0 3px rgba(245,158,11,.15);
}
.sc-type-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px; font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}
.sc-type-name { font-size: 14px; font-weight: 700; color: var(--text-1); margin-bottom: 4px; }
.sc-type-desc { font-size: 12px; color: var(--text-3); line-height: 1.5; }
.sc-type-criteria {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 11px; color: var(--text-3);
}
.sc-type-criteria li { margin-bottom: 3px; padding-left: 12px; position: relative; }
.sc-type-criteria li::before { content:'·'; position:absolute; left:0; }
.sc-selected-mark {
  position: absolute;
  top: 12px; right: 12px;
  width: 20px; height: 20px;
  background: #f59e0b;
  border-radius: 50%;
  display: none;
  align-items: center; justify-content: center;
  color: #fff; font-size: 11px; font-weight: 700;
}
.sc-type-card.selected .sc-selected-mark { display: flex; }

/* 비교 테이블 */
.compare-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.compare-table th, .compare-table td { padding: 10px 14px; border: 1px solid var(--border); text-align: center; }
.compare-table thead th { background: #f8fafc; font-weight: 700; color: var(--text-2); }
.compare-table .col-highlight { background: #fffbeb; color: #b45309; font-weight: 700; }
.compare-table .row-total td { font-weight: 700; background: #f0fdf4; }

/* 간편인증 모드 활성 배너 */
.simple-active-bar {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}
.simple-active-bar .bar-text { font-size: 13px; font-weight: 600; }
.simple-active-bar .bar-sub { font-size: 11px; opacity: .85; margin-top: 2px; }

/* 진단 카드 */
.diag-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.diag-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fafbfc;
}
.diag-step-num {
  min-width: 28px; height: 28px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
}
.diag-step-q { font-size: 13px; font-weight: 600; color: var(--text-1); margin-bottom: 8px; }
.diag-btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.diag-btn {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 500;
  border: 1.5px solid var(--border);
  background: #fff;
  cursor: pointer;
  transition: all .13s;
}
.diag-btn:hover, .diag-btn.sel { background: var(--primary); color: #fff; border-color: var(--primary); }
.diag-result {
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 2px solid;
  margin-top: 14px;
}
.diag-result.res-simple { background: #fffbeb; border-color: #f59e0b; }
.diag-result.res-full   { background: #eff6ff; border-color: #3b82f6; }

/* ===== SECTION HEADER ===== */
.section-hd {
  display: flex; align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-title    { font-size: 17px; font-weight: 700; color: var(--text-1); }
.section-subtitle { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ===== RESPONSIVE: 햄버거 & 사이드바 오버레이 ===== */
.hamburger {
  display: none;
  align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border: none; background: none;
  color: var(--text-1);
  cursor: pointer;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: background .14s;
}
.hamburger:hover { background: var(--border-light); }

.sidebar-close {
  display: none;
  margin-left: auto;
  align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border: none; background: rgba(255,255,255,.08);
  color: #94a3b8;
  cursor: pointer;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.sidebar-close:hover { background: rgba(255,255,255,.15); color: #fff; }

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.sidebar-overlay.open { display: block; }

/* ===== RESPONSIVE: 태블릿 (≤ 900px) ===== */
@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar { padding: 0 16px; }
  .content { padding: 16px; }
  .company-tag { display: none; }
}

/* ===== RESPONSIVE: 모바일 (≤ 768px) ===== */
@media (max-width: 768px) {
  /* 사이드바 off-canvas */
  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    z-index: 200;
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,.35);
  }
  .sidebar-close { display: flex; }

  /* 메인 영역 전체 폭 사용 */
  .main-wrapper { margin-left: 0; }

  /* 탑바 */
  .hamburger { display: flex; }
  .topbar { padding: 0 14px; gap: 8px; }
  .topbar-left { gap: 8px; }
  .topbar-title { font-size: 15px; }
  .topbar-subtitle { display: none; }
  .mode-tag { font-size: 11px; padding: 3px 8px; }
  .export-label { display: none; }
  .topbar-export-btn { padding: 6px 8px; min-width: 0; }

  /* 컨텐츠 패딩 */
  .content { padding: 12px; }

  /* 카드 */
  .card-body { padding: 14px; }
  .card-header { padding: 12px 14px; }

  /* 통계 그리드 2열 유지 (480 이하에서 1열로) */
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  /* 테이블: 가로 스크롤 */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 480px; }

  /* 모달 */
  .modal { width: calc(100vw - 24px); max-height: 88vh; overflow-y: auto; margin: auto; }
  .modal-body { padding: 14px; }

  /* alert */
  .alert { font-size: 12px; }

  /* 간편인증 배너 */
  .simple-active-bar { flex-direction: column; gap: 10px; align-items: flex-start; }
  .simple-active-bar button { width: 100%; text-align: center; }

  /* 섹션 헤더 */
  .section-header { margin-bottom: 10px; }
  .section-title { font-size: 15px; }
}

/* ===== RESPONSIVE: 소형 모바일 (≤ 480px) ===== */
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; gap: 8px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }

  .content { padding: 10px; }
  .card-body { padding: 12px; }

  .topbar-right { gap: 6px; }
  .mode-tag { display: none; }

  /* 위상 타임라인 */
  .phase-timeline { gap: 4px; }
  .phase-name { font-size: 9px; }
  .phase-circle { width: 24px; height: 24px; font-size: 10px; }

  /* 버튼 터치 영역 확보 */
  .btn { min-height: 36px; }
  .btn-sm { min-height: 30px; }

  /* 간편인증 유형 카드 */
  .sc-type-grid { grid-template-columns: 1fr; }

  /* 도메인 행 */
  .domain-row-header { flex-wrap: wrap; gap: 4px; }
}

/* ===== 터치 디바이스: 터치 타겟 확대 ===== */
@media (hover: none) and (pointer: coarse) {
  .sidebar-nav a { padding: 12px 20px; }
  .btn { min-height: 40px; }
  .btn-sm { min-height: 34px; }
  input[type="checkbox"] { width: 16px; height: 16px; }
  select { min-height: 36px; }
}
