/* Reset & Variables */
:root {
  --bg-dark-base: #f8fafc;
  --bg-dark-panel: rgba(255, 255, 255, 0.85);
  --border-light: rgba(0, 0, 0, 0.06);
  --border-glow: rgba(37, 99, 235, 0.15);

  --color-primary: #000000;
  --color-primary-glow: rgba(0, 0, 0, 0.1);
  --color-accent: #2563eb;

  --color-success: #10b981;
  --color-success-glow: rgba(16, 185, 129, 0.15);

  --color-warning: #f59e0b;
  --color-warning-glow: rgba(245, 158, 11, 0.15);

  --color-danger: #ef4444;
  --color-danger-glow: rgba(239, 68, 68, 0.15);

  --color-youtube: #ff0000;
  --color-youtube-glow: rgba(255, 0, 0, 0.15);

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dark: #0f172a;

  --shadow-main: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --font-ow: 'Outfit', 'Noto Sans KR', sans-serif;
}

body.dark-theme {
  --bg-dark-base: #0f172a;
  --bg-dark-panel: rgba(30, 41, 59, 0.85);
  --border-light: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.25);

  --color-primary: #ffffff;
  --color-primary-glow: rgba(255, 255, 255, 0.15);
  --color-accent: #6366f1;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dark: #f8fafc;

  --shadow-main: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

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

body {
  font-family: 'Inter', 'Noto Sans KR', -apple-system, sans-serif;
  background-color: var(--bg-dark-base);
  background-image:
    radial-gradient(circle at 10% 20%, rgba(37, 99, 235, 0.04), transparent 35%),
    radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.03), transparent 35%);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}

/* Layout */
.portal-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  height: 100vh;
  height: 100dvh;
  z-index: 10;
}

.sidebar-brand {
  padding: 1.5rem 1rem;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80px;
}

.brand-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 25px;
  background: var(--color-accent);
  filter: blur(15px);
  opacity: 0.25;
  border-radius: 50%;
  pointer-events: none;
}

.brand-logo {
  max-width: 95%;
  max-height: 65px;
  object-fit: contain;
  display: block;
  z-index: 1;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0 0.75rem;
  flex-grow: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  min-height: 0;
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: 0.85rem 1.1rem;
  border-radius: 14px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
  white-space: nowrap;
  word-break: keep-all;
  transition: var(--transition-fast);
}

.menu-item span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-item i {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.menu-item:hover {
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.03);
}

.menu-item:hover i {
  transform: translateX(2px);
}

.menu-item.active {
  color: var(--color-accent);
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid var(--border-glow);
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.05);
}

.menu-item.active i {
  color: var(--color-accent);
  filter: drop-shadow(0 0 3px rgba(37, 99, 235, 0.15));
}

/* Strict Admin Menu Access Control (관리자 권한 미보유 시 CSS 원천 차단) */
body:not(.is-admin) #admin-menu-group,
body:not(.is-admin) #admin-menu-items,
body:not(.is-admin) [data-tab="dashboard"],
body:not(.is-admin) [data-tab="member-mgmt"],
body:not(.is-admin) [data-tab="balancing"],
body:not(.is-admin) [data-tab="ocr"],
body:not(.is-admin) [data-tab="uploader"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Collapsible Admin Menu Group Styles (통일된 프리미엄 디자인) */
.menu-group-collapsible {
  margin-top: 0.4rem;
}

.menu-group-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.1rem;
  border-radius: 14px;
  color: #6366f1;
  font-weight: 700;
  font-size: 0.98rem;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  background: transparent;
  border: 1px solid transparent;
  transition: var(--transition-fast);
}

.menu-group-header.is-expanded {
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.28);
}

.menu-group-header span {
  white-space: nowrap;
}

.menu-group-header:hover {
  background: rgba(99, 102, 241, 0.05);
}

.menu-group-header.is-expanded:hover {
  background: rgba(99, 102, 241, 0.12);
}

.menu-group-header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  white-space: nowrap;
}

.menu-group-header i {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.menu-group-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-left: 0.3rem;
  margin-top: 0.3rem;
}

.sidebar-footer {
  padding: 1.5rem 1rem;
  border-top: 1px solid var(--border-light);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  background: rgba(0, 0, 0, 0.02);
  padding: 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: var(--transition-fast);
}

.user-card:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: var(--border-glow);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
}

.user-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width: 0;
}

.user-name {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.login-action-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.2rem;
  transition: var(--transition-fast);
  pointer-events: none;
  /* Let clicks pass through to the parent card */
}

.user-card:hover .login-action-btn {
  color: var(--color-accent);
}

/* Main Content Wrapper */
.main-content-wrapper {
  margin-left: 260px;
  flex-grow: 1;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: calc(100% - 260px);
  max-width: calc(100% - 260px);
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}

.content-header h1 {
  font-family: var(--font-ow);
  font-size: 1.8rem;
  font-weight: 800;
}

.system-mini-stats {
  display: none;
  /* Hidden by default, shown for admin only */
  gap: 1rem;
}

