/* S&SYS SALES PORTAL - 전문 고객 관계 및 영업 관리 시스템 스타일 */
:root {
  /* 색상 변수 */
  --primary-color: #315b8a;
  --secondary-color: #1e3d59;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --info-color: #17a2b8;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  
  --background-color: #f5f7fa;
  --sidebar-bg: #1e3d59;
  --sidebar-bg2: #183046;
  --sidebar-btn: #315b8a;
  --border-color: #dee2e6;
  --text-color: #2d3e50;
  --text-muted: #6c757d;
  --highlight-color: #e0eaf3;
  
  --shadow-sm: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
  --shadow: 0 0.5rem 1rem rgba(0,0,0,0.15);
  --shadow-lg: 0 1rem 3rem rgba(0,0,0,0.175);
  
  --transition: all 0.3s ease;
  --radius: 0.375rem;
  --radius-lg: 0.5rem;
  
  --font-size-base: 14px;
}

/* 전역 스타일 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans KR", sans-serif;
  font-size: var(--font-size-base);
  line-height: 1.5;
  color: var(--text-color);
  background-color: var(--background-color);
  overflow: auto;
}

/* 유틸리티 클래스 */
.hidden { display: none !important; }
.mb-3 { margin-bottom: 1rem !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.text-muted { color: var(--text-muted) !important; }
.fw-bold { font-weight: 700 !important; }

/* 로그인 모달 */
#loginModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
}

#loginModal .modal-content {
  background: white;
  width: 400px;
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: slideInDown 0.4s ease-out;
}

@keyframes slideInDown {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.login-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: contain;
  background: #fff;
  padding: 6px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.login-header h2 {
  color: var(--text-color);
  font-size: 1.75rem;
  font-weight: 600;
}

/* 폼 스타일 */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-color);
}

.form-group label i {
  margin-right: 0.5rem;
  color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 0.875rem;
  transition: var(--transition);
  background-color: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(49, 91, 138, 0.25);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.forgot-pw-link {
  text-align: right;
  margin-top: 0.5rem;
}

.forgot-pw-link a {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.875rem;
}

.forgot-pw-link a:hover {
  text-decoration: underline;
}

/* 버튼 스타일 */
.btn-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
}

button {
  cursor: pointer;
  transition: var(--transition);
}

.primary-btn,
.secondary-btn,
.danger-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

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

.danger-btn {
  background-color: var(--danger-color);
  color: #fff;
}

.primary-btn:hover {
  background-color: #264c70;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.secondary-btn {
  background-color: var(--light-color);
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.secondary-btn:hover {
  background-color: #e9ecef;
}

.danger-btn:hover {
  background-color: #c82333;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-icon,
.btn-icon-sm {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0.5rem;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover,
.btn-icon-sm:hover {
  background-color: var(--light-color);
  color: var(--text-color);
}

.btn-icon-sm {
  padding: 0.25rem;
  font-size: 0.875rem;
}

#loginError {
  color: var(--danger-color);
  margin-top: 15px;
  font-size: 0.9em;
  animation: fadeInUp 0.3s ease-in-out;
  padding: 8px 12px;
  background: #fff5f5;
  border: 1px solid #fed7d7;
  border-radius: 4px;
  font-weight: 500;
  text-align: center;
}

@keyframes fadeInUp {
  from { 
    opacity: 0; 
    transform: translateY(10px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

/* 메인 레이아웃 */
.main-layout {
  display: flex;
  width: 100vw;
  height: 100vh;
  margin: 0 auto;
  max-width: 100%;
  max-height: 100vh;
  overflow: hidden;
}

/* 사이드바 */
.sidebar {
  width: 260px;
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg2) 100%);
  color: white;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  overflow-y: auto;
  box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar.collapsed {
  width: 60px;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
}

.sidebar-logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  object-fit: contain;
  background: #fff;
  padding: 6px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.sidebar-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.sidebar-title span:first-child {
  font-size: 0.95rem;
}

.sidebar-title span:last-child {
  font-size: 1.15rem;
}

.sidebar.collapsed .sidebar-title {
  display: none;
}

.sidebar.collapsed .sidebar-logo {
  width: 40px;
  height: 40px;
}

/* 네비게이션 메뉴 */
.nav-menu {
  flex: 1;
  padding: 1rem 0;
  list-style: none;
  overflow-y: auto;
}

.nav-item {
  position: relative;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: var(--transition);
}

.nav-item:hover a,
.nav-item.active a {
  color: white;
  background-color: rgba(255, 255, 255, 0.1);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: var(--info-color);
}

.sub-menu {
  list-style: none;
  margin: 0;
  padding: 0 0 0 2.75rem;
  display: none;
}

.nav-item.active .sub-menu,
.nav-item:hover .sub-menu {
  display: block;
}

.sidebar.collapsed .sub-menu {
  display: none !important;
}

.sub-menu-item {
  margin: 0.25rem 0;
}

.sub-menu-item button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.8rem;
  padding: 0.35rem 0.5rem;
  border-radius: 0.25rem;
  transition: var(--transition);
}

.sub-menu-item button:hover,
.sub-menu-item.active button {
  background-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.sub-menu-item .count {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 999px;
  padding: 0 0.4rem;
  font-size: 0.75rem;
}

.sidebar.collapsed .nav-item a {
  justify-content: center;
  padding: 0.75rem;
}

.sidebar.collapsed .nav-item a span {
  display: none;
}

/* 사이드바 푸터 */
.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
}

.sidebar.collapsed .user-info span {
  display: none;
}

.logout-btn {
  width: 100%;
  padding: 0.5rem;
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.logout-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.sidebar.collapsed .logout-btn span {
  display: none;
}

.admin-badge {
  background-color: var(--danger-color);
  color: white;
  font-size: 0.625rem;
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius);
  margin-left: 0.5rem;
}

/* 메인 컨텐츠 */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: auto;
  background-color: var(--background-color);
}

.main-content.expanded {
  margin-left: 0;
}

/* 상단 헤더 */
.top-header {
  background-color: white;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.menu-toggle {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-color);
  padding: 0.5rem;
  border-radius: var(--radius);
}

.menu-toggle:hover {
  background-color: var(--light-color);
}

#pageTitle {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-color);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  font-size: 1.125rem;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0.5rem;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background-color: var(--light-color);
  color: var(--text-color);
}

.badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background-color: var(--danger-color);
  color: white;
  font-size: 0.625rem;
  padding: 0.125rem 0.375rem;
  border-radius: 10px;
  font-weight: 600;
}

