:root {
  --ui-font: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --ui-bg: #f3f5f7;
  --ui-bg-muted: #e7ecef;
  --ui-surface: #ffffff;
  --ui-surface-alt: #f8fafb;
  --ui-border: #d9e0e6;
  --ui-border-strong: #c5d0d8;
  --ui-text: #18222d;
  --ui-text-muted: #5e6b77;
  --ui-text-soft: #7d8994;
  --ui-accent: #0f766e;
  --ui-accent-strong: #115e59;
  --ui-accent-soft: #d8f0eb;
  --ui-warn: #b45309;
  --ui-warn-soft: #fff1df;
  --ui-danger: #b42318;
  --ui-danger-soft: #fde8e7;
  --ui-info: #155eef;
  --ui-info-soft: #e7f0ff;
  --ui-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  --ui-radius: 8px;
  --ui-radius-lg: 12px;
  --ui-gap: 20px;
}

html.dark-mode {
  --ui-bg: #0f1720;
  --ui-bg-muted: #15202b;
  --ui-surface: #101a24;
  --ui-surface-alt: #16222e;
  --ui-border: #243243;
  --ui-border-strong: #304255;
  --ui-text: #e6edf3;
  --ui-text-muted: #9eb0c2;
  --ui-text-soft: #7f93a8;
  --ui-accent: #17a398;
  --ui-accent-strong: #39c7b8;
  --ui-accent-soft: rgba(23, 163, 152, 0.16);
  --ui-warn: #f59e0b;
  --ui-warn-soft: rgba(245, 158, 11, 0.16);
  --ui-danger: #f87171;
  --ui-danger-soft: rgba(248, 113, 113, 0.15);
  --ui-info: #60a5fa;
  --ui-info-soft: rgba(96, 165, 250, 0.16);
  --ui-shadow: 0 18px 42px rgba(2, 8, 23, 0.42);
}

body,
body.ops-console {
  font-family: var(--ui-font);
  min-height:100vh;
  background: linear-gradient(180deg, #f6f8fa 0%, #eef2f5 100%) !important;
  color: var(--ui-text) !important;
}

html,
body,
body.ops-console {
  max-width: 100%;
  overflow-x: hidden !important;
  overflow-x: clip !important;
}

html::-webkit-scrollbar:horizontal,
body::-webkit-scrollbar:horizontal,
body.ops-console::-webkit-scrollbar:horizontal {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
  background: transparent !important;
}

html::-webkit-scrollbar-thumb:horizontal,
body::-webkit-scrollbar-thumb:horizontal,
body.ops-console::-webkit-scrollbar-thumb:horizontal,
html::-webkit-scrollbar-track:horizontal,
body::-webkit-scrollbar-track:horizontal,
body.ops-console::-webkit-scrollbar-track:horizontal,
html::-webkit-scrollbar-corner,
body::-webkit-scrollbar-corner,
body.ops-console::-webkit-scrollbar-corner {
  background: transparent !important;
  border: 0 !important;
}

html.dark-mode body,
html.dark-mode body.ops-console {
  background: linear-gradient(180deg, #0b1219 0%, #111b25 100%) !important;
}

.ops-backdrop {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(243, 245, 247, 0.7), rgba(238, 242, 245, 0.95)),
    linear-gradient(90deg, rgba(15, 118, 110, 0.03), transparent 35%, rgba(180, 83, 9, 0.03));
  z-index: -1;
}

html.dark-mode .ops-backdrop {
  background:
    radial-gradient(circle at top right, rgba(23, 163, 152, 0.12), transparent 32%),
    linear-gradient(180deg, rgba(11, 18, 25, 0.82), rgba(13, 22, 31, 0.96)),
    linear-gradient(90deg, rgba(96, 165, 250, 0.08), transparent 40%, rgba(245, 158, 11, 0.06));
}

.page-shell,
.dashboard-shell,
.ops-shell {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.ops-shell {
  width: min(100%, 1440px);
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 24px 40px;
  overflow-x: hidden;
  overflow-x: clip;
}

.dashboard-hero,
.feature-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 251, 0.98)) !important;
  border: 1px solid var(--ui-border) !important;
  border-radius: var(--ui-radius-lg);
  box-shadow: var(--ui-shadow);
  color: var(--ui-text) !important;
  padding: 28px;
}

html.dark-mode .dashboard-hero,
html.dark-mode .feature-hero {
  background: linear-gradient(180deg, rgba(16, 26, 36, 0.98), rgba(21, 32, 43, 0.98)) !important;
}

.dashboard-hero::before,
.feature-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto auto;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(15, 118, 110, 0.08), transparent 70%);
  pointer-events: none;
}

html.dark-mode .dashboard-hero::before,
html.dark-mode .feature-hero::before {
  background: radial-gradient(circle, rgba(23, 163, 152, 0.14), transparent 70%);
}

.dashboard-hero-grid,
.feature-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.9fr);
  gap: 24px;
  align-items: start;
}

.dashboard-kicker,
.feature-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--ui-accent-soft);
  color: var(--ui-accent-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dashboard-hero h1,
.feature-hero h1 {
  margin: 14px 0 8px;
  color: var(--ui-text);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.1;
  font-weight: 700;
}

.dashboard-hero p,
.feature-hero p,
.page-intro p,
.section-heading p,
.pulse-note,
.dashboard-item-subtitle,
.dashboard-item-time,
.recent-header .view-all {
  color: var(--ui-text-muted);
}

.dashboard-hero-pulse {
  display: grid;
  gap: 12px;
}

.pulse-card {
  background: var(--ui-surface-alt) !important;
  border: 1px solid var(--ui-border) !important;
  border-radius: var(--ui-radius);
  padding: 16px;
  min-height: 112px;
}

.pulse-label {
  color: var(--ui-text-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pulse-value {
  margin-top: 10px;
  color: var(--ui-text);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
}

.panel-surface,
.card,
.recent-card,
.project-card,
.stat-card,
.log-table-container,
.batch-card,
.modal-content,
.card.dark-card,
.stat-card-dark,
.recent-card.dark-card {
  background: var(--ui-surface) !important;
  border: 1px solid var(--ui-border) !important;
  border-radius: var(--ui-radius-lg) !important;
  box-shadow: var(--ui-shadow) !important;
  color: var(--ui-text) !important;
}

.panel-surface {
  padding: 20px;
}

.section-heading,
.recent-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-heading h2,
.recent-header h3 {
  color: var(--ui-text);
  font-size: 20px;
  font-weight: 700;
}

.stats-grid,
.recent-grid,
.dashboard-grid-two,
.dashboard-quick-actions-grid {
  gap: 18px !important;
}

.stats-grid > *,
.recent-grid > *,
.dashboard-grid-two > *,
.dashboard-hero-grid > *,
.dashboard-quick-actions-grid > *,
.panel-surface {
  min-width: 0;
}

.stats-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

.stats-grid-emphasis .stat-card,
.stats-grid-emphasis .stat-card-dark {
  min-height: 138px;
}

.stat-card,
.stat-card-dark {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 20px;
  border-radius: var(--ui-radius-lg);
}

.stat-icon,
.dashboard-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  flex: 0 0 52px;
  background: var(--ui-bg-muted);
  color: var(--ui-text);
}

.stat-icon-primary,
.dashboard-log-icon-success {
  background: #e0f2fe;
  color: #075985;
}

.stat-icon-success {
  background: #dcfce7;
  color: #166534;
}

.stat-icon-warning,
.dashboard-log-icon-warning {
  background: var(--ui-warn-soft);
  color: var(--ui-warn);
}

.stat-icon-info,
.dashboard-log-icon-error {
  background: var(--ui-info-soft);
  color: var(--ui-info);
}

.stat-value {
  color: var(--ui-text);
  font-size: 34px;
  line-height: 1;
  font-weight: 700;
}

.stat-label {
  margin-top: 4px;
  color: var(--ui-text-muted);
  font-size: 14px;
}

.stat-change {
  margin-top: 6px;
  color: var(--ui-text-soft);
  font-size: 13px;
}

.dashboard-quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-quick-actions-grid-inline {
  margin-top: 18px;
}

.dashboard-quick-actions-grid-inline:has(.dashboard-quick-action-btn:only-child) {
  grid-template-columns: minmax(180px, 240px) !important;
}

.dashboard-quick-action-btn,
.recent-item,
.dashboard-recent-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: var(--ui-radius);
  border: 1px solid var(--ui-border);
  background: var(--ui-surface-alt);
  color: var(--ui-text) !important;
  text-decoration: none;
}

.dashboard-quick-action-btn i {
  color: var(--ui-accent);
}

.dashboard-quick-action-btn span,
.recent-item span,
.dashboard-recent-item span,
.dashboard-item-title,
.dashboard-item-subtitle,
.dashboard-item-time,
.pulse-label,
.pulse-value,
.pulse-note,
.stat-value,
.stat-label,
.stat-change,
.section-title,
.section-heading h2,
.recent-header h3,
.recent-header .view-all {
  color: inherit;
}

.dashboard-hero h1,
.feature-hero h1,
.section-heading h2,
.recent-header h3,
.project-card-top h3,
.stat-value,
.pulse-value,
#feedbackSummary .stat-value {
  color: var(--ui-text) !important;
}