.mini-stat-item {
  background: var(--bg-dark-panel);
  border: 1px solid var(--border-light);
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-size: 0.8rem;
  display: flex;
  gap: 0.5rem;
}

.mini-stat-item .label {
  color: var(--text-muted);
  font-weight: 600;
}

.mini-stat-item .val {
  font-weight: bold;
  color: var(--color-primary);
}

/* Content Body Animations */
.content-body {
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Glass Panels & Cards */
.glass-panel {
  background: var(--bg-dark-panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow-main);
}

/* Dashboard View */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.system-dashboard-stat {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  position: relative;
  overflow: hidden;
}

.system-dashboard-stat::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 4px;
}

.system-dashboard-stat.cpu::before {
  background-color: var(--color-primary);
}

.system-dashboard-stat.mem::before {
  background-color: var(--color-success);
}

.system-dashboard-stat.uptime::before {
  background-color: var(--color-warning);
}

.dashboard-stat-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.dashboard-stat-value {
  font-family: var(--font-ow);
  font-size: 1.8rem;
  font-weight: 800;
  margin-top: 0.2rem;
}

/* Services Status Grid */
.services-section-title {
  font-family: var(--font-ow);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 1.5rem 0 1rem 0;
  color: var(--color-primary);
}

.services-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.service-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.2rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.service-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.12);
}

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

.service-name {
  font-family: var(--font-ow);
  font-weight: 700;
  font-size: 1.15rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.6rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-running {
  background: var(--color-success-glow);
  color: var(--color-success);
  border-color: rgba(16, 185, 129, 0.2);
}

.status-running .status-dot {
  background: var(--color-success);
  box-shadow: 0 0 6px var(--color-success);
  animation: pulse 1.5s infinite;
}

.status-stopped {
  background: rgba(156, 163, 175, 0.1);
  color: var(--text-muted);
  border-color: rgba(156, 163, 175, 0.15);
}

.status-stopped .status-dot {
  background: var(--text-muted);
}

.status-restarting {
  background: var(--color-warning-glow);
  color: var(--color-warning);
  border-color: rgba(245, 158, 11, 0.2);
}

.status-restarting .status-dot {
  background: var(--color-warning);
  box-shadow: 0 0 6px var(--color-warning);
  animation: pulse 1.0s infinite;
  /* 조금 더 빠르게 깜빡임 */
}

.status-error,
.status-not_created {
  background: var(--color-danger-glow);
  color: var(--color-danger);
  border-color: rgba(239, 68, 68, 0.2);
}

.status-error .status-dot,
.status-not_created .status-dot {
  background: var(--color-danger);
}

@keyframes pulse {
  0% {
    opacity: 0.4;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.4;
  }
}

.service-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
  flex-grow: 1;
}

.service-meta-info {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.meta-row {
  display: flex;
  justify-content: space-between;
}

.meta-row .val {
  font-family: 'Fira Code', monospace;
  color: var(--color-accent);
}

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

/* Standard Buttons */
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  color: #fff;
  transition: filter 0.2s, transform 0.1s;
  text-decoration: none;
}

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

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.25);
}

body.dark-theme .btn-primary {
  background: linear-gradient(135deg, #a5b4fc 0%, #818cf8 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(129, 140, 248, 0.3);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

body.dark-theme .btn-success {
  background: linear-gradient(135deg, #a7f3d0 0%, #34d399 100%);
  color: #064e3b;
  box-shadow: 0 4px 12px rgba(52, 211, 153, 0.3);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

body.dark-theme .btn-danger {
  background: linear-gradient(135deg, #fecaca 0%, #f87171 100%);
  color: #7f1d1d;
  box-shadow: 0 4px 12px rgba(248, 113, 113, 0.3);
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
}

body.dark-theme .btn-warning {
  background: linear-gradient(135deg, #fef3c7 0%, #fbbf24 100%);
  color: #78350f;
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

.btn-youtube {
  background: linear-gradient(135deg, #fd4655 0%, #f35066 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(223, 61, 82, 0.4);
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: var(--text-main);
}

body.dark-theme .btn-outline {
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-outline:hover {
  background: rgba(0, 0, 0, 0.03);
}

body.dark-theme .btn-outline:hover {
  background: rgba(255, 255, 255, 0.04);
}

.btn:hover:not(:disabled) {
  filter: brightness(1.1);
}

/* Console Logs Panel */
.console-panel {
  display: flex;
  flex-direction: column;
  min-height: 380px;
  max-height: 500px;
}

.console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border-light);
}

.console-tabs {
  display: flex;
  gap: 0.4rem;
}

.console-tab {
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.console-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.console-tab.active {
  background: rgba(99, 102, 241, 0.12);
  border-color: var(--border-glow);
  color: var(--color-accent);
}

.console-body {
  background: #040508;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  overflow-y: auto;
  flex-grow: 1;
  margin-top: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.log-line {
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-all;
}

.log-line.empty {
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  margin-top: 2rem;
}

.log-line.error {
  color: #ef4444;
}

/* Stats Sheet Grid Table */
.stats-table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.45);
}

.stats-table-wrapper table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
  text-align: center;
}

.stats-table-wrapper th,
.stats-table-wrapper td {
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--border-light);
  min-width: 42px;
}

.stats-table-wrapper th {
  background: rgba(0, 0, 0, 0.03);
  font-weight: 600;
  color: var(--color-accent);
}

.stats-table-wrapper tr:hover td {
  background: rgba(0, 0, 0, 0.015);
}

/* YouTube Videos Grid */
.video-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
}

@media (max-width: 1500px) {
  .video-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 1200px) {
  .video-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 850px) {
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 550px) {
  .video-grid {
    grid-template-columns: 1fr;
  }
}

.video-card {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s;
}

.video-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 0, 0, 0.12);
}

.video-card a {
  text-decoration: none;
  color: inherit;
}

.video-thumbnail {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-bottom: 1px solid var(--border-light);
}

.video-info {
  padding: 0.8rem;
}

.video-title {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
  min-height: 2.8em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.video-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

/* YouTube Uploader Layout */
.uploader-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem;
  width: 100%;
}

.file-explorer {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 0;
  min-height: 100%;
  width: 100%;
}

.explorer-card {
  display: flex;
  flex-direction: column;
  height: 0;
  flex: 1;
  min-height: 0;
  box-sizing: border-box;
  width: 100%;
}

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

  .file-explorer {
    height: auto;
    min-height: auto;
  }

  .explorer-card {
    height: 350px;
    flex: none;
  }
}

.explorer-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  color: var(--color-accent);
}

