/* Styles for Visit Schedule Dashboard */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  /* Color Palette - HSL based */
  --bg-main: #0b0f19;
  --bg-card: rgba(22, 30, 49, 0.6);
  --bg-card-hover: rgba(30, 41, 67, 0.8);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-hover: rgba(255, 255, 255, 0.15);
  
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* User-specific themes */
  --color-jongseok: #06b6d4;      /* Cyan */
  --color-jongseok-bg: rgba(6, 182, 212, 0.15);
  --color-jongseok-border: rgba(6, 182, 212, 0.3);
  
  --color-junhyeok: #a855f7;      /* Purple */
  --color-junhyeok-bg: rgba(168, 85, 247, 0.15);
  --color-junhyeok-border: rgba(168, 85, 247, 0.3);
  
  --color-admin: #f59e0b;          /* Amber */
  --color-admin-bg: rgba(245, 158, 11, 0.15);
  
  /* System states */
  --color-success: #10b981;       /* Emerald */
  --color-success-bg: rgba(16, 185, 129, 0.1);
  --color-danger: #f43f5e;        /* Rose */
  --color-danger-bg: rgba(244, 63, 94, 0.12);
  --color-warning: #f97316;       /* Orange */
  --color-warning-bg: rgba(249, 115, 22, 0.1);
  
  /* Font variables */
  --font-heading: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  
  /* Utilities */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.3);
  --shadow-glow-cyan: 0 0 20px rgba(6, 182, 212, 0.15);
  --shadow-glow-purple: 0 0 20px rgba(168, 85, 247, 0.15);
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Settings */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(6, 182, 212, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.06) 0%, transparent 40%);
  background-attachment: fixed;
  padding-bottom: 40px;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Glassmorphism utility */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-normal), background-color var(--transition-normal), box-shadow var(--transition-normal);
}

.glass-panel:hover {
  border-color: var(--border-color-hover);
  background: var(--bg-card-hover);
}

/* Layout Wrapper */
.app-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Header Styles */
header.app-header {
  position: relative;
  z-index: 150; /* Ensure header elements/dropdowns stack above main content and detail panel */
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  margin-bottom: 8px;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--color-jongseok) 0%, var(--color-junhyeok) 100%);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.2rem;
  color: #fff;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.brand-title-wrap h1 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  background: linear-gradient(to right, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 2px;
}

.brand-title-wrap p {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* User Switcher */
.user-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.switcher-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.switcher-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.switcher-btn.active[data-user="admin"] {
  background: var(--color-admin-bg);
  color: var(--color-admin);
  font-weight: 600;
}

.switcher-btn.active[data-user="jongseok"] {
  background: var(--color-jongseok-bg);
  color: var(--color-jongseok);
  font-weight: 600;
}

.switcher-btn.active[data-user="junhyeok"] {
  background: var(--color-junhyeok-bg);
  color: var(--color-junhyeok);
  font-weight: 600;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.switcher-btn[data-user="admin"] .badge-dot { background-color: var(--color-admin); }
.switcher-btn[data-user="jongseok"] .badge-dot { background-color: var(--color-jongseok); }
.switcher-btn[data-user="junhyeok"] .badge-dot { background-color: var(--color-junhyeok); }

/* In-App Notifications Button */
.notif-bell-container {
  position: relative;
}

.notif-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.notif-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.notif-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: var(--color-danger);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg-main);
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 8px rgba(244, 63, 94, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(244, 63, 94, 0); }
}

/* Main Workspace Layout */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
}

@media (max-width: 1024px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
}

/* Left Grid Section */
.left-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Monthly Calendar panel */
.calendar-panel {
  padding: 24px;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.calendar-title-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.calendar-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.5rem;
}

.calendar-nav {
  display: flex;
  gap: 8px;
}