#notificationBadge {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  transition: var(--transition);
}

.user-menu:hover {
  background-color: var(--light-color);
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 3px 6px;
  border-radius: 3px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  white-space: nowrap;
}

/* 컨텐츠 영역 */
.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.content-area .view-content {
  width: 100%;
  max-width: 100%;
  margin: 0;
}

.view-content {
  display: none;
}

.view-content.active {
  display: block;
}

/* 대시보드 */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background-color: white;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.kpi-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
}

.kpi-icon.blue { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.kpi-icon.green { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); }
.kpi-icon.orange { background: linear-gradient(135deg, #f2994a 0%, #f2c94c 100%); }
.kpi-icon.purple { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.kpi-icon.red { background: linear-gradient(135deg, #eb4d4b 0%, #c44569 100%); }
.kpi-icon.teal { background: linear-gradient(135deg, #00b4db 0%, #0083b0 100%); }

.kpi-content h3 {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.kpi-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0;
}

.kpi-change {
  font-size: 0.75rem;
  font-weight: 500;
}

.kpi-change.positive { color: var(--success-color); }
.kpi-change.negative { color: var(--danger-color); }

/* 차트 컨테이너 */
.dashboard-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.chart-container {
  background-color: white;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.chart-container h3 {
  font-size: 1.125rem;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.chart-container canvas {
  max-height: 300px;
}

/* 최근 활동 */
.recent-activities {
  background-color: white;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.recent-activities h3 {
  font-size: 1.125rem;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.activity-list {
  max-height: 400px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: white;
  flex-shrink: 0;
}

.activity-icon.customer_created { background-color: var(--success-color); }
.activity-icon.customer_updated { background-color: var(--info-color); }
.activity-icon.deal_created { background-color: var(--warning-color); }
.activity-icon.deal_moved { background-color: var(--primary-color); }
.activity-icon.comm_added { background-color: var(--secondary-color); }

.activity-content {
  flex: 1;
}

.activity-content p {
  margin: 0 0 0.25rem;
  color: var(--text-color);
  font-size: 0.875rem;
}

.activity-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* 뷰 헤더 */
.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.view-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.customer-filters {
  width: 100%;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: #fafbfc;
}

.customer-filters .filter-group {
  min-width: 160px;
}

.customer-filters .search-group {
  flex: 1;
  min-width: 220px;
}

.customer-filters .search-group .search-box {
  width: 100%;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box i {
  position: absolute;
  left: 0.75rem;
  color: var(--text-muted);
}

.search-box input {
  padding-left: 2.5rem;
  width: 100%;
  min-width: 0;
}

/* 데이터 테이블 */
.data-table-container {
  background-color: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: auto;
}

.data-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.data-table thead {
  background-color: var(--light-color);
}

.data-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-color);
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
  background: linear-gradient(180deg, var(--primary-color) 0%, #264c70 100%);
  color: #fff;
  font-weight: 600;
  user-select: none;
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  border-bottom: 2px solid #1a3a54;
  position: relative;
}

.data-table th i {
  margin-left: 0.5rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.75rem;
  cursor: pointer;
}

.data-table th:hover {
  background: linear-gradient(180deg, #264c70 0%, #1a3a54 100%);
}

.data-table td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.data-table tbody tr {
  height: 48px;
}

#customerTable th:nth-child(3),
#customerTable td:nth-child(3) {
  width: 190px;
}

#customerTable th:nth-child(5),
#customerTable td:nth-child(5) {
  width: 160px;
}

#customerTable th:nth-child(6),
#customerTable td:nth-child(6) {
  width: 220px;
}

#customerTable th:nth-child(7),
#customerTable td:nth-child(7) {
  width: 150px;
}

#customerTable th:nth-child(8),
#customerTable td:nth-child(8),
#customerTable th:nth-child(11),
#customerTable td:nth-child(11) {
  width: 85px;
  text-align: center;
}

#customerTable {
  table-layout: fixed;
}

#customerTable th:first-child,
#customerTable td:first-child {
  width: 44px;
  text-align: center;
}

#customerTable th:nth-child(2),
#customerTable td:nth-child(2) {
  width: 60px;
  text-align: center;
}

#customerTable th:nth-child(4),
#customerTable td:nth-child(4) {
  width: 90px;
}

#customerTable th:nth-child(9),
#customerTable td:nth-child(9) {
  max-width: 260px;
}

#customerTable th:nth-child(10),
#customerTable td:nth-child(10) {
  width: 90px;
  text-align: center;
}

#customerTable th:nth-child(12),
#customerTable td:nth-child(12) {
  width: 110px;
  text-align: center;
}

.data-table-container,
.table-container {
  resize: horizontal;
  overflow: auto;
  min-width: 320px;
}

.data-table tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

.data-table tbody tr:nth-child(even) {
  background-color: #fafbfc;
}

.data-table tbody tr:nth-child(even):hover {
  background-color: var(--highlight-color);
}

.data-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

.latest-history-cell {
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#salesTable td[data-field="remark"] {
  max-width: 420px;
}

#salesTable th[data-field="projectName"],
#salesTable td[data-field="projectName"] {
  min-width: 340px;
}

#salesTable td[data-field="projectName"] textarea {
  width: 100%;
  min-height: 64px;
  line-height: 1.5;
  resize: vertical;
  white-space: pre-wrap;
  overflow: auto;
  padding: 10px 12px;
  border: 1px solid #cfd8e3;
  border-radius: 10px;
  background: linear-gradient(180deg, #f9fbff 0%, #f4f7fb 100%);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

#salesTable th[data-field="status"],
#salesTable td[data-field="status"] {
  width: 58px;
  min-width: 58px;
}

