:root {
  --bg: #0b0f19;
  --card-bg: rgba(23, 32, 54, 0.7);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-hover-border: rgba(99, 102, 241, 0.5);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-danger: #ef4444;
  --accent-warning: #f59e0b;
  --glow-primary: rgba(99, 102, 241, 0.15);
  --glow-secondary: rgba(6, 182, 212, 0.15);
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

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

body {
  font-family: var(--font-family);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem 1.5rem;
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.1) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(139, 92, 246, 0.05) 0px, transparent 50%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  text-align: center;
}

/* Header & Titles */
.header {
  margin-bottom: 3.5rem;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  background: rgba(99, 102, 241, 0.1);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.25);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #818cf8;
  box-shadow: 0 0 8px #818cf8;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid var(--card-border);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-theme-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-theme-toggle .icon-sun {
  display: none;
  color: #f59e0b;
}

.btn-theme-toggle .icon-moon {
  display: block;
  color: #818cf8;
}

[data-theme="light"] .btn-theme-toggle .icon-sun {
  display: block;
}

[data-theme="light"] .btn-theme-toggle .icon-moon {
  display: none;
}

/* Glossary Entry Button */
.btn-glossary-entry {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
}

.btn-glossary-entry:hover {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(16, 185, 129, 0.6);
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

/* Terminology Miner Entry Button */
.btn-miner-entry {
  text-decoration: none;
}

.main-title {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sub-title {
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-top: 1rem;
}

.action-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 1.25rem;
  padding: 2.25rem 2rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.action-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--card-accent, var(--accent-primary)), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card-translate {
  --card-accent: #6366f1;
}

.card-review {
  --card-accent: #06b6d4;
}

.action-card:hover {
  transform: translateY(-4px);
  border-color: var(--card-hover-border);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.7), 0 0 25px 0 var(--card-glow, var(--glow-primary));
}

.card-translate:hover {
  --card-hover-border: rgba(99, 102, 241, 0.5);
  --card-glow: var(--glow-primary);
}

.card-review:hover {
  --card-hover-border: rgba(6, 182, 212, 0.5);
  --card-glow: var(--glow-secondary);
}

.action-card:hover::before {
  opacity: 1;
}

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  transition: all 0.3s ease;
}

.card-translate .card-icon {
  color: #818cf8;
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.2);
}

.card-review .card-icon {
  color: #22d3ee;
  background: rgba(6, 182, 212, 0.1);
  border-color: rgba(6, 182, 212, 0.2);
}

.action-card:hover .card-icon {
  transform: scale(1.08);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  padding-top: 1.5rem;
  margin-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.card-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: transform 0.2s ease;
}

.action-card:hover .card-arrow {
  transform: translateX(4px);
  color: #fff;
}

/* Footer */
.footer {
  margin-top: 3.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ========================================================================= */
/* GLOSSARY MODAL & EDITOR STYLES */
/* ========================================================================= */

.glossary-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 15, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1.5rem;
  animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.glossary-modal-card {
  background: #101726;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  width: 100%;
  max-width: 1280px;
  height: 90vh;
  max-height: 900px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 35px rgba(99, 102, 241, 0.12);
}

.glossary-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

/* Modal Header */
.modal-header {
  padding: 1.25rem 1.75rem;
  background: #141d30;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-align: left;
}

.modal-icon-badge {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #818cf8;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.2rem;
}

.modal-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.modal-subtitle code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  color: #38bdf8;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  text-decoration: none;
  font-family: inherit;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.btn-xs {
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  border-radius: 6px;
}

.btn-primary {
  background: var(--accent-primary);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-primary:hover {
  background: #4f46e5;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

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

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

.btn-icon-close {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon-close:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

/* Modal Body */
.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* File List View Cards Grid */
.glossary-files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  padding: 0.5rem;
}

.glossary-file-card {
  background: #141d30;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.glossary-file-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 15px rgba(99, 102, 241, 0.15);
  background: #18233a;
}

.file-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.file-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.25);
  color: #22d3ee;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.file-card-info {
  text-align: left;
  overflow: hidden;
}

.file-card-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-card-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.file-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.file-entry-pill {
  font-size: 0.78rem;
  font-weight: 500;
  background: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.25);
  padding: 2px 8px;
  border-radius: 9999px;
}

