/* ============ DATA TABLES ============ */
.table-toolbar {
  display: flex; align-items: center; gap: var(--space-3);
  margin-bottom: var(--space-4); flex-wrap: wrap;
}
.table-search {
  display: flex; align-items: center; gap: var(--space-2);
  background: var(--bg-input); border: 1px solid var(--border-default);
  border-radius: var(--radius-md); padding: var(--space-2) var(--space-3);
  flex: 1; min-width: 200px; max-width: 360px;
  transition: border-color var(--transition-fast);
}
.table-search:focus-within { border-color: var(--border-brand); }
.table-search input { background: none; border: none; outline: none; color: var(--text-primary); font-size: var(--text-sm); width: 100%; font-family: var(--font-sans); }
.table-search input::placeholder { color: var(--text-muted); }
.table-filter { display: flex; gap: var(--space-2); align-items: center; margin-left: auto; flex-wrap: wrap; }

.table-wrap {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); overflow: hidden;
}
.table-wrap table { width: 100%; border-collapse: collapse; }
.table-wrap thead tr { border-bottom: 1px solid var(--border-subtle); }
.table-wrap thead th {
  padding: var(--space-3) var(--space-4); text-align: left;
  font-size: var(--text-xs); font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
  background: rgba(255,255,255,0.02); white-space: nowrap;
  cursor: pointer; transition: color var(--transition-fast); user-select: none;
}
.table-wrap thead th:hover { color: var(--text-secondary); }
.table-wrap thead th.sorted { color: var(--text-brand); }
.table-wrap thead th .sort-icon { display: inline-block; margin-left: 4px; opacity: 0.5; font-size: 10px; }
.table-wrap thead th.sorted .sort-icon { opacity: 1; }

.table-wrap tbody tr {
  border-bottom: 1px solid var(--border-subtle); transition: background var(--transition-fast);
}
.table-wrap tbody tr:last-child { border-bottom: none; }
.table-wrap tbody tr:hover { background: rgba(255,255,255,0.02); }
.table-wrap tbody td { padding: var(--space-3) var(--space-4); font-size: var(--text-sm); color: var(--text-secondary); vertical-align: middle; }
.table-wrap tbody td .primary-cell { color: var(--text-primary); font-weight: 500; }
.table-wrap tbody td .sub-cell { color: var(--text-muted); font-size: var(--text-xs); margin-top: 2px; }

.table-actions { display: flex; align-items: center; gap: var(--space-1); flex-wrap: wrap; }
.action-btn {
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 15px; transition: all var(--transition-fast);
  background: none; border: none; color: var(--text-muted);
}
.action-btn:hover { background: var(--glass-bg); color: var(--text-primary); }
.action-btn.edit:hover { color: var(--accent-cyan); }
.action-btn.delete:hover { color: var(--accent-rose); }
.action-btn.view:hover { color: var(--accent-emerald); }

/* Pagination */
.table-pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-4) var(--space-5); border-top: 1px solid var(--border-subtle);
  background: var(--bg-card); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  flex-wrap: wrap; gap: var(--space-3);
}
.pagination-info { font-size: var(--text-xs); color: var(--text-muted); }
.pagination-controls { display: flex; gap: var(--space-1); }
.page-btn {
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  background: var(--glass-bg); border: 1px solid var(--border-default);
  color: var(--text-secondary); font-size: var(--text-sm); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition-fast);
}
.page-btn:hover, .page-btn.active { background: rgba(99,102,241,0.2); color: var(--text-brand); border-color: var(--border-brand); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Empty State */
.table-empty {
  padding: var(--space-16) var(--space-8); text-align: center;
}
.table-empty-icon { font-size: 48px; margin-bottom: var(--space-4); opacity: 0.4; }
.table-empty-title { font-size: var(--text-base); font-weight: 600; color: var(--text-secondary); margin-bottom: var(--space-2); }
.table-empty-desc { font-size: var(--text-sm); color: var(--text-muted); }


/* =========================================================
   SPREADSHEET WORKSPACE — Airtable-style grid
   ========================================================= */

/* Toolbar */
.ss-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}
.ss-toolbar-left  { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ss-toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.ss-table-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid;
  font-size: 13px;
}

/* Collaboration indicator area */
.ss-collab-area {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ss-collab-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-indigo);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: white;
  font-weight: 700;
  border: 2px solid var(--bg-base);
  cursor: default;
}

