:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --panel: #eaf3ff;
  --border: #c7d9ff;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #3b82f6;
  --danger: #dc2626;
  --success: #16a34a;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --canvas-bg: #ffffff;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1024;
  --panel: #131f3c;
  --border: #223659;
  --text: #f7fafc;
  --muted: #c4ccdc;
  --accent: #5f87ff;
  --danger: #f87171;
  --success: #34d399;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --canvas-bg: #05070f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  font-family: "Inter", "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at 25% 20%, rgba(120, 160, 255, 0.16), transparent 32%),
    radial-gradient(circle at 80% 10%, rgba(170, 200, 255, 0.14), transparent 28%),
    radial-gradient(circle at 60% 70%, rgba(90, 120, 255, 0.1), transparent 35%),
    linear-gradient(160deg, #0b1024 0%, #111831 48%, #1a2550 100%);
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: #e8eef8;
  border-right: 1px solid #c7d3e8;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

:root[data-theme="dark"] .sidebar {
  background: #15233f;
  border-right-color: #2a3f63;
}

.brand {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0px 0;
  margin-bottom: 0.1rem;
}

.brand-logo {
  max-width: 1500px;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.25));
}

.profile-card {
  border: 1px solid #c7d3e8;
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  background: #f7f9fc;
  margin-bottom: 1rem;
}

:root[data-theme="dark"] .profile-card {
  border-color: #2a3f63;
  background: #182a4a;
}

.avatar {
  font-size: 2rem;
  margin-bottom: 0.4rem;
}

.profile-text {
  font-weight: 600;
}

.profile-subtext {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.license-btn {
  width: 100%;
  margin-top: 0.6rem;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  border: 1px solid #2e3a55;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

:root[data-theme="dark"] .license-btn {
  border-color: #2e3a55;
}

.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.7rem;
}

.profile-card .ghost {
  border-color: #2e3a55;
}

.profile-avatar img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--border);
}

.avatar-fallback {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--border);
  color: var(--text);
  font-size: 1.6rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar-nav button {
  text-align: left;
  padding: 0.55rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 1.15rem;
  cursor: pointer;
  transition: background-color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}

.sidebar-nav button:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(4px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.sidebar-nav .nav-btn.active {
  background: rgba(59, 130, 246, 0.18);
  transform: translateX(6px);
  box-shadow: 0 8px 22px rgba(59, 130, 246, 0.2);
}

:root[data-theme="dark"] .sidebar-nav button:hover {
  background: rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .sidebar-nav .nav-btn.active {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

.main-area {
  flex: 1;
  padding: 1rem 1.5rem 3rem;
}

.content-view.hidden {
  display: none;
}

.content-view.placeholder {
  width: 100%;
}

.content-view {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.placeholder {
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 2rem;
  min-height: calc(100vh - 120px);
}

.placeholder-card {
  border: 1px dashed #c5cee2;
  border-radius: 16px;
  padding: 3rem;
  text-align: center;
  background: #f1f4fa;
  color: var(--muted);
  width: 100%;
  max-width: 1200px;
}

:root[data-theme="dark"] .placeholder-card {
  border-color: #3d475f;
  background: #0e1627;
}

.placeholder-card h2 {
  margin-bottom: 0.5rem;
  color: var(--text);
}

.page-header {
  width: 100%;
  margin: 0 0 0.75rem;
  padding: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.title-logo-wrap {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0;
}

.title-logo {
  max-height: 60px;
  width: auto;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.2));
}

.page-header h1 {
  margin: 0;
  font-size: 1.8rem;
}

.page-header .subtitle {
  margin: 0.3rem 0 0;
  color: var(--muted);
}

.run-info {
  text-align: right;
  color: var(--muted);
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.run-detail {
  margin-top: 0.75rem;
  padding: 0.5rem 0.25rem 0.25rem;
}

.run-detail-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--border);
}

.run-detail-left {
  display: grid;
  gap: 6px;
}

.run-meta-row {
  display: flex;
  gap: 8px;
  font-size: 0.95rem;
}

.run-meta-row .meta-label {
  color: var(--muted);
  min-width: 80px;
}

.run-meta-row .meta-value {
  color: var(--text);
  word-break: break-all;
}

.run-detail-right {
  text-align: right;
}

.run-detail-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 0.75rem;
}

.run-detail-minimap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.result-block {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem;
  background: var(--panel);
}

.result-title {
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.result-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.result-list li {
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--canvas-bg);
}

.result-text {
  font-weight: 600;
  margin-bottom: 4px;
  word-break: break-all;
}

.result-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--muted);
  gap: 8px;
}

