/* ============================================================
   WG · THE REFEREE (EL ÁRBITRO) MANAGEMENT DASHBOARD
   Design System: Wood, Iron & Concrete (Atampi Group Heritage)
   Premium aesthetics: Glassmorphism, Neon Lasers, Micro-animations
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&family=IBM+Plex+Sans:wght@300;400;500;600;700&display=swap');

:root {
  /* Color Palette: Slate Iron, Raw Concrete, Warm Oak, Laser Cyan */
  --bg-concrete-deep: #0a0c10;
  --bg-iron-matte: #121620;
  --bg-iron-brushed: #191f2d;
  --bg-iron-hover: #222b3d;
  --border-slate: #2d384e;
  --border-slate-glow: rgba(79, 143, 255, 0.15);
  
  --text-silver: #e2e8f0;
  --text-slate: #94a3b8;
  --text-muted: #475569;
  
  /* Glowing Highlights */
  --accent-laser: #00f0ff; /* Glowing cyan laser beam */
  --accent-laser-glow: rgba(0, 240, 255, 0.35);
  --wood-amber: #f59e0b; /* Warm polished walnut oak */
  --wood-amber-glow: rgba(245, 158, 11, 0.3);
  --concrete-gray: #8892b0;
  
  --green-emerald: #10b981;
  --orange-glow: #f97316;
  --red-critical: #ef4444;
  --red-critical-glow: rgba(239, 68, 68, 0.25);
  
  --font-mono: 'IBM Plex Mono', monospace;
  --font-sans: 'IBM Plex Sans', sans-serif;
  
  --glass-bg: rgba(18, 22, 32, 0.75);
  --glass-blur: blur(12px);
  --glass-border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Global Resets & Typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background: radial-gradient(circle at 50% 50%, var(--bg-iron-brushed) 0%, var(--bg-concrete-deep) 100%);
  color: var(--text-silver);
  min-height: 100vh;
  font-size: 14px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-concrete-deep);
}
::-webkit-scrollbar-thumb {
  background: var(--border-slate);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Main Layout */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Topbar Header (Atampi + WG Legacy Style) */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border-bottom: 2px solid var(--border-slate);
  flex-shrink: 0;
  z-index: 10;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  flex-wrap: wrap; /* Prevent cutting off of global buttons on smaller screens/zoomed screens */
}

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

.logo-container {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.logo-main {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 1.5px;
  color: #fff;
  line-height: 1.1;
}

.logo-main span {
  color: var(--accent-laser);
  text-shadow: 0 0 8px var(--accent-laser-glow);
}

.logo-subtitle {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-slate);
  font-weight: 600;
  margin-top: 2px;
}

.topbar-sep {
  width: 1px;
  height: 28px;
  background: var(--border-slate);
  flex-shrink: 0;
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  flex-wrap: wrap;
}

.search-wrap {
  position: relative;
  flex: 1.5;
  min-width: 200px;
}

.search-wrap input {
  width: 100%;
  background: rgba(10, 12, 16, 0.6);
  border: 1px solid var(--border-slate);
  color: #fff;
  border-radius: 8px;
  padding: 8px 12px 8px 34px;
  font-size: 13px;
  outline: none;
  transition: all 0.2s;
  font-family: var(--font-sans);
}

.search-wrap input:focus {
  border-color: var(--accent-laser);
  box-shadow: 0 0 10px var(--accent-laser-glow);
}

.search-wrap::before {
  content: '⌕';
  position: absolute;
  left: 12px;
  top: 48%;
  transform: translateY(-50%);
  color: var(--text-slate);
  font-size: 18px;
  pointer-events: none;
}

select {
  background: var(--bg-iron-matte);
  border: 1px solid var(--border-slate);
  color: var(--text-silver);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 0.2s;
}

select:focus {
  border-color: var(--accent-laser);
}

/* Premium Buttons */
.btn {
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-laser) 0%, #3b82f6 100%);
  color: #05070a;
  box-shadow: 0 4px 14px var(--accent-laser-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 240, 255, 0.5);
  background: var(--accent-laser);
}

.btn-secondary {
  background: var(--bg-iron-brushed);
  color: var(--text-silver);
  border: 1px solid var(--border-slate);
}
.btn-secondary:hover {
  background: var(--bg-iron-hover);
  border-color: var(--concrete-gray);
  color: #fff;
}

.btn-success {
  background: var(--green-emerald);
  color: #fff;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
}
.btn-success:hover {
  background: #059669;
  transform: translateY(-1px);
}

