/* ═══════════════════════════════════════════════════════════
   DWFX Review Dashboard — Complete CSS
   Dark mode default · Glass morphism · RTL Hebrew
   ═══════════════════════════════════════════════════════════ */

/* ─── Color Tokens (Dark = Default) ─── */
:root {
  --bg: #0f0f1a;
  --bg-secondary: #161625;
  --bg-card: rgba(30, 30, 50, 0.7);
  --bg-card-solid: #1e1e32;
  --bg-header: linear-gradient(135deg, #1a3a1e 0%, #2F9637 50%, #25782c 100%);
  --bg-sidebar: rgba(18, 18, 30, 0.92);
  --bg-input: rgba(255, 255, 255, 0.06);
  --bg-hover: rgba(255, 255, 255, 0.05);
  --bg-active: rgba(22, 101, 52, 0.3);

  --text: #e8e8f0;
  --text-secondary: #a0a0b8;
  --text-muted: #6a6a80;
  --text-inverse: #ffffff;

  --border: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.04);
  --border-focus: #2F9637;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-hover: 0 12px 40px rgba(0,0,0,0.5);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --radius-full: 50%;

  --primary: #2F9637;
  --primary-dark: #1a3a1e;
  --primary-light: rgba(47, 150, 55, 0.15);
  --accent: #4ade80;

  --pass: #4CAF50;
  --pass-bg: rgba(76, 175, 80, 0.12);
  --pass-border: rgba(76, 175, 80, 0.3);
  --fail: #F44336;
  --fail-bg: rgba(244, 67, 54, 0.12);
  --fail-border: rgba(244, 67, 54, 0.3);
  --warning: #FF9800;
  --warning-bg: rgba(255, 152, 0, 0.12);
  --warning-border: rgba(255, 152, 0, 0.3);
  --missing: #9E9E9E;
  --missing-bg: rgba(158, 158, 158, 0.12);
  --missing-border: rgba(158, 158, 158, 0.3);

  --glass-bg: rgba(30, 30, 50, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur: blur(12px);

  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.15s ease;
  --font: Arial, system-ui, -apple-system, 'Segoe UI', sans-serif;

  --sidebar-width: 240px;
  --header-height: 60px;
}

/* ─── Light Mode ─── */
[data-theme="light"] {
  --bg: #f0f2f8;
  --bg-secondary: #e8eaf0;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-solid: #ffffff;
  --bg-sidebar: rgba(255, 255, 255, 0.92);
  --bg-input: rgba(0, 0, 0, 0.04);
  --bg-hover: rgba(0, 0, 0, 0.03);
  --bg-active: rgba(22, 101, 52, 0.08);

  --text: #1a1a2e;
  --text-secondary: #5f6378;
  --text-muted: #9a9ab0;

  --border: rgba(0, 0, 0, 0.1);
  --border-light: rgba(0, 0, 0, 0.05);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --shadow-hover: 0 12px 40px rgba(0,0,0,0.15);

  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(0, 0, 0, 0.08);

  --pass-bg: rgba(76, 175, 80, 0.1);
  --fail-bg: rgba(244, 67, 54, 0.1);
  --warning-bg: rgba(255, 152, 0, 0.1);
  --missing-bg: rgba(158, 158, 158, 0.1);
}

/* ─── Reset ─── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ─── Base ─── */
html {
  direction: rtl;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: Arial, 'Segoe UI', system-ui, -apple-system, sans-serif !important;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--accent); }

::selection { background: var(--primary); color: #fff; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── Animations ─── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-280px); }
  to { opacity: 1; transform: translateX(0); }
}

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

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

@keyframes ripple {
  to { transform: scale(4); opacity: 0; }
}

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

@keyframes scoreRingFill {
  from { stroke-dashoffset: var(--ring-circumference); }
  to { stroke-dashoffset: var(--ring-offset); }
}

.page-enter { animation: fadeIn 0.35s ease-out; }

/* ═══ Layout ═══ */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: var(--header-height) 1fr;
  min-height: 100vh;
}

