/* ===== AirtableSheet Component Styles ===== */

:root {
  --ats-cell-border: #dbdde0;
  --ats-font-size: 13px;
}

.ats-wrapper {
  position: relative;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--ats-font-size);
  color: #333;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  outline: none;
  background: #fff;
  overflow: hidden;
}

.ats-wrapper:focus {
  border-color: #1a73e8;
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.15);
}

/* ===== Toolbar ===== */
.ats-toolbar {
  display: flex;
  align-items: center;
  height: 36px;
  border-bottom: 1px solid #d0d5dd;
  padding: 0 8px;
  gap: 8px;
  background: #f8f9fa;
  user-select: none;
}

/* ===== Table Area ===== */
.ats-table-area {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ===== Header ===== */
.ats-header-container {
  display: flex;
  flex-shrink: 0;
  height: 34px;
  border-bottom: 2px solid #d0d5dd;
  background: #f8f9fa;
  z-index: 20;
}

.ats-corner {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f1f3;
  border-right: 1px solid var(--ats-cell-border);
  font-weight: 600;
  color: #667085;
  z-index: 30;
  cursor: pointer;
  user-select: none;
}
.ats-corner:hover {
  background: #e4e5e9;
}

.ats-header-scroll {
  flex: 1;
  overflow: clip;
  position: relative;
}

.ats-header-track {
  position: relative;
  height: 100%;
  white-space: nowrap;
}

.ats-header-cell {
  position: absolute;
  top: 0;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 8px;
  border-right: 1px solid var(--ats-cell-border);
  background: #f8f9fa;
  cursor: default;
  user-select: none;
  overflow: hidden;
  box-sizing: border-box;
}

.ats-header-cell:hover {
  background: #eef0f4;
}

.ats-key-dot {
  color: #e74c3c;
  font-size: 8px;
  margin-right: 4px;
  flex-shrink: 0;
}

.ats-header-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: #344054;
}

.ats-header-menu-btn {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  cursor: pointer;
  color: #b0b7c0;
  font-size: 14px;
  transition: color 0.15s, background 0.15s;
}

.ats-header-cell:hover .ats-header-menu-btn {
  color: #667085;
}

.ats-header-menu-btn:hover {
  background: #d0d5dd;
  color: #1d2939;
}

.ats-resize-handle {
  position: absolute;
  top: 0;
  right: -3px;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  z-index: 5;
}

.ats-resize-handle:hover,
.ats-resize-handle.ats-resizing {
  background: #1a73e8;
  opacity: 0.4;
}

/* ===== Body (scrollable) ===== */
.ats-body {
  flex: 1;
  overflow: auto;
  position: relative;
}

.ats-scroll-spacer {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  visibility: hidden;
}

.ats-row-numbers {
  position: sticky;
  left: 0;
  z-index: 10;
  background: #f8f9fa;
}

.ats-row-num {
  position: absolute;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--ats-cell-border);
  border-bottom: 1px solid var(--ats-cell-border);
  color: #98a2b3;
  font-size: 12px;
  background: #f8f9fa;
  box-sizing: border-box;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.ats-row-num:hover {
  background: #e9ecef;
  color: #344054;
}

/* ===== Data Layer ===== */
.ats-data-layer {
  position: absolute;
  top: 0;
  left: 0;
  user-select: none;
  -webkit-user-select: none;
}

.ats-row {
  position: absolute;
  left: 0;
  display: flex;
  white-space: nowrap;
}

.ats-cell {
  position: absolute;
  display: flex;
  align-items: center;
  padding: 0 6px;
  border-right: 1px solid var(--ats-cell-border);
  border-bottom: 1px solid var(--ats-cell-border);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  background: #fff;
  box-sizing: border-box;
  cursor: cell;
}

.ats-cell:hover {
  background: #f9fafb;
}

.ats-cell.ats-active {
  outline: 2px solid #1a73e8;
  outline-offset: -1px;
  z-index: 2;
}