.btn-warning {
  background: var(--wood-amber);
  color: #05070a;
  box-shadow: 0 4px 10px var(--wood-amber-glow);
}
.btn-warning:hover {
  background: #fbbf24;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 6px;
}

.btn-logout {
  background: transparent;
  border: 1px solid var(--border-slate);
  color: var(--text-slate);
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-logout:hover {
  color: #fff;
  border-color: var(--red-critical);
  background: rgba(239, 68, 68, 0.1);
}

/* Sync status online bar */
.online-bar {
  background: rgba(16, 185, 129, 0.06);
  border-bottom: 1px solid rgba(16, 185, 129, 0.2);
  padding: 6px 24px;
  font-size: 12px;
  color: var(--green-emerald);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  font-weight: 500;
}

.online-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green-emerald);
  box-shadow: 0 0 8px var(--green-emerald);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.2); }
}

/* Statistics Grid */
.summary-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  padding: 16px 24px;
  background: rgba(18, 22, 32, 0.4);
  border-bottom: 1px solid var(--border-slate);
  flex-shrink: 0;
}

.stat {
  background: var(--bg-iron-matte);
  border: 1px solid var(--border-slate);
  border-radius: 10px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.stat::before {
  content: '';
  position: absolute;
  left: 0; bottom: 0; width: 100%; height: 3px;
  background: var(--border-slate);
  transition: background 0.2s;
}

.stat:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.stat.active::before { background: var(--accent-laser); }
.stat.at-risk::before { background: var(--red-critical); }
.stat.daily::before { background: var(--wood-amber); }

.stat-val {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
  color: #fff;
}

.stat-lbl {
  font-size: 11px;
  color: var(--text-slate);
  margin-top: 4px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Main Dashboard Workspace Splitter */
.dashboard-workspace {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.main-content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Table Area */
.table-wrap {
  flex: 1;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1000px;
}

thead {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg-iron-matte);
}

th {
  padding: 12px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-slate);
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid var(--border-slate);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color 0.15s;
}

th:hover {
  color: #fff;
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-slate);
  font-size: 13.5px;
  white-space: nowrap;
  vertical-align: middle;
}

tbody tr {
  cursor: pointer;
  transition: background 0.15s;
}

tbody tr:hover {
  background: var(--bg-iron-hover);
}

tbody tr.overdue {
  background: rgba(239, 68, 68, 0.04);
}

tbody tr.completed-row {
  opacity: 0.45;
}

tbody tr.completed-row:hover {
  opacity: 0.7;
}

.wo-id {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-laser);
}

.notes-cell {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-slate);
  font-size: 12.5px;
}

/* Stage Badges */
.stage-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: var(--bg-iron-brushed);
  color: var(--text-slate);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sLD { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.3); }
