/* ============================================================
   SYULS FC-ERP — Crisp Blue Theme
   테마 A: 화이트 사이드바 + 딥 블루 포인트
   ============================================================ */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
  background: #f0f4f8;
  color: #1e293b;
  font-size: 14px;
  line-height: 1.5;
}

/* ── 전체 레이아웃 ── */
#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ============================================================
   사이드바
   ============================================================ */
.sidebar {
  width: 224px;
  background: #fff;
  border-right: 1px solid #d0d9e6;
  box-shadow: 2px 0 8px rgba(12,68,124,0.06);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.25s ease;
  overflow: hidden;
  z-index: 100;
}

.sidebar.collapsed {
  width: 56px;
}

/* 로고 */
.sb-header {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #e8ecf2;
  flex-shrink: 0;
  min-height: 60px;
}

.sb-logo-icon {
  width: 34px;
  height: 34px;
  background: #0C447C;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  flex-shrink: 0;
  letter-spacing: -1px;
}

.sb-logo-text {
  font-size: 15px;
  font-weight: 700;
  color: #0C447C;
  letter-spacing: -0.3px;
  white-space: nowrap;
  opacity: 1;
  transition: opacity 0.2s;
}

.sidebar.collapsed .sb-logo-text { opacity: 0; pointer-events: none; }

/* 사용자 정보 */
.sb-user {
  padding: 10px 12px;
  margin: 8px;
  border-radius: 9px;
  background: #fafbfd;
  border: 1px solid #eef1f6;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
  overflow: hidden;
}

.sb-user-avatar {
  width: 30px;
  height: 30px;
  background: #E6F1FB;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #0C447C;
  flex-shrink: 0;
}

.sb-user-info { overflow: hidden; transition: opacity 0.2s; }
.sidebar.collapsed .sb-user-info { opacity: 0; pointer-events: none; }

.uname {
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.urole {
  font-size: 10px;
  color: #94a3b8;
  white-space: nowrap;
}

/* 메뉴 스크롤 영역 */
.sb-menu {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 0 12px;
}

.sb-menu::-webkit-scrollbar { width: 3px; }
.sb-menu::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 3px; }

/* 카테고리 헤더 (클릭으로 접기/펼치기) */
.msec {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 3px;
  font-size: 12px;
  font-weight: 800;
  color: #475569;
  letter-spacing: 0.3px;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}

.msec:hover { color: #7a8fa6; }

.msec-arrow {
  font-size: 9px;
  transition: transform 0.2s;
  color: #c8d4e0;
}

.msec.collapsed .msec-arrow { transform: rotate(-90deg); }
.sidebar.collapsed .msec { padding: 8px 0; justify-content: center; }
.sidebar.collapsed .msec span:first-child,
.sidebar.collapsed .msec-arrow { display: none; }

/* 메뉴 그룹 (접기 대상) */
.msec-group {
  overflow: hidden;
  transition: max-height 0.25s ease;
  max-height: 500px;
}

.msec-group.collapsed { max-height: 0; }

/* 메뉴 아이템 */
.mitem {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
  margin: 1px 8px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  color: #4a5a6e;
  transition: all 0.12s;
  white-space: nowrap;
  overflow: hidden;
}

.mitem:hover {
  background: #f0f6ff;
  color: #0C447C;
}

.mitem.active {
  background: #E6F1FB;
  color: #0C447C;
  font-weight: 600;
}

.mitem-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  opacity: 0.4;
  transition: opacity 0.12s;
}

.mitem.active .mitem-dot { opacity: 1; }
.mitem:hover .mitem-dot { opacity: 0.7; }

.mitem-label {
  opacity: 1;
  transition: opacity 0.2s;
}

.sidebar.collapsed .mitem {
  justify-content: center;
  padding: 8px 0;
  margin: 1px 8px;
}

.sidebar.collapsed .mitem-label { opacity: 0; width: 0; pointer-events: none; }
.sidebar.collapsed .mitem-dot { opacity: 0.5; }
.sidebar.collapsed .mitem.active .mitem-dot { opacity: 1; background: #0C447C; }

/* 사이드바 하단 */
.sb-foot {
  padding: 10px 12px;
  border-top: 1px solid #f0f3f7;
  flex-shrink: 0;
}

.sb-foot button,
#logout-btn {
  width: 100%;
  padding: 8px;
  background: transparent;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  font-size: 12px;
  color: #64748b;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
  overflow: hidden;
}

