@charset "UTF-8";
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");
@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700;800;900&display=swap");

/* ==========================================================================
   EG-AQUA UNIFIED COMMON DESIGN SYSTEM (app.css)
   Section 1: Design Tokens & Theme System (Light Default + Cyber Dark)
   Section 2: Base Reset & Typography
   Section 3: Layout & High-Density Business GNB
   Section 4: Core Components (KPI, Cards, Tables, Forms, Badges, Buttons)
   Section 5: Interactive UX Enhancements (Empty States, Toasts, Tabular Data)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Section 1: Design Tokens & Theme System
   -------------------------------------------------------------------------- */
:root {
  /* === 기본 라이트 모드 (Default Modern Clean Light) === */
  --ink: #F8FAFC;              /* 전체 페이지 배경: 슬레이트 오프화이트 */
  --surface: #FFFFFF;          /* 카드 / 테이블 / 모달 본체: 퓨어 화이트 */
  --surface-2: #F1F5F9;        /* 테이블 헤더, 인풋 기본 배경, 서브패널 */
  --surface-hover: #E2E8F0;    /* 행 및 메뉴 호버 배경 */
  --line: #E2E8F0;             /* 표준 구분선 */
  --line-strong: #CBD5E1;      /* 강조 구분선 */
  --text: #0F172A;             /* 기본 본문 텍스트: Slate 900 */
  --text-dim: #475569;         /* 보조 설명 텍스트: Slate 600 */
  --text-muted: #64748B;       /* 비활성/각주 텍스트: Slate 500 */
  
  /* 브랜드 & 업무 상태 악센트 */
  --accent: #0284C7;           /* 메인 오션 블루 */
  --accent-dark: #0369A1;
  --accent-light: rgba(2, 132, 199, 0.08);
  --accent-border: rgba(2, 132, 199, 0.25);
  --accent-2: #0EA5E9;
  --accent-emerald: #059669;   /* 정상 / 완료 / 수납 */
  --accent-warning: #D97706;   /* 임박 / 대기 */
  --accent-danger: #DC2626;    /* 연체 / 경과 */
  
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.08), 0 1px 2px -1px rgba(15, 23, 42, 0.06);
  --shadow-glow: 0 0 20px rgba(2, 132, 199, 0.15);
  
  /* 화면비: 맥북(1512px 뷰포트) 기준 쾌적한 1460px */
  --maxw: 1460px;
  --header-h: 60px;
}

/* === 다크 모드 (Cyber Aqua Dark Theme) === */
[data-theme="dark"] {
  --ink: #070B11;
  --surface: #0E1520;
  --surface-2: #16202E;
  --surface-hover: #1E2B3E;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(0, 229, 255, 0.2);
  --text: #F1F5F9;
  --text-dim: #94A3B8;
  --text-muted: #64748B;
  
  --accent: #00E5FF;
  --accent-dark: #00B4D8;
  --accent-light: rgba(0, 229, 255, 0.12);
  --accent-border: rgba(0, 229, 255, 0.3);
  --accent-2: #38BDF8;
  --accent-emerald: #10B981;
  --accent-warning: #F59E0B;
  --accent-danger: #EF4444;
  
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 30px rgba(0, 229, 255, 0.25);
}

/* --------------------------------------------------------------------------
   Section 2: Base Reset & Typography
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
  background-color: var(--ink);
  color: var(--text);
  color-scheme: light;
}

[data-theme="dark"] {
  color-scheme: dark;
}

body {
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
  line-height: 1.5;
  background-color: var(--ink);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 0.9rem;
  color: inherit;
}

/* 숫자/금액 가독성을 위한 전용 폰트 클래스 */
.tabular-nums {
  font-variant-numeric: tabular-nums;
  font-family: 'Outfit', -apple-system, sans-serif;
  letter-spacing: -0.01em;
}

/* --------------------------------------------------------------------------
   Section 3: Layout & High-Density Business GNB
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-left: auto;
  margin-right: auto;
  padding-left: 28px;
  padding-right: 28px;
}

.site-header {
  position: sticky;
  top: 0;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  z-index: 1000;
  display: flex;
  align-items: center;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 100%;
  max-width: 1560px;
  width: 100%;
  padding-left: 20px;
  padding-right: 20px;
}

/* Brand Logo */
.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Outfit', sans-serif;
  color: var(--text);
  flex-shrink: 0;
  text-decoration: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.brand-logo:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

/* 2D Flat Pure White Squircle Tile with Royal Blue Monogram */
.brand-icon-tile-2d {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 9px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.brand-tile-bg {
  fill: #FFFFFF;
  stroke: #CBD5E1;
  stroke-width: 2.5;
  transition: stroke 0.2s ease;
}

.brand-glyph {
  fill: #0052CC;
  transition: fill 0.2s ease;
}

[data-theme="dark"] .brand-tile-bg {
  fill: #FFFFFF;
  stroke: rgba(255, 255, 255, 0.25);
  stroke-width: 2;
}

[data-theme="dark"] .brand-glyph {
  fill: #0052CC;
}

.brand-icon-tile-2d svg {
  display: block;
  width: 100%;
  height: 100%;
}

.brand-text-group {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.15;
}

.brand-name {
  font-weight: 900;
  font-size: 1.12rem;
  letter-spacing: -0.03em;
  color: var(--text);
}

.brand-subname {
  color: var(--accent);
  font-weight: 800;
}

.brand-subtitle {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  text-transform: uppercase;
  align-self: center;
}

/* 10대 핵심 실무 메뉴 탭 (전체 메뉴 끊김 없는 반응형 네비게이션) */
.erp-main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
  padding: 4px 0;
}

