/* Yerel Excel - Office 365 Fluent Design Theme */
:root {
  --excel-green-primary: #107c41;
  --excel-green-dark: #0b5c31;
  --excel-green-darker: #074322;
  --excel-green-light: #dff6dd;
  --excel-green-hover: #138948;
  --excel-green-active: #0d6d37;
  --excel-bg-gray: #f3f2f1;
  --excel-border-color: #d1d1d1;
  --excel-cell-border: #e1dfdd;
  --excel-header-bg: #f8f9fa;
  --excel-selection-border: #107c41;
  --excel-selection-bg: rgba(16, 124, 65, 0.12);
  --excel-ribbon-bg: #ffffff;
  --excel-ribbon-tab-active: #ffffff;
  --excel-ribbon-tab-inactive: #f3f2f1;
  --excel-text-main: #242424;
  --excel-text-muted: #616161;
  --excel-font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  --shadow-sm: 0 1.6px 3.6px 0 rgba(0,0,0,0.13), 0 0.3px 0.9px 0 rgba(0,0,0,0.11);
  --shadow-md: 0 3.2px 7.2px 0 rgba(0,0,0,0.13), 0 0.6px 1.8px 0 rgba(0,0,0,0.11);
  --shadow-lg: 0 6.4px 14.4px 0 rgba(0,0,0,0.18), 0 1.2px 3.6px 0 rgba(0,0,0,0.14);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

body {
  font-family: var(--excel-font-family);
  font-size: 13px;
  color: var(--excel-text-main);
  background-color: var(--excel-bg-gray);
  overflow: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* TOP OFFICE 365 APP BAR */
.office-header {
  height: 48px;
  background-color: var(--excel-green-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
  z-index: 100;
}

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

.app-waffle-btn {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.app-waffle-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}
.app-icon {
  width: 24px;
  height: 24px;
  background: #0f6236;
  color: white;
  font-weight: 700;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.2);
}

.file-info {
  display: flex;
  flex-direction: column;
}
.file-name-input {
  background: transparent;
  border: 1px solid transparent;
  color: white;
  font-size: 14px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  outline: none;
  width: 220px;
  transition: all 0.2s;
  user-select: text;
  -webkit-user-select: text;
}
.file-name-input:hover {
  background: rgba(255, 255, 255, 0.15);
}
.file-name-input:focus {
  background: white;
  color: #242424;
  border-color: #0b5c31;
}

.save-status {
  font-size: 11px;
  opacity: 0.85;
  display: flex;
  align-items: center;
  gap: 4px;
  padding-left: 6px;
}

.header-center {
  flex: 1;
  max-width: 500px;
  margin: 0 20px;
}
.search-box {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  padding: 4px 10px;
  color: white;
  transition: background 0.2s;
}
.search-box:focus-within {
  background: white;
  color: #242424;
  box-shadow: var(--shadow-sm);
}
.search-box input {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 12px;
  width: 100%;
  outline: none;
  margin-left: 8px;
  user-select: text;
  -webkit-user-select: text;
}
.search-box input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}
.search-box:focus-within input::placeholder {
  color: #888;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hdr-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
}
.hdr-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}
.user-avatar {
  width: 28px;
  height: 28px;
  background: #ffaa00;
  color: #242424;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid white;
}

/* RIBBON BAR CONTAINER */
.ribbon-container {
  background: #fbfbfb;
  border-bottom: 1px solid #d1d1d1;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  display: flex;
  flex-direction: column;
}

/* Ribbon Tabs (Office 365 exact layout) */
.ribbon-tabs {
  display: flex;
  align-items: center;
  background: #f8f9fa;
  padding: 0 4px;
  border-bottom: 1px solid #e5e5e5;
  height: 30px;
  gap: 2px;
}
.ribbon-tab {
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 400;
  color: #242424;
  cursor: pointer;
  border-top-left-radius: 2px;
  border-top-right-radius: 2px;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  transition: all 0.1s;
  position: relative;
  user-select: none;
}
.ribbon-tab:hover {
  background: #eaeaea;
}
.ribbon-tab.active {
  background: #ffffff;
  color: #107c41;
  font-weight: 600;
  border: 1px solid #e5e5e5;
  border-bottom: 1px solid #ffffff;
  margin-bottom: -1px;
  z-index: 2;
}
.ribbon-tab.file-tab {
  color: #242424;
  font-weight: 500;
}
.ribbon-tab.file-tab:hover {
  background: #e1dfdd;
}

