/* ── Excel Panel ── */

.excel-panel {
  background: var(--surface);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Toolbar */
.excel-toolbar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--excel-toolbar);
  color: white;
  height: 32px;
  flex-shrink: 0;
}

.excel-toolbar-icon {
  font-size: 14px;
  opacity: 0.8;
}

.excel-toolbar-title {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.3px;
}



/* Formula bar */
.formula-bar {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  height: 28px;
  flex-shrink: 0;
  background: var(--surface);
}

.formula-ref {
  width: 56px;
  padding: 0 var(--sp-2);
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text);
  background: var(--border-light);
  border-right: 1px solid var(--border);
  height: 100%;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.formula-fx {
  padding: 0 var(--sp-2);
  font-size: var(--text-sm);
  font-style: italic;
  font-weight: 600;
  color: var(--text-muted);
  border-right: 1px solid var(--border);
  height: 100%;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.formula-val {
  flex: 1;
  padding: 0 var(--sp-2);
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: var(--text-secondary);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  height: 100%;
  display: flex;
  align-items: center;
}

/* Spreadsheet container */
.spreadsheet-container {
  flex: 1;
  overflow: auto;
  position: relative;
}

/* jspreadsheet overrides */
.spreadsheet-container .jexcel {
  width: 100% !important;
  font-family: var(--font) !important;
  font-size: var(--text-sm) !important;
}

.spreadsheet-container .jexcel thead td {
  background: var(--border-light) !important;
  color: var(--text-muted) !important;
  font-weight: 600 !important;
  font-size: var(--text-xs) !important;
  border-color: var(--border) !important;
  padding: 3px 6px !important;
}

.spreadsheet-container .jexcel tbody td {
  border-color: var(--border) !important;
  padding: 4px 8px !important;
  color: var(--text) !important;
  vertical-align: middle !important;
}

.spreadsheet-container .jexcel tbody td.readonly {
  color: var(--text-muted) !important;
  background: var(--border-light) !important;
  font-style: italic;
}

.spreadsheet-container .jexcel .highlight {
  background: var(--primary-light) !important;
}

.spreadsheet-container .jexcel .highlight-left,
.spreadsheet-container .jexcel .highlight-right,
.spreadsheet-container .jexcel .highlight-top,
.spreadsheet-container .jexcel .highlight-bottom {
  border-color: var(--primary) !important;
}

/* Row numbers */
.spreadsheet-container .jexcel tbody td:first-child {
  background: var(--border-light) !important;
  color: var(--text-muted) !important;
  font-weight: 500 !important;
  font-size: var(--text-xs) !important;
}

/* Header row styling (applied via JS) */
.spreadsheet-container .jexcel tbody tr:first-child td {
  font-weight: 600 !important;
}

/* Excel toolbar icon */
.excel-toolbar-icon {
  font-size: 13px;
  opacity: 0.9;
}