.sb-foot button:hover,
#logout-btn:hover {
  background: #fff0f0;
  border-color: #fca5a5;
  color: #dc2626;
}

.sidebar.collapsed .sb-foot button,
.sidebar.collapsed #logout-btn {
  font-size: 0;
  padding: 8px 0;
}

.sidebar.collapsed .sb-foot button::before,
.sidebar.collapsed #logout-btn::before {
  content: '→';
  font-size: 14px;
}

/* ============================================================
   메인 영역
   ============================================================ */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  background: #e8eef5;
}

/* 탑바 */
.topbar {
  background: #fff;
  border-bottom: 1px solid #d0d9e6;
  box-shadow: 0 1px 4px rgba(12,68,124,0.06);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  flex-shrink: 0;
  background: #fff;
}

.topbar h2, #ptitle {
  font-size: 15px !important;
  font-weight: 600 !important;
  color: #0C447C !important;
  margin: 0 !important;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar h2::before, #ptitle::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 18px;
  background: #0C447C;
  border-radius: 2px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-user {
  font-size: 12px;
  color: #64748b;
}

.topbar-user strong {
  color: #0C447C;
  font-weight: 600;
}

/* 탭바 */
.tab-bar-wrap {
  background: #fff;
  border-bottom: 1px solid #dde3ed;
  padding: 0 0 0 16px;
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  height: 38px;
  width: 100%;
}

.tab-bar-wrap::-webkit-scrollbar { height: 0; }

.erp-tab {
  padding: 0 13px;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  color: #64748b;
  border-bottom: 2px solid transparent;
  transition: all 0.12s;
  white-space: nowrap;
  flex-shrink: 0;
}

.erp-tab:hover { background: #f8fafc; color: #0C447C; }

.erp-tab.active {
  color: #0C447C;
  font-weight: 600;
  border-bottom: 2px solid #0C447C;
  background: #f0f6ff;
}

.erp-tab-close {
  font-size: 14px;
  opacity: 0.35;
  line-height: 1;
  margin-left: 1px;
  transition: opacity 0.12s;
}

.erp-tab-close:hover { opacity: 0.9; }

/* 콘텐츠 영역 */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px;
  background: #e8eef5;
}

/* ============================================================
   공통 컴포넌트
   ============================================================ */

/* 카드 */
.card {
  background: #fff;
  border: 1px solid #e8ecf2;
  border-radius: 10px;
  margin-bottom: 16px;
}

.card-hd {
  padding: 12px 18px;
  border-bottom: 1px solid #f0f4f8;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-hd h3 {
  font-size: 14px;
  font-weight: 600;
  color: #0C447C;
  margin: 0;
}

.card-bd { padding: 16px 18px; }

/* KPI 메트릭 */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.mc {
  background: #fff;
  border: 1px solid #e8ecf2;
  border-top: 3px solid #185FA5;
  border-radius: 10px;
  padding: 14px 16px;
}

.mc-label {
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 5px;
}

.mc-value {
  font-size: 20px;
  font-weight: 700;
  color: #0C447C;
  line-height: 1.2;
}

/* KPI 카드 (새 스타일) */
.kpi-card {
  background: #fff;
  border: 1px solid #e8ecf2;
  border-radius: 10px;
  padding: 14px 18px;
  flex: 1;
}