#salesTable th[data-field="product"],
#salesTable td[data-field="product"] {
  min-width: 200px;
}

#salesTable td[data-field="product"] select {
  width: 100%;
}

#salesTable td[data-field="product"] .product-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#salesTable td[data-field="product"] .product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

#salesTable td[data-field="product"] .product-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: #eef3fb;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-size: 0.85em;
  color: var(--text-color);
}

#salesTable td[data-field="product"] .product-tag button {
  border: none;
  background: transparent;
  color: #6c757d;
  cursor: pointer;
  padding: 0;
  font-size: 0.9em;
}

#salesTable td[data-field="product"] .product-tag button:hover {
  color: #dc3545;
}

#salesTable td[data-field="remark"] textarea {
  width: 100%;
  min-height: 64px;
  line-height: 1.5;
  resize: vertical;
  white-space: pre-wrap;
  overflow: auto;
  padding: 10px 12px;
  border: 1px solid #cfd8e3;
  border-radius: 10px;
  background: linear-gradient(180deg, #f9fbff 0%, #f4f7fb 100%);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
}

/* 배지 */
.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius);
  text-transform: uppercase;
}

.badge-normal { background-color: #e9ecef; color: #495057; }
.badge-vip { background-color: #fff3cd; color: #856404; }
.badge-vvip { background-color: #f8d7da; color: #721c24; }

/* 페이지네이션 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.page-btn {
  padding: 0.5rem 0.75rem;
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-color);
  font-size: 0.875rem;
}

.page-btn:hover {
  background-color: var(--light-color);
}

.page-info {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* 영업 안건 뷰 */
.status-summary {
  display: flex;
  gap: 8px;
  padding: 10px 15px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-bottom: 1px solid var(--border-color);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.status-card {
  background: #fff;
  border: 2px solid transparent;
  border-radius: 6px;
  padding: 8px 12px;
  flex: 1;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  min-width: 80px;
  min-height: 50px;
  max-height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.status-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-color);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.status-card:hover::before {
  transform: scaleX(1);
}

.status-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  border-color: var(--primary-color);
}

.status-card h3 {
  font-size: 0.75em;
  margin-bottom: 4px;
  color: #666;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1.2;
}

.status-card .count {
  font-weight: 700;
  font-size: 1.1em;
  color: var(--primary-color);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  line-height: 1;
  margin: 0;
}

/* 필터 영역 */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 15px 20px;
  background: #fafbfc;
  border-bottom: 1px solid var(--border-color);
  align-items: flex-end;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.filters .filter-group {
  display: flex;
  flex-direction: column;
  font-size: 0.9em;
  min-width: 120px;
}

.filters label {
  font-weight: 600;
  margin-bottom: 4px;
  color: #555;
  font-size: 0.8em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filters input,
.filters select {
  padding: 8px 10px;
  border: 2px solid #e1e5e9;
  border-radius: 4px;
  font-size: 0.85em;
  width: 130px;
  transition: all 0.3s ease;
  background: #fff;
}

.filters input:focus,
.filters select:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(49, 91, 138, 0.1);
  transform: translateY(-1px);
}

.filters button {
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 0.85em;
  font-weight: 600;
  transition: all 0.3s ease;
  height: fit-content;
  position: relative;
  overflow: hidden;
}

.filters button:hover {
  background: #2b4f7a;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(49, 91, 138, 0.3);
}

/* 영업 테이블 영역 */
.table-container {
  flex: 1;
  background: #fff;
  margin: 0;
  padding: 0;
  position: relative;
  border-top: 1px solid var(--border-color);
  height: calc(100vh - 450px);
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.table-wrapper {
  flex: 0 1 auto;
  width: 100%;
  overflow: auto;
  position: relative;
  resize: horizontal;
  min-width: 1200px;
  max-width: none;
}

.table-wrapper::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.table-wrapper::-webkit-scrollbar-track {
  background: #f1f3f4;
  border-radius: 6px;
}

.table-wrapper::-webkit-scrollbar-thumb {
  background: #c1c8cd;
  border-radius: 6px;
  border: 2px solid #f1f3f4;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
  background: #a8b2ba;
}

.table-wrapper::after {
  content: '';
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 12px;
  height: 12px;
  background: linear-gradient(135deg, transparent 50%, rgba(49, 91, 138, 0.25) 50%);
  pointer-events: none;
}

table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  min-width: 1800px;
  font-size: var(--font-size-base);
  background: #fff;
  position: relative;
}

thead {
  position: sticky;
  top: 0;
  z-index: 11;
  background: #fff;
}

th, td {
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  text-align: left;
  position: relative;
  transition: all 0.2s ease;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  background: linear-gradient(180deg, var(--primary-color) 0%, #264c70 100%);
  color: #fff;
  font-weight: 600;
  user-select: none;
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  border-bottom: 2px solid #1a3a54;
  background-clip: padding-box;
}

th:hover {
  background: linear-gradient(180deg, #264c70 0%, #1a3a54 100%);
}

tr:hover td {
  background: var(--highlight-color);
}

tr:nth-child(even) td {
  background: #fafbfc;
}

tr:nth-child(even):hover td {
  background: var(--highlight-color);
}

/* 정렬 표시기 */
.sort-indicator {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.9em;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  animation: sortPulse 0.3s ease-in-out;
}

@keyframes sortPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* 수정일 필드 스타일 */
td[data-field="modifiedDate"] {
  background-color: #f8f9fa !important;
  color: #495057;
  font-weight: 500;
  text-align: center;
  font-size: 0.85em;
  border-left: 3px solid #6c757d;
}

/* 입력 필드 스타일 */
td input, td select {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  padding: 4px 6px;
  font-size: 0.9em;
  transition: all 0.2s ease;
}

td input:focus, td select:focus {
  border-color: var(--primary-color);
  background: #fff;
  box-shadow: 0 0 0 2px rgba(49, 91, 138, 0.1);
  outline: none;
  border-radius: 3px;
  transform: scale(1.02);
}

td input[readonly] {
  background: #f8f9fa;
  color: #6c757d;
  cursor: pointer;
  border-left: 3px solid #dee2e6;
}

/* 체크박스 스타일 */
input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  cursor: pointer;
  accent-color: var(--primary-color);
  transform: scale(1.2);
  transition: all 0.2s ease;
}

input[type="checkbox"]:hover {
  transform: scale(1.3);
}

/* 열 크기 조절 */
.col-resizer {
  position: absolute;
  right: 0;
  top: 0;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  background: transparent;
  transition: background 0.2s ease;
}

.col-resizer:hover {
  background: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.6);
}

/* 테이블 셀 최소폭 설정 */
th[data-field="no"], td[data-field="no"] { min-width: 60px; }
th[data-field="region"], td[data-field="region"] { min-width: 120px; }
th[data-field="registDate"], td[data-field="registDate"] { min-width: 120px; }
th[data-field="product"], td[data-field="product"] { min-width: 200px; }
th[data-field="projectName"], td[data-field="projectName"] { min-width: 340px; }
th[data-field="type"], td[data-field="type"] { min-width: 130px; }
th[data-field="bidAmount"], td[data-field="bidAmount"] { min-width: 80px; }
th[data-field="currency"], td[data-field="currency"] { min-width: 130px; }
th[data-field="customer"], td[data-field="customer"] { min-width: 150px; }
th[data-field="manager"], td[data-field="manager"] { min-width: 100px; }
th[data-field="date"], td[data-field="date"] { min-width: 120px; }
th[data-field="progress"], td[data-field="progress"] { min-width: 170px; }
th[data-field="remark"], td[data-field="remark"] { min-width: 320px; }
th[data-field="status"], td[data-field="status"] { min-width: 58px; }
th[data-field="modifiedDate"], td[data-field="modifiedDate"] { min-width: 120px; }

/* 하단 버튼 영역 */
.bottom-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 15px 20px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-top: 2px solid var(--border-color);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

.bottom-controls button {
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9em;
  padding: 10px 16px;
  transition: all 0.3s ease;
  font-weight: 600;
  position: relative;
  overflow: hidden;
}

.bottom-controls button:hover {
  background: #2b4f7a;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(49, 91, 138, 0.3);
}

.bottom-controls button:active {
  transform: translateY(0);
}

/* 관리자 전용 버튼 스타일 */
#userManageBtn::after,
#uploadExcelBtn::after,
#clearHistoryBtn::after {
  content: '🔒';
  position: absolute;
  top: -2px;
  right: -2px;
  font-size: 0.7em;
  background: #dc3545;
  color: white;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6em;
}

/* 관리자 전용 버튼이 숨겨진 경우 잠금 아이콘도 숨김 */
#userManageBtn[style*="display: none"]::after,
#uploadExcelBtn[style*="display: none"]::after,
#clearHistoryBtn[style*="display: none"]::after {
  display: none;
}

/* 파이프라인 뷰 */
.pipeline-stats {
  display: flex;
  gap: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.pipeline-stats strong {
  color: var(--text-color);
  font-weight: 600;
}

.kanban-board {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
}

.kanban-column {
  flex: 1;
  min-width: 280px;
  background-color: #f8f9fa;
  border-radius: var(--radius-lg);
  padding: 1rem;
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border-color);
}

.column-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
}