.file-list-container {
  overflow-y: auto;
  flex-grow: 1;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.45);
}

.file-list {
  list-style: none;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(0, 0, 0, 0.02);
  transition: background 0.15s;
}

.file-item:hover {
  background: rgba(0, 0, 0, 0.02);
}

.file-item.active {
  background: rgba(37, 99, 235, 0.08);
  color: var(--color-accent);
  border-left: 3px solid var(--color-accent);
}

.file-item.selected {
  background: rgba(37, 99, 235, 0.04);
  border-left: 3px dashed rgba(37, 99, 235, 0.5);
}

.file-item i {
  color: var(--text-muted);
}

.file-item.directory i {
  color: var(--color-warning);
}

.file-item.active i {
  color: var(--color-accent);
}

.upload-form-panel {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-input,
.form-select,
.form-textarea {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 0.65rem 0.8rem;
  color: var(--text-main);
  font-size: 0.85rem;
  transition: border-color 0.2s, background-color 0.2s;
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--color-accent);
  background: rgba(255, 255, 255, 0.95);
}

.form-input[readonly] {
  background: rgba(0, 0, 0, 0.02);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* Upload Progress Items */
.progress-container-panel {
  margin-top: 1.5rem;
}

.progress-list-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 0.8rem;
}

.progress-item-card {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.progress-info-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
}

.progress-bar-bg {
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), #818cf8);
  width: 0;
  transition: width 0.3s;
}

.progress-stats-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* OCR Slots grid */
.ocr-slots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 1024px) {
  .ocr-slots-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .ocr-slots-grid {
    grid-template-columns: 1fr;
  }
}

.ocr-slot-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

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

.ocr-slot-title {
  font-size: 0.8rem;
  font-weight: bold;
  text-transform: uppercase;
  color: var(--color-accent);
}

.ocr-slot-clear-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
}

.ocr-slot-clear-btn:hover {
  color: var(--color-danger);
}

.ocr-slot-drop-zone {
  height: 100px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.1);
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  transition: var(--transition-fast);
}

.ocr-slot-drop-zone:hover {
  border-color: var(--color-primary);
  background: rgba(99, 102, 241, 0.05);
}

.ocr-slot-status {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Match OCR Final Results Table Card */
.match-result-card {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.match-result-header {
  background: rgba(255, 255, 255, 0.03);
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.match-result-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-accent);
}

/* Profile view position cards */
.profile-card {
  display: flex;
  flex-direction: column;
  gap: 1.95rem;
  max-width: 1404px;
  margin: 0 auto;
  width: 100%;
}

.profile-header-strip {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(168, 85, 247, 0.1) 100%);
  border-radius: 21px;
  padding: 2.275rem 2.6rem;
  border: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  height: 170px;
  box-sizing: border-box;
}

.profile-username {
  font-family: var(--font-ow);
  font-size: 2.6rem;
  font-weight: 900;
}

.profile-battletag {
  font-size: 1.43rem;
  color: var(--color-accent);
  margin-top: 0.25rem;
}

.profile-section-title {
  font-size: 1.24rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.profile-positions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.17rem;
}

.position-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  border-radius: 15px;
  padding: 1.56rem;
  text-align: center;
  box-sizing: border-box;
}