/* ═══ Header ═══ */
.header {
  grid-column: 1 / -1;
  background: var(--bg-header);
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 200;
  position: sticky;
  top: 0;
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-logo .logo-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-logo .logo-icon svg {
  width: 28px;
  height: 28px;
  stroke: #fff;
}

.header-logo span {
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.7;
  margin-right: 4px;
}

.menu-toggle {
  display: none;
}

/* ═══ Sidebar ═══ */
.sidebar {
  background: var(--bg-sidebar);
  backdrop-filter: var(--glass-blur);
  border-left: 1px solid var(--border);
  padding: 16px 0;
  overflow-y: auto;
  z-index: 150;
  transition: transform var(--transition);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 140;
  opacity: 0;
  transition: opacity var(--transition);
}

.nav-section {
  padding: 20px 20px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  border-radius: 0;
  transition: all var(--transition-fast);
  position: relative;
  cursor: pointer;
  text-decoration: none;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.nav-item.active {
  background: var(--bg-active);
  color: var(--primary);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  right: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

.nav-item .icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-item .icon svg {
  width: 20px;
  height: 20px;
}

/* ═══ Main Content ═══ */
.main-content {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(100vh - var(--header-height));
}

/* ═══ Buttons ═══ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-card);
  color: var(--text);
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

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

.btn-secondary {
  background: var(--bg-input);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--bg-hover);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
}

.btn-icon {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-xs);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  font-size: 1.1rem;
}

.btn-icon:hover {
  background: rgba(255,255,255,0.1);
}

.btn-icon svg {
  width: 20px;
  height: 20px;
}

.btn-group {
  display: flex;
  gap: 4px;
}

/* ═══ Cards ═══ */
.card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.card:hover {
  box-shadow: var(--shadow);
}

.card-glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
}

.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: all var(--transition);
  animation: fadeInUp 0.4s ease-out backwards;
}

.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.2s; }
.stat-card:nth-child(5) { animation-delay: 0.25s; }

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg {
  width: 22px;
  height: 22px;
}

.stat-icon.pass { background: var(--pass-bg); color: var(--pass); }
.stat-icon.fail { background: var(--fail-bg); color: var(--fail); }
.stat-icon.warning { background: var(--warning-bg); color: var(--warning); }
.stat-icon.missing { background: var(--missing-bg); color: var(--missing); }
.stat-icon.primary { background: var(--primary-light); color: var(--primary); }
.stat-icon.accent { background: rgba(124, 77, 255, 0.12); color: var(--accent); }

.stat-info { flex: 1; min-width: 0; }

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ═══ Status Cards (header-style) ═══ */
.status-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.status-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  animation: fadeIn 0.3s ease-out backwards;
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.status-indicator.online { background: var(--pass); box-shadow: 0 0 8px var(--pass); }
.status-indicator.offline { background: var(--fail); box-shadow: 0 0 8px var(--fail); }
.status-indicator.warning { background: var(--warning); box-shadow: 0 0 8px var(--warning); }

/* ═══ Score Ring ═══ */
.score-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.score-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-ring .ring-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 8;
}

.score-ring .ring-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease-out;
}

.score-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-num {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}

.score-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ═══ Page Headers ═══ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ═══ Tables ═══ */
.table-container {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}

.table-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

thead th {
  background: var(--bg-card-solid);
  padding: 12px 14px;
  text-align: right;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color var(--transition-fast);
}

thead th:hover {
  color: var(--text);
}

tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition-fast);
}

tbody tr:nth-child(even) {
  background: var(--bg-hover);
}

tbody tr:hover {
  background: var(--primary-light);
}

tbody td {
  padding: 10px 14px;
  vertical-align: middle;
}

.table-footer {
  padding: 10px 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ═══ Badges ═══ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

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

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

.badge-cv, .badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning-border);
}

.badge-sm, .badge-missing {
  background: var(--missing-bg);
  color: var(--missing);
  border: 1px solid var(--missing-border);
}
/* B6 FIX: HASHLAMA badge */
.badge-hashlama { background: rgba(234,179,8,0.15); color: #d97706; }

.badge-neutral {
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.badge-primary {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(47, 150, 55, 0.3);
}

/* ═══ Inputs ═══ */
.search-input {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.88rem;
  transition: all var(--transition-fast);
  width: 100%;
  max-width: 320px;
}

.search-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(47, 150, 55, 0.15);
}

.search-input::placeholder {
  color: var(--text-muted);
}

select.search-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239a9ab0' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  padding-left: 32px;
}