.ats-cell.ats-selected {
  background: #e8f0fe;
}

/* LocalDB 키 충돌 / 유효성 실패 셀 강조 */
.ats-cell.ats-cell-invalid {
  outline: 2px solid #d92d20;
  outline-offset: -1px;
  background: rgba(217, 45, 32, 0.06);
  z-index: 2;
}

.ats-cell.ats-editing {
  padding: 0;
  outline: 2px solid #1a73e8;
  outline-offset: -1px;
  z-index: 3;
}

.ats-cell-input {
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  padding: 0 6px;
  font: inherit;
  background: #fff;
  box-sizing: border-box;
}

.ats-cell-number {
  text-align: right;
  justify-content: flex-end;
}
.ats-cell-number.ats-editing {
  text-align: left;
}
.ats-cell-number .ats-cell-input {
  text-align: left;
}

.ats-cell.ats-error {
  outline: 1px solid #f5a6a0;
  outline-offset: -1px;
  background: #fff8f7;
}

.ats-cell.ats-required-empty {
  outline: 1px dashed #f5a6a0;
  outline-offset: -1px;
}

/* ===== Context Menu ===== */
.ats-context-menu {
  position: fixed;
  z-index: 10000;
  background: #fff;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  padding: 4px 0;
  min-width: 180px;
  font-size: 13px;
}

.ats-context-menu-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  cursor: pointer;
  color: #344054;
  gap: 8px;
}

.ats-context-menu-item:hover {
  background: #f0f4ff;
}

.ats-context-menu-item.ats-disabled {
  color: #98a2b3;
  cursor: default;
}

.ats-context-menu-item.ats-disabled:hover {
  background: none;
}

.ats-context-menu-separator {
  height: 1px;
  background: #eaecf0;
  margin: 4px 0;
}

.ats-context-menu-check {
  width: 16px;
  text-align: center;
  color: #1a73e8;
}

.ats-context-menu-icon {
  width: 16px;
  text-align: center;
  color: #667085;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ===== Dropdown ===== */
.ats-dropdown {
  position: fixed;
  z-index: 10000;
  background: #fff;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  padding: 8px;
  min-width: 240px;
  font-size: 13px;
  max-height: 480px;
  overflow-y: auto;
}

/* ===== Mode Toggle ===== */
.ats-mode-toggle {
  display: flex;
  align-items: center;
  height: 26px;
  border-radius: 4px;
  border: 1px solid #d0d5dd;
  overflow: hidden;
  font-size: 12px;
  cursor: pointer;
}

.ats-mode-btn {
  padding: 0 8px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #667085;
  transition: background 0.15s, color 0.15s;
}

.ats-mode-btn svg {
  display: block;
}

.ats-mode-btn.ats-mode-active {
  background: #1a73e8;
  color: #fff;
}

/* ===== Cell Content Bar ===== */
.ats-cell-content-bar {
  flex: 1;
  min-width: 0;
  position: relative;
}

.ats-cell-content-expand {
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  cursor: pointer;
  color: #98a2b3;
  z-index: 2;
  border-radius: 2px;
}

.ats-cell-content-expand:hover {
  color: #344054;
  background: rgba(0,0,0,0.05);
}

.ats-cell-content-input {
  width: 100%;
  height: 26px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  padding: 0 8px 0 24px;
  font: inherit;
  font-size: 12px;
  outline: none;
  box-sizing: border-box;
}

.ats-cell-content-input:focus {
  border-color: #1a73e8;
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.15);
}