/* Save indicator */
.ss-save-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--accent-cyan);
  animation: fadeIn 0.2s;
}
.ss-save-spinner {
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Main spreadsheet container */
.ss-container {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  height: calc(100vh - 240px);
  min-height: 400px;
}

.ss-grid-wrap {
  overflow: auto;
  flex: 1;
  position: relative;
}

/* The spreadsheet table itself */
.ss-grid {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  table-layout: auto;
}

/* Column headers */
.ss-th {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 0;
  background: var(--bg-elevated, #1a1d3a);
  border-bottom: 2px solid var(--header-color, #6366f1);
  border-right: 1px solid var(--border-subtle);
  white-space: nowrap;
  user-select: none;
}
.ss-th:first-child { border-left: none; }
.ss-th-row-num {
  width: 48px;
  min-width: 48px;
  position: sticky;
  top: 0;
  left: 0;
  z-index: 20;
  background: var(--bg-elevated, #1a1d3a);
}
.ss-th-inner {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ss-col-type-icon { font-size: 12px; opacity: 0.7; font-style: normal; }
.ss-col-name      { color: var(--text-secondary); }
.ss-req-dot       { color: var(--accent-rose); font-size: 14px; line-height: 1; }

.ss-th-actions {
  width: 56px;
  min-width: 56px;
}

/* Row cells */
.ss-td {
  padding: 0;
  border-bottom: 1px solid var(--border-subtle);
  border-right: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
  position: relative;
  background: var(--bg-card);
  transition: background 0.1s;
}
.ss-td-row-num {
  width: 48px;
  min-width: 48px;
  position: sticky;
  left: 0;
  z-index: 5;
  background: var(--bg-card);
  border-right: 1px solid var(--border-subtle);
  text-align: center;
}
.ss-td-actions {
  width: 56px;
  min-width: 56px;
  text-align: center;
}
.ss-row-num {
  font-size: 11px;
  color: var(--text-disabled);
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 4px;
}

/* Row states */
.ss-row:hover .ss-td { background: rgba(99,102,241,0.04); }
.ss-row:hover .ss-td-row-num { background: rgba(99,102,241,0.08); }
.ss-row-virtual .ss-td { background: rgba(255,255,255,0.01); }
.ss-row-virtual:hover .ss-td { background: rgba(99,102,241,0.03); }
.ss-row-new .ss-td { animation: rowFadeIn 0.4s ease; }
.ss-row-locked .ss-td { background: rgba(245,158,11,0.04); }

@keyframes rowFadeIn {
  from { background: rgba(99,102,241,0.12); }
  to   { background: transparent; }
}

/* Remote update highlight flash */
.ss-cell-updated {
  animation: cellFlash 0.8s ease;
}
@keyframes cellFlash {
  0%   { background: rgba(6,182,212,0.25); }
  100% { background: transparent; }
}

/* Lock indicator */
.ss-lock-indicator {
  font-size: 13px;
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Inline cell inputs */
.ss-input {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-sans);
  transition: background 0.15s;
  box-sizing: border-box;
}
.ss-input:focus {
  background: rgba(99,102,241,0.08);
  box-shadow: inset 0 0 0 2px rgba(99,102,241,0.5);
  border-radius: 4px;
}
.ss-input::placeholder { color: var(--text-disabled); }

.ss-select {
  height: 34px;
  padding: 0 8px;
  cursor: pointer;
}
.ss-status-select option[value="Done"]        { color: #10b981; }
.ss-status-select option[value="In Progress"] { color: #f59e0b; }
.ss-status-select option[value="Todo"]        { color: #94a3b8; }

.ss-checkbox {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  cursor: pointer;
  padding: 0 10px;
}
.ss-checkbox input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent-indigo);
  cursor: pointer;
}

.ss-cell-placeholder { display: block; height: 34px; }
.ss-cell-virtual     { cursor: cell; }
.ss-cell-virtual:hover .ss-cell-placeholder {
  background: rgba(99,102,241,0.06);
  border-radius: 3px;
}

/* Action buttons inside grid */
.ss-action-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.15s;
  color: var(--text-muted);
}
.ss-row:hover .ss-action-btn { opacity: 1; }
.ss-del-row:hover       { background: rgba(244,63,94,0.15); color: var(--accent-rose); }
.ss-save-new-row        { opacity: 1 !important; background: rgba(99,102,241,0.15); color: var(--accent-indigo); }
.ss-save-new-row:hover  { background: rgba(99,102,241,0.3); }

/* Status bar */
.ss-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px;
  border-top: 1px solid var(--border-subtle);
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.01);
  flex-shrink: 0;
}

/* Color picker (shared with schema modal) */
.color-picker-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
}
.color-swatch:hover  { transform: scale(1.15); }
.color-swatch.selected { border-color: white; transform: scale(1.2); }

/* Scrollbar styling for the grid */
.ss-grid-wrap::-webkit-scrollbar       { width: 8px; height: 8px; }
.ss-grid-wrap::-webkit-scrollbar-track { background: rgba(255,255,255,0.02); }
.ss-grid-wrap::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
.ss-grid-wrap::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .ss-toolbar { flex-direction: column; align-items: flex-start; }
  .ss-toolbar-right { width: 100%; justify-content: flex-end; }
  .ss-container { height: calc(100vh - 300px); }
}

/* =========================================================
   EXCEL-STYLE PREMIUM LIGHT THEME (SCOPED)
   ========================================================= */
#spreadsheet-workspace {
  --bg-card: #ffffff;
  --bg-elevated: #f9fafb;
  --border-subtle: #e5e7eb;
  --border-default: #d1d5db;
  --text-primary: #111827;
  --text-secondary: #374151;
  --text-muted: #6b7280;
  --text-disabled: #9ca3af;
  --glass-bg: rgba(0, 0, 0, 0.04);
  background: #f3f4f6 !important;
  color: #111827 !important;
  padding: 16px;
  border-radius: var(--radius-xl);
}