.column-count {
  background-color: var(--primary-color);
  color: white;
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  border-radius: 10px;
  font-weight: 600;
}

.column-body {
  min-height: 400px;
  transition: background-color 0.2s;
}

.column-body.drag-over {
  background-color: rgba(49, 91, 138, 0.1);
  border: 2px dashed var(--primary-color);
  border-radius: var(--radius);
}

/* 딜 카드 */
.deal-card {
  background-color: white;
  padding: 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 0.75rem;
  cursor: move;
  transition: var(--transition);
}

.deal-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.deal-card.dragging {
  opacity: 0.5;
  transform: rotate(2deg);
}

.deal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.deal-header h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
}

.deal-actions {
  display: flex;
  gap: 0.25rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.deal-card:hover .deal-actions {
  opacity: 1;
}

.deal-customer {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

/* 영업 보고 */
.report-container {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.report-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.report-header h2 {
  font-size: 1.5rem;
  margin: 0;
}

.report-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.report-table-wrapper {
  overflow-x: auto;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
}

.report-table th,
.report-table td {
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  text-align: left;
  vertical-align: top;
}

.report-table th {
  background-color: var(--light-color);
  font-weight: 600;
}

.report-table tbody tr:nth-child(even) {
  background-color: #f9fbfd;
}

.report-table tbody tr:hover {
  background-color: rgba(49, 91, 138, 0.08);
}

.report-table td {
  line-height: 1.6;
}

.report-table .category-cell {
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  color: var(--primary-color);
}

.report-table .count-cell {
  text-align: center;
  white-space: nowrap;
}

.report-table .project-cell {
  white-space: pre-wrap;
  max-width: 200px;
}

.report-table .item-cell {
  white-space: pre-wrap;
  max-width: 140px;
}

.report-table .amount-cell {
  white-space: nowrap;
  text-align: right;
  min-width: 110px;
}

.report-table .plan-cell,
.report-table .note-cell {
  white-space: pre-wrap;
}

.report-table .note-cell {
  max-width: 220px;
  word-break: break-word;
}

.report-table .empty-state {
  text-align: center;
  color: var(--text-muted);
}

.deal-value {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.deal-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.deal-probability {
  background-color: var(--light-color);
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius);
}

/* 커뮤니케이션 뷰 */
.comm-layout {
  display: flex;
  gap: 1.5rem;
  height: calc(100vh - 200px);
}

.comm-sidebar {
  width: 300px;
  background-color: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.comm-search {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.comm-search input {
  width: 100%;
}

.customer-list {
  flex: 1;
  overflow-y: auto;
}

.comm-customer-item {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
}

.comm-customer-item:hover,
.comm-customer-item.active {
  background-color: var(--light-color);
}

.comm-customer-item.active {
  border-left: 4px solid var(--primary-color);
}

.customer-info h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0 0 0.25rem;
}

.customer-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
}

.last-comm {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.comm-main {
  flex: 1;
  background-color: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.comm-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.comm-header-text h3 {
  font-size: 1.125rem;
  margin: 0 0 0.5rem;
  color: var(--text-color);
}

.comm-header-text p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

.comm-header .badge {
  position: static;
  margin-left: 0.5rem;
}

.comm-timeline {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
}

.timeline-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.timeline-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.timeline-item.email .timeline-icon { background-color: var(--info-color); }
.timeline-item.phone .timeline-icon { background-color: var(--success-color); }
.timeline-item.meeting .timeline-icon { background-color: var(--warning-color); }
.timeline-item.note .timeline-icon { background-color: var(--secondary-color); }

.timeline-content {
  flex: 1;
  background-color: var(--light-color);
  padding: 1rem;
  border-radius: var(--radius);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.timeline-type {
  font-weight: 600;
  color: var(--text-color);
  font-size: 0.875rem;
}

.timeline-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.timeline-body {
  color: var(--text-color);
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.comm-input {
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
  background-color: var(--light-color);
}

.comm-input select {
  width: 150px;
  margin-bottom: 0.75rem;
}

.comm-input textarea {
  width: 100%;
  min-height: 100px;
  margin-bottom: 0.75rem;
  resize: vertical;
}

/* 캘린더 뷰 */
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.calendar-actions {
  display: flex;
  gap: 0.75rem;
}

.calendar-filters label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-right: 1rem;
  font-size: 0.875rem;
  color: var(--text-color);
  cursor: pointer;
}

.calendar-filters input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

#calendar {
  background-color: white;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  min-height: 600px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: auto;
}

/* FullCalendar 커스터마이징 */
.fc {
  font-family: inherit;
}

.fc-toolbar-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-color);
}

.fc-button {
  background-color: var(--primary-color);
  border: none;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  font-weight: 500;
}

.fc-button:hover {
  background-color: #264c70;
}

.fc-button-active {
  background-color: #264c70 !important;
}

.fc-event {
  border: none;
  padding: 2px 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* 분석 뷰 */
.analytics-placeholder {
  background-color: white;
  padding: 3rem 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-size: 1.25rem;
  color: var(--text-muted);
  text-align: center;
}

.analytics-placeholder i {
  font-size: 2.5rem;
  color: var(--primary-color);
}

/* 설정 뷰 */
.settings-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--border-color);
}

.data-table th.col-no,
.data-table td.col-no {
  width: 80px;
  min-width: 80px;
  text-align: center;
}

.data-table td.main-customer-cell {
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.main-customer-cell .badge {
  position: static;
  margin: 0;
}

.customer-info .badge {
  position: static;
}

.history-btn {
  padding: 0.35rem 0.75rem;
  background-color: var(--light-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 0.75rem;
  color: var(--text-color);
  cursor: pointer;
  transition: var(--transition);
}

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

.remark-history-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.remark-history-controls label {
  font-weight: 600;
}

.remark-history-table {
  width: 100%;
  border-collapse: collapse;
}

.remark-history-table th,
.remark-history-table td {
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.remark-history-table tbody tr:nth-child(even) {
  background-color: #f9fbfd;
}

.remark-history-table td:nth-child(3) {
  white-space: pre-wrap;
}

.remark-history-table .empty {
  text-align: center;
  color: var(--text-muted);
}

.field-hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.timeline-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.timeline-actions {
  display: flex;
  gap: 0.5rem;
}

.timeline-action-btn {
  background: none;
  border: none;
  color: var(--danger-color);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 4px 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 4px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.timeline-action-btn:hover {
  color: #fff;
  background-color: var(--danger-color);
}

.timeline-action-btn i {
  font-size: 0.75rem;
}

.remark-history-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.remark-history-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

.remark-history-item:last-child {
  border-bottom: none;
}

.remark-history-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.deal-owner {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.settings-admin-actions {
  display: none;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

#userManageBtn {
  display: none;
  align-items: center;
  gap: 0.5rem;
}

.tab-btn {
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  position: relative;
  transition: var(--transition);
}

.tab-btn:hover {
  color: var(--text-color);
}

.tab-btn.active {
  color: var(--primary-color);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--primary-color);
}

.settings-content {
  background-color: white;
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.settings-panel {
  display: none;
}

.settings-panel.active {
  display: block;
}

.settings-panel h3 {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  color: var(--text-color);
}

.integration-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.integration-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
}

.integration-item img {
  width: 40px;
  height: 40px;
}

.integration-item h4 {
  font-size: 1rem;
  margin: 0 0 0.25rem;
  color: var(--text-color);
}

.integration-item p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

.toggle-btn {
  margin-left: auto;
  padding: 0.5rem 1rem;
  background-color: var(--success-color);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
}

/* 모달 공통 스타일 */
.modal,
.modal-background {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  animation: fadeIn 0.2s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  width: 90%;
  max-width: 600px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: modalSlideIn 0.4s ease-out;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-description {
  margin-top: -0.5rem;
  margin-bottom: 1.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.modal-content.modal-lg {
  max-width: 800px;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-50px) scale(0.9);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 1.25rem;
  margin: 0;
  color: var(--text-color);
}

.modal-close,
.close {
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
  position: absolute;
  right: 20px;
  top: 20px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
}

.modal-close:hover,
.close:hover {
  color: var(--text-color);
  background: #f8f9fa;
  transform: rotate(90deg);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* 히스토리 모달 */
.modal .modal-fullscreen-btn {
  position: absolute;
  right: 55px;
  top: 18px;
  background: #495057;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.9em;
  cursor: pointer;
  transition: background 0.2s ease;
}

.modal .modal-fullscreen-btn:hover {
  background: #343a40;
}

#historyModal .modal-content {
  width: 90%;
  max-width: 1400px;
  padding: 32px;
}

#historyModal h2 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 1.5em;
  color: var(--primary-color);
  font-weight: 600;
}

#contentModal .modal-content {
  width: 92%;
  max-width: 1400px;
  padding: 28px 32px;
}

#contentModal h2 {
  margin-top: 0;
  margin-bottom: 16px;
}

#contentModal #contentText {
  max-height: 72vh;
  overflow: auto;
}

#historyModal .history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  line-height: 1.8;
  max-height: 70vh;
  overflow-y: auto;
}

#historyModal .history-list li {
  padding: 8px 12px;
  margin-bottom: 4px;
  background: #f8f9fa;
  border-radius: 4px;
  border-left: 4px solid var(--primary-color);
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  transition: all 0.2s ease;
}

#historyModal .history-list li:hover {
  background: #e9ecef;
  transform: translateX(4px);
}