.result-meta .tag {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text);
  font-weight: 600;
}

:root[data-theme="dark"] .result-meta .tag {
  background: rgba(255, 255, 255, 0.08);
}
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.2rem;
}

.settings-panel {
  width: 100%;
  min-height: calc(100vh - 200px);
}

.license-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.license-plans {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
}

.plan-card {
  width: 220px;
  min-height: 420px;
  text-align: center;
  background: #f5f5f5;
  color: #1e1e1e;
  font-family: "Inter", "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

:root[data-theme="dark"] .plan-card {
  background: #111d38;
  color: #e5e7eb;
  border-color: #223659;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.plan-card .plan-title {
  padding: 18px 12px 10px;
  font-size: 1.2rem;
  font-weight: 800;
}

.plan-card .plan-price-wrap {
  padding: 10px 0 6px;
  background: #1e1e1e;
  color: #c7c6c6;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.35);
}

:root[data-theme="dark"] .plan-card .plan-price-wrap {
  background: #0c1427;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.5);
}

.plan-card .plan-price {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 800;
}

.plan-card .plan-desc {
  margin: 0;
  font-size: 0.95rem;
  color: #9da3ae;
}

.plan-card .plan-benefits {
  list-style: none;
  padding: 0 0 0 24px;
  margin: 18px 0 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plan-card .plan-benefits li {
  font-size: 0.95rem;
  color: inherit;
}

.plan-card .plan-actions {
  padding: 14px 0 18px;
}

.plan-card .plan-actions button {
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  color: #f9fafb;
  background: linear-gradient(90deg, #5f03f4, #2b2bff, #3838ff, #5f03f4);
  transition: box-shadow 0.15s ease-in-out, transform 0.08s ease;
}

.plan-card .plan-actions button:hover {
  box-shadow: 0 0 15px 0 #3838ff;
  transform: translateY(-1px);
}

.plan-card .plan-actions button:active {
  transform: translateY(0);
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.admin-tab {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
}

.admin-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.admin-panel .placeholder-card {
  max-width: none;
}

.finance-section {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.line-chart svg {
  width: 100%;
  height: 220px;
}

.axis {
  stroke: var(--border);
  stroke-width: 0.8;
}

.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.4;
}

.chart-point {
  fill: #1d4ed8;
  stroke: #0b236b;
  stroke-width: 0.4;
}

.chart-label {
  font-size: 8px;
  fill: var(--muted);
  text-anchor: middle;
}

.chart-value {
  font-size: 8px;
  fill: var(--text);
  text-anchor: middle;
}

.mini-chart {
  display: none;
}

.bar-row {
  display: grid;
  grid-template-columns: 60px 1fr 120px;
  gap: 0.6rem;
  align-items: center;
}

.bar-track {
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  height: 12px;
}

.bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}

.bar-label {
  font-weight: 600;
}

.bar-value {
  text-align: right;
  font-weight: 700;
}

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

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.92rem;
}

input,
select {
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
  border: 1px solid #353f52;
  background: #fff;
  color: var(--text);
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] select {
  background: #0b1220;
  border-color: #353f52;
}

.form-actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.progress {
  flex: 1;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

#status-label {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.progress-percent {
  font-weight: 700;
}

.tolerance-slider {
  margin-top: 0.6rem;
  padding: 0.65rem 0 0.35rem;
}

.tolerance-track {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 13px;
  box-sizing: border-box;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
}

.tolerance-slider input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: #1f2434;
  outline: none;
  margin-top: 0.5rem;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 3px 10px rgba(0, 0, 0, 0.3);
  overflow: visible;
}

.tolerance-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e5e7eb;
  border: 3px solid #0f172a;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  margin-top: -11px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.tolerance-slider input[type="range"]:focus-visible::-webkit-slider-thumb,
.tolerance-slider input[type="range"]:active::-webkit-slider-thumb {
  transform: translateY(-1px);
  box-shadow: 0 9px 22px rgba(0, 0, 0, 0.45);
}

.tolerance-slider input[type="range"]::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e5e7eb;
  border: 3px solid #0f172a;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.tolerance-slider input[type="range"]:focus-visible::-moz-range-thumb,
.tolerance-slider input[type="range"]:active::-moz-range-thumb {
  transform: translateY(-1px);
  box-shadow: 0 9px 22px rgba(0, 0, 0, 0.45);
}

.tolerance-slider input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: #1f2434;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 3px 10px rgba(0, 0, 0, 0.3);
}


.file-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem;
  align-items: center;
}

.file-btn {
  border: 1px solid #334155;
  background: #1e293b;
  color: #fff;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
}