#spreadsheet-workspace .ss-toolbar {
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

#spreadsheet-workspace .ss-container {
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

#spreadsheet-workspace .ss-th {
  background: #f9fafb !important;
  border-right: 1px solid #e5e7eb !important;
  border-bottom: 2px solid var(--header-color, #6366f1) !important;
}

#spreadsheet-workspace .ss-th-row-num {
  background: #f3f4f6 !important;
  border-right: 1px solid #d1d5db !important;
}

#spreadsheet-workspace .ss-th-inner {
  color: #4b5563 !important;
  font-weight: 700;
}

#spreadsheet-workspace .ss-col-name {
  color: #111827 !important;
}

#spreadsheet-workspace .ss-td {
  background: #ffffff !important;
  border-right: 1px solid #e5e7eb !important;
  border-bottom: 1px solid #e5e7eb !important;
  color: #111827 !important;
}

#spreadsheet-workspace .ss-td-row-num {
  background: #f9fafb !important;
  border-right: 1px solid #d1d5db !important;
}

#spreadsheet-workspace .ss-row-num {
  color: #6b7280 !important;
  font-weight: 600;
}

/* Hover effects */
#spreadsheet-workspace .ss-row:hover .ss-td {
  background: #f3f4f6 !important;
}

#spreadsheet-workspace .ss-row:hover .ss-td-row-num {
  background: #e5e7eb !important;
}

#spreadsheet-workspace .ss-row-virtual .ss-td {
  background: #ffffff !important;
  opacity: 0.85;
}

#spreadsheet-workspace .ss-row-virtual:hover .ss-td {
  background: #f9fafb !important;
}

#spreadsheet-workspace .ss-cell-virtual:hover .ss-cell-placeholder {
  background: rgba(99, 102, 241, 0.05) !important;
}

/* Row states */
#spreadsheet-workspace .ss-row-locked .ss-td {
  background: #fffbeb !important; /* Premium light amber for conflict row locks */
}

/* Inputs and interactive elements */
#spreadsheet-workspace .ss-input {
  color: #111827 !important;
}

#spreadsheet-workspace .ss-input:focus {
  background: #ffffff !important;
  box-shadow: inset 0 0 0 2px var(--header-color, #6366f1) !important;
  border-radius: 4px;
}

#spreadsheet-workspace .ss-select {
  background-color: transparent !important;
  color: #111827 !important;
}

/* FIX: White-on-white text select option rendering bug */
#spreadsheet-workspace select.ss-select option {
  background-color: #ffffff !important;
  color: #111827 !important;
}

