/* [스마트 업무관리 & 계약시스템] 초경량 PC 웹 대시보드 스타일 */
:root {
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --primary-light: #eff6ff;
  --success: #15803d;
  --success-light: #f0fdf4;
  --warning: #b45309;
  --warning-light: #fefce8;
  --danger: #b91c1c;
  --danger-light: #fef2f2;
  --neutral-50: #f8fafc;
  --neutral-100: #f1f5f9;
  --neutral-200: #e2e8f0;
  --neutral-300: #cbd5e1;
  --neutral-400: #94a3b8;
  --neutral-500: #64748b;
  --neutral-700: #334155;
  --neutral-900: #0f172a;
  --font-sans: -apple-system, BlinkMacSystemFont, "Pretendard", "Segoe UI", Roboto, "Malgun Gothic", sans-serif;
  --radius: 8px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--neutral-50);
  color: var(--neutral-900);
  line-height: 1.5;
  font-size: 14px;
}

/* Header (1단: 제목줄) */
.top-header {
  background: #ffffff;
  border-bottom: 1px solid var(--neutral-200);
  padding: 0 16px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 50;
}

/* GNB Navigation (2단: 메뉴줄) */
.gnb-bar {
  background: #f8fafc;
  border-bottom: 1px solid var(--neutral-200);
  padding: 4px 16px;
  min-height: 44px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  position: sticky;
  top: 52px;
  z-index: 45;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.gnb-group {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.gnb-divider {
  width: 1px;
  height: 18px;
  background: #cbd5e1;
  margin: 0 6px;
  flex-shrink: 0;
}

.gnb-tab {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}

.gnb-tab:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.gnb-tab.active {
  background: #ffffff;
  color: #0f172a;
  font-weight: 700;
  border-color: #cbd5e1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  white-space: nowrap;
}

.brand-logo {
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--neutral-900);
}

.brand-subtitle {
  font-size: 12px;
  color: var(--neutral-500);
  margin-left: 8px;
  border-left: 1px solid var(--neutral-200);
  padding-left: 8px;
}

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

.nav-tab {
  background: transparent;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.nav-tab:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.nav-tab.active {
  background: #ffffff;
  color: #0f172a;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Layout */
.app-container {
  display: flex;
  height: calc(100vh - 60px);
}

.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* Filter Bar */
.filter-card {
  background: #fff;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-item label {
  font-size: 12px;
  font-weight: 600;
  color: var(--neutral-700);
}

.form-select, .form-input {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--neutral-300);
  border-radius: 6px;
  font-size: 13px;
  background-color: #fff;
  color: var(--neutral-900);
  outline: none;
}

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

/* View Mode Tabs */
.view-toggle {
  display: flex;
  background: var(--neutral-100);
  border-radius: 6px;
  padding: 2px;
}

.view-btn {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--neutral-700);
  cursor: pointer;
  border-radius: 5px;
}

.view-btn.active {
  background: #fff;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* Stats Ribbon */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.stat-label {
  font-size: 12px;
  color: var(--neutral-500);
  font-weight: 600;
  text-transform: uppercase;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--neutral-900);
  margin-top: 4px;
}

.stat-sub {
  font-size: 12px;
  color: var(--neutral-500);
  margin-top: 4px;
}

/* Data Table */
.table-card {
  background: #fff;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table,
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.table th,
.data-table th {
  background: var(--neutral-100);
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--neutral-700);
  border-bottom: 1px solid var(--neutral-200);
  white-space: nowrap;
}

.table td,
.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--neutral-200);
  font-size: 12px;
  vertical-align: middle;
}

.table tr:hover,
.data-table tr:hover {
  background: var(--neutral-50);
}

/* Kanban Board */
.kanban-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.kanban-col {
  background: var(--neutral-100);
  border-radius: var(--radius);
  padding: 14px;
  min-height: 500px;
}

.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.kanban-col-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--neutral-700);
}

.kanban-count {
  background: #fff;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--neutral-500);
}

.kanban-card {
  background: #fff;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}

.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

.badge-dday-warn {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid #fecaca;
}

.badge-dday-near {
  background: var(--warning-light);
  color: var(--warning);
  border: 1px solid #fde68a;
}

.badge-dday-normal {
  background: var(--neutral-100);
  color: var(--neutral-700);
}

.badge-dday-done {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid #bbf7d0;
}

.badge-seq {
  background: #e0e7ff;
  color: #3730a3;
}

.badge-type {
  background: var(--neutral-100);
  color: var(--neutral-700);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: #fff;
  color: var(--neutral-700);
  border: 1px solid var(--neutral-300);
}

.btn-secondary:hover {
  background: var(--neutral-100);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  position: relative;
}

.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* Modals & Drawers */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal-backdrop.active {
  display: flex;
}

.modal-panel {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
}

.drawer {
  position: fixed;
  top: 0;
  right: -520px;
  width: 500px;
  height: 100vh;
  background: #fff;
  box-shadow: var(--shadow-lg);
  z-index: 60;
  transition: right 0.25s ease-in-out;
  display: flex;
  flex-direction: column;
}

.drawer.active {
  right: 0;
}

.drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--neutral-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.drawer-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--neutral-200);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Timeline */
.timeline {
  margin-top: 20px;
  position: relative;
  padding-left: 20px;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 6px;
  width: 2px;
  background: var(--neutral-200);
}

.timeline-item {
  position: relative;
  margin-bottom: 18px;
}

.timeline-dot {
  position: absolute;
  left: -20px;
  top: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--neutral-400);
}

.timeline-dot.completed {
  border-color: var(--success);
  background: var(--success);
}

.timeline-dot.current {
  border-color: var(--primary);
  background: var(--primary);
}

.timeline-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--neutral-900);
}

.timeline-date {
  font-size: 12px;
  color: var(--neutral-500);
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #1e293b;
  color: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   [독립형 계약시스템 v152 전용 스타일]
   ========================================================================== */
.vendor-overview-grid {
  display: grid;
  grid-template-columns: 180px 220px 1fr 340px;
  gap: 12px;
  margin-bottom: 16px;
}

.vendor-metric-box {
  background: #fff;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.vendor-metric-box .v-label {
  font-size: 12px;
  color: var(--neutral-500);
  font-weight: 600;
}

.vendor-metric-box .v-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  margin-top: 4px;
}

.vendor-risk-box {
  background: #fff;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow-sm);
}

.vendor-risk-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.risk-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.risk-chip.warning {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}

.vendor-search-box {
  background: #fff;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow-sm);
}

.workflow-reference-card {
  background: #f8fafc;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
}

.workflow-step-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.workflow-pill {
  padding: 4px 8px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--neutral-300);
  font-size: 11px;
  font-weight: 700;
  color: var(--neutral-700);
}

.workflow-arrow {
  color: var(--neutral-400);
  font-size: 10px;
}

/* 10-Stage Table Chips */
.stage-chip-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  font-size: 10px;
}

.cs-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
}

.cs-chip.done {
  background: #dcfce7;
  color: #15803d;
  border-color: #bbf7d0;
}

.cs-chip.current {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #bfdbfe;
  box-shadow: 0 0 0 1px #3b82f6;
}

.cs-chip.waiting {
  background: #f1f5f9;
  color: #64748b;
  border-color: #e2e8f0;
}

.cs-chip.na {
  background: #f8fafc;
  color: #cbd5e1;
  text-decoration: line-through;
}