.ats-cell-content-textarea {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  max-height: 350px;
  border: 1px solid #1a73e8;
  border-radius: 4px;
  padding: 4px 8px 4px 24px;
  font: inherit;
  font-size: 12px;
  outline: none;
  box-sizing: border-box;
  resize: none;
  line-height: 1.5;
  overflow-y: auto;
  z-index: 100;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.ats-cell-content-textarea:focus {
  border-color: #1a73e8;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12), 0 0 0 2px rgba(26, 115, 232, 0.15);
}

/* ===== Header Editing ===== */
.ats-header-cell .ats-header-edit-input {
  width: 100%;
  height: 24px;
  border: 1px solid #1a73e8;
  border-radius: 2px;
  padding: 0 4px;
  font: inherit;
  font-weight: 600;
  outline: none;
  box-sizing: border-box;
}

/* ===== Grid Collapse Animation ===== */
.ats-table-area.ats-collapsing {
  transition: height 0.3s ease-in-out;
  overflow: hidden;
}

.ats-table-area.ats-collapsed {
  height: 0 !important;
  overflow: hidden;
  border: none;
}

/* ===== Fullscreen ===== */
.ats-wrapper.ats-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  border-radius: 0;
}

.ats-wrapper.ats-fullscreen .ats-table-area {
  width: 100% !important;
  height: calc(100vh - 37px) !important;
}

/* ===== ComboBox ===== */
.ats-combobox {
  position: fixed;
  z-index: 10001;
  background: #fff;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  min-width: 180px;
  max-height: 260px;
  display: flex;
  flex-direction: column;
  font-size: 13px;
}

.ats-combobox-input {
  width: 100%;
  padding: 6px 8px;
  border: none;
  border-bottom: 1px solid #eaecf0;
  font: inherit;
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
}

.ats-combobox-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

.ats-combobox-item {
  padding: 5px 12px;
  cursor: pointer;
  font-size: 13px;
}

.ats-combobox-item:hover,
.ats-combobox-item.ats-highlighted {
  background: #f0f4ff;
}

.ats-combobox-edit-btn {
  visibility: hidden;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  cursor: pointer;
  color: #98a2b3;
}

.ats-combobox-item:hover .ats-combobox-edit-btn {
  visibility: visible;
}

.ats-combobox-edit-btn:hover {
  background: #e4e7ec;
  color: #344054;
}

.ats-combobox-add {
  padding: 5px 12px;
  border-top: 1px solid #eaecf0;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: #1a73e8;
  font-size: 12px;
}

.ats-combobox-add:hover {
  background: #f0f4ff;
}
.ats-combobox-add-input-wrap {
  display: flex;
  padding: 4px 8px;
  border-top: 1px solid #eaecf0;
}
.ats-combobox-add-input {
  width: 100%;
  padding: 4px 8px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  font-size: 12px;
  outline: none;
  box-sizing: border-box;
}
.ats-combobox-add-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.12);
}

/* ===== Settings Menu ===== */
.ats-settings-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  cursor: pointer;
  background: #fff;
  color: #667085;
  font-size: 14px;
  flex-shrink: 0;
}

.ats-settings-btn:hover {
  background: #f0f1f3;
  color: #344054;
}

/* ===== Common Code Editor Button ===== */
.ats-code-editor-btn {
  height: 26px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  cursor: pointer;
  background: #fff;
  color: #667085;
  font-size: 12px;
  flex-shrink: 0;
  gap: 4px;
}

.ats-code-editor-btn:hover {
  background: #f0f1f3;
  color: #344054;
}

/* ===== Drag Ghost ===== */
.ats-drag-ghost {
  position: fixed;
  z-index: 10002;
  pointer-events: none;
  opacity: 0.7;
  background: #e8f0fe;
  border: 1px solid #1a73e8;
  border-radius: 4px;
  padding: 4px 8px;
  font: 13px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 600;
  color: #344054;
}

.ats-drop-indicator {
  position: absolute;
  top: 0;
  width: 2px;
  height: 100%;
  background: #1a73e8;
  z-index: 25;
  pointer-events: none;
}