.sCN { background: rgba(236, 72, 236, 0.15); color: #fbcfff; border: 1px solid rgba(236, 72, 236, 0.3); }
.sES { background: rgba(14, 165, 233, 0.15); color: #7dd3fc; border: 1px solid rgba(14, 165, 233, 0.3); }
.sWR { background: rgba(245, 158, 11, 0.15); color: #fde047; border: 1px solid rgba(245, 158, 11, 0.3); }
.sGD { background: rgba(124, 58, 237, 0.15); color: #c084fc; border: 1px solid rgba(124, 58, 237, 0.3); }
.sPR { background: rgba(249, 115, 22, 0.15); color: #ffb86c; border: 1px solid rgba(249, 115, 22, 0.3); }
.sFN { background: rgba(59, 130, 246, 0.15); color: #93c5fd; border: 1px solid rgba(59, 130, 246, 0.3); }
.sQC { background: rgba(236, 72, 153, 0.15); color: #fbcfe8; border: 1px solid rgba(236, 72, 153, 0.3); }
.sSH { background: rgba(16, 185, 129, 0.15); color: #86efac; border: 1px solid rgba(16, 185, 129, 0.3); }
.sCO { background: rgba(16, 185, 129, 0.1); color: var(--green-emerald); }

/* Priority Badges */
.prio {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.pN { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }
.pI { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }
.pU { background: rgba(249, 115, 22, 0.18); color: #ffb86c; }
.pA { background: rgba(239, 68, 68, 0.2); color: #fca5a5; animation: blink 1.5s infinite; box-shadow: 0 0 10px var(--red-critical-glow); }

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

.task-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red-critical);
  margin-left: 6px;
  box-shadow: 0 0 6px var(--red-critical);
}

/* Right Sidebar: Team Status, Machine Load & Capacity Index */
.right-sidebar {
  width: 290px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border-left: 2px solid var(--border-slate);
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 20px;
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-slate);
  letter-spacing: 1.5px;
  border-bottom: 1px solid var(--border-slate);
  padding-bottom: 6px;
}

/* Team Workload meters */
.team-load-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.team-load-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.team-load-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.team-name {
  font-weight: 600;
  color: #fff;
}

.team-name.college-warning::after {
  content: ' 🎓 College';
  color: var(--wood-amber);
  font-size: 9px;
  font-weight: 700;
}

.team-count {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-slate);
}

.team-meter-bg {
  height: 6px;
  background: var(--bg-concrete-deep);
  border-radius: 3px;
  overflow: hidden;
}

.team-meter-fill {
  height: 100%;
  background: var(--accent-laser);
  border-radius: 3px;
  transition: width 0.3s;
}

/* Machine Queue status */
.machine-card-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.machine-card {
  background: var(--bg-iron-matte);
  border: 1px solid var(--border-slate);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.machine-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.machine-name {
  font-weight: 600;
  font-size: 12.5px;
}

.machine-status {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 4px;
}

.m-idle { background: rgba(148, 163, 184, 0.1); color: var(--text-slate); }
.m-running { background: rgba(0, 240, 255, 0.15); color: var(--accent-laser); animation: blink 2s infinite; }
.m-maintenance { background: rgba(239, 68, 68, 0.15); color: var(--red-critical); }

.machine-job {
  font-size: 11px;
  color: var(--text-slate);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.machine-progress {
  height: 3px;
  background: var(--bg-concrete-deep);
  border-radius: 2px;
  overflow: hidden;
}

.machine-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-laser), #3b82f6);
  border-radius: 2px;
  transition: width 0.5s;
}

/* Premium Modals & Overlays */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 10, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease-out;
}

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

.modal {
  background: var(--bg-iron-matte);
  border: 1px solid var(--border-slate);
  border-radius: 16px;
  width: 92%;
  max-width: 820px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  animation: slideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.modal.narrow { max-width: 500px; }
.modal.wide { max-width: 1080px; }

.modal-hdr {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-slate);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--bg-iron-matte);
  z-index: 10;
}

.modal-hdr h2 {
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fff;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-slate);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s;
}
.close-btn:hover {
  color: #fff;
}

.modal-body {
  padding: 24px;
}

/* Forms design */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-slate);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--bg-iron-brushed);
  border: 1px solid var(--border-slate);
  color: var(--text-silver);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13.5px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent-laser);
}

.form-group textarea {
  min-height: 80px;
  resize: vertical;
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: rgba(10, 12, 16, 0.4);
  border: 1px solid var(--border-slate);
  border-radius: 8px;
  padding: 12px;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  cursor: pointer;
  color: var(--text-silver);
}

.radio-row {
  display: flex;
  gap: 20px;
  padding: 6px 0;
}

.radio-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  cursor: pointer;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  padding: 18px 24px;
  border-top: 1px solid var(--border-slate);
  position: sticky;
  bottom: 0;
  background: var(--bg-iron-matte);
  z-index: 10;
}

/* Information Intake Score / inspector widget */
.intake-inspector-box {
  background: rgba(10, 12, 16, 0.5);
  border: 2px dashed var(--border-slate);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.intake-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.intake-title {
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.intake-score-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--bg-iron-brushed);
  color: var(--text-slate);
}

.intake-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.intake-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-slate);
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--bg-iron-brushed);
  border: 1px solid transparent;
}

.intake-item.complete {
  color: var(--text-silver);
  border-color: rgba(16, 185, 129, 0.2);
  background: rgba(16, 185, 129, 0.05);
}

.intake-check-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  color: transparent;
}

.intake-item.complete .intake-check-dot {
  border-color: var(--green-emerald);
  background: var(--green-emerald);
  color: #fff;
}

.intake-warning-banner {
  background: rgba(239, 68, 68, 0.12);
  border: 1.5px solid rgba(239, 68, 68, 0.4);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: #fca5a5;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: none;
}

/* Feasibility Shield Widget inside order modal */
.feasibility-shield-btn {
  background: linear-gradient(135deg, var(--wood-amber) 0%, #ea580c 100%);
  color: #05070a;
  border: none;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.feasibility-shield-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

/* Feasibility Shield Modal inside complete app */
.feasibility-modal-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
}

.feasibility-sidebar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-right: 1px solid var(--border-slate);
  padding-right: 12px;
}

