/* 
 * Admin Dashboard - Modern Design Implementation
 * Based on Figma Design
 */

/* Dashboard Container */
.dashboard-container {
  padding: 56px 32px 32px 32px;
  background: #F8F6FF;
  min-height: 100vh;
}

/* Override default content background */
.content-page,
.content {
  background: #F8F6FF !important;
}

/* Dashboard Header */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

/* Notification Button */
.notification-container {
  position: relative;
}

.notification-btn {
  background: #FFF;
  border: 1px solid #E5E5E5;
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-btn:hover {
  background: #F8F9FA;
  border-color: #DADADA;
}

.notification-btn svg {
  color: #5C595F;
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #FF4757;
  color: #FFF;
  font-size: 11px;
  font-weight: 600;
  border-radius: 10px;
  padding: 2px 6px;
  min-width: 18px;
  text-align: center;
  line-height: 1;
}

.dashboard-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dashboard-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
}

.dashboard-brand-text {
  flex: 1;
}

.dashboard-greeting {
  font-family: Pretendard, -apple-system, Roboto, Helvetica, sans-serif;
  font-size: 36px;
  font-weight: 700;
  line-height: 140%;
  letter-spacing: -1.08px;
  color: #000;
  margin-bottom: 16px;
}

.dashboard-subtitle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.84px;
  color: #000;
}

.order-count-badge {
  display: inline-flex;
  padding: 0 10px;
  justify-content: center;
  align-items: center;
  height: 32px;
  background: #802FFF;
  color: #FFF;
  border-radius: 6px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.54px;
}