.dashboard-hero p,
.feature-hero p,
.section-heading p,
.recent-header .view-all,
.dashboard-item-subtitle,
.dashboard-item-time,
.pulse-note,
.pulse-label,
.stat-label,
.stat-change,
.project-card-top p,
.project-card-meta,
.card,
.panel-surface,
.recent-card,
.project-card,
.dashboard-quick-action-btn,
.dashboard-quick-action-btn span,
#feedbackSummary .stat-label,
#feedbackSummary .stat-change {
  color: var(--ui-text-muted) !important;
}

.dashboard-quick-action-btn,
.dashboard-quick-action-btn span,
.dashboard-item-title,
.recent-item .dashboard-item-title,
.dashboard-recent-item .dashboard-item-title,
.view-all,
.btn-secondary {
  color: var(--ui-text) !important;
}

.btn-primary,
.btn-primary i,
.btn-primary span {
  color: #ffffff !important;
}

.dashboard-quick-action-btn:hover,
.recent-item:hover,
.dashboard-recent-item:hover {
  border-color: var(--ui-border-strong);
  background: #f2f7f6;
  transform: none;
  box-shadow: none;
}

html.dark-mode .dashboard-quick-action-btn:hover,
html.dark-mode .recent-item:hover,
html.dark-mode .dashboard-recent-item:hover {
  background: #1b2834;
}

.btn,
.btn-primary,
.btn-secondary {
  min-height: 40px;
  border-radius: 8px;
  font-weight: 600;
  box-shadow: none !important;
}

.btn-primary {
  background: var(--ui-accent) !important;
  border: 1px solid var(--ui-accent) !important;
  color: #ffffff !important;
}

.btn-primary:hover {
  background: var(--ui-accent-strong) !important;
  border-color: var(--ui-accent-strong) !important;
}

.btn-secondary {
  background: #ffffff !important;
  border: 1px solid var(--ui-border-strong) !important;
  color: var(--ui-text) !important;
}

html.dark-mode .btn-secondary {
  background: var(--ui-surface-alt) !important;
}

.badge,
.badge-success,
.badge-danger,
.badge-warning,
.badge-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge-success {
  background: #dcfce7;
  color: #166534;
}

.badge-danger {
  background: #fee4e2;
  color: #b42318;
}

.badge-warning {
  background: var(--ui-warn-soft);
  color: var(--ui-warn);
}

.badge-info {
  background: var(--ui-info-soft);
  color: var(--ui-info);
}

.dashboard-alert-error,
.dashboard-alert-warning,
.dashboard-alert-info {
  border-radius: var(--ui-radius);
  padding: 14px;
  border: 1px solid var(--ui-border);
}

.dashboard-alert-error {
  background: var(--ui-danger-soft);
  color: var(--ui-danger);
}

.dashboard-alert-warning {
  background: var(--ui-warn-soft);
  color: var(--ui-warn);
}

.dashboard-alert-info {
  background: var(--ui-info-soft);
  color: var(--ui-info);
}

.dashboard-chart-wrapper,
.dark-chart {
  background: #fbfcfd;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
}

html.dark-mode .dashboard-chart-wrapper,
html.dark-mode .dark-chart {
  background: #121c26;
}

.recent-card {
  padding: 18px 20px;
}

.dashboard-item-title,
.recent-item .dashboard-item-title {
  color: var(--ui-text);
  font-weight: 600;
}

.project-card {
  padding: 18px;
}

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

.project-card-title-row {
  display: block;
  margin-bottom: 14px;
}

.project-card-title-row h3,
.project-card-top h3 {
  color: var(--ui-text);
  font-size: 18px;
  font-weight: 700;
}

.project-card-title-row p {
  margin-top: 8px;
  color: var(--ui-text-muted);
  overflow-wrap: anywhere;
}

.project-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 14px;
  color: var(--ui-text-muted);
  font-size: 13px;
}

.project-card-meta span {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  line-height: 1.5;
}

.project-card-meta strong {
  color: var(--ui-text);
  font-weight: 700;
}

.project-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--ui-border);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.project-delete-btn {
  margin-left: auto;
}

.project-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 16%, transparent);
}

.project-status-normal {
  background: rgba(16, 185, 129, 0.10);
  border-color: rgba(16, 185, 129, 0.28);
  color: #047857;
}

.project-status-locked {
  background: rgba(239, 68, 68, 0.10);
  border-color: rgba(239, 68, 68, 0.28);
  color: #b42318;
}

.feedback-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.feedback-filter-control {
  width: 132px;
  min-height: 42px;
}

.feedback-list {
  display: grid;
  gap: 12px;
}

.feedback-item {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 230px;
  gap: 16px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--ui-surface) 88%, transparent);
}

.feedback-item-topline,
.feedback-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.feedback-item-topline {
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.feedback-item h3 {
  margin: 0 0 10px;
  font-size: 17px;
  line-height: 1.35;
}

.feedback-item pre {
  max-height: 148px;
  overflow: auto;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ui-text-muted);
  font: 13px/1.65 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.feedback-status,
.feedback-type,
.feedback-time {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--ui-border);
  color: var(--ui-text-muted);
  font-size: 12px;
  font-weight: 700;
}

.feedback-status-pending {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
}

.feedback-status-processing {
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
}