.btn-nav, .btn-today {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.btn-nav:hover, .btn-today:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-today {
  font-weight: 500;
}

.btn-add-schedule {
  background: linear-gradient(135deg, var(--color-jongseok) 0%, #0891b2 100%);
  border: none;
  color: #fff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
  transition: all var(--transition-normal);
}

.btn-add-schedule:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(6, 182, 212, 0.3);
  filter: brightness(1.1);
}

/* Calendar Grid */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.weekday-header {
  text-align: center;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
}

.weekday-header:nth-child(7) { color: #f43f5e; /* Sunday */ }
.weekday-header:nth-child(6) { color: #3b82f6; /* Saturday */ }

.calendar-day {
  aspect-ratio: 1.15;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
}

.calendar-day:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.calendar-day.other-month {
  opacity: 0.25;
}

.calendar-day.today {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.03);
}
.calendar-day.today::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 5px;
  height: 5px;
  background-color: var(--text-primary);
  border-radius: 50%;
}

.calendar-day.selected {
  border-color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.day-number {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}
.calendar-day.other-month .day-number {
  font-weight: 400;
}

/* Day Contents */
.day-schedules {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}

.schedule-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-badge.jongseok {
  background: var(--color-jongseok-bg);
  color: var(--color-jongseok);
  border: 1px solid var(--color-jongseok-border);
}

.schedule-badge.junhyeok {
  background: var(--color-junhyeok-bg);
  color: var(--color-junhyeok);
  border: 1px solid var(--color-junhyeok-border);
}

.day-meta-icons {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.day-change-indicator {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 1px 4px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  gap: 2px;
}

/* Right Section - Detail Panel */
.detail-panel {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: max-content;
  position: sticky;
  top: 24px;
}

.panel-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
}

.panel-date {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: #fff;
}

.panel-day-of-week {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.detail-section-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Schedule Card in Detail Panel */
.visit-status-card {
  padding: 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  position: relative;
}

.visit-status-card.active-jongseok {
  border-color: var(--color-jongseok-border);
  background: linear-gradient(135deg, var(--color-jongseok-bg) 0%, rgba(255,255,255,0.01) 100%);
}

.visit-status-card.active-junhyeok {
  border-color: var(--color-junhyeok-border);
  background: linear-gradient(135deg, var(--color-junhyeok-bg) 0%, rgba(255,255,255,0.01) 100%);
}

.no-schedule {
  text-align: center;
  padding: 24px 0;
  color: var(--text-muted);
  font-size: 0.875rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.no-schedule i {
  font-size: 1.5rem;
}

.schedule-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.visitor-tag {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.visitor-tag.jongseok {
  background: var(--color-jongseok-bg);
  color: var(--color-jongseok);
}
.visitor-tag.junhyeok {
  background: var(--color-junhyeok-bg);
  color: var(--color-junhyeok);
}

.schedule-status-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

.schedule-status-tag.scheduled {
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
}
.schedule-status-tag.visited {
  background: var(--color-success-bg);
  color: var(--color-success);
}
.schedule-status-tag.cancelled {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.schedule-memo-box {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text-primary);
  margin-top: 10px;
}
.schedule-memo-box .memo-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 600;
}

.schedule-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.btn-action-outline {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.btn-action-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-action-outline.danger:hover {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border-color: rgba(244, 63, 94, 0.3);
}

/* Detail Goal Widget */
.detail-goals-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-goal-row {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.detail-goal-row .user-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.detail-goal-row .user-label.jongseok { color: var(--color-jongseok); }
.detail-goal-row .user-label.junhyeok { color: var(--color-junhyeok); }

.detail-goal-metrics {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.metric-pill {
  flex: 1;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.metric-pill .label {
  font-size: 0.62rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.metric-pill .value {
  font-weight: 700;
  color: var(--text-primary);
}

/* Detail Logs List */
.detail-logs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 160px;
  overflow-y: auto;
}

.detail-log-item {
  font-size: 0.75rem;
  padding: 8px;
  border-left: 2px solid var(--text-muted);
  background: rgba(255, 255, 255, 0.01);
}

.detail-log-item.created { border-left-color: var(--color-success); }
.detail-log-item.updated { border-left-color: var(--color-warning); }
.detail-log-item.cancelled { border-left-color: var(--color-danger); }
.detail-log-item.restored { border-left-color: var(--color-jongseok); }
.detail-log-item.deleted { border-left-color: #64748b; }

.detail-log-meta {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.65rem;
  margin-bottom: 2px;
}

/* Summary Grid at Bottom */
.bottom-summary-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

@media (max-width: 900px) {
  .bottom-summary-grid {
    grid-template-columns: 1fr;
  }
}

/* Goal Status Cards Grid */
.goals-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.goals-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .goals-container {
    grid-template-columns: 1fr;
  }
}

.goal-card {
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.goal-card.jongseok-card {
  box-shadow: var(--shadow-glow-cyan);
}
.goal-card.jongseok-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--color-jongseok);
}

.goal-card.junhyeok-card {
  box-shadow: var(--shadow-glow-purple);
}
.goal-card.junhyeok-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--color-junhyeok);
}

.goal-card.unified-card {
  box-shadow: 0 8px 32px 0 rgba(0, 242, 254, 0.05), 0 8px 32px 0 rgba(248, 87, 166, 0.05);
}
.goal-card.unified-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--color-cyan), var(--color-purple));
}

@media (max-width: 768px) {
  .goal-card.unified-card .goal-items-wrap {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .goal-card.unified-card .goal-item {
    border-left: none !important;
    padding-left: 0 !important;
    border-top: 1px solid var(--border-color) !important;
    padding-top: 16px !important;
  }
  .goal-card.unified-card .goal-item:first-child {
    border-top: none !important;
    padding-top: 0 !important;
  }
}

.goal-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.user-name-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.jongseok-card .user-name-title { color: var(--color-jongseok); }
.junhyeok-card .user-name-title { color: var(--color-junhyeok); }

/* Goal Items (Weekly, Monthly) */
.goal-items-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.goal-item {
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
}
.goal-item:first-child {
  border: none;
  padding-top: 0;
}

.goal-item-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.goal-title {
  font-weight: 500;
  color: var(--text-primary);
}

.goal-ratio {
  font-family: var(--font-heading);
  font-weight: 700;
}

/* Progress bar */
.progress-bar-container {
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 3px;
  width: 0%;
  transition: width 0.6s cubic-bezier(0.1, 0.8, 0.3, 1);
}
.jongseok-card .progress-bar-fill { background: var(--color-jongseok); }
.junhyeok-card .progress-bar-fill { background: var(--color-junhyeok); }

.goal-forecast {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.forecast-badge {
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
}

.forecast-badge.success {
  background: var(--color-success-bg);
  color: var(--color-success);
}
.forecast-badge.warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}
.forecast-badge.danger {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  animation: pulse-danger-bg 2s infinite;
}

@keyframes pulse-danger-bg {
  0% { opacity: 0.8; }
  50% { opacity: 1; background-color: rgba(244, 63, 94, 0.25); }
  100% { opacity: 0.8; }
}

/* Right Bottom Log Summary Panel */
.recent-logs-panel {
  padding: 20px;
}

.panel-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.panel-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-link {
  background: transparent;
  border: none;
  color: var(--color-jongseok);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}
.btn-link:hover {
  text-decoration: underline;
  color: #22d3ee;
}

.logs-summary-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summary-log-item {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-color);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  position: relative;
}

.summary-log-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}

.summary-log-item.created::before { background-color: var(--color-success); }
.summary-log-item.updated::before { background-color: var(--color-warning); }
.summary-log-item.cancelled::before { background-color: var(--color-danger); }
.summary-log-item.restored::before { background-color: var(--color-jongseok); }
.summary-log-item.deleted::before { background-color: #64748b; }

.summary-log-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 0.7rem;
}
.summary-log-actor {
  font-weight: 600;
}
.summary-log-actor.admin { color: var(--color-admin); }
.summary-log-actor.jongseok { color: var(--color-jongseok); }
.summary-log-actor.junhyeok { color: var(--color-junhyeok); }

.summary-log-content {
  line-height: 1.3;
  color: var(--text-primary);
}

.empty-state {
  text-align: center;
  padding: 30px 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Modals System styling */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000; /* Ensure modals are above all other elements */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  width: 100%;
  max-width: 500px;
  transform: translateY(20px);
  transition: transform var(--transition-normal);
  padding: 24px;
}

.modal-overlay.active .modal-container {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 14px;
}

.modal-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.2rem;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.btn-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* Form Styles inside Modals */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 10px 14px;
  transition: all var(--transition-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--color-jongseok);
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.15);
  background: rgba(0, 0, 0, 0.45);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-input[readonly] {
  opacity: 0.6;
  cursor: not-allowed;
}