:root[data-theme="light"] .file-btn {
  background: #dbeafe;
  color: #0f172a;
  border-color: #c7d9ff;
}

.hidden-file-input {
  display: none;
}

progress {
  width: 100%;
  height: 10px;
  appearance: none;
  border-radius: 999px;
  overflow: hidden;
}

progress::-webkit-progress-bar {
  background: var(--border);
}

progress::-webkit-progress-value {
  background: var(--accent);
  transition: width 0.4s ease;
}

progress::-moz-progress-bar {
  transition: width 0.4s ease;
}

.btn-group {
  display: flex;
  gap: 0.6rem;
}

button {
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button[type="submit"] {
  background: var(--accent);
  color: #fff;
}

button.danger {
  background: #dc2626;
  color: #fff;
}

button.danger:hover {
  background: #b91c1c;
}

button.alt {
  background: #334155;
  color: #fff;
}

button.ghost {
  background: transparent;
  border: 1px dashed #475569;
  color: var(--muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 999;
  opacity: 0;
  transition: opacity 520ms ease;
}

.modal-backdrop.show {
  opacity: 1;
}

.modal-backdrop.fullscreen {
  backdrop-filter: blur(2px);
}

.auth-modal {
  position: relative;
  width: min(540px, 95%);
  padding: 0.25rem;
  background: transparent;
  border: none;
  box-shadow: none;
  display: flex;
  justify-content: center;
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  transition: opacity 520ms ease, transform 520ms ease;
}

.modal-backdrop.show .auth-modal {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.auth-card {
  width: 100%;
  max-width: 540px;
  background: #ffffff;
  border: 1px solid #dfe5f5;
  border-radius: 18px;
  padding: 22px 22px 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
  position: relative;
  overflow: hidden;
}

.auth-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 10%, rgba(93, 139, 255, 0.12), transparent 35%),
    radial-gradient(circle at 90% 15%, rgba(45, 121, 243, 0.12), transparent 28%);
  pointer-events: none;
}

:root[data-theme="dark"] .auth-card {
  background: #111d38;
  border-color: #223659;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 26px;
  height: 26px;
  min-width: 0;
  border-radius: 50%;
  border: 1px solid #cbd5e1;
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a !important;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  z-index: 2;
  padding: 0;
}

:root[data-theme="dark"] .modal-close {
  background: rgba(17, 24, 39, 0.92);
  color: #e5e7eb !important;
  border-color: #334155;
}

.auth-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
  position: relative;
  z-index: 1;
}

.auth-chip {
  align-self: flex-start;
  background: rgba(45, 121, 243, 0.12);
  color: #2d79f3;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
}

:root[data-theme="dark"] .auth-chip {
  background: rgba(95, 155, 255, 0.16);
  color: #9cc0ff;
}

.auth-header h3 {
  margin: 0;
  font-size: 1.5rem;
}

.auth-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.terms-field {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
}
.terms-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
}
.terms-checkbox input {
  width: 16px;
  height: 16px;
}
.terms-content {
  max-height: 60vh;
  overflow: auto;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  color: #0f172a;
  line-height: 1.6;
  white-space: pre-wrap;
}
:root[data-theme="dark"] .terms-content {
  background: #0b1529;
  border-color: #1e293b;
  color: #e2e8f0;
}
.terms-pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: inherit;
}
.terms-inline-link {
  color: #2d79f3;
  font-weight: 700;
  text-decoration: underline;
}
:root[data-theme="dark"] .terms-inline-link {
  color: #8ab4ff;
}
.terms-modal .auth-card {
  max-width: 720px;
}

.auth-form {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.75rem;
}

.auth-form label.input-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
  color: var(--text);
  font-weight: 700;
  font-size: 0.95rem;
}

.auth-form label.input-row input {
  height: 48px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  padding: 0 12px;
  color: #0f172a;
  font-size: 1rem;
}

:root[data-theme="dark"] .auth-form label.input-row input {
  border-color: #1f2a43;
  background: #0d1426;
  color: #e5e7eb;
}

.auth-form label.input-row input::placeholder {
  color: #9ca3af;
}

:root[data-theme="dark"] .auth-form label.input-row input::placeholder {
  color: #6b7280;
}

.auth-form .primary {
  width: 100%;
  height: 50px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 1rem;
}