.feedback-status-resolved {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.feedback-shot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 190px;
  height: auto;
  aspect-ratio: 1170 / 2532;
  align-self: start;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: rgba(2, 8, 23, 0.24);
  overflow: hidden;
}

.feedback-shot a,
.feedback-shot img {
  display: block;
  width: 100%;
  height: 100%;
}

.feedback-shot img {
  object-fit: contain;
}

.feedback-shot-empty {
  flex-direction: column;
  gap: 8px;
  color: var(--ui-text-muted);
  font-size: 12px;
  font-weight: 700;
}

.feedback-shot-count {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(2, 8, 23, 0.72);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.feedback-item-meta {
  align-items: flex-start;
  flex-direction: column;
  min-width: 0;
  padding-left: 14px;
  border-left: 1px solid var(--ui-border);
  color: var(--ui-text-muted);
  font-size: 12px;
}

.feedback-item-meta code,
.feedback-item-meta strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--ui-text);
  font-size: 12px;
}

.feedback-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
}

.feedback-actions .btn {
  justify-content: flex-start;
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
}

.feedback-danger-btn {
  border-color: rgba(239, 68, 68, 0.3);
  color: #b42318;
}

.feedback-reply {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 8px;
  background: rgba(15, 118, 110, 0.08);
}

.feedback-reply span {
  display: block;
  margin-bottom: 4px;
  color: var(--ui-text-muted);
  font-size: 12px;
  font-weight: 800;
}

.feedback-reply p {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.feedback-tree-toggle {
  width: fit-content;
  min-height: 34px;
  margin-top: 12px;
  padding: 7px 11px;
}

.feedback-tree-modal {
  position: fixed;
  inset: 0;
  z-index: 2600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(2, 8, 23, 0.68);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 160ms ease;
}

.feedback-tree-modal.show {
  opacity: 1;
}

.feedback-tree-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1080px, calc(100vw - 48px));
  height: min(760px, calc(100vh - 64px));
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: var(--ui-surface);
  color: var(--ui-text);
  box-shadow: 0 28px 90px rgba(2, 8, 23, 0.45);
  overflow: hidden;
  transform: translateY(10px) scale(0.98);
  transition: transform 160ms ease;
}

.feedback-tree-modal.show .feedback-tree-panel {
  transform: translateY(0) scale(1);
}

.feedback-tree-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--ui-border);
}

.feedback-tree-header h3,
.feedback-tree-header p {
  margin: 0;
}

.feedback-tree-header p {
  margin-top: 4px;
  color: var(--ui-text-muted);
  font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  overflow-wrap: anywhere;
}

.feedback-tree-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.feedback-tree-close {
  width: 42px;
  min-width: 42px;
  padding: 0;
  justify-content: center;
}

.feedback-tree-panel pre {
  overflow: auto;
  margin: 0;
  padding: 18px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ui-text);
  font: 13px/1.65 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.feedback-empty-state {
  border: 1px dashed var(--ui-border);
  border-radius: 8px;
}

.projects-stage .projects-grid {
  padding: 0;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  color: var(--ui-text-muted);
  font-size: 13px;
  font-weight: 600;
}

.version-label-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.inline-save-hint {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.10);
  color: #0f766e;
  font-size: 12px;
  font-weight: 700;
}

.inline-save-hint[hidden] {
  display: none;
}

.upload-success-modal {
  position: fixed;
  inset: 0;
  z-index: 2300;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms ease;
}

.upload-success-modal.show {
  opacity: 1;
}

.upload-success-card {
  min-width: 220px;
  padding: 24px 28px;
  border: 1px solid rgba(15, 118, 110, 0.20);
  border-radius: 8px;
  background: var(--ui-surface);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
  text-align: center;
  transform: translateY(8px) scale(0.98);
  transition: transform 160ms ease;
}

.upload-success-modal.show .upload-success-card {
  transform: translateY(0) scale(1);
}

.upload-success-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: #0f766e;
  font-size: 20px;
}

.upload-success-title {
  color: var(--ui-text);
  font-size: 18px;
  font-weight: 800;
}

.form-control {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--ui-border-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ui-text);
  padding: 10px 12px;
}

select.form-control {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='rgba(15,23,42,0.6)' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
  background-position: calc(100% - 14px) center;
  background-size: 15px;
  background-repeat: no-repeat;
  padding-right: 36px;
  cursor: pointer;
}

select.form-control option {
  background-color: #ffffff;
  color: rgba(15, 23, 42, 0.9);
}


html.dark-mode .form-control {
  background: var(--ui-surface-alt);
}

.form-control:focus {
  outline: none;
  border-color: var(--ui-accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.remember-me {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ui-text);
  font-size: 14px;
}

input[type="checkbox"] {
  appearance: auto;
  -webkit-appearance: checkbox;
  width: 16px !important;
  height: 16px !important;
  min-height: 16px !important;
  margin: 0;
  padding: 0;
  flex: 0 0 16px;
  background: #ffffff !important;
  border: 1px solid var(--ui-border-strong) !important;
  border-radius: 4px;
  vertical-align: middle;
}

html.dark-mode input[type="checkbox"] {
  background: var(--ui-surface-alt) !important;
  border-color: var(--ui-border-strong) !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(3, 7, 18, 0.62) !important;
  backdrop-filter: blur(10px);
}

.modal.show {
  display: flex !important;
}

.modal-content,
.modal-content.dark-modal {
  width: min(640px, calc(100vw - 32px));
  max-width: 640px;
  max-height: calc(100vh - 48px);
  overflow: hidden;
  margin: 0 auto;
  background: var(--ui-surface) !important;
  border-radius: 8px !important;
}

#projectModal .modal-header,
#projectModal .modal-body,
#projectModal .modal-footer {
  position: relative;
  z-index: 1;
  background: #ffffff !important;
}

html.dark-mode #projectModal .modal-header,
html.dark-mode #projectModal .modal-body,
html.dark-mode #projectModal .modal-footer {
  background: var(--ui-surface) !important;
}

#projectModal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px 14px;
  margin: 0;
  border-bottom: 1px solid var(--ui-border) !important;
}

#projectModal .modal-header h3 {
  margin: 0;
  color: var(--ui-text) !important;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 700;
}

#projectModal .modal-body {
  max-height: min(62vh, 560px);
  overflow: auto;
  padding: 18px 22px;
}

#projectModal .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--ui-border) !important;
}

#projectModal #projectForm {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

#projectModal .form-group {
  display: grid;
  gap: 6px;
  margin: 0;
  opacity: 1 !important;
}

#projectModal .form-label,
#projectModal .remember-me,
#projectModal .remember-me span {
  color: var(--ui-text) !important;
  opacity: 1 !important;
}

#projectModal .form-control,
#projectModal select.form-control,
#projectModal input.form-control {
  display: block;
  width: 100%;
  min-height: 44px;
  background: #ffffff !important;
  color: var(--ui-text) !important;
  border: 1px solid var(--ui-border-strong) !important;
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: none !important;
}

#projectModal .form-group:first-child,
#projectModal .form-group:last-child {
  grid-column: 1 / -1;
}