.feasibility-category-btn {
  background: none;
  border: none;
  color: var(--text-slate);
  padding: 8px 12px;
  border-radius: 6px;
  text-align: left;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.feasibility-category-btn:hover {
  background: var(--bg-iron-brushed);
  color: #fff;
}

.feasibility-category-btn.active {
  background: var(--bg-iron-hover);
  color: var(--wood-amber);
  font-weight: 700;
}

.feasibility-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feasibility-card {
  background: var(--bg-iron-matte);
  border: 1px solid var(--border-slate);
  border-radius: 10px;
  padding: 14px;
}

.feasibility-card h4 {
  font-size: 13.5px;
  color: var(--wood-amber);
  margin-bottom: 6px;
}

.feasibility-card p {
  font-size: 12.5px;
  color: var(--text-slate);
  line-height: 1.4;
  margin-bottom: 10px;
}

.feasibility-copy-box {
  background: rgba(10, 12, 16, 0.4);
  border: 1px solid var(--border-slate);
  border-radius: 6px;
  padding: 10px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-silver);
  line-height: 1.5;
  white-space: pre-wrap;
}

/* Lifecycle flow bar inside modal */
.lifecycle {
  display: flex;
  align-items: center;
  padding: 12px;
  background: var(--bg-iron-brushed);
  border-radius: 10px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.lc-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 70px;
}

.lc-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-slate);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  background: var(--bg-iron-matte);
  color: var(--text-slate);
  flex-shrink: 0;
  font-weight: 700;
}

.lc-item.done .lc-dot {
  background: var(--green-emerald);
  border-color: var(--green-emerald);
  color: #fff;
}

.lc-item.current .lc-dot {
  background: var(--accent-laser);
  border-color: var(--accent-laser);
  color: #05070a;
  transform: scale(1.15);
  box-shadow: 0 0 10px var(--accent-laser-glow);
}

.lc-label {
  font-size: 9px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.2;
  font-weight: 600;
  text-transform: uppercase;
}

.lc-item.done .lc-label { color: var(--text-slate); }
.lc-item.current .lc-label { color: var(--accent-laser); font-weight: 700; }

.lc-line {
  flex: 1;
  height: 2px;
  background: var(--border-slate);
  margin: 0 4px;
  margin-bottom: 14px;
}

.lc-line.done {
  background: var(--green-emerald);
}

/* History and Tasks lists style */
.history-item,
.task-item {
  background: var(--bg-iron-brushed);
  border: 1px solid var(--border-slate);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
}

.history-meta,
.task-meta {
  font-size: 11px;
  color: var(--text-slate);
  margin-bottom: 4px;
}

.history-note,
.task-desc {
  font-size: 13px;
  color: var(--text-silver);
  line-height: 1.4;
}

.task-acts {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* Assistant Chat Panel Overlay (🤖 Asistente WG) */
#assistant-panel {
  position: fixed;
  bottom: 0;
  right: 24px;
  width: 440px;
  height: 640px;
  background: var(--bg-iron-matte);
  border: 2px solid var(--border-slate);
  border-bottom: none;
  border-radius: 16px 16px 0 0;
  display: none;
  flex-direction: column;
  z-index: 150;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.6);
}

.asst-header {
  padding: 16px 20px;
  border-bottom: 1.5px solid var(--border-slate);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--bg-concrete-deep) 0%, var(--bg-iron-brushed) 100%);
  border-radius: 14px 14px 0 0;
}

.asst-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-laser);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
}

.asst-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-laser);
  box-shadow: 0 0 8px var(--accent-laser);
  animation: pulse 1.5s infinite;
}

.asst-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.asst-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.5;
}

.asst-msg.user {
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.25);
  color: #fff;
  align-self: flex-end;
  border-radius: 12px 12px 2px 12px;
}

.asst-msg.ai {
  background: var(--bg-iron-brushed);
  border: 1px solid var(--border-slate);
  color: var(--text-silver);
  align-self: flex-start;
  border-radius: 12px 12px 12px 2px;
}

.asst-msg.thinking {
  color: var(--text-slate);
  font-style: italic;
  animation: blink 1.5s infinite;
}

.asst-quick {
  padding: 10px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-top: 1px solid var(--border-slate);
  flex-shrink: 0;
  background: var(--bg-concrete-deep);
}