/* Order Status Row */
.order-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  padding: 14px 32px;
  background: #FFF;
  border-radius: 8px;
  margin-bottom: 32px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.order-stat-card {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.order-stat-label {
  font-size: 18px;
  font-weight: 600;
  color: #000;
}

.order-stat-value {
  display: inline-flex;
  padding: 0 10px;
  justify-content: center;
  align-items: center;
  height: 32px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.48px;
}

.order-stat-value[style*="F87CA4"] { background: #FDD8E4; }
.order-stat-value[style*="5CA6FB"] { background: #D7E8FE; }
.order-stat-value[style*="3BCFF0"] { background: #C4F1FB; }
.order-stat-value[style*="FF8A4A"] { background: #FFDCC9; }
.order-stat-value[style*="A9A9A9"] { background: #E5E5E5; }
.order-stat-value[style*="FFCD46"] { background: #FFF5DA; }

/* Statistics Section */
.statistics-section {
  margin-bottom: 32px;
}

.section-title {
  font-size: 24px;
  font-weight: 700;
  color: #000;
  margin-bottom: 24px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 24px;
}

/* Stat Cards */
.stat-card {
  background: #FFF;
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 0 12px rgba(72, 73, 85, 0.12);
  height: 509px;
  display: flex;
  flex-direction: column;
  transition: background-color 0.2s ease;
}

/* 카드 크기 변형 */
.stat-card-large {
  height: 600px;
}

.stat-card-medium {
  height: 400px;
}

.stat-card-small {
  height: 300px;
}

.stat-card:hover {
  background-color: #F8F9FA;
}

.stat-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.stat-card-title {
  font-size: 20px;
  font-weight: 700;
  color: #000;
  letter-spacing: -0.6px;
  margin: 0;
}

.stat-card-icon {
  color: #802FFF;
  font-size: 24px;
}

.stat-card-link {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 14px;
  font-weight: 500;
  color: #5C595F;
  text-decoration: none;
  letter-spacing: -0.42px;
}

.stat-card-link:hover {
  color: #802FFF;
}

/* Chart Container */
.chart-container {
  margin-bottom: 24px;
  height: 352px;
  position: relative;
  background: transparent;
  border-radius: 0;
  padding: 0;
}

/* Chart Legend */
.chart-legend {
  display: flex;
  gap: 16px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #F0F0F0;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  background: transparent;
  border-radius: 0;
  transition: none;
}

.legend-item:hover {
  background: transparent;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  position: relative;
}

.legend-label {
  font-size: 14px;
  font-weight: 500;
  color: #000;
  letter-spacing: -0.42px;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
}

/* Chart Loading State */
.chart-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  z-index: 10;
  backdrop-filter: blur(4px);
}

.chart-loading.hidden {
  display: none;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #F0F0F0;
  border-top: 3px solid #802FFF;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

.chart-loading p {
  font-size: 14px;
  color: #666;
  font-weight: 500;
  margin: 0;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Notification Modal */
.notification-modal {
  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: 1000;
  backdrop-filter: blur(4px);
}

.notification-modal.show {
  display: flex;
}

.notification-modal-content {
  background: #FFF;
  border-radius: 20px;
  width: 90%;
  max-width: 480px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid #E5E5E5;
}

.notification-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 24px 16px 24px;
  border-bottom: 1px solid #F0F0F0;
}

.notification-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #000;
  margin: 0;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
}

.notification-modal-close {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  border-radius: 8px;
  transition: background-color 0.2s ease;
  color: #A9A9A9;
}

.notification-modal-close:hover {
  background: #F8F9FA;
  color: #5C595F;
}

.notification-list {
  padding: 0;
  max-height: 60vh;
  overflow-y: auto;
}

.notification-item {
  padding: 20px 24px;
  border-bottom: 1px solid #F0F0F0;
  transition: background-color 0.2s ease;
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-item:hover {
  background: #F8F9FA;
}

.notification-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.notification-category {
  font-size: 14px;
  font-weight: 600;
  color: #802FFF;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
}

.notification-time {
  font-size: 13px;
  color: #A9A9A9;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
}

.notification-content {
  margin-top: 4px;
}

.notification-text {
  font-size: 15px;
  font-weight: 500;
  color: #000;
  margin: 0 0 4px 0;
  line-height: 1.4;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
}

.notification-subtext {
  font-size: 13px;
  color: #A9A9A9;
  margin: 0;
  line-height: 1.4;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
}

/* Period Analysis Styles */
.period-analysis-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.period-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.period-btn {
  background: #F8F9FA;
  border: 1px solid #E5E5E5;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #5C595F;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
}

.period-btn:hover {
  background: #E9ECEF;
  border-color: #DADADA;
}

.period-btn.active {
  background: #802FFF;
  border-color: #802FFF;
  color: #FFF;
}

.table-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: #A9A9A9;
  font-size: 14px;
  gap: 12px;
}

.table-loading.hidden {
  display: none;
}

.table-loading .loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid #F0F0F0;
  border-top: 2px solid #802FFF;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.table-loading p {
  margin: 0;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
}

.table-container {
  min-height: 200px;
}

/* 오늘 날짜 행 스타일 */
.stats-table tr.today-row {
  background: rgba(128, 47, 255, 0.05);
  font-weight: 600;
}

.stats-table tr.today-row td {
  color: #802FFF;
}

/* Stats Table */
.stats-table {
  width: 100%;
  font-size: 14px;
  border-collapse: collapse;
}

.stats-table thead {
  background: #F1F1F1;
}

.stats-table th {
  padding: 10px;
  font-weight: 700;
  color: #A9A9A9;
  text-align: center;
  letter-spacing: -0.39px;
  border-top: 1px solid #DADADA;
  border-bottom: 1px solid #F1F1F1;
  font-size: 13px;
}

.stats-table th:first-child {
  text-align: left;
}

.stats-table td {
  padding: 10px;
  border-bottom: 1px solid #F1F1F1;
  letter-spacing: -0.42px;
  text-align: center;
  font-size: 14px;
  color: #000;
}

.stats-table td:first-child {
  text-align: left;
  font-weight: 500;
}

/* Hover effect for table rows */
.stats-table tbody tr:hover {
  background: #F8F6FF;
}

.stats-table tbody tr:hover td {
  color: #802FFF;
  font-weight: 600;
}

/* Summary rows styling */
.stats-table tr.summary-row {
  background: #F8F8F8;
  font-weight: 700;
}

.stats-table tr.summary-row td {
  border-top: 2px solid #E5E5E5;
  font-weight: 700;
}

.text-end {
  text-align: right !important;
}

/* Resource Stats */
.resource-stats {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.resource-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.resource-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.resource-label {
  font-size: 16px;
  font-weight: 600;
  color: #000;
  letter-spacing: -0.48px;
}

.resource-value {
  font-size: 16px;
  font-weight: 700;
  color: #000;
  letter-spacing: -0.48px;
}

.resource-value.text-danger {
  color: #FF4757 !important;
}

.resource-progress {
  height: 6px;
  background: #DADADA;
  border-radius: 20px;
  position: relative;
  overflow: visible;
}

.progress-bar {
  height: 8px;
  background: #802FFF;
  border-radius: 20px;
  transition: width 0.3s ease;
  position: absolute;
  top: -1px;
  left: 0;
}

.progress-bar.success {
  background: #5CA6FB;
}

.progress-bar.danger {
  background: #FF4757;
  left: auto;
  right: 0;
}

/* Content Section */
.content-section {
  margin-top: 32px;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 24px;
}

/* Content Cards */
.content-card {
  background: #FFF;
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 0 12px rgba(72, 73, 85, 0.12);
  height: 440px;
  display: flex;
  flex-direction: column;
}

/* 콘텐츠 카드 크기 변형 */
.content-card-large {
  height: 550px;
}

.content-card-medium {
  height: 400px;
}

.content-card-small {
  height: 300px;
}

.content-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.content-card-title {
  font-size: 20px;
  font-weight: 700;
  color: #000;
  letter-spacing: -0.6px;
}

.content-more-link {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 14px;
  font-weight: 500;
  color: #5C595F;
  text-decoration: none;
  letter-spacing: -0.42px;
}

.content-more-link:hover {
  color: #802FFF;
}

/* Content Items */
.content-items {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  flex: 1;
}

.content-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}

.content-item:hover {
  background-color: #F8F9FA;
}

.content-item-image {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
}

.content-item-body {
  flex: 1;
  min-width: 0;
}

.content-item-title {
  font-size: 16px;
  font-weight: 500;
  color: #000;
  letter-spacing: -0.48px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 8px;
}

.content-item-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: #5C595F;
  letter-spacing: -0.42px;
}

.content-item-meta > span {
  font-weight: 500;
}

.content-item-meta .text-muted {
  color: #DADADA;
  margin: 0 8px;
}

.content-item-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  font-size: 18px;
  color: #802FFF;
}

/* Status Badge */
.status-badge {
  display: inline-flex;
  padding: 8px 14px;
  justify-content: center;
  align-items: center;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 700;
  line-height: 140%;
}

.status-complete {
  background: #F8F6FF;
  color: #802FFF;
}

.status-waiting {
  background: #F1F1F1;
  color: #5C595F;
}

/* Inquiry Cards */
.inquiry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.inquiry-card {
  background: #FFF;
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 0 12px rgba(72, 73, 85, 0.12);
  height: 292px;
  display: flex;
  flex-direction: column;
}

/* 문의 카드 크기 변형 */
.inquiry-card-large {
  height: 400px;
}

.inquiry-card-medium {
  height: 300px;
}

.inquiry-card-small {
  height: 200px;
}

.inquiry-items {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  flex: 1;
}

.inquiry-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inquiry-item-body {
  flex: 1;
  min-width: 0;
}

/* Live Schedule Sidebar */
.live-schedule-sidebar {
  position: fixed;
  right: 0;
  top: 0;
  width: 390px;
  height: 100vh;
  background: #F8F6FF;
  padding: 56px 24px 24px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.live-schedule-title {
  font-size: 24px;
  font-weight: 700;
  color: #000;
  margin-bottom: 16px;
}

.live-schedule-items {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.live-schedule-item {
  display: flex;
  padding: 16px 20px;
  align-items: center;
  gap: 24px;
  background: #FFF;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.live-schedule-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.live-schedule-item.active {
  border: 2px solid #802FFF;
  background: #F8F0FF;
}

.live-schedule-icon {
  width: 48px;
  height: 48px;
}

.live-schedule-content {
  flex: 1;
}

.live-schedule-name {
  font-size: 18px;
  font-weight: 700;
  color: #000;
  letter-spacing: -0.54px;
  margin-bottom: 4px;
}

.live-schedule-instructor {
  font-size: 14px;
  color: #5C595F;
  letter-spacing: -0.42px;
  margin-bottom: 8px;
}

.live-schedule-time {
  display: flex;
  gap: 8px;
  font-size: 14px;
  color: #000;
  letter-spacing: -0.42px;
}

/* Site Summary Card */
.site-summary-card {
  background: #FFF;
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.site-summary-title {
  font-size: 20px;
  font-weight: 700;
  color: #000;
  letter-spacing: -0.6px;
  margin-bottom: 24px;
}

.site-summary-items {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.site-summary-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.site-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-summary-label {
  font-size: 16px;
  font-weight: 600;
  color: #000;
  letter-spacing: -0.48px;
}

.site-summary-sublabel {
  font-size: 14px;
  font-weight: 500;
  color: #5C595F;
  margin-left: 8px;
}

.site-summary-value {
  font-size: 16px;
  font-weight: 700;
  color: #000;
  letter-spacing: -0.48px;
}

.site-summary-progress {
  height: 6px;
  background: #DADADA;
  border-radius: 20px;
  position: relative;
  overflow: visible;
}

.site-summary-progress-bar {
  height: 8px;
  border-radius: 20px;
  position: absolute;
  top: -1px;
  left: 0;
  transition: width 0.3s ease;
}

.site-summary-progress-overflow {
  height: 8px;
  border-radius: 20px;
  position: absolute;
  top: -1px;
  left: 100%;
  opacity: 0.7;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* Hide old Bootstrap components */
.dashboard-container > .row {
  display: none !important;
}

/* Override Bootstrap card styles for dashboard */
.dashboard-container .card {
  border: none;
  box-shadow: none;
}

/* Responsive Design */
@media (max-width: 1680px) {
  .dashboard-container {
    margin-right: 390px;
  }
}

@media (max-width: 1440px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .content-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
  
  .inquiry-grid {
    grid-template-columns: 1fr;
  }
  
  .live-schedule-sidebar {
    width: 280px;
  }
  
  .dashboard-container {
    margin-right: 280px;
  }
}

@media (max-width: 1200px) {
  .live-schedule-sidebar {
    position: static;
    width: 100%;
    height: auto;
    border-left: none;
    border-top: 1px solid #E5E5E5;
    margin-top: 32px;
  }
  
  .dashboard-container {
    margin-right: 0;
  }
  
  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .dashboard-container {
    padding: 24px 12px 12px 12px;
  }

  .dashboard-brand {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .dashboard-logo {
    width: 40px;
    height: 40px;
  }
  
  .dashboard-greeting {
    font-size: 28px;
  }
  
  .dashboard-subtitle {
    font-size: 20px;
  }
  
  .order-status-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .stats-grid,
  .content-grid,
  .inquiry-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .stat-card,
  .content-card,
  .inquiry-card {
    padding: 20px;
    min-height: auto;
  }
}

/* Scrollbar Styling */
.content-items::-webkit-scrollbar,
.inquiry-items::-webkit-scrollbar,
.live-schedule-sidebar::-webkit-scrollbar {
  width: 6px;
}

.content-items::-webkit-scrollbar-track,
.inquiry-items::-webkit-scrollbar-track,
.live-schedule-sidebar::-webkit-scrollbar-track {
  background: #F1F1F1;
  border-radius: 3px;
}

.content-items::-webkit-scrollbar-thumb,
.inquiry-items::-webkit-scrollbar-thumb,
.live-schedule-sidebar::-webkit-scrollbar-thumb {
  background: #DADADA;
  border-radius: 3px;
}

.content-items::-webkit-scrollbar-thumb:hover,
.inquiry-items::-webkit-scrollbar-thumb:hover,
.live-schedule-sidebar::-webkit-scrollbar-thumb:hover {
  background: #A9A9A9;
}

/* 테이블 반응형 처리 */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-responsive::-webkit-scrollbar {
  height: 6px;
}

.table-responsive::-webkit-scrollbar-track {
  background: #F1F1F1;
  border-radius: 3px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: #C1C1C1;
  border-radius: 3px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
  background: #A8A8A8;
}