/* ═══ Filter Buttons ═══ */
.filter-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.filter-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.filter-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ═══ Category Cards ═══ */
.cat-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.cat-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  cursor: pointer;
  transition: all var(--transition);
  border-right: 3px solid var(--pass);
}

.cat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

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

.cat-card-name {
  font-weight: 600;
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.cat-card-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-right: 8px;
}

.cat-card-bar {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--bg-input);
  margin-bottom: 8px;
}

.bar-pass { background: var(--pass); }
.bar-fail { background: var(--fail); }
.bar-cv { background: var(--warning); }
.bar-sm { background: var(--missing); }

.cat-card-stats {
  display: flex;
  gap: 12px;
  font-size: 0.78rem;
  font-weight: 500;
}

/* ═══ Rules Table Expand Rows ═══ */
.rule-row {
  cursor: pointer;
}

.rule-row:hover {
  background: var(--primary-light) !important;
}

.expand-row {
  display: none;
}

.expand-row.open {
  display: table-row;
  animation: fadeIn 0.25s ease-out;
}

.expand-row td {
  padding: 16px 20px;
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--border);
}

/* ═══ Citation Box ═══ */
.citation-box {
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 12px;
  border-right: 3px solid var(--primary);
  font-size: 0.82rem;
}

.citation-doc {
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.citation-excerpt {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 0.8rem;
}

/* ═══ Inline Edit ═══ */
.verdict-select {
  padding: 4px 8px;
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-xs);
  background: var(--bg-card-solid);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.82rem;
  cursor: pointer;
}

.comment-input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-xs);
  background: var(--bg-card-solid);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.82rem;
  resize: vertical;
  min-height: 36px;
}

/* ═══ Tabs ═══ */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}

.tab-btn {
  padding: 12px 24px;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-btn:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.tab-btn.active {
  color: var(--primary);
  font-weight: 600;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  right: 0;
  left: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 2px 2px 0 0;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.tab-content.active {
  display: block;
}

/* ═══ Quality Gate Banner ═══ */
.quality-gate {
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  font-weight: 600;
  font-size: 0.95rem;
}

.quality-gate.pass {
  background: var(--pass-bg);
  border: 1px solid var(--pass-border);
  color: var(--pass);
}

.quality-gate.fail {
  background: var(--fail-bg);
  border: 1px solid var(--fail-border);
  color: var(--fail);
}

.quality-gate svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* ═══ Loading / Spinner ═══ */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
  gap: 16px;
  font-size: 0.9rem;
}

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

/* ═══ Empty State ═══ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  border-radius: var(--radius-full);
}

.empty-icon svg {
  width: 32px;
  height: 32px;
  color: var(--text-muted);
}

.empty-state h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ═══ Upload Zone ═══ */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}

.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  border-radius: var(--radius-full);
}

.upload-icon svg {
  width: 28px;
  height: 28px;
  color: var(--primary);
}

.upload-text {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 4px;
}

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

/* ═══ Pipeline / Progress ═══ */
.pipeline {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pipeline-phase {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--radius-xs);
  transition: all var(--transition-fast);
  font-size: 0.88rem;
}

.pipeline-phase.running {
  background: var(--primary-light);
}

.pipeline-phase.done {
  opacity: 0.7;
}

.pipeline-phase.error {
  background: var(--fail-bg);
}

.phase-indicator {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--bg-input);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.pipeline-phase.running .phase-indicator {
  background: var(--primary);
  color: #fff;
  animation: pulse 1.5s ease-in-out infinite;
}

.pipeline-phase.done .phase-indicator {
  background: var(--pass);
  color: #fff;
}

.pipeline-phase.error .phase-indicator {
  background: var(--warning);
  color: #fff;
}

.phase-label {
  flex: 1;
}

.phase-status {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ═══ Progress Bar ═══ */
.progress-bar {
  height: 8px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* ═══ Modal / Overlay ═══ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  background: var(--bg-card-solid);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  max-width: 90vw;
  max-height: 90vh;
  overflow: auto;
  box-shadow: var(--shadow-lg);
  min-width: 320px;
}

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

.modal-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.modal-body {
  padding: 20px;
}

.modal-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}

/* ═══ Toast Notifications ═══ */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  background: var(--bg-card-solid);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  min-width: 280px;
  animation: toastIn 0.3s ease-out;
}

.toast.removing {
  animation: toastOut 0.3s ease-out forwards;
}