.profile-positions-grid .position-card {
  height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.position-card h5 {
  font-size: 1.35rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.78rem;
}

.hero-badges-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  align-items: center;
}

.hero-badge {
  padding: 0.32rem 0.8rem;
  border-radius: 99px;
  font-size: 1.05rem;
  font-weight: 700;
  width: 75%;
  text-align: center;
  letter-spacing: 0.3px;
  transition: transform 0.15s;
  /* 기본 색 (탱크) */
  background: rgba(59, 130, 246, 0.15);
  color: #1d4ed8;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.hero-badge:hover {
  transform: scale(1.04);
}

/* 공격(딜러) – 2번째 포지션 카드 */
.profile-positions-grid>div:nth-child(2) .hero-badge {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.28);
}

/* 지원(힐러) – 3번째 포지션 카드 */
.profile-positions-grid>div:nth-child(3) .hero-badge {
  background: rgba(16, 185, 129, 0.13);
  color: #065f46;
  border-color: rgba(16, 185, 129, 0.3);
}

/* Tiers Table grid */
.profile-tiers-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-size: 1.17rem;
  table-layout: fixed;
}

.profile-tiers-table th,
.profile-tiers-table td {
  padding: 0.975rem 1.3rem;
  border: 1px solid var(--border-light);
}

.profile-tiers-table th {
  background: rgba(255, 255, 255, 0.04);
  font-weight: 700;
  font-size: 1.04rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.profile-tiers-table td:first-child,
.profile-tiers-table th:first-child {
  width: 23.333%;
  text-align: center;
  padding-left: 1rem;
  font-weight: bold;
  color: var(--text-main);
}

.tier-text {
  font-weight: bold;
  font-size: 1.35rem;
}

/* Overlay & Login Modal */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 6, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.3s;
}

.login-box {
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 2.5rem !important;
}

.login-box h2 {
  font-family: var(--font-ow);
  font-size: 2.1rem;
  font-weight: 800;
  text-align: center;
  background: linear-gradient(135deg, #0f172a, #2563eb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Toast System */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: rgba(15, 18, 30, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 0.8rem 1.2rem;
  font-size: 0.85rem;
  color: #fff;
  box-shadow: var(--shadow-main);
  transform: translateX(120%);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border-left: 4px solid var(--color-primary);
}

.toast.show {
  transform: translateX(0);
}

.toast.success {
  border-left-color: var(--color-success);
}

.toast.error {
  border-left-color: var(--color-danger);
}

.toast.warning {
  border-left-color: var(--color-warning);
}

/* Admin member management modal styling enhancements */
#mgmt-member-modal {
  color: #f8fafc;
}

#mgmt-member-modal .glass-panel {
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.96) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  padding: 2.2rem !important;
}

#mgmt-member-modal label {
  color: #94a3b8 !important;
  /* Slate 400 for highly readable labels */
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

#mgmt-member-modal .form-input,
#mgmt-member-modal .form-select {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

#mgmt-member-modal .form-input:focus,
#mgmt-member-modal .form-select:focus {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: #60a5fa !important;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

#mgmt-member-modal input[type="checkbox"] {
  accent-color: #3b82f6;
}

#mgmt-member-modal fieldset {
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 12px !important;
  padding: 1.25rem !important;
  margin-top: 0.5rem;
}

#mgmt-member-modal legend {
  color: #60a5fa !important;
  /* Brighter blue for the dark bg */
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0 0.6rem;
}

#mgmt-member-modal .position-card {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 10px;
  padding: 1rem 0.8rem !important;
}

#mgmt-member-modal .position-card h5 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

/* Set specific colors for the role headers in the modal */
#mgmt-member-modal .position-card:nth-child(1) h5 {
  color: #60a5fa !important;
  /* Tank blue */
}

#mgmt-member-modal .position-card:nth-child(2) h5 {
  color: #f87171 !important;
  /* DPS red */
}

#mgmt-member-modal .position-card:nth-child(3) h5 {
  color: #34d399 !important;
  /* Support green */
}

#mgmt-member-modal table th {
  color: #94a3b8 !important;
  font-weight: 600;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1) !important;
  padding: 0.65rem 0.4rem !important;
}

#mgmt-member-modal table td {
  padding: 0.65rem 0.4rem !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

#mgmt-member-modal .btn-success {
  background: #10b981 !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2) !important;
  font-weight: 700;
  transition: all 0.2s ease;
}

#mgmt-member-modal .btn-success:hover {
  background: #059669 !important;
  transform: translateY(-1px);
}

/* ==========================================
   [8] Integrated Vote Management View Styles
   ========================================== */

/* Vote Grid */
.vote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

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

/* Vote Card */
.vote-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
}

.vote-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-glow);
}

.vote-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.vote-card-title {
  font-family: var(--font-ow);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.vote-card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  white-space: pre-line;
}

