/* Excel-native PivotTable / Slicer / Timeline editors. */
.native-data-dialog {
  position: fixed; inset: 50% auto auto 50%; z-index: 105; transform: translate(-50%, -50%);
  width: min(1120px, calc(100vw - 36px)); height: min(760px, calc(100vh - 48px));
  display: flex; flex-direction: column; overflow: hidden; color: #222; background: #fff;
  border: 1px solid #999; border-radius: 7px; box-shadow: 0 14px 46px rgba(0,0,0,.32);
  font: var(--font);
}
.native-data-dialog[hidden] { display: none; }
.native-data-title { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 12px; border-bottom: 1px solid #ddd; font-weight: 700; }
.native-data-title .native-data-subtitle { min-width: 0; overflow: hidden; color: #777; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; }
.native-data-title button { margin-left: auto; border: 0; background: transparent; color: #777; cursor: pointer; font-size: 20px; }
.native-data-note { padding: 7px 12px; color: #3c4c5d; background: #f3f7fb; border-bottom: 1px solid #d9e4ef; font-size: 12px; }
.native-data-main { min-height: 0; flex: 1; display: grid; grid-template-columns: 245px minmax(0, 1fr); }
.native-data-sidebar { min-height: 0; display: flex; flex-direction: column; padding: 10px; background: #fafafa; border-right: 1px solid #ddd; }
.native-data-list { min-height: 0; flex: 1; overflow: auto; border: 1px solid #d7d7d7; background: #fff; }
.native-data-list > button { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 8px 9px; border: 0; border-bottom: 1px solid #e6e6e6; background: #fff; text-align: left; cursor: pointer; font: var(--font); }
.native-data-list > button:hover { background: #f4f8f6; }
.native-data-list > button.active { background: var(--accent-weak); box-shadow: inset 3px 0 var(--accent); }
.native-data-list > button span, .native-data-list > button small { overflow: hidden; color: #666; text-overflow: ellipsis; white-space: nowrap; }
.native-data-list > button small { color: #888; }
.native-data-side-actions { display: flex; gap: 6px; margin-top: 8px; }
.native-data-side-actions button { min-height: 28px; flex: 1; border: 1px solid #bbb; border-radius: 3px; background: #fff; cursor: pointer; font: var(--font); }
.native-data-editor { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.native-data-tabs { display: flex; gap: 2px; padding: 8px 10px 0; border-bottom: 1px solid #ddd; }
.native-data-tabs button { padding: 6px 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; cursor: pointer; font: var(--font); }
.native-data-tabs button.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }
.native-data-body { min-height: 0; flex: 1; overflow: auto; padding: 12px; }
.native-empty { padding: 42px 15px; color: #888; text-align: center; }
.native-section { margin: 0 0 13px; padding: 10px; border: 1px solid #ddd; border-radius: 4px; }
.native-section > h3 { margin: -1px 0 8px; font-size: 13px; }
.native-form-grid { display: grid; grid-template-columns: repeat(3, minmax(150px,1fr)); gap: 7px 12px; }
.native-form-grid.two { grid-template-columns: repeat(2, minmax(180px,1fr)); }
.native-form-grid label, .native-check { display: flex; align-items: center; gap: 6px; min-width: 0; color: #444; }
.native-form-grid label > span { min-width: 92px; }
.native-form-grid input[type=text], .native-form-grid input[type=number], .native-form-grid input[type=date], .native-form-grid select,
.native-field-editor input[type=text], .native-field-editor input[type=number], .native-field-editor select,
.native-filter-row input, .native-filter-row select, .native-view-form input, .native-view-form select {
  min-width: 0; height: 27px; flex: 1; padding: 0 6px; border: 1px solid #c7c7c7; border-radius: 3px; font: var(--font);
}
.native-check input { margin: 0; }
.native-axis-grid { display: grid; grid-template-columns: repeat(4, minmax(145px,1fr)); gap: 8px; }
.native-axis { min-height: 130px; padding: 7px; background: #fafafa; border: 1px solid #d6d6d6; border-radius: 3px; }
.native-axis h4 { margin: 0 0 6px; color: #666; font-size: 12px; }
.native-axis-item { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 4px; margin: 3px 0; padding: 5px 6px; background: #fff; border: 1px solid #ddd; border-radius: 2px; }
.native-axis-item > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.native-axis-item div { display: flex; }
.native-axis-item button, .native-mini-btn { min-width: 24px; height: 23px; padding: 0 4px; border: 1px solid #c5c5c5; background: #fff; cursor: pointer; }
.native-field-layout { min-height: 430px; display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 10px; }
.native-field-list { overflow: auto; border: 1px solid #ddd; }
.native-field-list button { display: block; width: 100%; padding: 6px 8px; border: 0; border-bottom: 1px solid #eee; background: #fff; text-align: left; cursor: pointer; font: var(--font); }
.native-field-list button.active { color: var(--accent); background: var(--accent-weak); font-weight: 700; }
.native-field-editor { min-width: 0; overflow: auto; padding: 9px; border: 1px solid #ddd; }
.native-field-row { display: flex; align-items: center; gap: 8px; margin: 7px 0; }
.native-field-row > label:first-child { width: 125px; flex: none; color: #555; }
.native-item-grid { display: grid; grid-template-columns: repeat(3, minmax(120px,1fr)); gap: 4px; max-height: 220px; overflow: auto; padding: 6px; border: 1px solid #ddd; }
.native-item-grid label { display: flex; align-items: center; gap: 5px; overflow: hidden; white-space: nowrap; }
.native-value-card, .native-filter-row, .native-connection-row { display: grid; grid-template-columns: repeat(6, minmax(90px,1fr)) auto; gap: 6px; align-items: center; margin: 5px 0; padding: 7px; border: 1px solid #ddd; background: #fafafa; }
.native-filter-row { grid-template-columns: minmax(120px,1fr) minmax(150px,1.2fr) minmax(100px,1fr) minmax(100px,1fr) auto; }
.native-connection-row { grid-template-columns: auto minmax(100px,1fr) minmax(150px,1.5fr) minmax(110px,1fr); }
.native-toolbar { display: flex; align-items: center; gap: 7px; margin: 8px 0; }
.native-toolbar select { min-width: 170px; height: 27px; border: 1px solid #c7c7c7; }
.native-toolbar button, .native-data-footer button { min-height: 28px; padding: 0 12px; border: 1px solid #bbb; border-radius: 3px; background: #fff; cursor: pointer; font: var(--font); }
.native-data-footer { display: flex; align-items: center; gap: 8px; min-height: 45px; padding: 7px 12px; border-top: 1px solid #ddd; }
.native-data-status { min-width: 0; flex: 1; overflow: hidden; color: #777; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.native-data-footer button.primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.native-refresh-form { display: grid; grid-template-columns: repeat(2,minmax(220px,1fr)); gap: 8px 14px; margin: 10px 0; }
.native-refresh-form > label { display: flex; align-items: center; gap: 8px; min-width: 0; }
.native-refresh-form > label > span { width: 125px; flex: none; color: #555; }
.native-refresh-form input, .native-refresh-form select { min-width: 0; height: 28px; flex: 1; padding: 0 6px; border: 1px solid #c7c7c7; border-radius: 3px; font: var(--font); }
.native-refresh-form .native-check { grid-column: 1 / -1; }
.native-refresh-boundary { margin-bottom: 8px; padding: 8px 10px; border: 1px solid; border-radius: 3px; }
.native-refresh-boundary.ok { color: #185b37; background: #effaf4; border-color: #9bd2b3; }
.native-refresh-boundary.blocked, .native-refresh-error { color: #8d2025; background: #fff1f1; border-color: #e1a4a7; }
.native-refresh-layout { display: grid; grid-template-columns: repeat(2,minmax(180px,1fr)); gap: 6px 12px; margin: 9px 0; padding: 8px; background: #fafafa; border: 1px solid #ddd; }
.native-refresh-layout > div { display: flex; min-width: 0; gap: 8px; }
.native-refresh-layout strong { width: 75px; flex: none; }
.native-refresh-layout span { overflow: hidden; color: #666; text-overflow: ellipsis; white-space: nowrap; }
.native-refresh-summary { margin-bottom: 7px; color: #555; font-weight: 700; }
.native-refresh-preview { max-height: 330px; overflow: auto; border: 1px solid #ccc; background: #fff; }
.native-refresh-preview table { border-collapse: collapse; min-width: 100%; font: var(--font); }
.native-refresh-preview th, .native-refresh-preview td { min-width: 84px; padding: 4px 6px; border: 1px solid #ddd; text-align: left; white-space: nowrap; }
.native-refresh-preview th { position: sticky; top: 0; z-index: 1; background: #f1f4f3; font-weight: 700; }
.native-refresh-warning { margin-top: 5px; padding: 5px 7px; color: #6f5200; background: #fff7d6; }
.native-refresh-error { padding: 8px 10px; border: 1px solid; border-radius: 3px; }
.native-json { width: 100%; min-height: 250px; resize: vertical; padding: 7px; border: 1px solid #bbb; font: 12px/1.45 Consolas, monospace; }
.native-danger { color: #a4262c; }
.native-muted { color: #888; }
@media (max-width: 820px) {
  .native-data-main { grid-template-columns: 190px minmax(0,1fr); }
  .native-form-grid, .native-form-grid.two { grid-template-columns: 1fr; }
  .native-axis-grid { grid-template-columns: repeat(2, minmax(135px,1fr)); }
  .native-field-layout { grid-template-columns: 170px minmax(0,1fr); }
  .native-refresh-form, .native-refresh-layout { grid-template-columns: 1fr; }
}