/* Ribbon Content Area */
.ribbon-content {
  background: #ffffff;
  min-height: 94px;
  max-height: 96px;
  display: flex;
  align-items: stretch;
  padding: 3px 6px;
  overflow-x: auto;
  overflow-y: hidden;
}
.ribbon-panel {
  display: none;
  height: 100%;
}
.ribbon-panel.active {
  display: flex;
  align-items: stretch;
  gap: 4px;
}

/* Ribbon Groups */
.ribbon-group {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2px 8px;
  border-right: 1px solid #e5e5e5;
  min-width: fit-content;
}
.ribbon-group-content {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.ribbon-group-title {
  text-align: center;
  font-size: 10px;
  color: var(--excel-text-muted);
  padding-top: 3px;
  letter-spacing: 0.2px;
}

/* Ribbon Buttons & Controls */
.ribbon-btn-large {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  min-width: 48px;
  gap: 3px;
  font-size: 11px;
  color: var(--excel-text-main);
  transition: all 0.15s;
}
.ribbon-btn-large svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.8;
}
.ribbon-btn-large:hover {
  background: #f0f0f0;
  border-color: #d8d8d8;
}
.ribbon-btn-large:active, .ribbon-btn-large.active {
  background: var(--excel-green-light);
  border-color: var(--excel-green-primary);
  color: var(--excel-green-dark);
}
.ribbon-btn-large.highlight {
  background: #e8f5e9;
  border: 1px solid #81c784;
  color: #1b5e20;
}
.ribbon-btn-large.highlight:hover {
  background: #c8e6c9;
}

.ribbon-col-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  justify-content: center;
}
.ribbon-row-group {
  display: flex;
  align-items: center;
  gap: 2px;
}

.ribbon-btn-small {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 24px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  color: var(--excel-text-main);
  font-size: 11px;
  transition: all 0.12s;
}
.ribbon-btn-small svg {
  width: 15px;
  height: 15px;
}
.ribbon-btn-small:hover {
  background: #f0f0f0;
  border-color: #d8d8d8;
}
.ribbon-btn-small:active, .ribbon-btn-small.active {
  background: var(--excel-green-light);
  border-color: var(--excel-green-primary);
  color: var(--excel-green-dark);
}

.ribbon-select {
  height: 24px;
  font-size: 11px;
  border: 1px solid #d1d1d1;
  border-radius: 3px;
  padding: 0 4px;
  background: white;
  outline: none;
  cursor: pointer;
}
.ribbon-select:hover {
  border-color: #a0a0a0;
}
.ribbon-select:focus {
  border-color: var(--excel-green-primary);
}

/* Color picker popups */
.color-picker-wrap {
  position: relative;
  display: inline-block;
}
.color-input-hidden {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* FORMULA BAR */
.formula-bar-container {
  height: 32px;
  background: #ffffff;
  border-bottom: 1px solid var(--excel-border-color);
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 6px;
  font-size: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.cell-name-box {
  width: 80px;
  height: 24px;
  border: 1px solid #d1d1d1;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #333;
  background: #fafafa;
  font-family: Consolas, "Courier New", monospace;
  cursor: pointer;
}
.cell-name-box:hover {
  border-color: #a0a0a0;
}

.formula-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}
.formula-act-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 3px;
  cursor: pointer;
  font-weight: bold;
  font-size: 12px;
  color: #555;
}
.formula-act-btn:hover {
  background: #f0f0f0;
  border-color: #ddd;
}
.formula-act-btn.fx-btn {
  font-style: italic;
  font-family: serif;
  font-size: 14px;
  color: #0b5c31;
  font-weight: bold;
}