/* Status Badges */
.vote-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.vote-status-badge.active {
  background: var(--color-success-glow);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.vote-status-badge.closed {
  background: rgba(100, 116, 139, 0.1);
  color: var(--text-muted);
  border: 1px solid rgba(100, 116, 139, 0.2);
}

/* Vote Options */
.vote-options-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.vote-option-item {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
  cursor: pointer;
  transition: var(--transition-fast);
}

.vote-card.closed .vote-option-item {
  cursor: default;
}

.vote-option-item:hover:not(.disabled) {
  background: rgba(37, 99, 235, 0.03);
  border-color: rgba(37, 99, 235, 0.25);
}

.vote-option-item.selected {
  background: rgba(37, 99, 235, 0.05);
  border-color: var(--color-accent);
}

.vote-option-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
  font-weight: 600;
  font-size: 0.9rem;
}

.vote-option-name {
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.vote-option-stats {
  color: var(--color-accent);
  font-family: var(--font-ow);
  font-size: 0.85rem;
}

/* Progress Bar inside option */
.vote-option-progress-bg {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 9px;
  background: rgba(37, 99, 235, 0.06);
  z-index: 1;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.vote-option-item.selected .vote-option-progress-bg {
  background: rgba(37, 99, 235, 0.12);
}

/* Vote Participants List */
.vote-voters-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.25rem;
  z-index: 2;
  position: relative;
}

.vote-voter-chip {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border-light);
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-dark);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

/* Vote Action Footer */
.vote-card-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: auto;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border-light);
}

/* Vote Creator Form */
.vote-creator-panel {
  margin-bottom: 2rem;
}

.vote-creator-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.vote-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 600px) {
  .vote-form-row {
    grid-template-columns: 1fr;
  }
}

.vote-creator-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.vote-creator-option-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.vote-creator-option-row .form-input {
  flex-grow: 1;
}

.vote-creator-option-row .btn-remove-option {
  background: transparent;
  border: none;
  color: var(--color-danger);
  cursor: pointer;
  padding: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: var(--transition-fast);
}

.vote-creator-option-row .btn-remove-option:hover {
  background: var(--color-danger-glow);
}

/* Vote Item Position Styles */
.vote-position-selector {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px dashed rgba(0, 0, 0, 0.05);
  z-index: 5;
  position: relative;
}

.vote-position-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: bold;
}

.btn-pos-select {
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.6);
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.btn-pos-select:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-main);
}

.btn-pos-select.active[data-pos="탱"] {
  background: rgba(59, 130, 246, 0.15);
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.3);
}

.btn-pos-select.active[data-pos="딜"] {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.28);
}

.btn-pos-select.active[data-pos="힐"] {
  background: rgba(16, 185, 129, 0.13);
  color: #065f46;
  border-color: rgba(16, 185, 129, 0.3);
}

.btn-pos-select.active[data-pos="자유"] {
  background: rgba(100, 116, 139, 0.15);
  color: #475569;
  border-color: rgba(100, 116, 139, 0.3);
}

.voter-position-tag {
  display: inline-block;
  padding: 0 0.25rem;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 700;
  margin-left: 0.25rem;
  border: 1px solid transparent;
}

.voter-position-tag[data-position="탱"] {
  background: rgba(59, 130, 246, 0.15);
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.3);
}

.voter-position-tag[data-position="딜"] {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.28);
}

.voter-position-tag[data-position="힐"] {
  background: rgba(16, 185, 129, 0.13);
  color: #065f46;
  border-color: rgba(16, 185, 129, 0.3);
}

.voter-position-tag[data-position="자유"] {
  background: rgba(100, 116, 139, 0.15);
  color: #475569;
  border-color: rgba(100, 116, 139, 0.3);
}

/* Vote Layout Adjustments */
.vote-mgmt-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  width: 100%;
}

.vote-list-section {
  flex: 1;
  min-width: 0;
}

.vote-creator-panel-wrapper {
  width: 380px;
  flex-shrink: 0;
  position: sticky;
  top: 2rem;
}

@media (max-width: 1024px) {
  .vote-mgmt-layout {
    flex-direction: column-reverse;
  }

  .vote-creator-panel-wrapper {
    width: 100% !important;
    position: static !important;
  }
}

/* Custom Datetime Picker Style */
input[type="datetime-local"] {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  font-family: var(--font-ow);
  cursor: pointer;
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s, background-color 0.2s;
}