#historyModal.fullscreen .history-list {
  max-height: calc(90vh - 120px);
}

/* 사용자 관리 */
.user-management-page {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.user-management-header h2 {
  margin-bottom: 0.5rem;
  color: var(--primary-color);
  font-size: 1.4rem;
}

.user-management-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.user-management-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

#userManagementView .form-group {
  margin-bottom: 0;
}

#userManagementView .form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: #333;
}

#userManagementView input[type="text"],
#userManagementView input[type="password"],
#userManagementView input[type="email"],
#userManagementView select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dce1e6;
  border-radius: 6px;
  font-size: 0.95em;
  transition: all 0.2s ease;
  background-color: #fff;
}

#userManagementView input:focus,
#userManagementView select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(49, 91, 138, 0.1);
  outline: none;
}

.user-management-divider {
  height: 1px;
  background: #e9ecef;
}

.user-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.user-form-actions {
  justify-content: flex-end;
}

.user-modal-guide {
  margin-top: -4px;
  margin-bottom: 18px;
  color: var(--text-muted);
  font-size: 0.9em;
}

.user-table-wrapper {
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 18px;
  max-height: 320px;
  overflow-y: auto;
  background: #fff;
}

.user-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95em;
}

.user-table thead {
  background: #f5f7fa;
  position: sticky;
  top: 0;
  z-index: 1;
}