/* ===== Selection Range Overlay ===== */
.ats-range-overlay {
  position: absolute;
  border: 2px solid #1a73e8;
  background: rgba(26, 115, 232, 0.08);
  pointer-events: none;
  z-index: 5;
}

/* ===== BigData Textarea Popup ===== */
.ats-bigdata-popup {
  position: fixed;
  z-index: 10001;
  background: #fff;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  padding: 8px;
  padding-top: 0px;
  padding-bottom: 5px;
  min-width: 300px;
  max-width: 600px;
  display: flex;
  flex-direction: column;
}
.ats-bigdata-popup.ats-bigdata-expanded {
  width: 80%;
  height: 80%;
  max-width: none;
  min-width: 0;
}
.ats-bigdata-expanded .ats-bigdata-textarea {
  flex: 1;
  min-height: 0;
  max-height: none;
  resize: none;
}
.ats-bigdata-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  height: 31px;
}
.ats-bigdata-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
}
.ats-bigdata-chk-label {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: #667085;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.ats-bigdata-chk-label input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}
.ats-bigdata-header-btn {
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #667085;
}
.ats-bigdata-header-btn svg {
  width: 11px;
  height: 11px;
}
.ats-bigdata-close-btn svg {
  width: 14px;
  height: 14px;
}
.ats-bigdata-header-btn:hover {
  background: #f0f1f3;
  color: #344054;
}

.ats-bigdata-textarea {
  width: 100%;
  min-height: 120px;
  max-height: 400px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  padding: 8px;
  font: inherit;
  font-size: 13px;
  outline: none;
  resize: vertical;
  box-sizing: border-box;
  line-height: 1.5;
}

.ats-bigdata-textarea:focus {
  border-color: #98a2b3;
  box-shadow: 0 0 0 2px rgba(152, 162, 179, 0.15);
  background: #f7f8fa;
}

.ats-bigdata-btn-row {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 0px;
  padding: 8px 0px;
  padding-bottom: 2px;
}

.ats-bigdata-cancel-btn {
  height: 25px;
  padding: 0 14px;
  border-radius: 4px;
  border: 1px solid #d0d5dd;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  background: #fff;
  color: #344054;
}

.ats-bigdata-cancel-btn:hover {
  background: #f0f1f3;
}

/* ===== File Cell Styles ===== */
.ats-cell-memo-mark {
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-top: 6px solid #f59e0b;
  pointer-events: none;
}

.ats-cell-file-icon {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  color: #667085;
  flex-shrink: 0;
  pointer-events: none;
}

.ats-cell-file-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 22px;
}

/* ===== Checkbox Cell ===== */
.ats-cell-checkbox {
  cursor: pointer;
  width: 16px;
  height: 16px;
  margin: 0;
  vertical-align: middle;
  accent-color: #1a73e8;
}

/* ===== Date Cell ===== */
.ats-cell-date-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 22px;
}
.ats-cell-date-icon {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.ats-cell-date-icon:hover svg {
  stroke: #1a73e8;
}

/* ===== File Popup ===== */
.ats-file-popup {
  position: fixed;
  z-index: 10001;
  background: #fff;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  width: 360px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ats-file-popup-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  border-bottom: 1px solid #e4e7ec;
  color: #344054;
}

.ats-file-popup-list {
  flex: 1;
  overflow-y: auto;
  min-height: 60px;
  max-height: 240px;
  padding: 4px 0;
}

.ats-file-popup-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60px;
  color: #98a2b3;
  font-size: 12px;
}

.ats-file-popup-item {
  display: flex;
  align-items: center;
  padding: 5px 12px;
  gap: 8px;
  font-size: 12px;
  color: #344054;
}

.ats-file-popup-item:hover {
  background: #f8f9fa;
}

.ats-file-popup-item-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ats-file-popup-item-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.ats-file-popup-item-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  color: #667085;
  border: none;
  background: none;
  padding: 0;
}

.ats-file-popup-item-btn:hover {
  background: #f0f1f3;
  color: #344054;
}