#spreadsheet-workspace .ss-checkbox input[type="checkbox"] {
  accent-color: var(--header-color, #6366f1) !important;
}

/* Badges styling for light background contrast */
#spreadsheet-workspace .badge-muted {
  background: #f3f4f6 !important;
  color: #4b5563 !important;
  border: 1px solid #e5e7eb;
}

#spreadsheet-workspace .badge-info {
  background: #e0f2fe !important;
  color: #0369a1 !important;
}

#spreadsheet-workspace .badge-purple {
  background: #f3e8ff !important;
  color: #6b21a8 !important;
}

#spreadsheet-workspace .badge-success {
  background: #dcfce7 !important;
  color: #166534 !important;
}

#spreadsheet-workspace .badge-warning {
  background: #fef3c7 !important;
  color: #92400e !important;
}

/* Status Bar */
#spreadsheet-workspace .ss-status-bar {
  background: #f9fafb !important;
  border-top: 1px solid #e5e7eb !important;
  color: #4b5563 !important;
}

/* Scrollbar overrides for light mode */
#spreadsheet-workspace .ss-grid-wrap::-webkit-scrollbar-track {
  background: #f3f4f6 !important;
}

#spreadsheet-workspace .ss-grid-wrap::-webkit-scrollbar-thumb {
  background: #d1d5db !important;
  border-radius: 4px !important;
}

#spreadsheet-workspace .ss-grid-wrap::-webkit-scrollbar-thumb:hover {
  background: #9ca3af !important;
}

/* =========================================================
   NEXWARE UPGRADE: AVATAR STACK & TOOLTIP
   ========================================================= */
.avatar-stack-container {
  position: relative;
  display: inline-block;
  cursor: pointer;
}
.avatar-stack {
  display: flex;
  align-items: center;
  margin-left: 4px;
}
.avatar-stack-item {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--bg-card);
  margin-left: -8px;
  overflow: hidden;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, z-index 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  position: relative;
}
.avatar-stack-item:first-child {
  margin-left: 0;
}
.avatar-stack-item:hover {
  transform: translateY(-3px);
  z-index: 20;
}
.avatar-stack-more {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-input);
  border: 2px solid var(--border-default);
  margin-left: -8px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.avatar-stack-tooltip {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 8px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  z-index: 1000;
  min-width: 240px;
  color: #111827;
  text-align: left;
}
.avatar-stack-container:hover .avatar-stack-tooltip {
  display: block;
}
.tooltip-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid #f3f4f6;
}
.tooltip-user-row:last-child {
  border-bottom: none;
}

/* =========================================================
   NEXWARE UPGRADE: SPREADSHEET TOOLBAR MENU SYSTEM
   ========================================================= */
.ss-toolbar-menus {
  display: flex;
  gap: 2px;
  background: #f3f4f6;
  padding: 2px 8px;
  border-bottom: 1px solid #e5e7eb;
  border-radius: 6px 6px 0 0;
  flex-wrap: wrap;
}
.ss-menu-item {
  position: relative;
  display: inline-block;
}
.ss-menu-btn {
  background: transparent;
  border: none;
  outline: none;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.ss-menu-btn:hover {
  background: #e5e7eb;
  color: #111827;
}
.ss-menu-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  z-index: 100;
  min-width: 160px;
  padding: 4px 0;
  margin-top: 2px;
}
.ss-menu-item:hover .ss-menu-dropdown {
  display: block;
}
.ss-menu-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  padding: 8px 16px;
  font-size: 13px;
  color: #374151;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.ss-menu-dropdown-item:hover {
  background: #f3f4f6;
  color: #111827;
}
.ss-menu-dropdown-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 4px 0;
}

/* =========================================================
   NEXWARE UPGRADE: FORMAT QUICK TOOLBAR
   ========================================================= */