#projectModal select.form-control {
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ui-text-muted) 50%), linear-gradient(135deg, var(--ui-text-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 18px, calc(100% - 12px) 18px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.upload-workspace {
  max-width: none;
}

.upload-layout {
  display: grid;
  grid-template-columns: minmax(420px, 0.95fr) minmax(420px, 1.05fr);
  gap: 22px;
  align-items: start;
  justify-content: stretch;
}

.upload-main-heading {
  grid-column: 1;
  margin: 0;
}

.upload-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: var(--ui-surface-alt);
}

.upload-download-card {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: start;
  min-width: 0;
}

.upload-ops-card {
  grid-column: 1 / -1;
}

.upload-card-main,
.download-card-section {
  min-width: 0;
}

.download-card-section {
  display: grid;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.download-card-section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.download-section-title {
  color: var(--ui-text);
  font-size: 15px;
  font-weight: 800;
}

.download-info-list {
  display: grid;
  gap: 10px;
}

.download-info-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
}

.upload-card-label {
  color: var(--ui-text-muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.upload-link {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  line-height: 1.5;
  min-width: 0;
}

.download-url {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.copy-download-btn,
.restore-selected-archive-btn {
  justify-self: start;
}

.download-qr-panel {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ui-text-muted);
  cursor: zoom-in;
}

.download-qr-section {
  justify-items: center;
}

.download-qr-panel:hover {
  border-color: var(--ui-border-strong);
  background: rgba(255, 255, 255, 0.07);
}

.download-qr-code {
  display: grid;
  place-items: center;
  width: 148px;
  height: 148px;
  padding: 8px;
  border-radius: 8px;
  background: #ffffff;
}

.download-qr-code img,
.download-qr-code canvas {
  width: 132px !important;
  height: 132px !important;
}

.download-qr-note {
  color: var(--ui-text-muted);
  font-size: 13px;
  font-weight: 700;
}

.qr-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(3, 7, 18, 0.74);
  backdrop-filter: blur(12px);
  cursor: zoom-out;
}

.qr-lightbox.show {
  display: grid;
}

.qr-lightbox-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--ui-border-strong);
  border-radius: 8px;
  background: var(--ui-surface);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.42);
}

.download-qr-code-large {
  width: 304px;
  height: 304px;
  padding: 12px;
}

.download-qr-code-large img,
.download-qr-code-large canvas {
  width: 280px !important;
  height: 280px !important;
}

.upload-form {
  grid-column: 1;
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  gap: 14px 16px;
  max-width: 760px;
  width: 100%;
  justify-self: stretch;
}

.upload-form .form-group {
  margin: 0;
}

.upload-form .form-group:nth-child(2),
.upload-form .form-group:nth-child(4),
.upload-actions {
  grid-column: 1 / -1;
}

.upload-form input[type="number"].form-control {
  appearance: none;
  -webkit-appearance: none;
}

.sr-only-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  padding: 0 !important;
  margin: -1px !important;
}

.segmented-control {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(86px, 1fr));
  width: 100%;
  min-height: 44px;
  padding: 4px;
  border: 1px solid var(--ui-border-strong);
  border-radius: 8px;
  background: var(--ui-surface-alt);
}

.segment-btn {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ui-text-muted);
  font-weight: 800;
  letter-spacing: 0;
  cursor: pointer;
}

.segment-btn.active {
  background: var(--ui-accent);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.22);
}

.segment-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--ui-accent) 55%, transparent);
  outline-offset: 2px;
}

.script-dropzone {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 12px;
  align-items: center;
  min-height: 92px;
  padding: 16px;
  border: 1px dashed var(--ui-border-strong);
  border-radius: 8px;
  background: var(--ui-surface-alt);
  color: var(--ui-text);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.script-dropzone:hover,
.script-dropzone.drag-over {
  border-color: var(--ui-accent);
  background: rgba(15, 118, 110, 0.08);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.10);
}

html.dark-mode .script-dropzone {
  background: rgba(16, 26, 36, 0.72);
}

html.dark-mode .script-dropzone:hover,
html.dark-mode .script-dropzone.drag-over {
  background: rgba(23, 163, 152, 0.10);
  box-shadow: 0 0 0 3px rgba(23, 163, 152, 0.14);
}

.script-dropzone-icon {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: rgba(15, 118, 110, 0.12);
  color: var(--ui-accent);
  font-size: 18px;
}

.script-dropzone-main {
  min-width: 0;
  color: var(--ui-text);
  font-weight: 800;
}

.script-dropzone-sub {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ui-text-muted);
  font-size: 13px;
  font-weight: 700;
}

.script-dropzone-input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  padding: 0 !important;
  margin: -1px !important;
}

.upload-form textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

.upload-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.download-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 148px), 1fr));
  gap: 10px;
  min-width: 0;
}

.download-ops-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 16px;
  align-items: start;
  min-width: 0;
}

.download-ops-help {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 10px;
  min-width: 0;
}

.ops-help-item {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.ops-help-item strong {
  color: var(--ui-text);
  font-size: 13px;
  line-height: 1.35;
}

.ops-help-item span {
  color: var(--ui-text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.download-action-grid .btn {
  width: 100%;
  justify-content: center;
  min-height: 40px;
  padding-inline: 10px;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.download-action-grid .btn i {
  flex: 0 0 auto;
}

.log-console-hero {
  min-height: auto;
  padding: 28px;
}

.log-console-hero h1 {
  font-size: clamp(32px, 4vw, 52px);
}

.log-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.log-pulse {
  gap: 12px;
}

.log-stats-grid .stat-card,
.log-stats-grid .stat-card-dark {
  min-height: 104px;
  padding: 16px;
}

.log-workbench-grid {
  display: grid;
  grid-template-columns: minmax(440px, 1fr) minmax(360px, 0.8fr) !important;
  align-items: stretch;
}

.log-filter-body {
  display: grid;
  gap: 12px;
}

.log-filter-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.log-type-control {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  max-width: 560px;
  min-height: 44px;
  padding: 4px;
  border: 1px solid var(--ui-border-strong);
  border-radius: 8px;
  background: var(--ui-surface-alt);
}

.log-type-btn {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ui-text-muted);
  font-weight: 800;
  letter-spacing: 0;
}

.log-type-btn.active {
  background: var(--ui-accent);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.22);
}

.project-management-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.project-card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.project-card-actions .btn {
  min-height: 38px;
  padding: 8px 12px;
  text-decoration: none !important;
}

.project-card-actions a,
.project-card-actions a:hover,
.project-card-actions a:focus,
.project-card-actions a:visited,
.mini-actions a,
.mini-actions a:hover,
.mini-action-btn,
.mini-action-btn:hover,
.dashboard-quick-action-btn,
.dashboard-quick-action-btn:hover,
.btn,
.btn:hover,
.btn:focus {
  text-decoration: none !important;
}

.project-card-actions .btn i {
  font-size: 13px;
}

.project-api-tool {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--ui-border);
}

.project-api-heading {
  margin-bottom: 14px;
}

.project-api-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  align-items: stretch;
}

.project-api-actions .btn,
.project-api-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  min-height: 42px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

.project-api-actions .btn i,
.project-api-button i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 14px;
  line-height: 1;
  flex: 0 0 18px;
}