.formula-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
}
.formula-input {
  width: 100%;
  height: 24px;
  border: 1px solid #d1d1d1;
  border-radius: 2px;
  padding: 2px 8px;
  font-size: 13px;
  font-family: Consolas, "Segoe UI", monospace;
  outline: none;
  background: #ffffff;
  user-select: text;
  -webkit-user-select: text;
}
.formula-input:focus {
  border-color: var(--excel-green-primary);
  box-shadow: 0 0 0 1px var(--excel-green-primary);
}

/* SPREADSHEET MAIN CONTAINER */
.spreadsheet-workspace {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
  background: #ffffff;
}

.spreadsheet-grid-viewport {
  flex: 1;
  overflow: auto;
  position: relative;
  outline: none;
}

/* TABLE STYLING */
.excel-table {
  border-collapse: collapse;
  table-layout: fixed;
  background: #ffffff;
  font-size: 12px;
  font-family: var(--excel-font-family);
}

/* Corner cell */
.th-corner {
  background: #f3f2f1;
  border-right: 1px solid #d1d1d1;
  border-bottom: 1px solid #d1d1d1;
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  height: 25px;
  position: sticky;
  top: 0;
  left: 0;
  z-index: 30;
  cursor: pointer;
}
.th-corner:hover {
  background: #e1dfdd;
}

/* Column Header (A, B, C...) */
.th-col {
  background: #f8f9fa;
  color: #444;
  font-weight: 500;
  text-align: center;
  height: 25px;
  border-right: 1px solid var(--excel-cell-border);
  border-bottom: 1px solid #bbb;
  position: sticky;
  top: 0;
  z-index: 20;
  user-select: none;
  font-size: 11px;
  cursor: pointer;
}
.th-col.selected-header {
  background: #dff6dd;
  color: var(--excel-green-dark);
  font-weight: 700;
  border-bottom: 2px solid var(--excel-green-primary);
}
.col-resizer {
  position: absolute;
  right: 0;
  top: 0;
  width: 5px;
  height: 100%;
  cursor: col-resize;
  z-index: 25;
}
.col-resizer:hover {
  background: var(--excel-green-primary);
}

/* Row Header (1, 2, 3...) */
.th-row {
  background: #f8f9fa;
  color: #444;
  font-weight: 500;
  text-align: center;
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  border-right: 1px solid #bbb;
  border-bottom: 1px solid var(--excel-cell-border);
  position: sticky;
  left: 0;
  z-index: 10;
  user-select: none;
  font-size: 11px;
  cursor: pointer;
}
.th-row.selected-header {
  background: #dff6dd;
  color: var(--excel-green-dark);
  font-weight: 700;
  border-right: 2px solid var(--excel-green-primary);
}
.row-resizer {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 5px;
  cursor: row-resize;
  z-index: 15;
}
.row-resizer:hover {
  background: var(--excel-green-primary);
}

/* Regular Grid Cells */
.excel-cell {
  border-right: 1px solid var(--excel-cell-border);
  border-bottom: 1px solid var(--excel-cell-border);
  padding: 2px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  height: 24px;
  background-color: #ffffff;
  color: #242424;
  position: relative;
  user-select: none;
  cursor: cell;
}

/* Header styled row (Row 1 usually) */
.excel-cell.header-row-cell {
  font-weight: 600;
}

/* Selection classes */
.excel-cell.cell-selected {
  outline: 2px solid var(--excel-selection-border);
  outline-offset: -2px;
  z-index: 5;
}
.excel-cell.in-range {
  background-color: var(--excel-selection-bg) !important;
}

/* Fill Handle (Sürükleme Tutamacı) */
.fill-handle {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 7px;
  height: 7px;
  background-color: var(--excel-selection-border);
  border: 1px solid #ffffff;
  cursor: crosshair;
  z-index: 9;
}