.ats-file-popup-item-btn.ats-file-delete:hover {
  background: #fef3f2;
  color: #d92d20;
}

.ats-file-popup-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-top: 1px solid #e4e7ec;
  gap: 8px;
}

.ats-file-popup-attach {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  color: #344054;
}

.ats-file-popup-attach:hover {
  background: #f0f1f3;
}

.ats-file-popup-attach:disabled {
  opacity: 0.4;
  cursor: default;
}

.ats-file-popup-confirm {
  height: 28px;
  padding: 0 14px;
  border-radius: 4px;
  border: 1px solid #1a73e8;
  background: #1a73e8;
  color: #fff;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.ats-file-popup-confirm:hover {
  background: #1557b0;
}

/* ===== Frozen First Column ===== */
.ats-frozen-column {
  position: sticky;
  left: 50px;
  z-index: 9;
  pointer-events: auto;
}

.ats-frozen-cell {
  background: #fff;
  border-right: 2px solid #c0c5cc;
}

.ats-frozen-cell:hover {
  background: #f9fafb;
}

.ats-frozen-cell.ats-active {
  outline: 2px solid #1a73e8;
  outline-offset: -1px;
  z-index: 2;
}

.ats-frozen-cell.ats-selected {
  background: #e8f0fe;
}

.ats-frozen-header {
  border-right: 2px solid #c0c5cc !important;
  background: #edf0f4;
}

.ats-frozen-header:hover {
  background: #e5e7eb;
}

/* ===== Filtered Header Indicator ===== */
.ats-header-cell.ats-header-filtered {
  background: #e8f0fe;
  border-bottom: 2px solid #1a73e8;
}

.ats-header-cell.ats-header-filtered:hover {
  background: #d4e4fd;
}

.ats-header-filter-badge {
  flex-shrink: 0;
  font-size: 10px;
  margin-left: 2px;
  margin-right: 2px;
  opacity: 0.7;
}

/* ===== Code Cell Styles ===== */
.ats-cell-code {
  cursor: pointer;
  padding-right: 20px;
}

.ats-cell-code::after {
  content: '\25BE';
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  color: #98a2b3;
  font-size: 10px;
  pointer-events: none;
}

/* ===== Row Detail Popup ===== */
.ats-row-detail-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.25);
  z-index: 10002;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 8vh;
}

.ats-row-detail-popup {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.16);
  width: 680px;
  min-height: 500px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ats-row-detail-title {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #e4e7ec;
  gap: 8px;
  background: #f8f9fa;
  flex-shrink: 0;
}

.ats-row-detail-title-text {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #344054;
}

.ats-row-detail-nav {
  width: 30px;
  height: 30px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  color: #667085;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ats-row-detail-nav:hover:not(:disabled) {
  background: #f0f1f3;
  color: #344054;
}

.ats-row-detail-nav:disabled {
  opacity: 0.3;
  cursor: default;
}

.ats-row-detail-title-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.ats-row-detail-action-btn {
  width: 30px;
  height: 30px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  color: #667085;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  padding: 0;
}

.ats-row-detail-action-btn:hover {
  background: #f0f1f3;
  color: #344054;
}

.ats-row-detail-action-btn.ats-row-detail-delete:hover {
  background: #fef3f2;
  color: #d92d20;
  border-color: #fecdca;
}

.ats-row-detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 116px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ats-row-detail-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ats-row-detail-label {
  font-size: 12px;
  font-weight: 500;
  color: #667085;
}

.ats-row-detail-input {
  width: 100%;
  height: 32px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  padding: 0 8px;
  font: inherit;
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
}

.ats-row-detail-input:focus {
  border-color: #1a73e8;
  box-shadow: 0 0 0 2px rgba(26,115,232,0.15);
}