.asst-quick-btn {
  font-size: 11px;
  background: var(--bg-iron-matte);
  border: 1px solid var(--border-slate);
  color: var(--text-slate);
  border-radius: 20px;
  padding: 4px 10px;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 0.15s;
}
.asst-quick-btn:hover {
  background: rgba(0, 240, 255, 0.1);
  border-color: var(--accent-laser);
  color: var(--accent-laser);
}

.asst-input-wrap {
  padding: 14px;
  border-top: 1.5px solid var(--border-slate);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  background: var(--bg-iron-matte);
}

.asst-input {
  flex: 1;
  background: var(--bg-iron-brushed);
  border: 1px solid var(--border-slate);
  color: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13.5px;
  font-family: var(--font-sans);
  outline: none;
  resize: none;
  min-height: 40px;
  max-height: 90px;
}
.asst-input:focus {
  border-color: var(--accent-laser);
}

.asst-send {
  background: var(--accent-laser);
  color: #05070a;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
  font-weight: 700;
}
.asst-send:hover {
  background: #66fcf1;
}

/* TV Shop Screen Layout */
#tv-screen {
  position: fixed;
  inset: 0;
  background: #05070a;
  z-index: 2000;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.tv-header {
  padding: 20px 32px;
  border-bottom: 2px solid var(--border-slate);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: var(--bg-iron-matte);
}

.tv-logo {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #fff;
}
.tv-logo span { color: var(--accent-laser); text-shadow: 0 0 10px var(--accent-laser-glow); }

.tv-clock {
  font-family: var(--font-mono);
  font-size: 20px;
  color: var(--accent-laser);
  font-weight: 700;
}

.tv-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
  align-content: start;
}

.tv-card {
  background: var(--bg-iron-matte);
  border: 2px solid var(--border-slate);
  border-radius: 14px;
  padding: 16px;
  position: relative;
  transition: border-color 0.3s;
}

.tv-card.tv-green { border-color: rgba(16, 185, 129, 0.4); }
.tv-card.tv-yellow { border-color: rgba(245, 158, 11, 0.5); }
.tv-card.tv-orange { border-color: rgba(249, 115, 22, 0.6); }
.tv-card.tv-red { border-color: var(--red-critical); box-shadow: 0 0 15px var(--red-critical-glow); }

/* ============================================================
   PREMIUM REMODELING ADDITIONS: TABS, INLINE EDITS & DOTS
   ============================================================ */

/* Modal Tabs Navigation */
.modal-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-concrete-deep);
  padding: 6px;
  border-radius: 12px;
  margin-bottom: 22px;
  border: 1px solid var(--border-slate);
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-slate);
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  background: var(--bg-iron-brushed);
  color: var(--accent-laser);
  border: 1px solid var(--border-slate);
  box-shadow: 0 0 12px var(--accent-laser-glow);
}

.tab-panel {
  display: none;
  animation: fadeInPanel 0.25s ease-out;
}

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

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

/* Inline Edit Table Selectors */
.tbl-select {
  background: rgba(10, 12, 16, 0.5);
  border: 1px solid transparent;
  color: inherit;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  outline: none;
  text-transform: uppercase;
  transition: all 0.15s;
}