.auth-form .ghost.block {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.auth-field label {
  color: var(--text);
  font-weight: 600;
}

.auth-input {
  border: 1.5px solid #ecedec;
  border-radius: 12px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.6);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-input svg {
  opacity: 0.7;
}

.auth-icon {
  fill: currentColor;
}

.auth-icon.light {
  color: #ffffff;
}

.auth-input input {
  border: none;
  width: 100%;
  height: 100%;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
}

.auth-input input::placeholder {
  color: #9ca3af;
}

:root[data-theme="dark"] .auth-input input::placeholder {
  color: #6b7280;
}

.auth-input input:focus {
  outline: none;
}

.auth-input:focus-within {
  border: 1.5px solid #2d79f3;
  box-shadow: 0 0 0 4px rgba(45, 121, 243, 0.14);
}

:root[data-theme="dark"] .auth-input {
  border-color: #1f2a43;
  background: #111a2f;
}

:root[data-theme="dark"] .auth-input:focus-within {
  border-color: #5f9bff;
  box-shadow: 0 0 0 4px rgba(95, 155, 255, 0.16);
}

.auth-extra-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.95rem;
  padding: 0 2px;
}

.auth-extra-row .remember-check {
  display: inline-flex;
  align-items: center;
  flex-direction: row;
  gap: 8px;
  margin: 0;
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}

.auth-extra-row .remember-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #2d79f3;
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
}

.link-btn.small {
  padding: 0;
  font-size: 0.95rem;
  font-weight: 600;
  margin-left: auto;
}

.auth-submit {
  margin: 4px 0 6px;
  background-color: #151717;
  border: none;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 12px;
  height: 52px;
  width: 100%;
  cursor: pointer;
  padding: 0 1rem;
  transition: transform 0.08s ease, box-shadow 0.15s ease, opacity 0.2s;
}

.auth-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(21, 23, 23, 0.25);
}

.auth-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-switch {
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0.35rem 0 0.2rem;
}

.link-btn {
  border: none;
  background: transparent;
  color: #2d79f3;
  font-weight: 700;
  cursor: pointer;
  padding: 0 0.25rem;
}

.link-btn:hover {
  text-decoration: underline;
}

.auth-error {
  margin-top: -0.1rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  color: #e5e7eb;
  background: #4b5563;
}

.badge.success {
  background: #10b981;
  color: #042f2e;
}

.badge.muted {
  background: #374151;
  color: #c7cbd2;
}

.badge.clickable {
  cursor: pointer;
  border: none;
}

.save-btn {
  background: #404655;
  color: #d1d5db;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #4b5563;
  font-weight: 700;
  cursor: not-allowed;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.save-btn.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  cursor: pointer;
}

.save-btn.saved {
  background: #1d4ed8;
  color: #e0ecff;
}

.confirm-modal {
  background: #111827;
  color: #e5e7eb;
  padding: 20px;
  border-radius: 14px;
  border: 1px solid #1f2937;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  width: min(360px, 100%);
}

.confirm-modal h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.confirm-modal p {
  margin: 0 0 16px;
  color: #cbd5e1;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.server-control {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.success-text {
  color: var(--success);
}

.confirm-actions .ghost {
  border: 1px solid #4b5563;
  color: #e5e7eb;
}

.confirm-actions .danger {
  background: #ef4444;
  color: #fff;
  border: 1px solid #ef4444;
}

.faq-list {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 60vh;
  overflow-y: auto;
}

.faq-item {
  background: #1c2233;
  border: 1px solid #2a3042;
  border-radius: 10px;
  padding: 10px 14px;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  color: #e5e7eb;
}

.faq-item p {
  margin: 8px 0 4px;
  color: #cdd3dd;
  line-height: 1.5;
}

.notice-section .section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.notice-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  max-height: 60vh;
  overflow-y: auto;
}

.notice-card {
  background: #1c2233;
  border: 1px solid #2a3042;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.notice-card h4 {
  margin: 0 0 6px;
  color: #e5e7eb;
}

.notice-card p {
  margin: 0;
  color: #cdd3dd;
  line-height: 1.5;
}

.notice-card.pinned {
  border-color: #3b82f6;
  box-shadow: 0 6px 14px rgba(59, 130, 246, 0.25);
}

.notice-list.edit-mode .notice-card {
  box-shadow: none;
}

.notice-card input,
.notice-card textarea {
  width: 100%;
  background: #121828;
  border: 1px solid #2f3547;
  color: #e5e7eb;
  border-radius: 8px;
  padding: 8px 10px;
}

.notice-card textarea {
  min-height: 70px;
  resize: vertical;
}

.notice-card .notice-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.notice-card .save-btn {
  white-space: nowrap;
  min-width: 82px;
  flex-shrink: 0;
}

.traffic-chart {
  margin: 10px 0 16px;
  padding: 10px 12px;
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 10px;
  overflow-x: auto;
}

.traffic-svg {
  width: 1040px;
  height: 220px;
}