.toast.success { border-right: 3px solid var(--pass); }
.toast.error { border-right: 3px solid var(--fail); }
.toast.info { border-right: 3px solid var(--primary); }

.toast svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ═══ Gallery ═══ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.gallery-item {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
}

.gallery-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.gallery-item img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  background: var(--bg-input);
  padding: 8px;
}

.g-label {
  padding: 8px 10px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ═══ Settings ═══ */
.settings-section {
  margin-bottom: 24px;
}

.settings-section > h3 {
  font-size: 1rem;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-section > h3 svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

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

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

.setting-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.setting-value {
  font-size: 0.88rem;
  font-weight: 500;
}

/* ═══ File List ═══ */
.file-list {
  list-style: none;
  max-height: 400px;
  overflow-y: auto;
}

.file-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.file-type-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--bg-input);
  color: var(--text-secondary);
}

.file-type-pdf { background: var(--fail-bg); color: var(--fail); }
.file-type-docx { background: var(--primary-light); color: var(--primary); }
.file-type-xlsx { background: var(--pass-bg); color: var(--pass); }
.file-type-dwf, .file-type-dwfx { background: var(--warning-bg); color: var(--warning); }

/* ═══ Disk Usage ═══ */
.disk-usage {
  margin-top: 8px;
}

/* ═══ Iframe Report ═══ */
.report-iframe {
  width: 100%;
  height: 70vh;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
}

/* ═══ DOCX Preview ═══ */
.docx-preview {
  background: #fff;
  color: #333;
  padding: 24px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  max-height: 70vh;
  overflow-y: auto;
  direction: rtl;
  line-height: 1.8;
}

/* ═══ Theme Toggle ═══ */
.theme-toggle {
  position: relative;
  width: 36px;
  height: 36px;
}

.theme-toggle .toggle-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: all var(--transition-fast);
  background: none;
  border: none;
  color: inherit;
}