/* In-Cell Active Editor */
.in-cell-editor {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 2px solid var(--excel-selection-border);
  background: #ffffff;
  font-family: Consolas, "Segoe UI", monospace;
  font-size: 12px;
  padding: 2px 5px;
  outline: none;
  z-index: 50;
  user-select: text;
  -webkit-user-select: text;
  box-shadow: var(--shadow-sm);
}

/* Formül modunda hücre editörü - mavi kenarlık */
.in-cell-editor.formula-mode {
  border-color: #0078d4;
  background: #f0f7ff;
  color: #0b3574;
  caret-color: #0078d4;
  box-shadow: 0 0 0 1px #0078d4, var(--shadow-sm);
}

/* Formül modu - formula bar da mavi kenarlık */
.formula-input.formula-mode {
  border-color: #0078d4;
  box-shadow: 0 0 0 1px #0078d4;
  background: #f0f7ff;
  color: #0b3574;
}

/* Formül Otomatik Tamamlama Dropdown */
#formulaAutocomplete {
  position: fixed;
  background: #ffffff;
  border: 1px solid #c8c6c4;
  border-radius: 4px;
  box-shadow: var(--shadow-md);
  z-index: 9999;
  max-height: 220px;
  overflow-y: auto;
  min-width: 260px;
  display: none;
  font-size: 12px;
}
#formulaAutocomplete.visible {
  display: block;
}
.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 1px solid #f3f2f1;
}
.autocomplete-item:last-child {
  border-bottom: none;
}
.autocomplete-item:hover,
.autocomplete-item.active {
  background: #dff6dd;
  color: #0b5c31;
}
.autocomplete-item .ac-icon {
  width: 20px;
  height: 20px;
  background: #107c41;
  color: white;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: bold;
  font-style: italic;
  font-family: serif;
  flex-shrink: 0;
}
.autocomplete-item .ac-name {
  font-weight: 600;
  color: #107c41;
  font-family: Consolas, monospace;
}
.autocomplete-item.active .ac-name {
  color: #0b5c31;
}
.autocomplete-item .ac-desc {
  color: #616161;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.autocomplete-item.active .ac-desc {
  color: #074322;
}
.autocomplete-header {
  padding: 4px 10px 3px;
  font-size: 10px;
  font-weight: 600;
  color: #888;
  background: #fafafa;
  border-bottom: 1px solid #eee;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  user-select: none;
}

/* SHEET TABS & STATUS BAR */
.sheet-tabs-bar {
  height: 34px;
  background: #f3f2f1;
  border-top: 1px solid var(--excel-border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  z-index: 90;
}

.sheets-nav-left {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  max-width: 60%;
}

.sheet-tab-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: #e1dfdd;
  border: 1px solid #d1d1d1;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  font-size: 12px;
  font-weight: 500;
  color: #444;
  cursor: pointer;
  transition: all 0.15s;
  height: 28px;
  position: relative;
  bottom: -3px;
}
.sheet-tab-item:hover {
  background: #ebebeb;
}
.sheet-tab-item.active {
  background: #ffffff;
  color: var(--excel-green-primary);
  font-weight: 600;
  border-color: #d1d1d1;
  border-bottom: 2px solid var(--excel-green-primary);
  z-index: 2;
}

.add-sheet-btn {
  background: transparent;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #555;
  font-size: 16px;
  font-weight: bold;
  transition: background 0.15s;
  margin-left: 4px;
}
.add-sheet-btn:hover {
  background: #e1dfdd;
  color: #000;
}

/* Status bar info on right */
.sheets-status-right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  color: var(--excel-text-muted);
}
.status-calc-item {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0,0,0,0.03);
  padding: 2px 6px;
  border-radius: 3px;
}
.status-calc-item b {
  color: #242424;
}

.zoom-widget {
  display: flex;
  align-items: center;
  gap: 6px;
}
.zoom-slider {
  width: 70px;
  height: 4px;
  accent-color: var(--excel-green-primary);
  cursor: pointer;
}
.zoom-pct {
  width: 38px;
  text-align: right;
  font-weight: 600;
}