.file-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-card-action {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-card-action:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.btn-card-delete {
  cursor: pointer;
}

.btn-card-delete:hover {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  color: #f87171 !important;
}

/* Editor View Header */
.editor-header {
  padding: 0.85rem 1.5rem;
  background: #141d30;
}

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

.file-switcher-wrapper {
  position: relative;
}

.glossary-file-select {
  background: #0d1424;
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 8px;
  color: #38bdf8;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
  outline: none;
  font-family: var(--font-mono);
}

.glossary-file-select:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.count-pill {
  font-size: 0.78rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.badge-dirty {
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 2px 8px;
  border-radius: 6px;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.editor-header-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.view-mode-toggle {
  display: inline-flex;
  background: #0d1424;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 2px;
}

.btn-mode {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-mode.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Editor Toolbar / Search Bar */
.editor-toolbar {
  padding: 0.75rem 1.5rem;
  background: #0e1526;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  max-width: 500px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.glossary-search-input {
  width: 100%;
  background: #141d30;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.45rem 2rem 0.45rem 2.25rem;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

.glossary-search-input:focus {
  border-color: var(--accent-primary);
  background: #18233a;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.btn-search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px 6px;
}

.search-stats {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Editor Table Container */
.editor-table-container {
  flex: 1;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: #0d1424;
}

.glossary-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.glossary-table th {
  background: #141d30;
  padding: 10px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 5;
}

.th-sortable {
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.th-sortable:hover {
  background: #1c2742;
  color: #fff;
}

.th-content {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}

.sort-icon {
  font-size: 0.85rem;
  color: var(--text-muted);
  opacity: 0.6;
  transition: all 0.2s ease;
  display: inline-block;
  line-height: 1;
}

.th-sortable:hover .sort-icon {
  opacity: 1;
  color: var(--text-secondary);
}

.sort-icon.sort-active {
  color: #38bdf8;
  opacity: 1;
  font-weight: bold;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
}

.glossary-table td {
  padding: 6px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: top;
}

.glossary-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.col-no {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-align: center;
  padding-top: 10px !important;
}

.term-input {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.5;
  padding: 6px 8px;
  font-family: inherit;
  resize: vertical;
  min-height: 34px;
  overflow-y: hidden;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.term-input:focus {
  background: #18233a;
  border-color: var(--accent-primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.term-target {
  color: #e2e8f0;
}

.btn-row-delete {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-row-delete:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

/* Raw CSV View */
.editor-raw-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: 100%;
}

.raw-help-bar {
  padding: 0.6rem 1rem;
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: 8px;
  color: #22d3ee;
  font-size: 0.8rem;
  text-align: left;
}

.raw-csv-textarea {
  flex: 1;
  width: 100%;
  background: #0d1424;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 1rem;
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
  resize: none;
  outline: none;
  box-sizing: border-box;
}

.raw-csv-textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Loading & Empty States */
.loading-spinner-box, .error-box, .empty-state-card {
  padding: 4rem 2rem;
  text-align: center;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.table-loading-row, .table-empty-row, .table-error-row {
  text-align: center !important;
  padding: 3rem 1rem !important;
  color: var(--text-muted);
}

/* Sub-modals (Create File & Confirm) */
.submodal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10050;
  padding: 1rem;
}

.submodal-card {
  background: #141d30;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  animation: modalFadeIn 0.15s ease;
}

.submodal-header {
  padding: 1rem 1.25rem;
  background: #18233a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.submodal-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
}

.submodal-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  text-align: left;
}

.submodal-body label {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.submodal-input {
  width: 100%;
  background: #0d1424;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  font-family: var(--font-mono);
}

.submodal-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

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

.submodal-footer {
  padding: 0.85rem 1.25rem;
  background: #101726;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Toast Notification System */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 100099;
}

.toast {
  background: #1e293b;
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.25s ease;
  transition: all 0.3s ease;
}

.toast-success {
  border-color: rgba(16, 185, 129, 0.4);
  background: #064e3b;
  color: #a7f3d0;
}

.toast-error {
  border-color: rgba(239, 68, 68, 0.4);
  background: #7f1d1d;
  color: #fecaca;
}

.toast-warning {
  border-color: rgba(245, 158, 11, 0.4);
  background: #78350f;
  color: #fde68a;
}

.toast-out {
  opacity: 0;
  transform: translateY(10px);
}

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

@media (max-width: 860px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }
  .card-title {
    white-space: normal;
  }
  .glossary-modal-card {
    height: 96vh;
    padding: 0;
  }
}

/* ========================================================================= */
/* LIGHT THEME SYSTEM OVERRIDES */
/* ========================================================================= */

[data-theme="light"] {
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --card-hover-border: rgba(99, 102, 241, 0.6);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --glow-primary: rgba(99, 102, 241, 0.08);
  --glow-secondary: rgba(6, 182, 212, 0.08);
  color-scheme: light;
}

[data-theme="light"] body {
  background: #f8fafc;
  color: #0f172a;
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.06) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.05) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(139, 92, 246, 0.03) 0px, transparent 50%);
}

[data-theme="light"] .main-title {
  background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .badge {
  background: rgba(99, 102, 241, 0.08);
  color: #4f46e5;
  border-color: rgba(99, 102, 241, 0.2);
}

[data-theme="light"] .badge-dot {
  background: #4f46e5;
  box-shadow: 0 0 6px #4f46e5;
}

[data-theme="light"] .btn-theme-toggle {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .btn-theme-toggle:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

[data-theme="light"] .btn-glossary-entry {
  background: rgba(16, 185, 129, 0.1);
  color: #065f46;
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .btn-glossary-entry:hover {
  background: rgba(16, 185, 129, 0.18);
  color: #047857;
}



[data-theme="light"] .action-card {
  background: #ffffff;
  border-color: #e2e8f0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.06), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .action-card:hover {
  border-color: var(--card-hover-border);
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.1), 0 0 15px 0 var(--card-glow);
}

[data-theme="light"] .card-meta {
  border-top-color: #f1f5f9;
}

[data-theme="light"] .card-arrow {
  color: var(--text-primary);
}

[data-theme="light"] .action-card:hover .card-arrow {
  color: var(--card-accent, var(--accent-primary));
}

[data-theme="light"] .card-icon {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .card-translate .card-icon {
  background: rgba(99, 102, 241, 0.08);
  color: #4f46e5;
  border-color: rgba(99, 102, 241, 0.2);
}

[data-theme="light"] .card-review .card-icon {
  background: rgba(6, 182, 212, 0.08);
  color: #0891b2;
  border-color: rgba(6, 182, 212, 0.2);
}

/* Glossary Modal in Light Mode */
[data-theme="light"] .glossary-modal-overlay {
  background: rgba(15, 23, 42, 0.45);
}

[data-theme="light"] .glossary-modal-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .modal-header,
[data-theme="light"] .modal-footer {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .modal-title {
  color: #0f172a;
}

[data-theme="light"] .modal-icon-badge {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.2);
  color: #4f46e5;
}

[data-theme="light"] .modal-subtitle code {
  background: #f1f5f9;
  color: #0284c7;
  border: 1px solid #e2e8f0;
}

[data-theme="light"] .btn-icon-close {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #475569;
}

[data-theme="light"] .btn-icon-close:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

[data-theme="light"] .glossary-file-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .glossary-file-card:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

[data-theme="light"] .btn-card-action {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

[data-theme="light"] .btn-card-action:hover {
  background: #e2e8f0;
  color: #0f172a;
}

[data-theme="light"] .btn-card-delete:hover {
  background: rgba(239, 68, 68, 0.1) !important;
  color: #ef4444 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}

[data-theme="light"] .editor-header {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

[data-theme="light"] .glossary-file-select {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] .glossary-file-select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

[data-theme="light"] .count-pill {
  background: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
}

[data-theme="light"] .view-mode-toggle {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

[data-theme="light"] .btn-mode {
  color: #64748b;
}

[data-theme="light"] .btn-mode.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .editor-toolbar {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

[data-theme="light"] .glossary-search-input {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] .glossary-search-input:focus {
  background: #ffffff;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

[data-theme="light"] .editor-table-container {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .glossary-table th {
  background: #f1f5f9;
  color: #334155;
  border-color: #e2e8f0;
}

[data-theme="light"] .th-sortable:hover {
  background: #e2e8f0;
  color: #0f172a;
}

[data-theme="light"] .glossary-table td {
  border-color: #e2e8f0;
  color: #0f172a;
}

[data-theme="light"] .glossary-table tr:hover td {
  background: #f8fafc;
}

[data-theme="light"] .col-no {
  color: #64748b;
}

[data-theme="light"] .term-input {
  color: #0f172a;
}

[data-theme="light"] .term-input:focus {
  background: #f8fafc;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
  color: #0f172a;
}

[data-theme="light"] .term-target {
  color: #0f172a;
}

[data-theme="light"] .btn-row-delete {
  color: #94a3b8;
}

[data-theme="light"] .btn-row-delete:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

[data-theme="light"] .form-input,
[data-theme="light"] .raw-csv-textarea,
[data-theme="light"] .submodal-input,
[data-theme="light"] select {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] .form-input:focus,
[data-theme="light"] .raw-csv-textarea:focus,
[data-theme="light"] .submodal-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

[data-theme="light"] .submodal-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .submodal-footer {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .btn-secondary {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

[data-theme="light"] .btn-secondary:hover {
  background: #e2e8f0;
  color: #0f172a;
}

[data-theme="light"] .tab-btn {
  background: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
}

[data-theme="light"] .tab-btn.active {
  background: #ffffff;
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

/* Scrollbars in Light Mode */
[data-theme="light"] ::-webkit-scrollbar-track {
  background: #f1f5f9;
}
[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: #cbd5e1;
}
[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ========================================================================= */
/* ASSET HUB / CLOUD ASSET LIBRARY STYLES */
/* ========================================================================= */
.asset-modal-card {
  max-width: 1080px;
  width: 95vw;
  height: 88vh;
}

.asset-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.5rem;
  background: #0e1526;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  flex-wrap: wrap;
}

.asset-toolbar-left, .asset-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.asset-select {
  background: #0d1424;
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 8px;
  color: #38bdf8;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
  outline: none;
}

.asset-select:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.asset-url-panel {
  padding: 0.85rem 1.5rem;
  background: #141d30;
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
  animation: modalFadeIn 0.2s ease;
}

.asset-url-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.asset-text-input {
  flex: 1;
  background: #0d1424;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.45rem 0.85rem;
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  min-width: 200px;
}

.asset-text-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.asset-url-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 0.45rem;
}

.asset-tabs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 1.5rem;
  background: #101828;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  flex-wrap: wrap;
}

.asset-tabs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
}

.asset-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

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

.asset-tab.active {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.asset-filter-search {
  position: relative;
  min-width: 200px;
}

.asset-search-box {
  width: 100%;
  background: #0d1424;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  padding: 0.35rem 0.75rem;
  color: var(--text-primary);
  font-size: 0.82rem;
  outline: none;
}

.asset-search-box:focus {
  border-color: var(--accent-primary);
}

.asset-table-container {
  flex: 1;
  overflow-y: auto;
  background: #0d1424;
}

.asset-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.asset-table th {
  background: #141d30;
  padding: 10px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 5;
}

.asset-table td {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.85rem;
  vertical-align: middle;
}

.asset-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.asset-cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 600;
}

.badge-cat-tm {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-cat-glossary {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.badge-cat-task {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-cat-other {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.asset-name-cell {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 500;
  color: var(--text-primary);
}

.asset-actions-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Light Mode Overrides for Asset Hub */
[data-theme="light"] .asset-toolbar,
[data-theme="light"] .asset-tabs-row {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .asset-url-panel {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

[data-theme="light"] .asset-select,
[data-theme="light"] .asset-text-input,
[data-theme="light"] .asset-search-box {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] .asset-table-container {
  background: #ffffff;
}

[data-theme="light"] .asset-table th {
  background: #f1f5f9;
  color: #334155;
  border-color: #e2e8f0;
}

[data-theme="light"] .asset-table td {
  border-color: #f1f5f9;
  color: #0f172a;
}

[data-theme="light"] .asset-table tr:hover td {
  background: #f8fafc;
}

[data-theme="light"] .asset-tab {
  color: #64748b;
  background: transparent;
  border: 1px solid transparent;
  font-family: inherit;
}

[data-theme="light"] .asset-tab:hover {
  background: #e2e8f0;
  color: #0f172a;
}

[data-theme="light"] .asset-tab.active {
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
  border-color: rgba(99, 102, 241, 0.3);
  font-weight: 600;
}

.btn-danger {
  background: #dc2626;
  color: #ffffff;
  border: 1px solid #b91c1c;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-danger:hover {
  background: #b91c1c;
}

.btn-danger-outline {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-danger-outline:hover {
  background: rgba(239, 68, 68, 0.22);
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.55);
}

[data-theme="light"] .btn-danger-outline {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fca5a5;
}
[data-theme="light"] .btn-danger-outline:hover {
  background: #fee2e2;
  color: #b91c1c;
}

[data-theme="light"] .submodal-header {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
[data-theme="light"] .submodal-header h3 {
  color: #0f172a;
}
[data-theme="light"] .submodal-body {
  color: #334155;
}

/* Client Manager List Items */
.client-manage-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  transition: all 0.2s ease;
}
.client-manage-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(99, 102, 241, 0.3);
}
[data-theme="light"] .client-manage-item {
  background: #f8fafc;
  border-color: #e2e8f0;
}
[data-theme="light"] .client-manage-item:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.icon-spin {
  animation: spin 0.8s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

/* Upload Progress Card */
.asset-upload-progress-card {
  margin: 0.85rem 1.5rem 0.5rem;
  padding: 0.9rem 1.2rem;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  animation: modalFadeIn 0.2s ease;
}

.upload-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
  gap: 1rem;
}

.upload-file-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  overflow: hidden;
}

.upload-file-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.upload-file-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.upload-stats {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.upload-speed {
  color: #38bdf8;
  font-family: var(--font-mono);
  font-weight: 600;
}

.upload-eta {
  color: #a7f3d0;
  font-weight: 500;
}

.upload-progress-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.upload-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6366f1, #38bdf8, #10b981);
  border-radius: 999px;
  transition: width 0.15s ease-out;
}

.upload-progress-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.upload-bytes {
  font-family: var(--font-mono);
}

.upload-percent {
  font-weight: 700;
  color: #818cf8;
}

/* Light Mode Overrides for Upload Progress Card */
[data-theme="light"] .asset-upload-progress-card {
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  border: 1px solid rgba(99, 102, 241, 0.3);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .upload-file-name {
  color: #0f172a;
}

[data-theme="light"] .upload-progress-bar-track {
  background: #e2e8f0;
}

[data-theme="light"] .upload-speed {
  color: #0284c7;
}

[data-theme="light"] .upload-eta {
  color: #059669;
}

[data-theme="light"] .upload-percent {
  color: #4f46e5;
}

/* ========================================================================= */
/* SDLPPX PARSER & FLOATING TOP-RIGHT NAV STYLES */
/* ========================================================================= */
.top-right-nav {
  position: fixed;
  top: 18px;
  right: 24px;
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-right-nav .btn-theme-toggle {
  background: rgba(23, 32, 54, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.top-right-nav .btn-theme-toggle:hover {
  background: rgba(30, 41, 69, 0.9);
  border-color: rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}

[data-theme="light"] .top-right-nav .btn-theme-toggle {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: #1e293b;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .top-right-nav .btn-theme-toggle:hover {
  background: #ffffff;
  border-color: rgba(99, 102, 241, 0.4);
}

/* SDLPPX Entry Button in Header */
.btn-sdlppx-entry {
  cursor: pointer;
}

/* SDLPPX Modal Card */
.sdlppx-modal-card {
  max-width: 860px;
  width: 92vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.sdlppx-modal-body {
  padding: 1.5rem 1.75rem;
  overflow-y: auto;
}

/* SDLPPX Dropzone */
.sdlppx-dropzone {
  border: 2px dashed rgba(16, 185, 129, 0.35);
  border-radius: 14px;
  padding: 2.25rem 1.5rem;
  text-align: center;
  background: rgba(16, 185, 129, 0.03);
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.sdlppx-dropzone:hover, .sdlppx-dropzone.dragover {
  border-color: #34d399;
  background: rgba(16, 185, 129, 0.08);
  transform: scale(1.005);
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.15);
}

.sdlppx-drop-icon {
  color: #10b981;
  margin-bottom: 0.75rem;
  display: inline-flex;
  transition: transform 0.2s ease;
}

.sdlppx-dropzone:hover .sdlppx-drop-icon {
  transform: translateY(-2px);
}

.sdlppx-drop-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.sdlppx-browse-text {
  color: #34d399;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sdlppx-drop-hint {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.sdlppx-file-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
  padding: 0.45rem 1rem;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.45);
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #6ee7b7;
}

.sdlppx-file-badge .count-pill {
  background: rgba(0, 0, 0, 0.3);
  color: #a7f3d0;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-weight: 600;
}

.btn-icon-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  padding: 2px;
}

.btn-icon-clear:hover {
  color: #ef4444;
}

/* Project input row */
.sdlppx-project-row {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  border-radius: 12px;
}

.sdlppx-project-label-group {
  margin-bottom: 0.65rem;
}

.sdlppx-field-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.required-star {
  color: #ef4444;
}

.sdlppx-field-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.sdlppx-input-action-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sdlppx-input-wrapper {
  flex: 1;
}

/* Conflict Card */
.sdlppx-conflict-card {
  padding: 1.25rem 1.5rem;
  background: rgba(245, 158, 11, 0.07);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 12px;
}

.sdlppx-conflict-badge {
  font-size: 0.85rem;
  font-weight: 700;
  color: #f59e0b;
  margin-bottom: 0.35rem;
}

.sdlppx-conflict-title {
  font-size: 0.88rem;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.sdlppx-conflict-list {
  max-height: 130px;
  overflow-y: auto;
  padding: 0.6rem 0.85rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #fbbf24;
}

.sdlppx-conflict-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Results Section */
.sdlppx-result-section {
  padding: 1.25rem;
  background: rgba(16, 185, 129, 0.04);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 12px;
}

.sdlppx-result-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.sdlppx-result-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #34d399;
}

.sdlppx-stat-chips {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sdlppx-stat-chip {
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
}

.sdlppx-stat-chip.chip-task {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
}

.sdlppx-stat-chip.chip-tm {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}

.sdlppx-stat-chip.chip-glossary {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}

.sdlppx-stat-chip.chip-skipped {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.3);
}

.sdlppx-result-table-wrapper {
  max-height: 240px;
  overflow-y: auto;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  margin-bottom: 1.25rem;
}

.sdlppx-result-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Light Mode Overrides for SDLPPX */
[data-theme="light"] .sdlppx-dropzone {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.03);
}

[data-theme="light"] .sdlppx-dropzone:hover, [data-theme="light"] .sdlppx-dropzone.dragover {
  border-color: #059669;
  background: rgba(16, 185, 129, 0.08);
}

[data-theme="light"] .sdlppx-drop-icon {
  color: #059669;
}

[data-theme="light"] .sdlppx-drop-title {
  color: #0f172a;
}

[data-theme="light"] .sdlppx-browse-text {
  color: #047857;
  font-weight: 600;
}

[data-theme="light"] .sdlppx-drop-hint {
  color: #334155;
}

[data-theme="light"] .sdlppx-file-badge {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #064e3b; /* High-contrast deep emerald green for clear readability */
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(16, 185, 129, 0.12);
}

[data-theme="light"] .sdlppx-file-badge .count-pill {
  background: #ffffff;
  color: #064e3b;
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-weight: 700;
}

[data-theme="light"] .btn-icon-clear {
  color: #065f46;
}

[data-theme="light"] .btn-icon-clear:hover {
  color: #dc2626;
}

[data-theme="light"] .sdlppx-project-row {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .sdlppx-field-label {
  color: #0f172a;
}

[data-theme="light"] .sdlppx-conflict-card {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.4);
}

[data-theme="light"] .sdlppx-conflict-list {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #b45309;
}

[data-theme="light"] .sdlppx-result-section {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.3);
}

[data-theme="light"] .sdlppx-result-title {
  color: #059669;
}

[data-theme="light"] .sdlppx-result-table-wrapper {
  background: #ffffff;
  border-color: #e2e8f0;
}