input[type="datetime-local"]:focus {
  border-color: var(--color-accent);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Make calendar icon color blend with theme (blue) */
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  filter: invert(30%) sepia(80%) saturate(1500%) hue-rotate(200deg) brightness(90%) contrast(100%);
  opacity: 0.8;
  transition: opacity 0.2s;
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

/* Mobile Responsive Optimizations */

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mobile-toggle-btn {
  display: none;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 25;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.sidebar-backdrop.active {
  display: block;
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
}

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

  .file-explorer {
    height: auto;
    min-height: auto;
  }

  .explorer-card {
    height: 300px;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 14px;
  }

  .sidebar {
    left: -260px;
    z-index: 30;
    transition: none;
    /* 새로고침 시 스르륵 사라지는 현상 방지 */
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.15);
    top: 0;
    bottom: 0;
    height: 100vh;
    height: 100dvh;
  }

  .sidebar-brand {
    padding: 1.25rem 1rem;
  }

  .menu-item {
    padding: 0.75rem 1.15rem;
    font-size: 0.95rem;
    border-radius: 10px;
  }

  .sidebar-footer {
    padding: 1rem;
  }

  .sidebar.open {
    left: 0;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* 열릴 때만 자연스럽게 슬라이드 */
  }

  /* 모바일 CPU/MEM 미니 스탯 숨김 및 타이틀 구조 보존 */
  .system-mini-stats {
    display: none !important;
  }

  /* 모바일 대시보드 스탯 폰트 조절 */
  .dashboard-stat-value {
    font-size: 1.3rem !important;
  }

  .dashboard-stats-vertical .dashboard-stat-value {
    font-size: 1.15rem !important;
    word-break: break-all;
  }

  /* 모바일 내프로필 티어정보 셀 높이 및 간격 조절 */
  .profile-tiers-table th,
  .profile-tiers-table td {
    padding: 0.85rem 0.35rem !important;
    /* 패딩을 여유있게 늘려 공간 확보 */
  }

  .tier-select-container select {
    padding: 0.35rem !important;
    font-size: 0.8rem !important;
  }

  .main-content-wrapper {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
    padding: 1.25rem;
  }

  .mobile-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 8px;
    transition: var(--transition-fast);
  }

  .mobile-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.05);
  }

  .mobile-toggle-btn i {
    width: 24px;
    height: 24px;
  }

  /* Profile Header Mobile Optimization */
  .profile-header-strip {
    flex-direction: column;
    text-align: center;
    align-items: center;
    padding: 1.5rem !important;
    gap: 1.2rem;
    height: auto !important;
  }

  .profile-header-strip>div {
    padding-left: 0 !important;
    align-items: center;
  }

  .profile-username {
    justify-content: center;
    font-size: 2rem !important;
  }

  .profile-positions-grid {
    grid-template-columns: 1fr;
  }

  .profile-positions-grid .position-card {
    height: auto;
    min-height: 180px;
    padding: 1.25rem;
  }
}

@media (max-width: 600px) {

  /* Member Management Modal form stacking on mobile */
  #mgmt-member-modal form>div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  #mgmt-member-modal fieldset>div[style*="grid-template-columns: repeat(3, 1fr)"] {
    grid-template-columns: 1fr !important;
  }

  #mgmt-member-modal fieldset table th,
  #mgmt-member-modal fieldset table td {
    padding: 0.4rem 0.2rem !important;
    font-size: 0.8rem !important;
  }
}

@media (max-width: 480px) {
  .login-box {
    padding: 1.75rem 1.25rem !important;
    margin: 1rem;
    max-width: 92%;
  }
}

/* Management Table Style */
.mgmt-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-size: 0.9rem;
}

.mgmt-table th,
.mgmt-table td {
  padding: 0.8rem 0.6rem;
  border: 1px solid var(--border-light);
  white-space: nowrap;
}

.mgmt-table th {
  background: rgba(0, 0, 0, 0.03);
  font-weight: 600;
  color: var(--color-accent);
}

.mgmt-table tr:hover td {
  background: rgba(0, 0, 0, 0.015);
}

/* Tier Select container default styles */
.tier-select-container {
  display: flex;
  gap: 0.35rem;
  max-width: 240px;
  margin: 0 auto;
  width: 100%;
}

/* Responsive updates for tables and select containers */
@media (max-width: 768px) {
  .profile-tiers-table {
    font-size: 0.85rem !important;
  }

  .profile-tiers-table th,
  .profile-tiers-table td {
    padding: 0.6rem 0.35rem !important;
  }

  .tier-select-container {
    flex-direction: column;
    gap: 0.2rem;
    align-items: center;
  }

  .tier-select-container select {
    width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
    font-size: 0.75rem !important;
    padding: 0.25rem !important;
    text-align-last: center;
  }
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-main);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.theme-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: var(--border-glow);
  color: var(--color-accent);
}

body.dark-theme .theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.04);
}

/* Dark Theme Adjustments */
body.dark-theme .sidebar {
  background: rgba(15, 23, 42, 0.85);
}

body.dark-theme .sidebar-brand h2 {
  background: linear-gradient(135deg, #ffffff, #6366f1);
  -webkit-background-clip: text;
}

body.dark-theme .menu-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

body.dark-theme .menu-item.active {
  background: rgba(99, 102, 241, 0.15);
}

body.dark-theme .user-card {
  background: rgba(255, 255, 255, 0.02);
}

body.dark-theme .user-card:hover {
  background: rgba(255, 255, 255, 0.04);
}

body.dark-theme .stats-table-wrapper {
  background: rgba(15, 23, 42, 0.6);
}

body.dark-theme .stats-table-wrapper th {
  background: rgba(255, 255, 255, 0.03);
}

body.dark-theme .video-card {
  background: rgba(30, 41, 59, 0.8);
}

body.dark-theme .file-list-container {
  background: rgba(15, 23, 42, 0.6);
}

body.dark-theme .file-item:hover {
  background: rgba(255, 255, 255, 0.02);
}

body.dark-theme .file-item.active {
  background: rgba(99, 102, 241, 0.15);
}

body.dark-theme .file-item.selected {
  background: rgba(99, 102, 241, 0.08);
}

body.dark-theme .btn-outline {
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.15);
}