.user-table th,
.user-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #e8ecf0;
  text-align: left;
}

.user-table th:first-child,
.user-table td:first-child {
  width: 60px;
  text-align: center;
}

.user-table input,
.user-table select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #dce1e6;
  border-radius: 6px;
  font-size: 0.9em;
}

.user-table input:focus,
.user-table select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(49, 91, 138, 0.12);
  outline: none;
}

.user-role-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75em;
  background: #e9ecef;
  color: var(--text-color);
  font-weight: 600;
}

.user-role-badge.primary {
  background: rgba(49, 91, 138, 0.15);
  color: var(--primary-color);
}

.user-role-badge.info {
  background: rgba(23, 162, 184, 0.15);
  color: var(--info-color);
}

.user-table-empty {
  text-align: center;
  padding: 24px 0;
  font-size: 0.95em;
  color: var(--text-muted);
}

.user-table-actions {
  justify-content: space-between !important;
  margin-top: 12px;
}

/* 내용 보기 모달 */
#contentModal .modal-content {
  width: 800px;
  max-width: 95%;
  padding: 30px;
  max-height: 90vh;
}

#contentModal h2 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 1.4em;
  color: var(--primary-color);
  font-weight: 600;
}

#contentText {
  white-space: pre-wrap;
  line-height: 1.6;
  font-size: 1em;
  max-height: 600px;
  overflow-y: auto;
  border: 2px solid #e9ecef;
  padding: 20px;
  border-radius: 8px;
  background: #fafbfc;
}

#contentText::-webkit-scrollbar {
  width: 8px;
}

#contentText::-webkit-scrollbar-track {
  background: #e9ecef;
  border-radius: 4px;
}

#contentText::-webkit-scrollbar-thumb {
  background: #6c757d;
  border-radius: 4px;
}

/* 비밀번호 관련 모달 */
#forgotPasswordModal,
#changePasswordModal {
  z-index: 10001;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(3px);
}

#forgotPasswordModal .modal-content,
#changePasswordModal .modal-content {
  width: 450px;
  max-width: 95%;
  padding: 30px;
  margin: 10% auto;
}

#forgotPasswordModal h2,
#changePasswordModal h2 {
  margin: 0 0 20px 0;
  color: var(--primary-color);
  font-size: 1.4em;
  font-weight: 600;
  text-align: center;
}

#forgotPasswordModal p,
#changePasswordModal p {
  margin-bottom: 25px;
  color: #555;
  font-size: 1em;
  line-height: 1.6;
  text-align: center;
}

#forgotPasswordModal .form-group,
#changePasswordModal .form-group {
  margin-bottom: 20px;
}

#forgotPasswordModal .form-group label,
#changePasswordModal .form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
}

#forgotPasswordModal .form-group input,
#changePasswordModal .form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e1e5e9;
  border-radius: 6px;
  font-size: 1em;
  transition: all 0.3s ease;
}

#forgotPasswordModal .form-group input:focus,
#changePasswordModal .form-group input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(49, 91, 138, 0.1);
  outline: none;
}

#forgotPasswordModal .btn-row,
#changePasswordModal .btn-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 25px;
}

#forgotPasswordModal button,
#changePasswordModal button {
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1em;
  transition: all 0.3s ease;
  font-weight: 600;
}

#forgotPasswordModal button:first-child,
#changePasswordModal button:first-child {
  background-color: var(--primary-color);
  color: white;
}

#forgotPasswordModal button:first-child:hover,
#changePasswordModal button:first-child:hover {
  background-color: #264c70;
  transform: translateY(-2px);
}