.kpi-label { font-size: 11px; color: #94a3b8; margin-bottom: 5px; }
.kpi-value { font-size: 20px; font-weight: 700; color: #0C447C; }

/* 폼 */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #dde3ed;
  border-radius: 7px;
  font-size: 13px;
  color: #1e293b;
  background: #fff;
  box-sizing: border-box;
  transition: border 0.12s, box-shadow 0.12s;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: #185FA5;
  box-shadow: 0 0 0 3px rgba(24,95,165,0.1);
}

.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* 버튼 */
.btn-primary {
  background: #0C447C;
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
  font-family: inherit;
}
.btn-primary:hover { background: #185FA5; }

.btn-outline {
  background: transparent;
  color: #0C447C;
  border: 1.5px solid #0C447C;
  padding: 7px 16px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
  font-family: inherit;
}
.btn-outline:hover { background: #eff6ff; }

.btn-sm {
  background: #f1f5f9;
  color: #374151;
  border: none;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.12s;
  font-family: inherit;
}
.btn-sm:hover { background: #e2e8f0; }
.btn-sm.btn-danger { color: #dc2626; }
.btn-sm.btn-danger:hover { background: #fff5f5; }
.btn-sm.btn-outline { background: transparent; border: 1px solid #0C447C; color: #0C447C; }

/* 레거시 호환 */
.btn { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; border-radius: 7px; font-size: 13px; font-family: inherit; transition: all 0.12s; }
.btn-primary.btn { background: #0C447C; color: #fff; border: none; padding: 8px 16px; font-weight: 600; }
.btn-primary.btn:hover { background: #185FA5; }
.btn-secondary { background: #f1f5f9; color: #374151; border: 1px solid #e2e8f0; padding: 7px 14px; }
.btn-secondary:hover { background: #e2e8f0; }
.btn-danger { background: #fff; color: #dc2626; border: 1px solid #fca5a5; padding: 5px 10px; }
.btn-danger:hover { background: #fff5f5; }

/* 배지 */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-green  { background: #dcfce7; color: #166534; }
.badge-amber  { background: #fef3c7; color: #92400e; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-gray   { background: #f1f5f9; color: #475569; }

/* 테이블 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  background: #f8fafc;
  padding: 9px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  border-bottom: 2px solid #e8ecf2;
  white-space: nowrap;
}

.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}

.data-table tr:hover td { background: #f0f6ff; cursor: pointer; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .bold { font-weight: 700; }
.data-table .empty { text-align: center; color: #94a3b8; padding: 32px; font-size: 13px; }
.row-inactive td { opacity: 0.45; }

/* 페이지 헤더 */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.page-header h2 {
  font-size: 17px !important;
  font-weight: 700 !important;
  color: #0C447C !important;
  margin: 0 !important;
}

.page-header h2::before { display: none !important; }

/* 필터바 */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

/* 모달 */
#modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(15,23,42,0.45);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

#modal-box {
  background: #fff;
  border-radius: 12px;
  width: 560px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

#mtitle {
  font-size: 15px !important;
  font-weight: 600 !important;
  color: #0C447C !important;
}

/* 빈 상태 */
.empty-state {
  text-align: center;
  color: #94a3b8;
  padding: 48px 0;
  font-size: 14px;
}

/* 탭 (페이지 내부) */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 20px;
}

/* 로그인 화면 */
#login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #0C447C 0%, #185FA5 100%);
}

/* ============================================================
   모바일 반응형
   ============================================================ */
.mobile-only { display: none; }

/* ── 모바일 전역 오버플로 가드 (페이지 자동 확대 방지) ── */
html, body { max-width: 100vw; overflow-x: hidden; }
#app { max-width: 100vw; overflow-x: hidden; }

@media (max-width: 768px) {
  /* 입력란 최소 16px — iOS 입력 시 자동 줌 방지 */
  input, select, textarea { font-size: 16px !important; }
  .mobile-only { display: inline-flex !important; }

  .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 9000;
    box-shadow: 2px 0 12px rgba(12,68,124,0.15);
  }
  .sidebar.mobile-open { transform: translateX(0); }

  .main { margin-left: 0 !important; width: 100%; }
  .topbar { padding: 0 10px; height: 48px; }
  .topbar h2, #ptitle { font-size: 14px !important; }
  .topbar h2::before, #ptitle::before { display: none; }
  .topbar-user { display: none; }

  .tab-bar-wrap { padding-left: 8px; overflow-x: auto; }
  .erp-tab { padding: 0 10px; font-size: 11px; }

  .content { padding: 10px; }
  .page-wrap { gap: 10px; }

  .card { border-radius: 8px; }
  .card-header, .card-hd { padding: 10px 12px; flex-wrap: wrap; gap: 6px; }
  .card-header .card-title { font-size: 13px; }
  .card-bd, .card-body { padding: 10px 12px; }

  /* 폼 — font-size 16px는 iOS 줌 방지용, padding만 축소 */
  .form-control { padding: 8px 10px; }
  .page-header { flex-direction: column; gap: 8px; align-items: flex-start; }
  .filter-bar { flex-direction: column; }
  .filter-bar .form-control { width: 100% !important; }
  .form-row { flex-direction: column; }

  /* 카드 헤더 컨트롤바가 세로로 내려오게 */
  .card-header > div[style*="display:flex"] { width: 100%; }
  .card-header .form-control { flex: 1; min-width: 60px; }

  /* KPI / 지표 */
  .metrics { grid-template-columns: 1fr 1fr; gap: 8px; }
  .mc { padding: 10px 12px; }
  .mc-value { font-size: 16px !important; }

  /* 대시보드 그리드는 세로로 스택 */
  .dash-spike .welcome-row { grid-template-columns: 1fr !important; }
  .dash-spike .metrics { grid-template-columns: 1fr 1fr !important; }

  /* 테이블 */
  .data-table { font-size: 11px; min-width: unset !important; }
  .data-table th, .data-table td { padding: 7px 5px; }
  table th, table td { padding: 7px 8px; font-size: 11px; }

  /* 테이블 가로 스크롤 컨테이너 강제 */
  .card table { min-width: max-content; }

  /* 모달 */
  #modal { padding: 10px; align-items: flex-start; overflow-y: auto; }
  #modal-box { width: 95vw !important; max-width: 95vw !important; max-height: 90vh; overflow-y: auto; }
  #modal-box .form-group, #modal-box .fg { margin-bottom: 10px; }

  /* 모달 내 2열 그리드 → 1열 */
  #modal div[style*="grid-template-columns:1fr 1fr"],
  #modal div[style*="grid-template-columns: 1fr 1fr"],
  #modal div[style*="grid-template-columns:1fr 1fr 1fr"],
  #modal div[style*="grid-template-columns:1fr 1fr 1fr 1fr"],
  #modal div[style*="grid-template-columns:2fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* 대시보드 2fr/1fr 그리드 → 세로 */
  .dash-spike div[style*="grid-template-columns:2fr 1fr"],
  .dash-spike div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* 버튼 */
  .btn, .btn-primary, .btn-secondary, .btn-danger { font-size: 12px; padding: 8px 12px; }
  .btn-sm { font-size: 11px !important; padding: 5px 9px !important; }

  /* 로그인 */
  #login-wrap > div { padding: 24px 20px; }
}

@media (max-width: 480px) {
  .metrics { grid-template-columns: 1fr; }
  .dash-spike .metrics { grid-template-columns: 1fr !important; }
  .topbar-right { gap: 6px; }
}

/* ── 기존 ERP 스타일 호환 ── */
.card-hd { padding: 12px 18px; border-bottom: 1px solid #f0f4f8; display: flex; justify-content: space-between; align-items: center; }
.card-hd h3 { font-size: 14px; font-weight: 600; color: #0C447C; margin: 0; }
.card-bd { padding: 16px 18px; }

table { width: 100%; border-collapse: collapse; }
table th { background: #f8fafc; padding: 9px 12px; text-align: left; font-size: 12px; font-weight: 600; color: #64748b; border-bottom: 2px solid #e8ecf2; }
table td { padding: 9px 12px; border-bottom: 1px solid #f1f5f9; color: #1e293b; font-size: 13px; }
table tr:hover td { background: #f0f6ff; cursor: pointer; }

.fg { margin-bottom: 14px; }
.fg label { display: block; font-size: 12px; font-weight: 600; color: #374151; margin-bottom: 4px; }
input[type=text], input[type=number], input[type=email], input[type=password], input[type=date], select, textarea {
  padding: 8px 12px; border: 1px solid #dde3ed; border-radius: 7px; font-size: 13px;
  font-family: inherit; color: #1e293b; background: #fff; box-sizing: border-box;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #185FA5; box-shadow: 0 0 0 3px rgba(24,95,165,0.1); }

.btn { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; border-radius: 7px; font-size: 13px; font-family: inherit; transition: all 0.12s; border: none; padding: 8px 16px; font-weight: 600; }
.btn-primary { background: #0C447C !important; color: #fff !important; }
.btn-primary:hover { background: #185FA5 !important; }
.btn-secondary { background: #f1f5f9; color: #374151; border: 1px solid #e2e8f0 !important; }
.btn-secondary:hover { background: #e2e8f0; }
.btn-danger { background: #fff; color: #dc2626; border: 1px solid #fca5a5 !important; }
.btn-danger:hover { background: #fff5f5; }
.btn-sm { padding: 4px 10px !important; font-size: 12px !important; }

.metrics { display: grid; gap: 12px; margin-bottom: 16px; }
.mc { background: #fff; border: 1px solid #e8ecf2; border-top: 3px solid #185FA5; border-radius: 10px; padding: 14px 16px; }
.mc-label { font-size: 11px; color: #94a3b8; margin-bottom: 5px; }
.mc-value { font-size: 20px; font-weight: 700; color: #0C447C; }

/* ── 호환성 보완 ── */
.card-header { padding: 12px 18px; border-bottom: 1px solid #f0f4f8; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.card-title { font-size: 14px; font-weight: 600; color: #0C447C; margin: 0; }
.card-body { padding: 16px 18px; }
.badge { display:inline-block; padding:2px 8px; border-radius:12px; font-size:11px; font-weight:600; }
.badge-blue { background:#dbeafe; color:#1d4ed8; }
.badge-green { background:#dcfce7; color:#16a34a; }
.badge-orange { background:#ffedd5; color:#ea580c; }
.badge-red { background:#fee2e2; color:#dc2626; }
.badge-gray { background:#f1f5f9; color:#64748b; }
.stat-card { background:#fff; border-radius:10px; padding:16px 20px; box-shadow:0 1px 4px rgba(0,0,0,0.07); }
.stat-label { font-size:12px; color:#64748b; margin-bottom:6px; }
.stat-value { font-size:22px; font-weight:700; color:#1e293b; }
.page-wrap { display:flex; flex-direction:column; gap:16px; }
.erp-table { width:100%; border-collapse:collapse; font-size:13px; }
.erp-table th { background:#f8fafc; padding:9px 12px; text-align:left; font-weight:600; color:#374151; border-bottom:2px solid #e2e8f0; white-space:nowrap; }
.erp-table td { padding:9px 12px; border-bottom:1px solid #f0f4f8; vertical-align:middle; }
.erp-table tr:hover td { background:#f0f6ff; cursor:pointer; }
.form-group { margin-bottom:14px; }
.form-label { display:block; font-size:12px; font-weight:600; color:#374151; margin-bottom:5px; }
.form-control { width:100%; padding:8px 12px; border:1px solid #dde3ed; border-radius:7px; font-size:13px; box-sizing:border-box; outline:none; font-family:inherit; }
.form-control:focus { border-color:#0C447C; box-shadow:0 0 0 3px rgba(12,68,124,0.08); }
.inner-tab { background:none; border:none; padding:10px 18px; font-size:13px; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; font-weight:500; transition:all .15s; }
.inner-tab.active { color:#0C447C; border-bottom-color:#0C447C; font-weight:700; }
.btn-sm { padding:5px 10px; font-size:12px; border-radius:6px; border:1px solid #e2e8f0; background:#f8fafc; color:#374151; cursor:pointer; }
.btn-sm:hover { background:#e2e8f0; }
.btn-sm.btn-primary { background:#0C447C; color:#fff; border-color:#0C447C; }
.btn-sm.btn-primary:hover { background:#185FA5; }
.btn-sm.btn-danger { color:#dc2626; border-color:#fecaca; }
.btn-sm.btn-danger:hover { background:#fee2e2; }
.btn-danger { background:#dc2626; color:#fff; border:none; padding:7px 14px; border-radius:7px; cursor:pointer; font-size:13px; }
.btn-danger:hover { background:#b91c1c; }

/* ============================================================
   DASHBOARD — Spike(demo-b) tone overrides (scoped to .dash-spike)
   ============================================================ */
.dash-spike { color:#2a3547; }

.dash-spike .welcome-row { display:grid; grid-template-columns:2fr 1fr 1fr; gap:16px; margin-bottom:16px; }
.dash-spike .welcome {
  background:linear-gradient(135deg,#ecf2ff 0%,#f9fbff 100%);
  border:1px solid #eaeff4; border-radius:14px; padding:22px 24px;
  position:relative; overflow:hidden; min-height:160px;
  box-shadow:0 1px 3px rgba(46,54,80,.04);
}
.dash-spike .welcome::after {
  content:''; position:absolute; right:-30px; bottom:-30px; width:170px; height:170px;
  background:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><circle cx="100" cy="100" r="80" fill="%235d87ff" opacity="0.15"/><circle cx="100" cy="100" r="50" fill="%235d87ff" opacity="0.25"/></svg>') no-repeat;
}
.dash-spike .welcome h2 { font-size:19px; font-weight:700; color:#2a3547; margin-bottom:8px; position:relative; z-index:1; }
.dash-spike .welcome p { color:#5d677a; font-size:13px; margin-bottom:14px; position:relative; z-index:1; max-width:420px; line-height:1.55; }
.dash-spike .welcome .cta {
  background:#5d87ff; color:#fff; border:none; padding:9px 16px; border-radius:8px;
  font-weight:600; font-size:12px; cursor:pointer; position:relative; z-index:1;
  box-shadow:0 6px 16px rgba(93,135,255,.3);
}
.dash-spike .welcome .cta:hover { background:#4a74f0; }

.dash-spike .bigstat {
  background:#fff; border:1px solid #eaeff4; border-radius:14px;
  padding:20px 22px; box-shadow:0 1px 3px rgba(46,54,80,.04);
  position:relative; overflow:hidden; min-height:160px;
  display:flex; flex-direction:column; justify-content:center;
}
.dash-spike .bigstat .l { font-size:12px; color:#7c8fac; font-weight:500; }
.dash-spike .bigstat .v { font-size:24px; font-weight:800; color:#2a3547; margin:6px 0; letter-spacing:-.3px; }
.dash-spike .bigstat .c { font-size:11px; font-weight:700; color:#7c8fac; }
.dash-spike .bigstat.teal  .v, .dash-spike .bigstat.teal  .c { color:#13deb9; }
.dash-spike .bigstat.coral .v, .dash-spike .bigstat.coral .c { color:#fa896b; }

/* KPI grid — 4 cards with left color bar */
.dash-spike .metrics { grid-template-columns:repeat(4,1fr); gap:14px; }
.dash-spike .mc {
  background:#fff; border:1px solid #eaeff4; border-top:1px solid #eaeff4;
  border-left:4px solid #5d87ff; border-radius:12px;
  padding:16px 18px; box-shadow:0 1px 3px rgba(46,54,80,.04);
}
.dash-spike .mc.mc-teal  { border-left-color:#13deb9; }
.dash-spike .mc.mc-sky   { border-left-color:#49beff; }
.dash-spike .mc.mc-coral { border-left-color:#fa896b; }
.dash-spike .mc-label { font-size:11px; color:#7c8fac; letter-spacing:.04em; text-transform:uppercase; font-weight:600; }
.dash-spike .mc-value { font-size:22px; font-weight:800; color:#2a3547; letter-spacing:-.3px; margin-top:4px; }
.dash-spike .mc-sub   { font-size:11px; color:#7c8fac; margin-top:2px; }

/* Cards — softer radius/shadow for the dashboard only */
.dash-spike .card {
  border:1px solid #eaeff4; border-radius:14px;
  box-shadow:0 1px 3px rgba(46,54,80,.04);
}
.dash-spike .card-hd { padding:16px 22px 6px; border-bottom:none; }
.dash-spike .card-hd h3 { font-size:15px; font-weight:700; color:#2a3547; }
.dash-spike .card-bd { padding:10px 16px 16px; }

@media (max-width: 960px) {
  .dash-spike .welcome-row { grid-template-columns:1fr; }
  .dash-spike .metrics     { grid-template-columns:repeat(2,1fr); }
}