.alert-message {
  padding: 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  line-height: 1.4;
  margin-bottom: 18px;
  display: none; /* Toggled by JS */
  align-items: flex-start;
  gap: 8px;
}

.alert-message.warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  border: 1px solid rgba(249, 115, 22, 0.3);
  display: flex;
}

.alert-message.danger {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid rgba(244, 63, 94, 0.3);
  display: flex;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-jongseok) 0%, #0891b2 100%);
  border: none;
  color: white;
  padding: 10px 20px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 10px 20px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

/* In-app Notification Panel Overlay */
.notif-popover {
  position: absolute;
  top: 50px;
  right: 0;
  width: 360px;
  max-height: 480px;
  z-index: 160; /* Higher than header's base z-index */
  background: #111827 !important; /* Solid opaque dark background to ensure readability */
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: transform var(--transition-normal), opacity var(--transition-normal);
}

.notif-popover.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.notif-popover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
}

.notif-popover-header h3 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
}

.notif-popover-body {
  overflow-y: auto;
  flex: 1;
  max-height: 380px;
}

.notif-list-container {
  display: flex;
  flex-direction: column;
}

.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.01);
  transition: background var(--transition-fast);
}

.notif-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.notif-item.unread {
  background: rgba(6, 182, 212, 0.03);
  position: relative;
}