body.dark-theme .btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
}

body.dark-theme .form-input,
body.dark-theme .form-select,
body.dark-theme .form-textarea {
  background: rgba(15, 23, 42, 0.65);
  color: #f8fafc;
}

body.dark-theme .form-input:focus,
body.dark-theme .form-select:focus,
body.dark-theme .form-textarea:focus {
  background: rgba(15, 23, 42, 0.85);
}

body.dark-theme .btn-pos-select {
  background: rgba(15, 23, 42, 0.6);
}

body.dark-theme .btn-pos-select:hover {
  background: rgba(255, 255, 255, 0.05);
}

body.dark-theme .vote-voter-chip {
  background: rgba(15, 23, 42, 0.8);
  color: #f8fafc;
}

body.dark-theme .vote-option-item {
  background: rgba(255, 255, 255, 0.02);
}

body.dark-theme .vote-option-item:hover:not(.disabled) {
  background: rgba(99, 102, 241, 0.05);
}

body.dark-theme .vote-option-item.selected {
  background: rgba(99, 102, 241, 0.08);
}

body.dark-theme .vote-option-progress-bg {
  background: rgba(99, 102, 241, 0.08);
}

body.dark-theme .vote-option-item.selected .vote-option-progress-bg {
  background: rgba(99, 102, 241, 0.15);
}

body.dark-theme .progress-item-card {
  background: rgba(30, 41, 59, 0.5);
  border-color: var(--border-light);
  color: #f8fafc;
}

body.dark-theme .progress-bar-bg {
  background: rgba(255, 255, 255, 0.1);
}

/* Dark Theme Pastel Buttons */
body.dark-theme .btn-primary {
  background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

body.dark-theme .btn-success {
  background: linear-gradient(135deg, #34d399 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

body.dark-theme .btn-danger {
  background: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

body.dark-theme .btn-warning {
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

body.dark-theme .btn-youtube {
  background: linear-gradient(135deg, #fd4655 0%, #f35066 100%);
  box-shadow: 0 4px 12px rgba(248, 113, 113, 0.3);
}

/* Uploader Login & Connect Buttons */
#uploader-connect-btn,
#uploader-login-submit {
  background: linear-gradient(135deg, #93c5fd 0%, #60a5fa 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(96, 165, 250, 0.3) !important;
}

body.dark-theme #uploader-connect-btn,
body.dark-theme #uploader-login-submit {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
}

/* Dark Theme Hero Badges readability overrides */
body.dark-theme .hero-badge {
  background: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.4);
}

body.dark-theme .profile-positions-grid>div:nth-child(2) .hero-badge {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.35);
}

body.dark-theme .profile-positions-grid>div:nth-child(3) .hero-badge {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.35);
}

/* Tier Select Dropdowns styling */
.tier-select-container select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: rgba(255, 255, 255, 0.8) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 12px !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border-light) !important;
  outline: none;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
  font-size: 1.35rem !important;
  padding: 0.4rem 0 !important;
  text-align: center !important;
  text-align-last: center !important;
}

/* Ensure division dropdown is wide enough for centered text and arrow */
.tier-select-container select[id$="-lv"] {
  min-width: 75px !important;
}

/* Keep table cell sizes strictly fixed between edit and view modes */
.profile-tiers-table td,
#mgmt-member-modal table td {
  height: 60px !important;
  padding: 0 0.6rem !important;
  box-sizing: border-box;
  vertical-align: middle !important;
}

.tier-select-container select:focus {
  background: rgba(255, 255, 255, 0.95) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 12px !important;
  border-color: var(--color-accent) !important;
}

body.dark-theme .tier-select-container select {
  background: rgba(15, 23, 42, 0.8) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 12px !important;
  color: #f8fafc !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

body.dark-theme .tier-select-container select:focus {
  background: rgba(15, 23, 42, 0.95) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 12px !important;
  border-color: var(--color-accent) !important;
}

.most-hero-select {
  width: 75% !important;
  margin: 0 auto 0.75rem;
  display: block;
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: rgba(255, 255, 255, 0.8) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 10px !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border-light) !important;
  outline: none;
  border-radius: 99px !important;
  cursor: pointer;
  transition: var(--transition-fast);
  padding: 0.5rem 0 !important;
  text-align: center !important;
  text-align-last: center !important;
}

.most-hero-select:focus {
  background: rgba(255, 255, 255, 0.95) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 10px !important;
  border-color: var(--color-accent) !important;
}