@media (min-width: 1100px) {
  .erp-main-nav {
    overflow: visible;
  }
}

@media (max-width: 1099px) {
  .erp-main-nav {
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    padding-right: 14px;
  }
  .erp-main-nav::-webkit-scrollbar {
    display: none;
  }
}

.erp-nav-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
  user-select: none;
  letter-spacing: -0.02em;
}

.erp-nav-item .nav-icon {
  font-size: 0.88rem;
  display: inline-block;
  transition: transform 0.2s ease;
}

.erp-nav-item:hover {
  color: var(--accent);
  background-color: var(--surface-hover);
}

.erp-nav-item:hover .nav-icon {
  transform: translateY(-1px);
}

.erp-nav-item.active {
  color: var(--accent);
  background-color: var(--accent-light);
  border-color: var(--accent-border);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Header Right Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  border-color: var(--line-strong);
  color: var(--text);
  background: var(--surface-hover);
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  font-size: 0.85rem;
}

.user-name {
  font-weight: 700;
  color: var(--text);
}

/* Page Section */
.page-section {
  padding: 24px 0 48px;
  min-height: calc(100vh - var(--header-h));
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 14px;
}

.page-title {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.page-desc {
  font-size: 0.88rem;
  color: var(--text-dim);
  margin-top: 3px;
}

/* --------------------------------------------------------------------------
   Section 4: Core Components
   -------------------------------------------------------------------------- */
/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.86rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  box-sizing: border-box;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-accent {
  background-color: var(--accent);
  color: #FFFFFF;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
}

.btn-accent:hover {
  background-color: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

[data-theme="dark"] .btn-accent {
  color: #070B11;
  box-shadow: 0 2px 10px rgba(0, 229, 255, 0.25);
}

[data-theme="dark"] .btn-accent:hover {
  background-color: #55f3ff;
  box-shadow: 0 4px 16px rgba(0, 229, 255, 0.4);
}

.btn-primary {
  background-color: var(--surface-2);
  color: var(--text);
  border-color: var(--line);
}

.btn-primary:hover {
  background-color: var(--surface-hover);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.btn-outline {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

.btn-outline:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-danger {
  background-color: rgba(220, 38, 38, 0.1);
  color: var(--accent-danger);
  border: 1px solid rgba(220, 38, 38, 0.25);
}

.btn-danger:hover {
  background-color: var(--accent-danger);
  color: #FFFFFF;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 12px 28px;
  font-size: 1rem;
  border-radius: var(--radius);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 4px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-accent {
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}

.badge-success {
  background: rgba(5, 150, 105, 0.12);
  color: var(--accent-emerald);
  border: 1px solid rgba(5, 150, 105, 0.25);
}

.badge-warning {
  background: rgba(217, 119, 6, 0.12);
  color: var(--accent-warning);
  border: 1px solid rgba(217, 119, 6, 0.25);
}

.badge-danger {
  background: rgba(220, 38, 38, 0.12);
  color: var(--accent-danger);
  border: 1px solid rgba(220, 38, 38, 0.25);
}

/* Cards & KPI */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-width: 0;
}

.card:hover {
  border-color: var(--line-strong);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent);
  opacity: 0.85;
}

.kpi-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Data Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
  min-width: 850px;
}

.data-table th {
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  white-space: nowrap;
}

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

.data-table tbody tr {
  transition: background-color 0.15s ease;
}

.data-table tbody tr:hover {
  background-color: var(--surface-hover);
}

/* Forms & Filter Bar */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  min-width: 0;
}

.form-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-dim);
}

.form-control {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 9px 12px;
  font-size: 0.88rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

[data-theme="dark"] .form-control {
  background: var(--surface-2);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

[data-theme="dark"] .form-control:focus {
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.2);
}

.form-help {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Filter Slot Cards */
.filter-slot-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  min-width: 0;
  flex-wrap: wrap;
}

.filter-slot-card:hover {
  background: var(--surface-hover);
  border-color: var(--line-strong);
}

.filter-slot-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--accent);
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Section 5: Interactive UX Enhancements
   -------------------------------------------------------------------------- */
/* Empty State Component */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  margin: 16px 0;
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.8;
}

.empty-state-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.empty-state-desc {
  font-size: 0.85rem;
  color: var(--text-dim);
  max-width: 400px;
  margin: 0 auto 16px;
}

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

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 420px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast-success {
  border-left: 4px solid var(--accent-emerald);
}

.toast-warning {
  border-left: 4px solid var(--accent-warning);
}

.toast-error {
  border-left: 4px solid var(--accent-danger);
}

@keyframes toastSlideIn {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Count Badge for Search/Filter */
.count-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-light);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-full);
}