.project-api-output,
.project-token-output {
  min-height: 180px;
  max-height: 360px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: var(--ui-surface-alt);
  color: var(--ui-text);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.project-token-output {
  min-height: 52px;
  max-height: 140px;
  margin-bottom: 12px;
}

.project-api-modal {
  position: fixed;
  inset: 0;
  z-index: 2850;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.project-api-modal.show {
  opacity: 1;
  pointer-events: auto;
}

.project-api-modal-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(980px, calc(100vw - 32px));
  max-height: min(820px, calc(100vh - 40px));
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: var(--ui-surface);
  color: var(--ui-text);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.20);
  overflow: hidden;
  transform: translateY(10px) scale(0.985);
  transition: transform 160ms ease;
}

.project-api-modal.show .project-api-modal-panel {
  transform: translateY(0) scale(1);
}

.project-api-modal-header {
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--ui-border);
  background: var(--ui-surface);
}

.project-api-modal-header h3 {
  margin: 0;
  color: var(--ui-text);
  font-size: 20px;
  line-height: 1.25;
  font-weight: 800;
}

.project-api-modal-header p {
  margin: 6px 0 0;
  color: var(--ui-text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.project-api-modal-code {
  min-height: 420px;
  margin: 0;
  padding: 18px 22px;
  overflow: auto;
  background: var(--ui-surface-alt);
  color: var(--ui-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre;
  tab-size: 4;
}

.project-api-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--ui-border);
  background: var(--ui-surface);
}

.project-api-modal-actions .btn {
  min-width: 132px;
}

html.dark-mode .project-api-modal-panel {
  background: rgba(16, 28, 39, 0.98);
  border-color: var(--ui-border-strong);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.52);
}

html.dark-mode .project-api-modal {
  background: rgba(2, 8, 23, 0.72);
}

html.dark-mode .project-api-modal-code {
  background: rgba(11, 20, 30, 0.72);
}

.mini-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.mini-action-btn {
  min-height: 34px;
  padding: 7px 10px;
  text-decoration: none !important;
  white-space: nowrap;
}

@media (max-width: 1024px) {
  .feedback-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feedback-item {
    grid-template-columns: 136px minmax(0, 1fr);
  }

  .feedback-item-meta {
    grid-column: 1 / -1;
    padding-top: 12px;
    padding-left: 0;
    border-top: 1px solid var(--ui-border);
    border-left: 0;
  }

  .feedback-shot {
    width: 136px;
    height: auto;
  }

  .feedback-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .feedback-actions .btn {
    justify-content: center;
  }
}

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

  .feedback-filter-control {
    width: 100%;
  }

  .feedback-item {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .feedback-shot {
    width: 100%;
    height: auto;
  }

  .feedback-actions {
    grid-template-columns: 1fr 1fr;
  }

  .feedback-tree-modal {
    align-items: stretch;
    padding: 14px;
  }

  .feedback-tree-panel {
    width: 100%;
    height: 100%;
  }

  .feedback-tree-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .feedback-tree-actions {
    width: 100%;
  }

  .feedback-tree-actions .btn:first-child {
    flex: 1;
  }
}

.pulse-value-path {
  font-size: 15px;
  overflow-wrap: anywhere;
}

.backup-action-area {
  display: grid;
  gap: 14px;
}

.backup-action-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.backup-action-buttons .btn {
  min-height: 42px;
}

.raw-log-detail {
  margin-top: 8px;
  color: var(--ui-text-muted);
}

.raw-log-detail summary {
  cursor: pointer;
  font-size: 13px;
}

.raw-log-detail pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 8px 0 0;
  padding: 10px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid var(--ui-border);
  color: var(--ui-text);
}

.project-data-section {
  scroll-margin-top: 18px;
}

.inline-admin-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 120px 140px minmax(180px, 0.7fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.inline-admin-form-simple {
  grid-template-columns: minmax(260px, 520px) auto;
  justify-content: start;
}

.mini-data-summary {
  margin: 4px 0 12px;
  color: var(--ui-text-muted);
  font-size: 14px;
  font-weight: 700;
}

.cloud-control-panel {
  margin-bottom: 22px;
}

.cloud-control-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(320px, 1.2fr) minmax(220px, auto);
  gap: 14px;
  align-items: stretch;
}

.cloud-control-status-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: var(--ui-surface-alt);
}

.cloud-control-code {
  margin: 8px 0;
  color: var(--ui-text);
}

.cloud-control-actions {
  display: grid;
  gap: 10px;
  align-content: center;
}

.cloud-control-frame-panel {
  min-height: 620px;
}

.cloud-control-frame-wrap {
  min-height: 560px;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--ui-surface-alt);
}

.cloud-control-frame {
  display: block;
  width: 100%;
  height: min(760px, calc(100vh - 220px));
  min-height: 560px;
  border: 0;
  background: var(--ui-bg);
}

.cloud-control-empty {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 560px;
  gap: 10px;
  color: var(--ui-text-muted);
  text-align: center;
}

.cloud-control-empty strong {
  color: var(--ui-text);
  font-size: 22px;
}

.view-all.disabled,
.btn.disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  pointer-events: none;
}

.mini-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: var(--ui-surface-alt);
}

.mini-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.mini-table th,
.mini-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--ui-border);
  color: var(--ui-text);
  text-align: left;
  vertical-align: top;
}

.mini-table th {
  color: var(--ui-text-muted);
  font-size: 13px;
  font-weight: 800;
}

.mini-table tr:last-child td {
  border-bottom: 0;
}

.mini-muted {
  color: var(--ui-text-soft);
}

.mini-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  overflow-wrap: anywhere;
}

.mini-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--ui-border);
  border-radius: 999px;
  color: var(--ui-text-muted);
  font-size: 12px;
  font-weight: 800;
}

.mini-status.ok {
  border-color: rgba(52, 211, 153, 0.4);
  color: #34d399;
}

.mini-status.warn {
  border-color: rgba(251, 191, 36, 0.42);
  color: #fbbf24;
}

.mini-status.locked {
  border-color: rgba(248, 113, 113, 0.42);
  color: #f87171;
}

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

  .upload-layout,
  .upload-form,
  .inline-admin-form,
  .inline-admin-form-simple,
  .log-workbench-grid,
  .log-filter-row {
    grid-template-columns: 1fr;
  }
  .upload-form {
    max-width: none;
  }
  .upload-main-heading,
  .upload-form,
  .upload-download-card,
  .upload-ops-card {
    grid-column: auto;
    grid-row: auto;
  }
  .download-action-grid,
  .download-ops-layout,
  .download-info-row {
    grid-template-columns: 1fr;
  }
  .download-info-row {
    gap: 4px;
  }
}

html.dark-mode #projectModal .form-control,
html.dark-mode #projectModal select.form-control,
html.dark-mode #projectModal input.form-control {
  background: var(--ui-surface-alt) !important;
}

#projectModal input::placeholder {
  color: var(--ui-text-soft) !important;
  opacity: 1 !important;
}

.close-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--ui-border);
  background: var(--ui-surface-alt);
  color: var(--ui-text);
  font-size: 24px;
  line-height: 1;
}

.security-table-wrap {
  max-width: 100%;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: var(--ui-surface-alt);
}

.security-table {
  width: 100%;
  min-width: 780px;
  table-layout: auto;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  background: transparent !important;
}