#forgotPasswordModal button:last-child,
#changePasswordModal button:last-child {
  background-color: #6c757d;
  color: white;
}

#forgotPasswordModal button:last-child:hover,
#changePasswordModal button:last-child:hover {
  background-color: #5a6268;
  transform: translateY(-2px);
}

#changePasswordStatus,
#resetEmailStatus {
  margin-top: 20px;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 0.9em;
  font-weight: 500;
  text-align: center;
}

#changePasswordStatus.success,
#resetEmailStatus.success {
  background-color: #d4edda;
  color: #155724;
  border: 2px solid #c3e6cb;
}

#changePasswordStatus.error,
#resetEmailStatus.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 2px solid #f5c6cb;
}

/* 엑셀 업로드 모달 */
#excelModal .modal-content {
  width: 400px;
  max-width: 90%;
  padding: 30px;
  margin: 15% auto;
  text-align: center;
}

#excelModal h3 {
  margin: 0 0 25px 0;
  color: var(--primary-color);
  font-size: 1.3em;
  font-weight: 600;
}

#excelModal .btn-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 25px;
}

#excelModal button {
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1em;
  padding: 12px 20px;
  transition: all 0.3s ease;
  font-weight: 600;
}

#excelModal button:hover {
  background: #2b4f7a;
  transform: translateY(-2px);
}

#excelCancelBtn {
  background: #6c757d !important;
}

#excelCancelBtn:hover {
  background: #5a6268 !important;
}

/* 담당자별 현황 모달 */
#managerStatusModal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
}

#managerStatusModal .modal-content {
  background: #fff;
  margin: 2% auto;
  width: 90%;
  max-width: 1200px;
  padding: 25px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 12px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.4s ease-out;
}

#managerStatusModal h2 {
  margin-top: 0;
  margin-bottom: 20px;
  color: var(--primary-color);
  font-size: 1.4em;
  font-weight: 600;
}

#managerStatusSort {
  padding: 8px 12px;
  border: 2px solid #e9ecef;
  border-radius: 6px;
  font-size: 0.9em;
  margin-bottom: 15px;
  background: #fff;
  transition: all 0.3s ease;
}

#managerStatusSort:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(49, 91, 138, 0.1);
}

.manager-status-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.manager-status-table th,
.manager-status-table td {
  padding: 10px 12px;
  border: 1px solid #dee2e6;
  text-align: left;
}

.manager-status-table th {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  font-weight: 700;
  color: #495057;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
  z-index: 1;
}

.manager-status-table td {
  font-size: 0.85em;
  line-height: 1.3;
  transition: all 0.2s ease;
}

.manager-status-table tr:nth-child(even) {
  background-color: #f8f9fa;
}

.manager-status-table tr:hover {
  background-color: #e3f2fd !important;
}

.manager-status-table tr:hover td {
  color: #1565c0;
}

#managerStatusList {
  max-height: 600px;
  overflow-y: auto;
  padding: 0;
  margin: 0;
}

#managerStatusList::-webkit-scrollbar {
  width: 8px;
}

#managerStatusList::-webkit-scrollbar-track {
  background: #f1f3f4;
  border-radius: 4px;
}

#managerStatusList::-webkit-scrollbar-thumb {
  background: #c1c8cd;
  border-radius: 4px;
}

/* 전체화면 모달 스타일 */
.fullscreen {
  background: rgba(0, 0, 0, 0.8) !important;
  backdrop-filter: blur(4px) !important;
}

.fullscreen .modal-content {
  width: 95% !important;
  max-width: 1400px !important;
  margin: 2% auto !important;
  max-height: 96vh !important;
  overflow-y: auto !important;
}

/* 전체화면 모드에서의 담당자별 현황 테이블 조정 */
#managerStatusModal.fullscreen .manager-status-table {
  font-size: 1.1em;
}

#managerStatusModal.fullscreen .manager-status-table th,
#managerStatusModal.fullscreen .manager-status-table td {
  padding: 12px 16px;
}

/* 영업 지표 분석 모달 */
#salesAnalysisModal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  overflow-y: auto;
}

#salesAnalysisModal .modal-content {
  background: #f5f7fa;
  margin: 20px auto;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.4s ease-out;
}

/* KPI 카드 스타일 */
.kpi-card {
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.kpi-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.kpi-card h4 {
  margin: 0 0 10px 0;
  font-size: 0.9em;
  font-weight: 600;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-card .kpi-value {
  font-size: 2em;
  font-weight: 700;
  margin: 10px 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.kpi-card .kpi-label {
  font-size: 0.85em;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* 차트 캔버스 스타일 */
canvas {
  max-height: 300px !important;
}

/* 영업 지표 버튼 스타일 */
#salesAnalysisBtn {
  background: #17a2b8 !important;
  position: relative;
  overflow: hidden;
}

#salesAnalysisBtn:hover {
  background: #138496 !important;
}

#salesAnalysisBtn::before {
  content: '📊';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1em;
}

#salesAnalysisBtn {
  padding-left: 35px !important;
}

/* 관리자 전용 버튼 추가 스타일 */
#clearHistoryBtn {
  background: #dc3545 !important;
}

#clearHistoryBtn:hover {
  background: #c82333 !important;
}

#managerStatusBtn {
  background: #ff6b6b !important;
}

#managerStatusBtn:hover {
  background: #ff5252 !important;
}

/* 알림 패널 */
.notification-panel {
  position: fixed;
  top: 60px;
  right: -400px;
  width: 400px;
  height: calc(100vh - 60px);
  background-color: white;
  box-shadow: var(--shadow-lg);
  transition: right 0.3s ease;
  z-index: 1000;
}

.notification-panel.show {
  right: 0;
}

.panel-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-header h3 {
  font-size: 1.125rem;
  margin: 0;
  color: var(--text-color);
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
}

.notification-list {
  padding: 1rem;
  overflow-y: auto;
  height: calc(100% - 70px);
}

.notification-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border-color);
  animation: fadeInUp 0.2s ease;
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--highlight-color);
  color: var(--primary-color);
  flex-shrink: 0;
}