.ats-row-detail-textarea {
  width: 100%;
  min-height: 160px;
  max-height: 400px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  padding: 6px 8px;
  font: inherit;
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
  resize: vertical;
  line-height: 1.5;
}

.ats-row-detail-textarea:focus {
  border-color: #1a73e8;
  box-shadow: 0 0 0 2px rgba(26,115,232,0.15);
}

/* Row detail file input */
.ats-row-detail-file-input {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #344054;
  user-select: none;
}
.ats-row-detail-file-input:hover {
  border-color: #1a73e8;
  background: #f0f5ff;
}
.ats-row-detail-file-icon {
  flex-shrink: 0;
  color: #667085;
  display: flex;
  align-items: center;
}
.ats-row-detail-file-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ats-row-detail-file-badge {
  flex-shrink: 0;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  background: #f2f4f7;
  color: #667085;
  border: 1px solid #e4e7ec;
}

/* Inline file popup inside row detail */
.ats-file-popup-inline {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  width: 100%;
  margin-top: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ===== File Drag-and-Drop ===== */
.ats-file-popup-list.ats-file-dragover {
  background: #e8f0fe;
  border: 2px dashed #1a73e8;
  border-radius: 4px;
}

/* ===== Upload Notification Toast ===== */
.ats-upload-toast {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 10002;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  font-size: 13px;
  color: #344054;
  min-width: 280px;
  max-width: 400px;
  animation: ats-toast-in 0.3s ease-out;
}

@keyframes ats-toast-in {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.ats-upload-toast.ats-toast-out {
  animation: ats-toast-out 0.3s ease-in forwards;
}

@keyframes ats-toast-out {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(20px); opacity: 0; }
}

.ats-upload-toast-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #e4e7ec;
  border-top-color: #1a73e8;
  border-radius: 50%;
  animation: ats-spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes ats-spin {
  to { transform: rotate(360deg); }
}

.ats-upload-toast-check {
  width: 16px;
  height: 16px;
  color: #12b76a;
  flex-shrink: 0;
}

.ats-upload-toast-msg {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ats-upload-toast-close {
  width: 20px;
  height: 20px;
  border: none;
  background: none;
  cursor: pointer;
  color: #98a2b3;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  border-radius: 4px;
  font-size: 16px;
}

.ats-upload-toast-close:hover {
  background: #f0f1f3;
  color: #344054;
}

/* 이미지 미리보기 오버레이 */
.ats-image-preview-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10003;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.ats-image-preview-overlay img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 6px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  object-fit: contain;
  background: #fff;
}
.ats-image-preview-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #344054;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.ats-image-preview-close:hover {
  background: #fff;
  color: #111;
}
.ats-text-preview-content {
  max-width: 80%;
  max-height: 80%;
  overflow: auto;
  background: #fff;
  color: #1d2939;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.6;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  tab-size: 4;
}
.ats-preview-wrapper {
  display: flex;
  flex-direction: column;
  max-width: 90%;
  max-height: 90%;
  cursor: default;
  margin-top: -50px;
}
.ats-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: transparent;
  border-radius: 8px 8px 0 0;
  min-height: 32px;
}
.ats-preview-toolbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: #fff;
  cursor: pointer;
  border-radius: 4px;
}
.ats-preview-toolbar-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}
.ats-preview-html-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #fff;
  cursor: pointer;
  user-select: none;
}
.ats-preview-html-toggle input {
  cursor: pointer;
}
.ats-preview-wrapper > img {
  max-width: 100%;
  max-height: calc(90vh - 44px);
  border-radius: 0 0 6px 6px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  object-fit: contain;
  background: #fff;
}
.ats-preview-wrapper > .ats-text-preview-content {
  max-width: 100%;
  width: 80vw;
  max-height: calc(80vh - 44px);
  border-radius: 0 0 8px 8px;
}
.ats-html-preview-frame {
  width: 80vw;
  height: calc(80vh - 44px);
  border: none;
  background: #fff;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