.security-table th,
.security-table td {
  padding: 15px 18px !important;
  border-bottom: 1px solid var(--ui-border) !important;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.security-table thead th {
  background: var(--ui-surface);
  color: var(--ui-text-muted) !important;
  font-size: 13px;
  font-weight: 800;
}

.security-table tbody tr:last-child td {
  border-bottom: 0 !important;
}

.security-table .text-center {
  padding: 24px 18px !important;
  color: var(--ui-text-muted) !important;
  text-align: center;
}

.security-suspicious-table th:nth-child(1),
.security-suspicious-table td:nth-child(1),
.security-blacklist-table th:nth-child(1),
.security-blacklist-table td:nth-child(1) {
  min-width: 132px;
}

.security-suspicious-table th:nth-child(2),
.security-suspicious-table td:nth-child(2),
.security-blacklist-table th:nth-child(2),
.security-blacklist-table td:nth-child(2) {
  min-width: 190px;
  max-width: 320px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.security-suspicious-table th:nth-child(4),
.security-suspicious-table td:nth-child(4),
.security-blacklist-table th:nth-child(3),
.security-blacklist-table td:nth-child(3),
.security-blacklist-table th:nth-child(4),
.security-blacklist-table td:nth-child(4) {
  min-width: 96px;
}

.security-suspicious-table th:nth-child(5),
.security-suspicious-table td:nth-child(5),
.security-blacklist-table th:nth-child(5),
.security-blacklist-table td:nth-child(5) {
  min-width: 150px;
}

.security-suspicious-table {
  min-width: 0;
  table-layout: fixed;
}

.security-suspicious-table th:nth-child(1),
.security-suspicious-table td:nth-child(1) {
  width: 15%;
}

.security-suspicious-table th:nth-child(2),
.security-suspicious-table td:nth-child(2) {
  width: 28%;
}

.security-suspicious-table th:nth-child(3),
.security-suspicious-table td:nth-child(3) {
  width: 10%;
}

.security-suspicious-table th:nth-child(4),
.security-suspicious-table td:nth-child(4) {
  width: 10%;
}

.security-suspicious-table th:nth-child(5),
.security-suspicious-table td:nth-child(5) {
  width: 19%;
  white-space: normal;
}

.security-suspicious-table th:nth-child(6),
.security-suspicious-table td:nth-child(6) {
  width: 18%;
}

.security-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.security-row-actions .btn,
.btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

#security-logs {
  max-width: 100%;
  overflow-x: hidden;
}

#security-logs .log-entry {
  display: block;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

#security-logs .log-time,
#security-logs .log-type {
  display: inline;
  margin-right: 6px;
  white-space: nowrap;
}

#security-logs .log-message {
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (min-width: 721px) {
  html,
  body,
  body.ops-console {
    overflow-x: hidden;
  }

  body.ops-console .dashboard-grid-two {
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.75fr);
  }
}

@media (min-width: 921px) {
  .security-suspicious-table {
    min-width: 0;
  }

  .security-suspicious-table th,
  .security-suspicious-table td {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .security-suspicious-table .security-row-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

#ban-modal {
  z-index: 2600;
}

#ban-modal .security-ban-modal {
  width: min(720px, calc(100vw - 32px));
  max-width: 720px;
  border: 1px solid var(--ui-border);
  border-radius: 8px !important;
  overflow: hidden;
}

#ban-modal .modal-header,
#ban-modal .modal-body,
#ban-modal .modal-footer {
  position: relative;
  z-index: 1;
  margin: 0 !important;
  background: var(--ui-surface) !important;
}

#ban-modal .modal-header {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 18px;
  padding: 22px 24px 18px !important;
  border-bottom: 1px solid var(--ui-border) !important;
}

#ban-modal .modal-header h3 {
  margin: 0;
  color: var(--ui-text) !important;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 800;
}

#ban-modal .modal-header p {
  margin: 8px 0 0;
  color: var(--ui-text-muted);
  font-size: 14px;
  line-height: 1.6;
}

#ban-modal .close-btn {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  font-size: 22px;
}

#ban-modal .modal-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-height: min(62vh, 560px);
  overflow: auto;
  padding: 20px 24px !important;
}

#ban-modal .form-group {
  display: grid;
  gap: 7px;
  margin: 0 !important;
}

#ban-modal .form-group:last-child {
  grid-column: 1 / -1;
}

#ban-modal label {
  color: var(--ui-text) !important;
  font-size: 14px;
  font-weight: 800;
}

#ban-modal .required {
  color: var(--ui-danger);
}

#ban-modal .form-text {
  color: var(--ui-text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.ban-type-segment {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  min-height: 44px;
  padding: 4px;
  border: 1px solid var(--ui-border-strong);
  border-radius: 8px;
  background: var(--ui-surface-alt);
}

.ban-type-option {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ui-text-muted);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  cursor: pointer;
}

.ban-type-option.active {
  background: var(--ui-accent);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.2);
}

.ban-type-option:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--ui-accent) 55%, transparent);
  outline-offset: 2px;
}

#ban-modal textarea.form-control {
  min-height: 96px;
  resize: vertical;
}

#ban-modal .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 22px !important;
  border-top: 1px solid var(--ui-border) !important;
}

#ban-modal .modal-footer .btn {
  min-width: 104px;
}

html.dark-mode .security-table-wrap,
html.dark-mode .security-table thead th {
  background: rgba(23, 37, 50, 0.92) !important;
}

html.dark-mode #ban-modal .modal-header,
html.dark-mode #ban-modal .modal-body,
html.dark-mode #ban-modal .modal-footer,
html.dark-mode #ban-modal .security-ban-modal {
  background: rgba(16, 28, 39, 0.98) !important;
}

.app-toast-host {
  position: fixed;
  right: 22px;
  top: 22px;
  z-index: 3000;
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.app-toast {
  min-width: 260px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid var(--ui-border-strong);
  border-radius: 8px;
  background: var(--ui-surface);
  color: var(--ui-text);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transform: translateY(-8px);
}

.app-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.app-toast-success {
  border-color: rgba(20, 184, 166, 0.5);
}

.app-toast-error {
  border-color: rgba(248, 113, 113, 0.65);
}

.app-dialog-host {
  position: fixed;
  inset: 0;
  z-index: 2800;
  pointer-events: none;
}

.app-dialog {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(3, 7, 18, 0.64);
  backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: auto;
  transition: opacity 180ms ease;
}

.app-dialog.show {
  opacity: 1;
}

.app-dialog-panel {
  width: min(480px, calc(100vw - 32px));
  padding: 22px;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: var(--ui-surface);
  color: var(--ui-text);
  box-shadow: 0 28px 80px rgba(2, 8, 23, 0.34);
  transform: translateY(10px) scale(0.98);
  transition: transform 180ms ease;
}

.app-dialog.show .app-dialog-panel {
  transform: translateY(0) scale(1);
}

.app-dialog-header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.app-dialog-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--ui-warn-soft);
  color: var(--ui-warn);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.app-dialog-danger .app-dialog-icon {
  background: var(--ui-danger-soft);
  color: var(--ui-danger);
}

.app-dialog-info .app-dialog-icon {
  background: var(--ui-info-soft);
  color: var(--ui-info);
}

.app-dialog-success .app-dialog-icon {
  background: var(--ui-accent-soft);
  color: var(--ui-accent-strong);
}