.ss-format-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #ffffff;
  padding: 4px 8px;
  border-bottom: 1px solid #e5e7eb;
  flex-wrap: wrap;
}
.ss-format-btn {
  background: transparent;
  border: none;
  outline: none;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  color: #4b5563;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}
.ss-format-btn:hover {
  background: #f3f4f6;
  color: #111827;
}
.ss-format-btn.active {
  background: #e0f2fe;
  color: #0284c7;
}
.ss-format-select {
  height: 28px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 0 4px;
  font-size: 12px;
  color: #374151;
  background: #ffffff;
  cursor: pointer;
}
.ss-format-divider {
  width: 1px;
  height: 18px;
  background: #e5e7eb;
  margin: 0 4px;
}

/* =========================================================
   NEXWARE UPGRADE: COLLAPSIBLE SIDEBAR INFO PANEL
   ========================================================= */
.ss-layout-container {
  display: flex;
  width: 100%;
  gap: 12px;
}
.ss-grid-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.ss-sidebar-panel {
  width: 280px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: all 0.2s ease-in-out;
}
.ss-sidebar-panel.collapsed {
  display: none;
}
.ss-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f3f4f6;
  padding-bottom: 10px;
}
.ss-sidebar-title {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}
.ss-sidebar-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ss-sidebar-label {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 600;
  color: #9ca3af;
  letter-spacing: 0.05em;
}
.ss-sidebar-value {
  font-size: 13px;
  color: #374151;
}

/* =========================================================
   NEXWARE UPGRADE: COLUMN RESIZERS & HEADERS
   ========================================================= */
.ss-th-inner-excel {
  display: flex;
  flex-direction: column;
  padding: 4px 8px;
  position: relative;
  height: 100%;
  justify-content: center;
}
.ss-th-letter {
  font-size: 10px;
  font-weight: 700;
  color: #9ca3af;
  text-align: center;
  border-bottom: 1px solid #f3f4f6;
  padding-bottom: 2px;
  margin-bottom: 2px;
}
.col-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  cursor: col-resize;
  background: transparent;
  transition: background 0.15s;
  z-index: 50;
}
.col-resize-handle:hover, .col-resize-handle.active {
  background: var(--header-color, #6366f1);
}

/* Selected Cell state */
.ss-cell {
  position: relative;
  cursor: cell;
}
.ss-cell.ss-cell-selected {
  outline: 2px solid var(--header-color, #6366f1) !important;
  outline-offset: -2px;
  background: rgba(99, 102, 241, 0.02) !important;
  z-index: 2;
}

/* Custom barcode container styling */
.barcode-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #ffffff;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  margin-top: 4px;
}
.barcode-container svg {
  max-width: 100%;
  height: auto;
}

/* =========================================================
   NEXWARE PHASE 2 UPGRADE: FORMULA BAR
   ========================================================= */
.ss-formula-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  padding: 6px 12px;
}
.ss-formula-label {
  font-size: 11px;
  font-weight: 700;
  color: #9ca3af;
  font-family: var(--font-mono);
  user-select: none;
  min-width: 32px;
}
.ss-formula-divider {
  width: 1px;
  height: 14px;
  background: #e5e7eb;
}
.ss-formula-input {
  flex: 1;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 13px;
  font-family: var(--font-mono);
  background: #f9fafb;
  outline: none;
  color: #111827;
  transition: border-color 0.15s, background-color 0.15s;
}
.ss-formula-input:focus {
  border-color: var(--header-color, #6366f1);
  background: #ffffff;
}

/* =========================================================
   NEXWARE PHASE 2 UPGRADE: CAMERA SCANNER VIEWFINDER
   ========================================================= */
.scanner-viewfinder-modal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}
.scanner-video-feed {
  width: 100%;
  max-width: 440px;
  height: 280px;
  background: #000000;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  border: 2px solid #374151;
}
.scanner-video-feed video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scanner-overlay-box {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 140px;
  border: 2px dashed #10b981;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}
.scanner-laser-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  animation: laserScan 2s linear infinite;
  pointer-events: none;
}
@keyframes laserScan {
  0%   { top: 0; }
  50%  { top: 100%; }
  100% { top: 0; }
}

/* Gridline Toggles */
.ss-grid-no-gridlines td {
  border-right: 1px solid transparent !important;
}
.ss-grid-no-gridlines th {
  border-right: 1px solid transparent !important;
}
.ss-grid-no-gridlines .ss-td-row-num {
  border-right: 1px solid #d1d5db !important;
}
.ss-grid-no-gridlines .ss-th-row-num {
  border-right: 1px solid #d1d5db !important;
}

/* Fullscreen state container spacing override */
.fullscreen-active {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 99999 !important;
  background: #f3f4f6 !important;
  padding: 16px !important;
  box-sizing: border-box !important;
}
.fullscreen-active .ss-container {
  height: calc(100vh - 180px) !important;
}