body.dark-theme .most-hero-select {
  background: rgba(15, 23, 42, 0.8) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 10px !important;
  color: #f8fafc !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

body.dark-theme .most-hero-select:focus {
  background: rgba(15, 23, 42, 0.95) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 10px !important;
  border-color: var(--color-accent) !important;
}

/* Remove bottom margin from the last hero select dropdown in the list */
.most-hero-select:last-of-type {
  margin-bottom: 0 !important;
}

/* Reset dropdown popup option elements alignment and padding */
.tier-select-container select option,
.most-hero-select option {
  padding: 0 !important;
  text-align: center !important;
  background-color: #1e293b;
  color: #ffffff;
  text-indent: 0 !important;
}

/* Mobile Layout for Home Cards and Stats Grid */
@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Dashboard Two Column Layout */
.dashboard-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.dashboard-left-pane {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.dashboard-stats-vertical {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.services-list-vertical {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dashboard-right-pane {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.dashboard-right-pane .console-panel {
  flex-grow: 1;
  height: 100%;
  max-height: none;
  min-height: 450px;
}

/* Dashboard Spacing & Readability Optimization */
.dashboard-left-pane .services-section-title {
  margin-top: 0.5rem;
  margin-bottom: 0.2rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-dark);
}

.dashboard-stats-vertical .system-dashboard-stat {
  padding: 1.25rem 1.1rem;
  border-radius: 12px;
  box-shadow: var(--shadow-main);
  border: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.dashboard-stats-vertical .system-dashboard-stat::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 5px;
  /* Thicker accent bar */
}

.dashboard-stats-vertical .dashboard-stat-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.dashboard-stats-vertical .dashboard-stat-value {
  font-size: 1.45rem;
  /* Clean, compact, highly legible font size */
  font-weight: 800;
  color: var(--text-dark);
  font-family: var(--font-ow);
  word-break: keep-all;
}

.services-list-vertical .service-card {
  padding: 1.25rem;
  border-radius: 14px;
  gap: 0.8rem;
  background: var(--bg-dark-panel);
  box-shadow: var(--shadow-main);
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.services-list-vertical .service-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
  font-family: var(--font-ow);
}

.services-list-vertical .service-desc {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
  font-weight: 500;
}

.services-list-vertical .service-actions {
  margin-top: 0.4rem;
}

/* Console Log View Optimization */
.dashboard-right-pane .console-panel {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  padding: 1.5rem;
}

.dashboard-right-pane .console-body {
  border-radius: 10px;
  padding: 1.2rem;
  font-size: 0.8rem;
  line-height: 1.6;
  font-family: 'Fira Code', Consolas, Monaco, monospace;
  background-color: #0b0f19;
  /* Deeper dark background for logs */
  border: 1px solid rgba(255, 255, 255, 0.05);
  flex-grow: 1;
  /* 남는 하단 공간을 가득 채우도록 변경 */
  height: 0;
  /* flex 상속 세로 크기 계산 활성화 */
  min-height: 0;
  overflow-y: auto;
  /* 내용이 넘칠 때 세로 스크롤 활성화 */
}

.dashboard-right-pane .log-line {
  color: #d1d5db;
  /* Softer white to prevent eye fatigue */
}

@media (max-width: 1024px) {
  .dashboard-two-col {
    grid-template-columns: 1fr;
  }

  .dashboard-right-pane {
    position: static;
    height: auto;
  }
}

@media (max-width: 768px) {
  .dashboard-stats-vertical {
    grid-template-columns: 1fr;
  }
}

/* Number input spinner (up/down arrows) removal */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

/* Switch Toggle Styling */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-round {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-light, rgba(0, 0, 0, 0.1));
  transition: var(--transition-fast);
  border-radius: 24px;
  border: 1px solid var(--border-light);
}

.slider-round:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  transition: var(--transition-fast);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.switch-toggle input:checked+.slider-round {
  background-color: var(--color-accent, #2563eb);
  border-color: var(--color-accent, #2563eb);
}

.switch-toggle input:checked+.slider-round:before {
  transform: translateX(20px);
}

/* Clan Member Management Sub-tabs Styling */
.btn-mgmt-tab {
  background: rgba(0, 0, 0, 0.03) !important;
  border: 1px solid var(--border-light) !important;
  color: var(--text-muted) !important;
  box-shadow: none !important;
  transition: var(--transition-fast);
}

body.dark-theme .btn-mgmt-tab {
  background: rgba(255, 255, 255, 0.03) !important;
  color: var(--text-muted) !important;
}

.btn-mgmt-tab:hover {
  background: rgba(0, 0, 0, 0.06) !important;
  color: var(--text-main) !important;
}

body.dark-theme .btn-mgmt-tab:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--text-main) !important;
}

.btn-mgmt-tab.active {
  background: var(--color-accent) !important;
  border-color: var(--color-accent) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2) !important;
}

body.dark-theme .btn-mgmt-tab.active {
  background: var(--color-accent) !important;
  border-color: var(--color-accent) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25) !important;
}