.app-dialog h3 {
  margin: 0;
  color: var(--ui-text);
  font-size: 18px;
  line-height: 1.3;
  font-weight: 700;
}

.app-dialog p {
  margin: 8px 0 0;
  color: var(--ui-text-muted);
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.app-dialog-input {
  width: 100%;
  margin-top: 18px;
}

.app-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.app-dialog-actions .btn {
  min-width: 88px;
}

html.dark-mode .app-dialog {
  background: rgba(2, 8, 23, 0.72);
}

html.dark-mode .app-dialog-panel {
  background: rgba(16, 28, 39, 0.98);
  border-color: var(--ui-border-strong);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.48);
}

@media (max-width: 720px) {
  #projectModal #projectForm {
    grid-template-columns: 1fr;
  }
  .app-toast-host {
    left: 16px;
    right: 16px;
    top: 16px;
  }
  .app-dialog {
    align-items: flex-end;
    padding: 16px;
  }
  .app-dialog-panel {
    width: 100%;
  }
  .app-dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .project-api-modal {
    align-items: stretch;
    padding: 14px;
  }
  .project-api-modal-panel {
    width: 100%;
    max-height: calc(100vh - 28px);
  }
  .project-api-modal-header {
    padding: 16px 16px 12px;
  }
  .project-api-modal-code {
    min-height: 360px;
    padding: 14px 16px;
    font-size: 11px;
  }
  .project-api-modal-actions {
    display: grid;
    grid-template-columns: 1fr;
    padding: 12px 16px 16px;
  }
  .project-api-modal-actions .btn {
    width: 100%;
  }
  .security-table {
    min-width: 0;
  }
  .security-table thead {
    display: none;
  }
  .security-table,
  .security-table tbody,
  .security-table tr,
  .security-table td {
    display: block;
    width: 100%;
  }
  .security-table tr {
    padding: 12px 14px;
    border-bottom: 1px solid var(--ui-border);
  }
  .security-table tbody tr:last-child {
    border-bottom: 0;
  }
  .security-table td {
    display: grid;
    grid-template-columns: minmax(86px, 0.36fr) minmax(0, 1fr);
    gap: 12px;
    padding: 9px 0 !important;
    border-bottom: 0 !important;
    white-space: normal;
  }
  .security-table td::before {
    content: attr(data-label);
    color: var(--ui-text-muted);
    font-size: 13px;
    font-weight: 800;
  }
  .security-table td[colspan] {
    display: block;
    text-align: center;
  }
  .security-table td[colspan]::before {
    content: "";
    display: none;
  }
  .security-row-actions {
    justify-content: flex-start;
  }
  #ban-modal .modal-body {
    grid-template-columns: 1fr;
  }
  #ban-modal .modal-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

.view-all {
  color: var(--ui-accent-strong);
  font-weight: 600;
}

.floating-theme-switch {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1200;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--ui-border);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ui-text);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(12px);
  font: 600 13px/1 var(--ui-font);
}

.floating-theme-switch:hover {
  background: rgba(255, 255, 255, 0.96);
}

.floating-theme-switch .theme-toggle-glyph {
  font-size: 16px;
  line-height: 1;
}

.floating-theme-switch .theme-toggle-label {
  letter-spacing: 0;
}

html.dark-mode .floating-theme-switch {
  background: rgba(16, 26, 36, 0.92);
  border-color: var(--ui-border-strong);
  box-shadow: 0 16px 30px rgba(2, 8, 23, 0.34);
}

html.dark-mode .floating-theme-switch:hover {
  background: rgba(21, 32, 43, 0.98);
}

@media (max-width: 1200px) {
  .stats-grid,
  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 920px) {
  .ops-shell {
    padding: 18px 14px 28px;
  }

  .dashboard-hero-grid,
  .feature-hero,
  .dashboard-grid-two,
  .recent-grid,
  .dashboard-quick-actions-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 640px) {
  .floating-theme-switch {
    top: 12px;
    right: 12px;
    min-height: 36px;
    padding: 0 12px;
  }

  .stats-grid,
  .projects-grid {
    grid-template-columns: 1fr !important;
  }

  .dashboard-hero,
  .feature-hero,
  .panel-surface,
  .recent-card,
  .stat-card,
  .stat-card-dark {
    padding: 16px;
  }

  .dashboard-hero h1,
  .feature-hero h1 {
    font-size: 28px;
  }
}

/* Dark mode readability pass: keep the glass style, but restore operational contrast. */
html.dark-mode {
  --ui-bg: #07111a;
  --ui-bg-muted: #111d28;
  --ui-surface: #101c27;
  --ui-surface-alt: #172532;
  --ui-border: #2a3c4e;
  --ui-border-strong: #3a5166;
  --ui-text: #f2f7fb;
  --ui-text-muted: #c3d0dd;
  --ui-text-soft: #94a7ba;
  --ui-accent: #18b4a7;
  --ui-accent-strong: #5ee5d7;
  --ui-shadow: 0 18px 42px rgba(0, 5, 12, 0.48);
}