.notification-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.notification-message {
  font-size: 0.9rem;
  color: var(--text-color);
  line-height: 1.4;
}

.notification-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.no-data {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
}

/* 로딩 오버레이 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  backdrop-filter: blur(2px);
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 반응형 디자인 */
@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  .dashboard-charts {
    grid-template-columns: 1fr;
  }

  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .content-area .view-content {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -260px;
    z-index: 1001;
    height: 100vh;
  }
  
  .sidebar.mobile-open {
    left: 0;
  }
  
  .main-content {
    margin-left: 0;
  }

  .content-area .view-content {
    max-width: 100%;
  }
  
  .view-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .view-filters {
    flex-direction: column;
    width: 100%;
  }
  
  .search-box input {
    width: 100%;
  }
  
  .comm-layout {
    flex-direction: column;
  }
  
  .comm-sidebar {
    width: 100%;
    height: 200px;
  }
  
  .kanban-board {
    flex-direction: column;
  }
  
  .kanban-column {
    width: 100%;
  }
  
  .filters {
    flex-direction: column;
  }
  
  .filters .filter-group {
    width: 100%;
  }
  
  .filters input,
  .filters select {
    width: 100%;
  }
  
  .bottom-controls {
    flex-direction: column;
  }
  
  .bottom-controls button {
    width: 100%;
  }
  
  table {
    font-size: 0.75rem;
  }
  
  th, td {
    padding: 4px 6px;
  }
  
  .modal-content {
    width: 95%;
    margin: 2% auto;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  #loginModal .modal-content {
    width: 95%;
    padding: 1.5rem;
  }

  .login-logo {
    width: 60px;
    height: 60px;
  }

  .login-header h2 {
    font-size: 1.5rem;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .kpi-card {
    flex-direction: column;
    text-align: center;
  }
  
  .kpi-icon {
    margin-bottom: 1rem;
  }
  
  .status-summary {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .status-card {
    min-width: auto;
  }
  
  #pageTitle {
    font-size: 1.25rem;
  }
  
  .header-actions {
    flex-wrap: wrap;
  }
  
  .connection-status {
    display: none;
  }
}

/* 프린트 스타일 */
@media print {
  .sidebar,
  .top-header,
  .bottom-controls,
  .btn-row,
  .modal,
  .loading-overlay {
    display: none !important;
  }
  
  .main-content {
    margin: 0;
  }
  
  .content-area {
    padding: 0;
  }
  
  table {
    border: 1px solid #000;
    page-break-inside: auto;
  }
  
  tr {
    page-break-inside: avoid;
    page-break-after: auto;
  }
  
  thead {
    display: table-header-group;
  }
  
  tfoot {
    display: table-footer-group;
  }
}

/* 접근성 개선 */
:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* 고대비 모드 지원 */
@media (prefers-contrast: high) {
  :root {
    --primary-color: #1a3a54;
    --text-color: #000;
    --background-color: #fff;
    --border-color: #000;
  }
  
  .modal-content {
    border: 2px solid #000;
  }
  
  button:hover {
    outline: 2px solid #000;
  }
}

/* 다크 모드 지원 */
@media (prefers-color-scheme: dark) {
  :root {
    --background-color: #1a1a1a;
    --text-color: #e0e0e0;
    --border-color: #333;
    --light-color: #2a2a2a;
    --sidebar-bg: #0f1419;
    --sidebar-bg2: #0a0e13;
  }
  
  body {
    background-color: var(--background-color);
    color: var(--text-color);
  }
  
  .modal-content,
  .data-table-container,
  .kpi-card,
  .chart-container,
  .recent-activities,
  .comm-sidebar,
  .comm-main,
  #calendar,
  .analytics-card,
  .settings-content {
    background-color: #2a2a2a;
    color: var(--text-color);
  }
  
  input, select, textarea {
    background-color: #333;
    color: var(--text-color);
    border-color: #444;
  }
  
  .data-table thead {
    background-color: #333;
  }
  
  .data-table tbody tr:nth-child(even) {
    background-color: #252525;
  }
  
  .data-table tbody tr:hover {
    background-color: #333;
  }
}

/* 애니메이션 성능 최적화 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* 커스텀 스크롤바 전역 스타일 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Firefox 스크롤바 */
* {
  scrollbar-width: thin;
  scrollbar-color: #888 #f1f1f1;
}

/* 툴팁 스타일 */
[title] {
  position: relative;
}

[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.5rem 0.75rem;
  background-color: rgba(0, 0, 0, 0.9);
  color: white;
  font-size: 0.75rem;
  border-radius: var(--radius);
  white-space: nowrap;
  z-index: 10000;
  pointer-events: none;
  margin-bottom: 0.25rem;
}

[title]:hover::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.9);
  z-index: 10000;
  pointer-events: none;
}

/* 선택 불가 텍스트 */
.no-select {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* 이미지 드래그 방지 */
img {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
}

/* 포커스 트랩 */
.focus-trap {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

/* 오류 메시지 애니메이션 */
.error-shake {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* 성공 메시지 애니메이션 */
.success-pulse {
  animation: pulse 1s ease-in-out;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* 드래그 중 커서 */
.dragging {
  cursor: grabbing !important;
}

/* 리사이징 중 커서 */
.resizing {
  cursor: col-resize !important;
}

/* 비활성 상태 */
.disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

/* 강조 효과 */
.highlight {
  background-color: yellow !important;
  animation: highlight-fade 2s ease-out;
}

@keyframes highlight-fade {
  0% { background-color: yellow; }
  100% { background-color: transparent; }
}

/* 줄무늬 배경 (로딩 상태) */
.loading-stripes {
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.15) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.15) 75%,
    transparent 75%,
    transparent
  );
  background-size: 1rem 1rem;
  animation: loading-stripes 1s linear infinite;
}

@keyframes loading-stripes {
  0% { background-position: 0 0; }
  100% { background-position: 1rem 1rem; }
}

/* 끝 */