.notif-item.unread::after {
  content: '';
  position: absolute;
  top: 14px;
  right: 14px;
  width: 6px;
  height: 6px;
  background-color: var(--color-jongseok);
  border-radius: 50%;
}

.notif-icon-wrap {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.8rem;
}

.notif-item.schedule_created .notif-icon-wrap { background: rgba(16, 185, 129, 0.15); color: var(--color-success); }
.notif-item.schedule_updated .notif-icon-wrap { background: rgba(249, 115, 22, 0.15); color: var(--color-warning); }
.notif-item.schedule_cancelled .notif-icon-wrap { background: rgba(244, 63, 94, 0.15); color: var(--color-danger); }
.notif-item.goal_risk .notif-icon-wrap { background: rgba(244, 63, 94, 0.15); color: var(--color-danger); }
.notif-item.goal_status_changed .notif-icon-wrap { background: rgba(6, 182, 212, 0.15); color: var(--color-jongseok); }

.notif-text {
  flex: 1;
  font-size: 0.78rem;
  line-height: 1.35;
}

.notif-item-title {
  font-weight: 600;
  margin-bottom: 2px;
  color: #fff;
}

.notif-item-body {
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.notif-item-time {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.notif-popover-footer {
  padding: 10px;
  text-align: center;
  border-top: 1px solid var(--border-color);
}

/* Full History Change Log Modal Layout */
.log-history-modal-container {
  max-width: 800px;
  width: 90%;
}

.log-filters {
  display: grid;
  grid-template-columns: repeat(3, 1fr) auto;
  gap: 12px;
  margin-bottom: 20px;
  background: rgba(0,0,0,0.2);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

@media (max-width: 600px) {
  .log-filters {
    grid-template-columns: 1fr;
  }
}

.history-logs-table-container {
  max-height: 380px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.history-logs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  text-align: left;
}

.history-logs-table th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
}

.history-logs-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.history-logs-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.015);
}

.history-action-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
}
.history-action-badge.created { background: var(--color-success-bg); color: var(--color-success); }
.history-action-badge.updated { background: var(--color-warning-bg); color: var(--color-warning); }
.history-action-badge.cancelled { background: var(--color-danger-bg); color: var(--color-danger); }
.history-action-badge.restored { background: var(--color-jongseok-bg); color: var(--color-jongseok); }
.history-action-badge.deleted { background: rgba(100, 116, 139, 0.15); color: #94a3b8; }