html.dark-mode body,
html.dark-mode body.ops-console {
  background:
    radial-gradient(900px 560px at 8% 0%, rgba(24, 180, 167, 0.12), transparent 62%),
    radial-gradient(700px 460px at 100% 10%, rgba(96, 165, 250, 0.09), transparent 58%),
    linear-gradient(180deg, #07111a 0%, #0b1620 100%) !important;
}

html.dark-mode .ops-backdrop {
  background:
    radial-gradient(circle at top right, rgba(24, 180, 167, 0.11), transparent 34%),
    linear-gradient(180deg, rgba(7, 17, 26, 0.78), rgba(8, 17, 26, 0.96));
}

html.dark-mode .dashboard-hero,
html.dark-mode .feature-hero,
html.dark-mode .panel-surface,
html.dark-mode .card,
html.dark-mode .dark-card,
html.dark-mode .recent-card,
html.dark-mode .project-card,
html.dark-mode .stat-card,
html.dark-mode .stat-card-dark,
html.dark-mode .modal-content,
html.dark-mode .log-table-container,
html.dark-mode .batch-card {
  background: rgba(16, 28, 39, 0.88) !important;
  border-color: var(--ui-border) !important;
  color: var(--ui-text) !important;
}

html.dark-mode .pulse-card,
html.dark-mode .dashboard-quick-action-btn,
html.dark-mode .recent-item,
html.dark-mode .dashboard-recent-item,
html.dark-mode .dashboard-chart-wrapper,
html.dark-mode .dark-chart,
html.dark-mode .form-control,
html.dark-mode .search-box input,
html.dark-mode .filter-select,
html.dark-mode select,
html.dark-mode input,
html.dark-mode textarea {
  background: rgba(23, 37, 50, 0.92) !important;
  border-color: var(--ui-border) !important;
  color: var(--ui-text) !important;
}

html.dark-mode .dashboard-hero h1,
html.dark-mode .feature-hero h1,
html.dark-mode .section-title,
html.dark-mode .section-heading h2,
html.dark-mode .recent-header h3,
html.dark-mode .project-card-top h3,
html.dark-mode .dashboard-item-title,
html.dark-mode .item-title,
html.dark-mode .stat-value,
html.dark-mode .pulse-value,
html.dark-mode strong,
html.dark-mode label,
html.dark-mode .form-label {
  color: var(--ui-text) !important;
}

html.dark-mode .dashboard-hero p,
html.dark-mode .feature-hero p,
html.dark-mode .section-heading p,
html.dark-mode .stat-label,
html.dark-mode .stat-change,
html.dark-mode .pulse-label,
html.dark-mode .pulse-note,
html.dark-mode .dashboard-item-subtitle,
html.dark-mode .dashboard-item-time,
html.dark-mode .item-subtitle,
html.dark-mode .item-time,
html.dark-mode .project-card-meta,
html.dark-mode .recent-header .view-all {
  color: var(--ui-text-muted) !important;
  opacity: 1 !important;
}

html.dark-mode input::placeholder,
html.dark-mode textarea::placeholder,
html.dark-mode .form-control::placeholder {
  color: #8498ac !important;
  opacity: 1 !important;
}

html.dark-mode .dashboard-quick-action-btn:hover,
html.dark-mode .recent-item:hover,
html.dark-mode .dashboard-recent-item:hover,
html.dark-mode .project-card:hover {
  background: rgba(30, 47, 62, 0.96) !important;
  border-color: var(--ui-border-strong) !important;
}

html.dark-mode .dashboard-alert-error,
html.dark-mode .dashboard-alert-warning,
html.dark-mode .dashboard-alert-info {
  background: rgba(23, 37, 50, 0.92) !important;
  border-color: var(--ui-border) !important;
  color: var(--ui-text) !important;
}

html.dark-mode .dashboard-alert-error {
  border-left-color: #f87171 !important;
}

html.dark-mode .dashboard-alert-warning {
  border-left-color: #fbbf24 !important;
}

html.dark-mode .dashboard-alert-info {
  border-left-color: #60a5fa !important;
}

html.dark-mode .badge-danger {
  background: rgba(248, 113, 113, 0.2) !important;
  border-color: rgba(248, 113, 113, 0.44) !important;
  color: #fecaca !important;
}

html.dark-mode .badge-warning {
  background: rgba(251, 191, 36, 0.18) !important;
  border-color: rgba(251, 191, 36, 0.4) !important;
  color: #fde68a !important;
}

html.dark-mode .badge-info {
  background: rgba(96, 165, 250, 0.18) !important;
  border-color: rgba(96, 165, 250, 0.4) !important;
  color: #bfdbfe !important;
}

html.dark-mode .badge-success {
  background: rgba(52, 211, 153, 0.18) !important;
  border-color: rgba(52, 211, 153, 0.4) !important;
  color: #a7f3d0 !important;
}

html.dark-mode .dashboard-alert-warning .badge,
html.dark-mode .dashboard-alert-warning .badge-danger {
  background: rgba(251, 191, 36, 0.18) !important;
  border-color: rgba(251, 191, 36, 0.4) !important;
  color: #fde68a !important;
}

html.dark-mode .dashboard-alert-info .badge,
html.dark-mode .dashboard-alert-info .badge-danger {
  background: rgba(96, 165, 250, 0.18) !important;
  border-color: rgba(96, 165, 250, 0.4) !important;
  color: #bfdbfe !important;
}

html.dark-mode .floating-theme-switch {
  background: rgba(12, 24, 35, 0.92) !important;
  border-color: var(--ui-border-strong) !important;
  color: var(--ui-text) !important;
}

html.dark-mode .dashboard-chart-wrapper,
html.dark-mode .dark-chart {
  min-height: 240px;
}

html.dark-mode .card,
html.dark-mode .stat-card,
html.dark-mode .recent-card,
html.dark-mode .project-card,
html.dark-mode .batch-card,
html.dark-mode .dashboard-hero,
html.dark-mode .page-intro,
html.dark-mode .login-container {
  animation: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .stat-card,
  .recent-card,
  .project-card,
  .batch-card,
  .dashboard-hero,
  .page-intro,
  .login-container {
    animation: none !important;
  }
}

/* ===== High-End Premium Dropdown Redesign (Glassmorphism & System Match) ===== */

/* High-priority base styling */
select.form-control,
select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  cursor: pointer !important;
  padding-right: 38px !important;
  min-height: 42px !important;
  box-sizing: border-box !important;
  
  /* Modern clean SVG Chevron Down arrow */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='rgba%28255,%20255,%20255,%200.75%29' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E") !important;
  background-position: calc(100% - 14px) center !important;
  background-size: 15px !important;
  background-repeat: no-repeat !important;
  
  border-radius: var(--gl-radius, 14px) !important;
  border: 1px solid var(--gl-border, rgba(255, 255, 255, 0.08)) !important;
  background-color: var(--gl-surface-2, rgba(255, 255, 255, 0.06)) !important;
  color: var(--gl-text, rgba(255, 255, 255, 0.92)) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  outline: none !important;
  transition: border-color 0.22s var(--gl-ease, cubic-bezier(.4,0,.2,1)), box-shadow 0.22s var(--gl-ease, cubic-bezier(.4,0,.2,1)), background-color 0.22s var(--gl-ease, cubic-bezier(.4,0,.2,1)) !important;
}

/* Hover styles */
select.form-control:hover,
select:hover {
  border-color: var(--gl-border-active, rgba(129, 140, 248, 0.25)) !important;
  background-color: rgba(255, 255, 255, 0.09) !important;
}

html:not(.dark-mode) select.form-control:hover,
html:not(.dark-mode) select:hover {
  background-color: rgba(255, 255, 255, 0.95) !important;
  border-color: rgba(15, 23, 42, 0.15) !important;
}

/* Light mode specific background and chevron color */
html:not(.dark-mode) select.form-control,
html:not(.dark-mode) select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='rgba%2815,%2023,%2042,%200.65%29' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E") !important;
  background-position: calc(100% - 14px) center !important;
  background-size: 15px !important;
  background-repeat: no-repeat !important;
  background-color: rgba(255, 255, 255, 0.78) !important;
  color: rgba(15, 23, 42, 0.9) !important;
  border: 1px solid rgba(15, 23, 42, 0.09) !important;
}

/* Focus and active styles */
select.form-control:focus,
select:focus {
  border-color: var(--gl-border-active, rgba(129, 140, 248, 0.45)) !important;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15) !important;
}

/* Dark mode fallback overrides to prevent standard overrides from interfering */
html.dark-mode select.form-control,
html.dark-mode select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='rgba%28255,%20255,%20255,%200.75%29' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E") !important;
  background-position: calc(100% - 14px) center !important;
  background-size: 15px !important;
  background-repeat: no-repeat !important;
  background-color: var(--gl-surface-2, rgba(255, 255, 255, 0.06)) !important;
  color: var(--gl-text, rgba(255, 255, 255, 0.92)) !important;
}

/* Options design: standard option elements cannot be fully styled with border-radius, but we can set background and color */
select.form-control option,
select option {
  background-color: #0d1527 !important; /* Premium dark blue background */
  color: rgba(255, 255, 255, 0.92) !important;
  padding: 12px !important;
  font-size: 14px !important;
}

html:not(.dark-mode) select.form-control option,
html:not(.dark-mode) select option {
  background-color: #ffffff !important;
  color: rgba(15, 23, 42, 0.9) !important;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

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