.tbl-select:hover {
  border-color: var(--border-slate);
  background: var(--bg-iron-matte);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.tbl-select:focus {
  border-color: var(--accent-laser);
  background: var(--bg-iron-brushed);
  color: #fff;
}

/* Specific select dropdown styles */
.tbl-select.sLD { background: rgba(148, 163, 184, 0.08); color: #cbd5e1; }
.tbl-select.sCN { background: rgba(236, 72, 236, 0.08); color: #fbcfff; }
.tbl-select.sES { background: rgba(14, 165, 233, 0.08); color: #7dd3fc; }
.tbl-select.sWR { background: rgba(245, 158, 11, 0.08); color: #fde047; }
.tbl-select.sGD { background: rgba(124, 58, 237, 0.08); color: #c084fc; }
.tbl-select.sPR { background: rgba(249, 115, 22, 0.08); color: #ffb86c; }
.tbl-select.sFN { background: rgba(59, 130, 246, 0.08); color: #93c5fd; }
.tbl-select.sQC { background: rgba(236, 72, 153, 0.08); color: #fbcfe8; }
.tbl-select.sSH { background: rgba(16, 185, 129, 0.08); color: #86efac; }
.tbl-select.sCO { background: rgba(16, 185, 129, 0.06); color: var(--green-emerald); }

.tbl-select.pN { background: rgba(59, 130, 246, 0.08); color: #93c5fd; }
.tbl-select.pI { background: rgba(245, 158, 11, 0.08); color: #fcd34d; }
.tbl-select.pU { background: rgba(249, 115, 22, 0.1); color: #ffb86c; }
.tbl-select.pA { background: rgba(239, 68, 68, 0.12); color: #fca5a5; animation: blink 2s infinite; }

/* Interactive Intake Dots in Table Row */
.tbl-intake-dots {
  display: flex;
  gap: 5px;
  justify-content: center;
  align-items: center;
}

.intake-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--border-slate);
  background: rgba(10, 12, 16, 0.3);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--text-slate);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.intake-dot:hover {
  transform: scale(1.15);
  border-color: var(--concrete-gray);
  color: #fff;
  box-shadow: 0 0 6px rgba(255,255,255,0.1);
}

.intake-dot.ok {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--green-emerald);
  color: var(--green-emerald);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.25);
  text-shadow: 0 0 4px rgba(16, 185, 129, 0.5);
}

.intake-dot.ok:hover {
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
}

/* Interactive LifeCycle Progress in Modal Header */
.progress-stage-dot {
  cursor: pointer;
  transition: all 0.2s;
}
.progress-stage-dot:hover {
  color: #fff;
  transform: translateY(-2px);
}
.progress-stage-dot.current {
  text-shadow: 0 0 6px var(--accent-laser-glow);
}

/* Technical Sheet (Ficha Técnica) Style */
.wo-technical-sheet {
  background: linear-gradient(135deg, #181c2b 0%, #0d0f1a 100%);
  border: 1px solid var(--border-slate);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
  color: var(--text-silver);
  font-family: var(--font-sans);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}

.ts-row-top {
  display: grid;
  grid-template-columns: 1fr 1.3fr 1.3fr 1fr;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
  margin-bottom: 12px;
  align-items: center;
}

@media (max-width: 768px) {
  .ts-row-top {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.ts-col-id {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ts-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-slate);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.ts-wo-id {
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  margin: 0;
}

.ts-client-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  max-width: fit-content;
}

.ts-client-badge.new {
  background: rgba(16, 185, 129, 0.12);
  color: var(--green-emerald);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.ts-client-badge.rec {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.ts-col-client {
  font-size: 13px;
  line-height: 1.4;
}

.ts-sub-info {
  font-size: 11px;
  color: var(--text-slate);
  margin-top: 4px;
}

.ts-col-delivery {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ts-delivery-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--wood-amber);
}

.ts-fulfillment-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-laser);
}

.ts-col-payment {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ts-payment-method {
  font-size: 11.5px;
}

.ts-payment-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  width: max-content;
}

.ts-payment-badge.paid {
  background: rgba(16, 185, 129, 0.15);
  color: #86efac;
}

.ts-payment-badge.pending {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

.ts-row-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  color: var(--text-slate);
}

.ts-stage-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-slate);
  padding: 1px 6px;
  border-radius: 4px;
  color: #fff;
  font-weight: 700;
  font-size: 10.5px;
}

/* Flashing Warning Banners */
.ts-warning-banner {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid var(--red-critical);
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 12px;
  font-size: 12px;
  font-weight: 700;
  color: #fca5a5;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: pulse-border 2s infinite;
}

.ts-info-banner {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid var(--wood-amber);
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 12px;
  font-size: 12px;
  font-weight: 700;
  color: #fde047;
  display: flex;
  align-items: center;
  gap: 8px;
}

@keyframes pulse-border {
  0% { border-color: rgba(239, 68, 68, 0.4); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.2); }
  50% { border-color: var(--red-critical); box-shadow: 0 0 10px rgba(239, 68, 68, 0.3); }
  100% { border-color: rgba(239, 68, 68, 0.4); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* ============================================================
   ADMIN DROPDOWN & COMPOSITE CELL STYLING
   ============================================================ */

/* Glassmorphic Dropdown Menu for Global Actions */
.admin-dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 42px;
  background: rgba(21, 24, 32, 0.98);
  border: 1px solid var(--border-slate);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(15px);
  z-index: 1000;
  width: 220px;
  padding: 6px 0;
  animation: fadeInDropdown 0.2s ease-out;
}

.admin-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-silver);
  padding: 10px 16px;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.15s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.admin-dropdown-menu a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent-laser);
  padding-left: 20px;
}

.admin-dropdown-menu a:last-child {
  border-bottom: none;
}

@keyframes fadeInDropdown {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Checkboxes Column Styling */
.director-checkbox-col input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent-laser);
}

/* Composite Layout Styling for 6-Column Simple Table */
.tbl-composite-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

.tbl-composite-subtitle {
  font-size: 11px;
  color: var(--text-slate);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 450px;
}

.tbl-composite-meta {
  font-size: 10.5px;
  color: var(--text-slate);
  margin-top: 3px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.tbl-composite-pills {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 4px;
}

.tbl-composite-pill {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-silver);
}

/* ============================================================
   MULTI-ACCOUNT INBOX DASHBOARD (Wood, Iron & Concrete Style)
   ============================================================ */

.inbox-layout {
  display: flex;
  height: 70vh;
  min-height: 550px;
  background: rgba(10, 12, 16, 0.4);
  border: 1px solid var(--border-slate);
  border-radius: 12px;
  overflow: hidden;
  font-family: var(--font-sans);
}

/* 1. Accounts Sidebar */
.inbox-sidebar {
  width: 240px;
  background: rgba(18, 22, 32, 0.85);
  border-right: 1px solid var(--border-slate);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.inbox-sidebar-hdr {
  padding: 16px;
  border-bottom: 1px solid var(--border-slate);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-slate);
  letter-spacing: 1px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.inbox-accounts-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inbox-account-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-silver);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.inbox-account-item:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.05);
}

.inbox-account-item.active {
  background: rgba(79, 143, 255, 0.08);
  border-color: rgba(79, 143, 255, 0.3);
  box-shadow: 0 0 12px rgba(79, 143, 255, 0.1);
}

.inbox-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(0,0,0,0.5);
}

.inbox-account-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.inbox-account-name {
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inbox-account-email {
  font-size: 10px;
  color: var(--text-slate);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inbox-account-badge {
  font-size: 9.5px;
  font-weight: 700;
  background: var(--red-critical);
  color: #fff;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
  box-shadow: 0 0 6px var(--red-critical-glow);
}

.inbox-account-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  position: absolute;
  top: 8px;
  right: 8px;
}
.inbox-status-active { background: var(--green-emerald); box-shadow: 0 0 4px var(--green-emerald); }
.inbox-status-inactive { background: var(--text-muted); }

.inbox-sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-slate);
}

.inbox-btn-action {
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  background: var(--bg-iron-brushed);
  border: 1px solid var(--border-slate);
  color: var(--text-silver);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s;
}

.inbox-btn-action:hover {
  background: var(--bg-iron-hover);
  border-color: var(--text-slate);
}

/* 2. Middle Emails List */
.inbox-emails-panel {
  width: 320px;
  background: rgba(13, 17, 24, 0.4);
  border-right: 1px solid var(--border-slate);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.inbox-search-bar {
  padding: 12px;
  border-bottom: 1px solid var(--border-slate);
  background: rgba(10,12,16,0.3);
}

.inbox-search-bar input {
  width: 100%;
  background: var(--bg-iron-brushed);
  border: 1px solid var(--border-slate);
  color: #fff;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12.5px;
  outline: none;
  font-family: var(--font-sans);
}

.inbox-search-bar input:focus {
  border-color: var(--accent-laser);
  box-shadow: 0 0 8px var(--accent-laser-glow);
}

.inbox-email-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inbox-email-card {
  background: rgba(30, 41, 59, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  border-left: 3px solid transparent;
}

.inbox-email-card:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border-slate);
}

.inbox-email-card.active {
  background: rgba(79, 143, 255, 0.05);
  border-color: rgba(79, 143, 255, 0.25);
  border-left-color: #4f8fff;
}

.inbox-email-card.unread {
  border-left-color: var(--accent-laser);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.05);
}