/* CONTEXT MENU */
.excel-context-menu {
  position: fixed;
  background: #ffffff;
  border: 1px solid #d1d1d1;
  box-shadow: var(--shadow-md);
  border-radius: 4px;
  padding: 4px 0;
  z-index: 1000;
  display: none;
  min-width: 170px;
}
.context-menu-item {
  padding: 6px 14px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #242424;
  transition: background 0.1s;
}
.context-menu-item:hover {
  background: #f0f0f0;
  color: var(--excel-green-primary);
}
.context-menu-separator {
  height: 1px;
  background: #e5e5e5;
  margin: 4px 0;
}

/* MODALS & OVERLAYS */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
}
.modal-window {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  border: 1px solid #d1d1d1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 90vh;
}
.modal-header {
  padding: 12px 18px;
  background: var(--excel-header-bg);
  border-bottom: 1px solid var(--excel-border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--excel-green-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-close-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: #888;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 4px;
}
.modal-close-btn:hover {
  background: #e8e8e8;
  color: #111;
}

.modal-body {
  padding: 18px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: 12px 18px;
  background: #f8f9fa;
  border-top: 1px solid #e1dfdd;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.btn-primary {
  background: var(--excel-green-primary);
  color: white;
  border: none;
  padding: 7px 16px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover {
  background: var(--excel-green-dark);
}
.btn-secondary {
  background: #ffffff;
  color: #333;
  border: 1px solid #d1d1d1;
  padding: 7px 16px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.btn-secondary:hover {
  background: #f0f0f0;
}

/* FLOATING CHART CONTAINER */
.floating-chart-box {
  position: absolute;
  width: 520px;
  height: 340px;
  background: #ffffff;
  border: 1px solid var(--excel-border-color);
  box-shadow: var(--shadow-md);
  border-radius: 6px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  resize: both;
}
.chart-box-header {
  height: 32px;
  background: #f8f9fa;
  border-bottom: 1px solid #e1dfdd;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  cursor: move;
  font-weight: 600;
  font-size: 12px;
  color: var(--excel-green-dark);
}
.chart-box-header .chart-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.chart-box-content {
  flex: 1;
  padding: 10px;
  position: relative;
  min-height: 0;
}

/* 3D MAP FULLSCREEN / WINDOW STYLES */
.map3d-window {
  width: 92vw;
  height: 88vh;
  max-width: 1400px;
}
.map3d-layout {
  display: flex;
  height: 100%;
  position: relative;
}
.map3d-viewport {
  flex: 1;
  background: #0d131a;
  position: relative;
  overflow: hidden;
}
.map3d-sidebar {
  width: 320px;
  background: #18222d;
  color: #e0e6ed;
  border-left: 1px solid #2a3b4c;
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 16px;
  overflow-y: auto;
}
.map3d-controls-overlay {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(18, 26, 36, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 10px 14px;
  color: white;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 50;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.map3d-badge {
  background: var(--excel-green-primary);
  color: white;
  font-size: 11px;
  font-weight: bold;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}
.map3d-tooltip {
  position: absolute;
  display: none;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid #38bdf8;
  color: white;
  border-radius: 6px;
  padding: 10px 14px;
  pointer-events: none;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  font-size: 12px;
  min-width: 180px;
}
.map3d-tooltip h4 {
  color: #38bdf8;
  font-size: 14px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 4px;
}
.map3d-tooltip .metric-row {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
}
.map3d-timeline-bar {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(18, 26, 36, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 30px;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 50;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  color: white;
}
.timeline-play-btn {
  background: var(--excel-green-primary);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: transform 0.1s;
}
.timeline-play-btn:hover {
  transform: scale(1.08);
}

/* Formül referans renklendirme (Excel nokta modu) */
.excel-cell.formula-ref-color.ref-c0 { box-shadow: inset 0 0 0 2px #4472c4; background-color: rgba(68, 114, 196, 0.12) !important; }
.excel-cell.formula-ref-color.ref-c1 { box-shadow: inset 0 0 0 2px #ed7d31; background-color: rgba(237, 125, 49, 0.12) !important; }
.excel-cell.formula-ref-color.ref-c2 { box-shadow: inset 0 0 0 2px #a5a5a5; background-color: rgba(165, 165, 165, 0.12) !important; }
.excel-cell.formula-ref-color.ref-c3 { box-shadow: inset 0 0 0 2px #ffc000; background-color: rgba(255, 192, 0, 0.15) !important; }
.excel-cell.formula-ref-color.ref-c4 { box-shadow: inset 0 0 0 2px #5b9bd5; background-color: rgba(91, 155, 213, 0.12) !important; }

.excel-cell.find-hit {
  background-color: #fff3cd !important;
  outline: 2px solid #ffc107;
}

/* Bul / Değiştir & Formül yardımcısı */
.fr-window, .fw-window {
  width: 480px;
  max-width: 95vw;
}
.fr-body, .fw-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fr-label {
  font-size: 12px;
  color: #444;
  min-width: 90px;
}
.fr-input {
  flex: 1;
  height: 28px;
  border: 1px solid #d1d1d1;
  border-radius: 3px;
  padding: 0 8px;
  font-size: 13px;
  user-select: text;
  -webkit-user-select: text;
}
.fr-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fr-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  margin-top: 4px;
}
.fr-options label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.fw-func-name {
  font-size: 15px;
  font-weight: 700;
  color: #107c41;
  margin-bottom: 4px;
}
.fw-func-desc {
  font-size: 12px;
  color: #555;
  line-height: 1.45;
  margin-bottom: 8px;
}
.fw-arg-row {
  display: grid;
  grid-template-columns: 130px 1fr minmax(100px, 190px);
  gap: 4px 10px;
  margin-bottom: 10px;
  align-items: start;
}
.fw-arg-label {
  font-size: 12px;
  font-weight: 600;
  padding-top: 6px;
}
.fw-arg-input-wrap {
  display: flex;
  gap: 4px;
}
.fw-arg-input {
  flex: 1;
  height: 26px;
  border: 1px solid #d1d1d1;
  border-radius: 3px;
  padding: 0 6px;
  font-size: 12px;
  user-select: text;
  -webkit-user-select: text;
}
.fw-pick-btn {
  width: 28px;
  height: 26px;
  border: 1px solid #d1d1d1;
  background: #f8f9fa;
  border-radius: 3px;
  cursor: pointer;
}
.fw-pick-btn:hover {
  background: #dff6dd;
  border-color: #107c41;
}
.fw-arg-type {
  grid-column: 3;
  grid-row: 1;
  align-self: center;
  font-size: 12px;
  color: #444;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fw-arg-row.fw-opt .fw-arg-label { font-weight: 400; }
.fw-arg-row:not(.fw-active) .fw-arg-hint { display: none; }
.fw-formula-code { flex-basis: 100%; color: #666; }
.fw-arg-hint {
  grid-column: 1 / -1;
  font-size: 11px;
  color: #666;
  margin: 0;
  padding-left: 0;
}
.fw-result-row {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e5e5e5;
  font-size: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.fw-result-row code {
  background: #f3f4f6;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: Consolas, monospace;
  font-size: 11px;
}
.fw-live-result {
  color: #107c41;
}
.fw-help-link {
  margin-right: auto;
  font-size: 12px;
  color: #107c41;
  text-decoration: none;
}
.fw-help-link:hover {
  text-decoration: underline;
}


.excel-table td.frozen-row{position:sticky;z-index:4;box-shadow:0 2px 0 rgba(0,0,0,.12)}

/* Sanallaştırma boşluk satırı */
.excel-table tr.vs-spacer { background: transparent; }
.excel-table tr.vs-spacer td { padding: 0; border: 0; background: transparent; pointer-events: none; }