.theme-toggle .toggle-icon:hover {
  background: rgba(255,255,255,0.1);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

/* ═══ Log Viewer ═══ */
.log-viewer {
  background: #0d0d0d;
  color: #c8c8c8;
  font-family: 'Courier New', monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  padding: 16px;
  border-radius: var(--radius-sm);
  max-height: 400px;
  overflow: auto;
  direction: ltr;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ═══ Responsive (Mobile) ═══ */
@media (max-width: 768px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: var(--header-height);
    right: 0;
    bottom: 0;
    width: var(--sidebar-width);
    transform: translateX(var(--sidebar-width));
    box-shadow: var(--shadow-lg);
    z-index: 150;
  }

  .sidebar.open {
    transform: translateX(0);
    animation: slideInLeft 0.3s ease-out;
  }

  .sidebar-backdrop.open {
    display: block;
    opacity: 1;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .main-content {
    padding: 16px;
    max-height: calc(100vh - var(--header-height));
  }

  .page-header {
    flex-direction: column;
  }

  .stat-cards {
    grid-template-columns: 1fr;
  }

  .status-cards {
    grid-template-columns: 1fr;
  }

  .cat-cards-grid {
    grid-template-columns: 1fr;
  }

  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-input {
    max-width: none;
  }

  table {
    font-size: 0.82rem;
  }

  tbody td, thead th {
    padding: 8px 10px;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .modal-content {
    width: 95vw;
  }

  .score-ring {
    margin: 0 auto;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 0 12px;
  }

  .header-logo {
    font-size: 1rem;
  }

  .header-logo span {
    display: none;
  }
}

/* ═══ Review Stats Row ═══ */
.review-stats-row {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
  align-items: center;
}

.review-stats-row span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.review-stats-row svg {
  width: 16px;
  height: 16px;
}

/* ═══ Download Buttons ═══ */
.download-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ═══ Env Table ═══ */
.env-table {
  direction: ltr;
  text-align: left;
  font-family: 'Courier New', monospace;
  font-size: 0.78rem;
}

.env-table td {
  padding: 4px 12px;
  vertical-align: top;
}

.env-table td:first-child {
  color: var(--primary);
  font-weight: 600;
  white-space: nowrap;
}

/* ═══ Pagination ═══ */
.pagination { margin-top: 16px; }
.pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.pagination-controls .btn {
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.page-dots {
  padding: 0 4px;
  color: var(--text-muted);
}


/* ═══ Bug Fix: Dropdown dark mode ═══ */
select, select option {
  background-color: var(--card-bg) !important;
  color: var(--text-primary) !important;
  border-color: var(--border) !important;
}
[data-theme="dark"] select,
[data-theme="dark"] select option {
  background-color: #1e293b !important;
  color: #e2e8f0 !important;
}
[data-theme="light"] select,
[data-theme="light"] select option {
  background-color: #ffffff !important;
  color: #1e293b !important;
}


/* ═══ Bug Fix: DOCX mammoth preview styling ═══ */
.docx-preview-styled {
  background: #ffffff;
  color: #1e293b;
  padding: 40px 48px;
  font-family: Arial, 'Segoe UI', sans-serif !important;
  font-size: 11pt;
  line-height: 1.7;
  direction: rtl;
  max-width: 900px;
  margin: 0 auto;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.docx-preview-styled * {
  font-family: Arial, 'Segoe UI', sans-serif !important;
}
.docx-preview-styled h1 {
  font-size: 18pt;
  color: #1E3A5F;
  font-weight: bold;
  margin: 24px 0 12px;
  border-bottom: 2px solid #1E3A5F;
  padding-bottom: 6px;
}
.docx-preview-styled h2 {
  font-size: 14pt;
  color: #1E3A5F;
  font-weight: bold;
  margin: 20px 0 10px;
}
.docx-preview-styled h3 {
  font-size: 12pt;
  color: #2c5282;
  font-weight: bold;
  margin: 16px 0 8px;
}
.docx-preview-styled p {
  margin: 6px 0;
  text-align: justify;
}
.docx-preview-styled table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 10pt;
}
.docx-preview-styled table th,
.docx-preview-styled table td {
  border: 1px solid #cbd5e1;
  padding: 6px 10px;
  text-align: right;
  vertical-align: top;
}
.docx-preview-styled table th {
  background: #1E3A5F;
  color: white;
  font-weight: bold;
}
.docx-preview-styled table tr:nth-child(even) {
  background: #f1f5f9;
}
.docx-preview-styled strong {
  color: #1E3A5F;
}
.docx-preview-styled .badge-pass-inline {
  background: #dcfce7; color: #166534; padding: 2px 8px; border-radius: 4px; font-size: 9pt;
}

/* Library upload section */
.library-upload-area {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 16px;
}
.library-upload-area:hover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.05);
}
.library-folder-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent);
  margin-left: 8px;
}
.library-status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 600;
}
.library-status-badge.complete { background: rgba(34,197,94,0.15); color: #22c55e; }
.library-status-badge.accepted { background: rgba(99,102,241,0.15); color: #818cf8; }
.library-status-badge.pending { background: rgba(234,179,8,0.15); color: #eab308; }
.library-status-badge.error { background: rgba(239,68,68,0.15); color: #ef4444; }

.library-doc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.library-doc-row:last-child { border-bottom: none; }
.library-doc-info { flex: 1; min-width: 0; }
.library-doc-name { font-weight: 500; font-size: 0.9rem; }
.library-doc-meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.library-status-badge.not_applicable { background: rgba(148,163,184,0.15); color: #94a3b8; }

.btn-danger-outline {
    background: transparent;
    border: 1px solid var(--fail);
    color: var(--fail);
}
.btn-danger-outline:hover {
    background: var(--fail);
    color: white;
}
.btn-icon-sm {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-icon-sm:hover {
    background: rgba(239, 68, 68, 0.1);
}
.btn-icon-sm:hover i {
    color: var(--fail) !important;
}


.upload-split {
  margin-bottom: 24px;
}
.upload-zone {
  transition: all 0.2s;
}
.upload-zone.drag-over {
  background: var(--bg-hover);
  border-color: var(--primary);
}


/* Switch toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #374151;
  transition: .4s;
  border-radius: 24px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--primary);
}
input:checked + .slider:before {
  transform: translateX(24px);
}


/* Metadata fields */
.meta-field { display:flex;flex-direction:column;gap:4px }
.meta-field label { font-size:0.75rem;color:var(--text-secondary);font-weight:600 }
.meta-input { background:var(--bg-secondary);border:1px solid var(--border);border-radius:6px;padding:6px 10px;color:var(--text);font-size:0.85rem;direction:rtl;font-family:Arial,sans-serif }
.meta-input:focus { border-color:var(--primary);outline:none;box-shadow:0 0 0 2px rgba(99,102,241,0.2) }

/* ═══════════════════════════════════════════════════════════
   Library Explorer — Tree View + Breadcrumbs + File List
   ═══════════════════════════════════════════════════════════ */

/* Two-pane layout */
.lib-explorer {
  display: flex;
  gap: 0;
  min-height: 500px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
}

/* ─── Tree sidebar ─── */
.lib-tree-sidebar {
  width: 260px;
  min-width: 220px;
  max-width: 320px;
  border-left: 1px solid var(--border);
  background: var(--bg-secondary);
  overflow-y: auto;
  padding: 8px 0;
  flex-shrink: 0;
}
.lib-tree-sidebar::-webkit-scrollbar { width: 4px; }
.lib-tree-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.lib-tree-node {
  user-select: none;
}
.lib-tree-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 8px;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text);
  border-radius: 0;
  transition: background 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lib-tree-row:hover {
  background: var(--bg-hover);
}
.lib-tree-row.active {
  background: var(--bg-active);
  color: var(--accent);
  font-weight: 600;
}
.lib-tree-row .tree-chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  transition: transform 0.2s;
  opacity: 0.5;
}
.lib-tree-row .tree-chevron.expanded {
  transform: rotate(90deg);
}
.lib-tree-row .tree-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-muted);
}
.lib-tree-row.active .tree-icon {
  color: var(--accent);
}
.lib-tree-children {
  display: none;
}
.lib-tree-children.open {
  display: block;
}
.lib-tree-count {
  font-size: 0.7rem;
  opacity: 0.5;
  margin-right: auto;
  padding-right: 4px;
}

/* ─── File pane (right side) ─── */
.lib-file-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Breadcrumb */
.lib-breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 16px;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  flex-wrap: wrap;
}
.lib-breadcrumb-item {
  color: var(--text-secondary);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s;
}
.lib-breadcrumb-item:hover {
  color: var(--accent);
  background: var(--bg-hover);
}
.lib-breadcrumb-item.current {
  color: var(--text);
  font-weight: 600;
  cursor: default;
}
.lib-breadcrumb-item.current:hover {
  background: transparent;
  color: var(--text);
}
.lib-breadcrumb-sep {
  color: var(--text-muted);
  font-size: 0.7rem;
}

/* Toolbar */
.lib-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
  flex-wrap: wrap;
}
.lib-toolbar-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* File list */
.lib-file-list {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}
.lib-file-list::-webkit-scrollbar { width: 4px; }
.lib-file-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Subfolder row in file list */
.lib-subfolder-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s;
  font-size: 0.85rem;
}
.lib-subfolder-row:hover {
  background: var(--bg-hover);
}
.lib-subfolder-row i {
  color: #f59e0b;
  flex-shrink: 0;
}
.lib-subfolder-row .subfolder-count {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-right: auto;
}