.inbox-email-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}

.inbox-email-sender {
  font-weight: 700;
  color: var(--text-silver);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.inbox-email-date {
  color: var(--text-slate);
  font-size: 10px;
}

.inbox-email-subject {
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inbox-email-card.unread .inbox-email-subject {
  font-weight: 700;
  color: var(--accent-laser);
}

.inbox-email-snippet {
  font-size: 11px;
  color: var(--text-slate);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.inbox-empty-notice {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-slate);
  font-size: 12.5px;
}

/* 3. Right Email Reader & Co-Pilot */
.inbox-reader-panel {
  flex: 1;
  background: rgba(18, 22, 32, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.inbox-reader-hdr {
  padding: 20px;
  border-bottom: 1px solid var(--border-slate);
  background: rgba(10,12,16,0.3);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.inbox-reader-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.inbox-reader-subject {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.inbox-reader-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
}

.inbox-meta-row {
  display: flex;
  gap: 6px;
  color: var(--text-slate);
}

.inbox-meta-row strong {
  color: var(--text-silver);
}

.inbox-reader-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  font-size: 13.5px;
  color: var(--text-silver);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(10, 12, 16, 0.25);
}

/* 4. Bryan Co-Pilot Panel */
.inbox-copilot-section {
  padding: 16px 20px;
  border-top: 1px solid var(--border-slate);
  background: rgba(26, 38, 54, 0.5);
  backdrop-filter: blur(10px);
}

.inbox-copilot-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.inbox-copilot-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-laser);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.inbox-copilot-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-slate);
}

.inbox-copilot-loader {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border-slate);
  border-top-color: var(--accent-laser);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.inbox-copilot-draft {
  background: rgba(10, 12, 16, 0.6);
  border: 1px solid var(--border-slate);
  border-radius: 8px;
  padding: 12px;
  font-size: 12.5px;
  max-height: 200px;
  overflow-y: auto;
  font-family: var(--font-sans);
  color: var(--text-silver);
  margin-bottom: 10px;
}

/* 5. Account Config Overlay/Panel */
.inbox-config-section {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  overflow-y: auto;
}

.inbox-config-title {
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  color: #fff;
  border-bottom: 1px solid var(--border-slate);
  padding-bottom: 8px;
}

/* ─── MOBILE RESPONSIVE STYLES (iOS/Android) ─── */
@media (max-width: 768px) {
  /* Allow vertical scrolling on body/app so they can scroll down to see the sidebar */
  body, #app {
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100vh;
  }

  .dashboard-workspace {
    flex-direction: column !important;
    overflow: visible !important;
  }

  .main-content-area {
    overflow: visible !important;
    width: 100% !important;
  }

  /* Make table scrollable horizontally inside its container with native touch acceleration */
  .table-wrap {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    margin-bottom: 24px;
    border: 1px solid var(--border-slate);
    border-radius: 8px;
  }

  table {
    min-width: 900px !important;
  }

  /* Make the sidebar full width below the table, and allow scrolling */
  .right-sidebar {
    width: 100% !important;
    border-left: none !important;
    border-top: 2px solid var(--border-slate) !important;
    padding: 16px !important;
    box-sizing: border-box !important;
    overflow: visible !important;
  }

  /* Ribbon layout for stat cards */
  .summary-bar {
    display: flex !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 12px !important;
    gap: 10px !important;
    background: rgba(18, 22, 32, 0.6) !important;
  }

  .stat {
    flex: 0 0 130px !important;
    padding: 8px 12px !important;
  }

  /* Topbar Responsive Layout */
  .topbar {
    display: grid !important;
    grid-template-columns: 1fr auto auto !important;
    gap: 8px !important;
    padding: 10px 14px !important;
  }

  .logo-container {
    grid-column: 1 / 4 !important;
    text-align: center !important;
    align-items: center !important;
  }

  #user-badge-wrap {
    grid-column: 1 !important;
    justify-self: start !important;
  }

  #btn-lang-toggle {
    grid-column: 2 !important;
    margin-right: 0 !important;
  }

  .btn-logout {
    grid-column: 3 !important;
  }

  .topbar-sep {
    display: none !important;
  }

  /* Make filter options scrollable horizontally on mobile */
  .topbar-controls {
    grid-column: 1 / 4 !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 8px !important;
    padding-bottom: 6px !important;
    margin-top: 4px !important;
  }

  .topbar-controls select, .topbar-controls input {
    flex-shrink: 0 !important;
    width: auto !important;
  }

  /* Make action buttons scrollable horizontally on mobile */
  .topbar-actions {
    grid-column: 1 / 4 !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 8px !important;
    padding-bottom: 6px !important;
    margin-top: 2px !important;
  }

  .topbar-actions button {
    flex-shrink: 0 !important;
  }

  /* Full screen assistant panel on mobile */
  #assistant-panel {
    width: 100% !important;
    height: 100% !important;
    right: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    top: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    z-index: 2000 !important;
  }
}

/* Premium chatbot close button styling */
.asst-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-slate);
  color: var(--text-slate);
  font-size: 20px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  outline: none;
}
.asst-close:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red-critical) !important;
  border-color: var(--red-critical);
}
.asst-close:active {
  transform: scale(0.9);
}