.traffic-x-labels text {
  font-size: 10px;
  fill: #9ca3af;
}

.traffic-meta {
  color: #9ca3af;
  font-size: 12px;
  margin-bottom: 6px;
}

.traffic-graph-wrapper {
  min-width: 1040px;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: rgba(59, 130, 246, 0.08);
}

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

.run-search input {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 8px;
  padding: 6px 10px;
  color: #e5e7eb;
  width: 200px;
}

.run-detail {
  margin-top: 12px;
  padding: 12px;
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 10px;
  color: #e5e7eb;
}

.faq-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.faq-edit-buttons {
  display: flex;
  gap: 8px;
}

.faq-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

.faq-edit-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #1c2233;
  border: 1px solid #2a3042;
  border-radius: 10px;
  padding: 10px;
}

.faq-edit-row input,
.faq-edit-row textarea {
  width: 100%;
  background: #121828;
  border: 1px solid #2f3547;
  color: #e5e7eb;
  border-radius: 8px;
  padding: 8px 10px;
}

.faq-edit-row textarea {
  min-height: 70px;
  resize: vertical;
}

.faq-edit-row .ghost {
  align-self: flex-start;
}

.error-text {
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.35);
  padding: 0.6rem 0.7rem;
  border-radius: 8px;
}

.helper-text {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0;
}

code {
  background: #11182a;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  color: var(--text);
}

.settings-section {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
}

.settings-section h3 {
  margin: 0 0 0.5rem;
}

.info-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.profile-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.profile-fields {
  flex: 1;
  min-width: 240px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
}

.profile-avatar {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: center;
}

.upload-btn {
  border: 1px dashed var(--border);
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
  background: transparent;
}

.upload-btn input {
  display: none;
}

.profile-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.profile-summary {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  align-items: flex-start;
}

.profile-lines {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 1rem;
}

.name-line strong {
  font-size: 1.1rem;
}

.info-line strong {
  margin-left: 0.2rem;
}

.status-text {
  font-size: 0.9rem;
}

.toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-weight: 600;
}

.muted {
  color: var(--muted);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: transparent;
  border: none;
  padding: 0.2rem 0;
  cursor: pointer;
  color: var(--text);
}

.switch-thumb {
  width: 44px;
  height: 24px;
  background: #d1d5db;
  border-radius: 999px;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  transition: background 0.2s ease;
}

.switch-thumb::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.switch.on .switch-thumb {
  background: #22c55e;
}

.switch.on .switch-thumb::after {
  transform: translateX(20px);
}

.switch-label {
  font-weight: 600;
  color: var(--text);
}

.summary-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.8rem;
}

.summary-card {
  padding: 0.8rem 1rem;
  border-radius: 10px;
  border: 1px solid #1f2937;
  background: #f3f6fb;
}

:root[data-theme="dark"] .summary-card {
  background: #0e1627;
}

.summary-card .label {
  color: var(--muted);
  font-size: 0.9rem;
}

.summary-card .value {
  font-size: 1.6rem;
  margin-top: 0.2rem;
}

.summary-card.timing small {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.minimap-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.minimap-column header {
  margin-bottom: 0.5rem;
  font-weight: 600;
}

canvas {
  width: 100%;
  height: auto;
  border-radius: 12px;
  background: var(--canvas-bg);
  border: 1px solid var(--border);
}

.tables-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.table-wrapper header {
  font-weight: 600;
  margin-bottom: 0.4rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  text-align: center;
}

thead {
  background: #e3e8f4;
}

:root[data-theme="dark"] thead {
  background: #1e2536;
}

th,
td {
  padding: 0.45rem 0.4rem;
  border-bottom: 1px solid #1f2535;
  border-right: 1px solid var(--border);
}

th:last-child,
td:last-child {
  border-right: none;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: rgba(59, 130, 246, 0.18);
}

tbody tr.selected {
  background: rgba(59, 130, 246, 0.35);
}

/* Smooth entrance for panels/sections */
@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.content-view > *, .panel, .settings-section, .placeholder-card, .admin-panel {
  animation: fadeSlideIn 420ms ease;
}

.license-plans {
  animation: fadeSlideIn 380ms ease;
}

.collapsible-enter {
  animation: fadeSlideIn 420ms ease forwards;
}

.collapsible-exit {
  animation: fadeSlideOut 420ms ease forwards;
}

@media (max-width: 720px) {
  .page-header {
    flex-direction: column;
    gap: 0.6rem;
  }

  .run-info {
    text-align: left;
  }

  .btn-group {
    width: 100%;
    flex-direction: column;
  }

  .summary-card.timing {
    grid-column: span 1;
  }

  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.8rem;
  }
}