/* File row */
.lib-file-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s;
  font-size: 0.85rem;
}
.lib-file-row:last-child {
  border-bottom: none;
}
.lib-file-row:hover {
  background: var(--bg-hover);
}
.lib-file-row .file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.lib-file-row .file-stats {
  font-size: 0.75rem;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}
.lib-file-row .file-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.lib-file-row:hover .file-actions {
  opacity: 1;
}

/* Empty state */
.lib-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
  gap: 12px;
}
.lib-empty i {
  opacity: 0.3;
}

/* ─── Move File Modal ─── */
.lib-move-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.lib-move-modal {
  background: var(--bg-card-solid);
  border-radius: var(--radius);
  width: 400px;
  max-width: 90vw;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.lib-move-modal-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 0.9rem;
}
.lib-move-modal-body {
  overflow-y: auto;
  padding: 8px 0;
  flex: 1;
}
.lib-move-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.15s;
}
.lib-move-option:hover {
  background: var(--bg-hover);
}
.lib-move-option.selected {
  background: var(--bg-active);
  color: var(--accent);
}
.lib-move-option i {
  flex-shrink: 0;
}
.lib-move-modal-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Upload area inside file pane */
.lib-upload-inline {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin: 12px 16px;
}
.lib-upload-inline:hover {
  border-color: var(--accent);
  background: rgba(74, 222, 128, 0.05);
}
