/
kan64
/
spreadsheet-lab
Обзор
Документация
Войти
/
kan64
/
spreadsheet-lab
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
develop
client/src/index.css
2 690 строк
48 KB
Anton Kravchenkov
feat(ui): Insert copied rows above below
30 мар 2026, 21:56
30 мар 2026, 21:56
d7502fe
Код
Авторство
О чём код?
/* Reset & Base */ *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; } :root { --bg-primary: #ffffff; --bg-secondary: #f3f3f3; --bg-toolbar: #f8f9fa; --bg-header: #f0f0f0; --bg-header-active: #d6e4f0; --bg-selected: #d4e6f9; --bg-range: rgba(46, 115, 252, 0.08); --border-color: #e0e0e0; --border-selected: #1a73e8; --text-primary: #202124; --text-muted: #bdbdbd; --text-secondary: #5f6368; --text-header: #444; --accent: #1a73e8; --accent-hover: #1557b0; --danger: #d93025; --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif; --font-size: 13px; } html, body { height: 100%; font-family: var(--font-family); font-size: var(--font-size); color: var(--text-primary); background: var(--bg-primary); } #root { height: 100%; } /* Страница таблицы: не отдавать горизонтальный overscroll браузеру (назад/вперёд) */ html.spreadsheet-page-active, body.spreadsheet-page-active, body.spreadsheet-page-active #root, body.spreadsheet-page-active .app { overscroll-behavior-x: none; } .grid-canvas-scroll { overscroll-behavior-x: none; overscroll-behavior-y: none; overscroll-behavior: none; } /* App layout */ .app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; } /* =================== Toolbar =================== */ .toolbar { display: flex; align-items: center; gap: 2px; padding: 4px 8px; background: var(--bg-toolbar); border-bottom: 1px solid var(--border-color); min-height: 40px; flex-shrink: 0; } .toolbar-group { display: flex; align-items: center; gap: 2px; } .toolbar-btn { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: none; border-radius: 4px; background: transparent; color: var(--text-primary); cursor: pointer; font-size: 14px; transition: background 0.15s; } .toolbar-btn:hover:not(:disabled) { background: rgba(0, 0, 0, 0.06); } .toolbar-btn:active:not(:disabled) { background: rgba(0, 0, 0, 0.1); } .toolbar-btn.active { background: rgba(26, 115, 232, 0.12); color: var(--accent); } .toolbar-btn:disabled { opacity: 0.4; cursor: default; } .toolbar-separator { width: 1px; height: 24px; background: var(--border-color); margin: 0 4px; } .toolbar-select { height: 30px; padding: 0 8px; border: 1px solid var(--border-color); border-radius: 4px; background: var(--bg-primary); font-size: 12px; color: var(--text-primary); cursor: pointer; outline: none; } .toolbar-select:focus { border-color: var(--accent); } .toolbar-column-width { display: flex; align-items: center; gap: 6px; } .toolbar-label { font-size: 12px; color: var(--text-secondary); white-space: nowrap; } .toolbar-input { width: 56px; height: 28px; padding: 0 6px; border: 1px solid var(--border-color); border-radius: 4px; background: var(--bg-primary); font-size: 12px; text-align: right; } .toolbar-input:focus { outline: none; border-color: var(--accent); } .toolbar-input:disabled { opacity: 0.5; cursor: not-allowed; } .toolbar-unit { font-size: 11px; color: var(--text-secondary); } .toolbar-color-label { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 4px; cursor: pointer; position: relative; transition: background 0.15s; } .toolbar-color-label:hover { background: rgba(0, 0, 0, 0.06); } .color-input { position: absolute; width: 0; height: 0; opacity: 0; overflow: hidden; } /* =================== Color Picker =================== */ .color-picker-wrapper { position: relative; } .color-picker-trigger { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; width: 36px !important; padding-bottom: 2px; } .color-picker-trigger .color-indicator { width: 18px; height: 3px; border-radius: 1px; margin-top: 1px; flex-shrink: 0; } .color-picker-arrow { position: absolute; right: 2px; bottom: 4px; opacity: 0.5; } .color-picker-dropdown { position: absolute; top: 100%; left: 0; margin-top: 4px; background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: 8px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15); padding: 8px; z-index: 50; min-width: 230px; } .color-picker-reset { display: flex; align-items: center; gap: 6px; width: 100%; padding: 6px 8px; border: none; background: none; border-radius: 4px; font-size: 12px; color: var(--text-primary); cursor: pointer; font-family: var(--font-family); transition: background 0.1s; } .color-picker-reset:hover { background: rgba(0, 0, 0, 0.06); } .color-picker-sep { height: 1px; background: var(--border-color); margin: 6px 0; } .color-picker-grid { display: flex; flex-direction: column; gap: 2px; padding: 2px 0; } .color-picker-row { display: flex; gap: 2px; } .color-picker-swatch { width: 20px; height: 20px; border: 1px solid rgba(0, 0, 0, 0.1); border-radius: 3px; cursor: pointer; padding: 0; transition: transform 0.1s, box-shadow 0.1s; } .color-picker-swatch:hover { transform: scale(1.2); box-shadow: 0 0 4px rgba(0, 0, 0, 0.25); z-index: 1; position: relative; } .color-picker-swatch.active { outline: 2px solid var(--accent); outline-offset: 1px; } .color-picker-custom { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 4px; cursor: pointer; font-size: 12px; color: var(--text-secondary); transition: background 0.1s; position: relative; } .color-picker-custom:hover { background: rgba(0, 0, 0, 0.06); color: var(--text-primary); } /* =================== Border Picker =================== */ .border-picker-wrapper { position: relative; } .toolbar-freeze-wrapper { position: relative; } .toolbar-freeze-btn { display: flex; align-items: center; gap: 2px; } .toolbar-freeze-chevron { opacity: 0.7; } .toolbar-freeze-dropdown { position: absolute; top: 100%; left: 0; margin-top: 4px; display: flex; flex-direction: row; gap: 2px; background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: 8px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15); padding: 6px; z-index: 50; } .border-picker-wrapper .toolbar-btn { position: relative; padding-bottom: 4px; } .border-picker-dropdown { position: absolute; top: 100%; left: 0; margin-top: 4px; background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: 8px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15); padding: 8px; z-index: 50; min-width: 180px; } .border-picker-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; } .border-picker-option { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid transparent; border-radius: 4px; background: transparent; cursor: pointer; color: var(--text-primary); transition: background 0.15s, border-color 0.15s; } .border-picker-option:hover { background: rgba(0, 0, 0, 0.06); border-color: var(--border-color); } .border-picker-separator { height: 1px; background: var(--border-color); margin: 8px 0; } .border-picker-color-row { display: flex; align-items: center; gap: 8px; padding: 2px 0; } .border-picker-color-label { font-size: 12px; color: var(--text-secondary); white-space: nowrap; } .border-picker-color-swatch { display: flex; align-items: center; cursor: pointer; position: relative; } .border-picker-color-preview { width: 22px; height: 22px; border-radius: 4px; border: 1px solid var(--border-color); } /* =================== Formula Bar =================== */ .formula-bar { display: flex; align-items: center; height: 32px; border-bottom: 1px solid var(--border-color); background: var(--bg-primary); flex-shrink: 0; } .formula-bar-cell-name { width: 80px; padding: 0 8px; font-size: 12px; font-weight: 500; text-align: center; color: var(--text-primary); border-right: 1px solid var(--border-color); line-height: 32px; user-select: none; } .formula-bar-separator { width: 0; } .formula-bar-fx { padding: 0 8px; border-right: 1px solid var(--border-color); line-height: 32px; user-select: none; } .fx-label { font-style: italic; color: var(--text-secondary); font-size: 13px; font-weight: 500; } .formula-bar-input { flex: 1; height: 100%; border: none; outline: none; padding: 0 8px; font-size: 13px; font-family: var(--font-family); color: var(--text-primary); background: var(--bg-primary); } .formula-bar-input:focus { background: #fff; } /* =================== Grid =================== */ .grid-container { flex: 1; outline: none; background: var(--bg-primary); overflow: hidden; overscroll-behavior: none; user-select: none; min-height: 0; position: relative; /* Изоляция перерисовки canvas от остального UI */ contain: layout style paint; isolation: isolate; } .col-headers-viewport, .row-headers-viewport { background: var(--bg-header); } .grid-body { background: var(--bg-primary); overflow-anchor: auto; /* Prevent scroll jump when new cells load */ } .grid-corner { background: var(--bg-header); border-right: 1px solid var(--border-color); border-bottom: 1px solid #c0c0c0; } /* Column headers */ .col-header { display: flex; align-items: center; justify-content: center; background: var(--bg-header); border-right: 1px solid var(--border-color); border-bottom: 1px solid #c0c0c0; font-size: 11px; font-weight: 500; color: var(--text-header); user-select: none; position: relative; } .col-header.active { background: var(--bg-header-active); color: var(--accent); font-weight: 600; } .col-resize-handle { position: absolute; right: -3px; top: 0; width: 6px; height: 100%; cursor: col-resize; z-index: 5; } .col-resize-handle:hover { background: rgba(26, 115, 232, 0.3); } /* Row headers */ .row-header { display: flex; align-items: center; justify-content: center; background: var(--bg-header); border-right: 1px solid #c0c0c0; border-bottom: 1px solid var(--border-color); font-size: 11px; font-weight: 500; color: var(--text-header); user-select: none; position: relative; } .row-header.active { background: var(--bg-header-active); color: var(--accent); font-weight: 600; } .row-resize-handle { position: absolute; bottom: -3px; left: 0; width: 100%; height: 6px; cursor: row-resize; z-index: 5; } .row-resize-handle:hover { background: rgba(26, 115, 232, 0.3); } /* Grid cells */ .grid-cell { display: flex; align-items: center; border: 0 solid var(--border-color); border-right-width: 1px; border-bottom-width: 1px; padding: 0 4px; overflow: hidden; cursor: cell; background: var(--bg-primary); user-select: none; } /* INP: instant selection feedback via DOM class, no React re-render */ .grid-cell.selected-optimistic { box-shadow: inset 0 0 0 9999px rgba(46, 115, 252, 0.08), inset 0 2px 0 0 var(--border-selected), inset 0 -2px 0 0 var(--border-selected), inset 2px 0 0 0 var(--border-selected), inset -2px 0 0 0 var(--border-selected); } .grid-cell.clipboard-highlight { outline: 2px dashed var(--accent); outline-offset: -1px; } .grid-cell.editing { z-index: 10; font-size: 13px; font-family: var(--font-family); resize: none; overflow: visible; line-height: 1.4; white-space: pre-wrap; word-wrap: break-word; } /* Editing: preserve same look as view mode (no extra padding, border, background) */ .grid-cell.editing.text-vertical { display: flex; justify-content: center; align-items: center; } .grid-cell.editing .cell-edit-inner { display: block; width: 100%; outline: none; } .cell-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; } .grid-cell.merged { z-index: 1; } .grid-cell.frozen { /* Container uses position:sticky for zero-jitter freeze */ } .grid-cell.freeze-border-bottom { box-shadow: 0 2px 0 0 #bababa; clip-path: inset(0 0 -4px 0); } .grid-cell.freeze-border-right { box-shadow: 2px 0 0 0 #bababa; clip-path: inset(0 -4px 0 0); } .grid-cell.freeze-border-bottom.freeze-border-right { box-shadow: 2px 2px 0 0 #bababa; clip-path: inset(0 -4px -4px 0); } .col-header.freeze-border-right { box-shadow: 2px 0 0 0 #bababa; clip-path: inset(0 -4px 0 0); } .row-header.freeze-border-bottom { box-shadow: 0 2px 0 0 #bababa; clip-path: inset(0 0 -4px 0); } .grid-cell.wrap-text { align-items: flex-start; padding-top: 2px; } .grid-cell.wrap-text .cell-text { white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word; text-overflow: clip; line-height: 1.4; } /* Vertical text: поворот -90° против часовой стрелки */ .grid-cell.text-vertical { justify-content: center; align-items: center; } .grid-cell.text-vertical .cell-text-vertical-inner { display: inline-block; white-space: nowrap; transform-origin: center center; } .grid-cell.text-vertical .cell-text-vertical-inner .cell-text, .grid-cell.text-vertical .cell-text-vertical-inner .cell-rich-text { white-space: nowrap; } /* Fill handle for date autofill */ .grid-cell.has-fill-handle { overflow: visible; } .grid-cell .cell-fill-handle { position: absolute; right: 0; bottom: 0; width: 10px; height: 10px; background: var(--accent, #1a73e8); cursor: crosshair; z-index: 20; border-radius: 2px 0 0 0; border: 1px solid rgba(255,255,255,0.5); } .grid-cell .cell-fill-handle:hover { background: var(--accent-hover, #1557b0); } /* =================== Sheet Tabs =================== */ .sheet-tabs { display: flex; align-items: center; height: 32px; background: var(--bg-secondary); border-top: 1px solid var(--border-color); padding: 0 4px; flex-shrink: 0; gap: 2px; overflow: hidden; } .sheet-tabs-nav { display: flex; align-items: center; gap: 1px; flex-shrink: 0; } .sheet-tabs-nav-btn { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: none; background: transparent; border-radius: 4px; color: var(--text-secondary); cursor: pointer; transition: background 0.15s, color 0.15s; } .sheet-tabs-nav-btn:hover:not(:disabled) { background: rgba(0, 0, 0, 0.08); color: var(--text-primary); } .sheet-tabs-nav-btn:disabled { opacity: 0.3; cursor: default; } .sheet-tabs-scroll { display: flex; align-items: center; gap: 2px; overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: none; } .sheet-tabs-scroll::-webkit-scrollbar { display: none; } .sheet-tab { display: flex; align-items: center; padding: 0 16px; height: 26px; border-radius: 4px 4px 0 0; background: var(--bg-secondary); border: 1px solid transparent; border-bottom: none; font-size: 12px; cursor: pointer; user-select: none; white-space: nowrap; transition: background 0.15s; color: var(--text-secondary); flex-shrink: 0; } .sheet-tab:hover { background: #e8e8e8; } .sheet-tab.active { background: var(--bg-primary); border-color: var(--border-color); color: var(--text-primary); font-weight: 500; } .sheet-tab-add { display: flex; align-items: center; justify-content: center; width: 28px; height: 26px; border: none; background: transparent; border-radius: 4px; font-size: 18px; color: var(--text-secondary); cursor: pointer; transition: background 0.15s; flex-shrink: 0; } .sheet-tab-add:hover { background: rgba(0, 0, 0, 0.06); color: var(--text-primary); } .sheet-tab-input { border: 1px solid var(--accent); border-radius: 2px; padding: 0 4px; font-size: 12px; height: 20px; width: 80px; outline: none; } .sheet-tab[draggable="true"] { cursor: grab; } .sheet-tab[draggable="true"]:active { cursor: grabbing; } .sheet-tab.drop-left { border-left: 2px solid var(--accent); } .sheet-tab.drop-right { border-right: 2px solid var(--accent); } .sheet-tab-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; } /* =================== Tooltip =================== */ .tooltip { position: fixed; transform: translate(-50%, -100%); padding: 4px 10px; background: #333; color: #fff; font-size: 12px; line-height: 1.4; border-radius: 4px; white-space: nowrap; pointer-events: none; z-index: 10000; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); animation: tooltip-fade-in 0.12s ease-out; } @keyframes tooltip-fade-in { from { opacity: 0; transform: translate(-50%, -100%) translateY(4px); } to { opacity: 1; transform: translate(-50%, -100%) translateY(0); } } .tooltip-link { white-space: normal; max-width: 280px; } .tooltip-link-url { font-size: 11px; opacity: 0.9; word-break: break-all; } /* =================== Context Menu =================== */ .context-menu { position: fixed; background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: 8px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15); padding: 4px 0; z-index: 100; min-width: 180px; } .context-menu-item { display: flex; align-items: center; width: 100%; padding: 8px 16px; border: none; background: none; text-align: left; font-size: 13px; color: var(--text-primary); cursor: pointer; font-family: var(--font-family); transition: background 0.1s; } .context-menu-item-icon { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-right: 10px; flex-shrink: 0; color: var(--text-secondary); } .context-menu-item:hover:not(:disabled) { background: rgba(26, 115, 232, 0.08); } .context-menu-item:disabled { color: var(--text-secondary); opacity: 0.5; cursor: default; } .context-menu-separator { height: 1px; background: var(--border-color); margin: 4px 0; } /* =================== Scrollbar styling =================== */ .grid-container::-webkit-scrollbar { width: 12px; height: 12px; } .grid-container::-webkit-scrollbar-track { background: var(--bg-secondary); } .grid-container::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 6px; border: 3px solid var(--bg-secondary); } .grid-container::-webkit-scrollbar-thumb:hover { background: #a8a8a8; } .grid-container::-webkit-scrollbar-corner { background: var(--bg-secondary); } /* =================== Paste Progress Overlay =================== */ .paste-progress-overlay { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 1000; display: flex; align-items: center; gap: 10px; background: var(--bg-primary, #fff); border: 1px solid var(--border-color, #d0d0d0); border-radius: 8px; padding: 8px 16px; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15); min-width: 240px; pointer-events: none; } .paste-progress-bar { flex: 1; height: 6px; background: var(--bg-secondary, #f0f0f0); border-radius: 3px; overflow: hidden; } .paste-progress-fill { height: 100%; background: #217346; border-radius: 3px; transition: width 0.15s ease; } .paste-progress-text { font-size: 12px; color: var(--text-secondary, #555); white-space: nowrap; min-width: 100px; text-align: right; } /* =================== Cell Text Editor Overlay =================== */ .cell-editor-overlay { position: absolute; z-index: 10; background: transparent; pointer-events: auto; user-select: text; overflow: hidden; } .cell-editor-overlay [contenteditable] { user-select: text; -webkit-user-select: text; } .cell-editor-overlay [contenteditable]:focus { outline: none; } .cell-editor-overlay [contenteditable] ::selection { background: rgba(46, 115, 252, 0.3); } /* =================== Files Page =================== */ .files-page { display: flex; flex-direction: column; min-height: 100vh; background: #f8f9fa; overflow: auto; } .files-header { background: #217346; color: white; padding: 0 24px; height: 64px; display: flex; align-items: center; flex-shrink: 0; box-shadow: 0 2px 8px rgba(0,0,0,0.15); } .files-header-content { max-width: 960px; width: 100%; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; } .files-header-user { display: flex; align-items: center; gap: 12px; } .files-header-username { font-size: 14px; font-weight: 500; color: rgba(255, 255, 255, 0.9); } .files-header-logout { padding: 6px 14px; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 6px; background: rgba(255, 255, 255, 0.1); color: white; font-size: 13px; font-weight: 500; font-family: var(--font-family); cursor: pointer; transition: all 0.15s; } .files-header-logout:hover { background: rgba(255, 255, 255, 0.2); border-color: rgba(255, 255, 255, 0.5); } .files-logo { display: flex; align-items: center; gap: 12px; } .files-logo h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.3px; } .files-main { max-width: 960px; width: 100%; margin: 0 auto; padding: 32px 24px; flex: 1; } .files-section { margin-bottom: 40px; } .files-section-header h2 { font-size: 16px; font-weight: 600; color: var(--text-primary); } /* Create area */ .files-create-area { display: flex; gap: 16px; flex-wrap: wrap; } .files-create-card { width: 160px; height: 140px; border: 2px dashed #ccc; border-radius: 12px; background: white; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; cursor: pointer; transition: all 0.2s; font-family: var(--font-family); font-size: 13px; color: var(--text-secondary); } .files-create-card:hover { border-color: #217346; background: #f0faf4; color: #217346; box-shadow: 0 4px 12px rgba(33,115,70,0.1); } .files-create-card-icon { display: flex; align-items: center; justify-content: center; } .files-new-input-wrapper { width: 160px; height: 140px; border: 2px solid #217346; border-radius: 12px; background: white; display: flex; align-items: center; justify-content: center; padding: 16px; } .files-new-input { width: 100%; border: none; border-bottom: 2px solid #217346; font-size: 14px; font-family: var(--font-family); padding: 4px 0; outline: none; text-align: center; } /* File list */ .files-list { background: white; border-radius: 12px; border: 1px solid #e0e0e0; overflow: hidden; } .files-list-header { display: grid; grid-template-columns: 1fr 120px 130px 140px 80px; padding: 12px 20px; font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; background: #fafafa; border-bottom: 1px solid #e0e0e0; } .files-list-item { display: grid; grid-template-columns: 1fr 120px 130px 140px 80px; padding: 14px 20px; align-items: center; border-bottom: 1px solid #f0f0f0; cursor: pointer; transition: background 0.15s; } .files-list-item:last-child { border-bottom: none; } .files-list-item:hover { background: #f5f8ff; } .files-col-name { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-primary); font-weight: 500; min-width: 0; } .files-item-icon { flex-shrink: 0; } .files-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .files-col-date { font-size: 13px; color: var(--text-secondary); } .files-col-actions { display: flex; gap: 4px; justify-content: flex-end; } .files-action-btn { width: 32px; height: 32px; border: none; border-radius: 6px; background: transparent; color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.15s; } .files-action-btn:hover { background: #e8eaed; color: var(--text-primary); } .files-action-delete:hover { background: #fce8e6; color: var(--danger); } .files-rename-input { border: none; border-bottom: 2px solid var(--accent); font-size: 14px; font-family: var(--font-family); padding: 2px 4px; outline: none; width: 100%; min-width: 0; background: transparent; } /* Empty state */ .files-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 64px 24px; color: var(--text-secondary); gap: 12px; } .files-empty p { font-size: 16px; font-weight: 500; } .files-empty-hint { font-size: 13px !important; font-weight: 400 !important; color: #999; } .files-total-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #e8eaed; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-left: 8px; } .files-section-header { display: flex; align-items: center; margin-bottom: 16px; } .files-list-loading { opacity: 0.5; pointer-events: none; transition: opacity 0.2s; } /* Pagination */ .files-pagination { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 16px 0; } .files-pagination-btn { display: flex; align-items: center; gap: 6px; padding: 8px 16px; border: 1px solid #e0e0e0; border-radius: 8px; background: white; font-size: 13px; font-weight: 500; font-family: var(--font-family); color: var(--text-primary); cursor: pointer; transition: all 0.15s; } .files-pagination-btn:hover:not(:disabled) { background: #f5f8ff; border-color: var(--accent); color: var(--accent); } .files-pagination-btn:disabled { opacity: 0.4; cursor: default; } .files-pagination-info { font-size: 13px; color: var(--text-secondary); font-weight: 500; min-width: 60px; text-align: center; } /* =================== Spreadsheet Page top bar =================== */ .spreadsheet-topbar { display: flex; align-items: center; gap: 8px; padding: 4px 12px; background: #217346; color: white; height: 36px; flex-shrink: 0; } .back-btn { width: 28px; height: 28px; border: none; border-radius: 6px; background: rgba(255,255,255,0.15); color: white; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.15s; } .back-btn:hover { background: rgba(255,255,255,0.3); } .spreadsheet-topbar { justify-content: flex-start; } .spreadsheet-file-name { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; } .spreadsheet-avatars { display: flex; align-items: center; flex-shrink: 0; } .spreadsheet-avatars .spreadsheet-user-avatar { margin-left: -6px; border: 2px solid #217346; } .spreadsheet-avatars .spreadsheet-user-avatar:first-child { margin-left: 0; } .spreadsheet-user-avatar { width: 28px; height: 28px; border-radius: 50%; background: rgba(255, 255, 255, 0.2); color: white; font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; cursor: default; user-select: none; } .spreadsheet-user-avatar.owner { background: rgba(255, 255, 255, 0.3); z-index: 1; } .spreadsheet-user-avatar.shared { background: rgba(255, 255, 255, 0.15); font-size: 11px; } /* Not found */ .spreadsheet-not-found { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; gap: 16px; color: var(--text-primary); } .spreadsheet-not-found h2 { font-size: 24px; } .spreadsheet-not-found p { color: var(--text-secondary); } .spreadsheet-not-found button { padding: 10px 24px; border: none; border-radius: 8px; background: #217346; color: white; font-size: 14px; font-family: var(--font-family); cursor: pointer; transition: background 0.15s; } .spreadsheet-not-found button:hover { background: #1a5c38; } /* =================== Cell links =================== */ .grid-cell.has-link .cell-text { color: #1a73e8; text-decoration: underline; cursor: pointer; } .cell-rich-text { display: inline; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word; width: 100%; line-height: 1.4; } .cell-rich-link { color: #1a73e8; text-decoration: underline; cursor: pointer; } .grid-cell.editing a { color: #1a73e8; text-decoration: underline; } .grid-cell.editing [contenteditable]:focus { outline: none; } /* =================== Link Dialog =================== */ .link-dialog-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); display: flex; align-items: center; justify-content: center; z-index: 1000; } .link-dialog { background: white; border-radius: 12px; padding: 24px; width: 420px; max-width: 90vw; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2); font-family: var(--font-family); } .link-dialog-title { font-size: 18px; font-weight: 600; color: var(--text-primary); margin-bottom: 20px; } .link-dialog-field { margin-bottom: 16px; } .link-dialog-field label { display: block; font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; } .link-dialog-input { width: 100%; padding: 8px 12px; border: 1px solid var(--border-color); border-radius: 6px; font-size: 14px; font-family: var(--font-family); outline: none; transition: border-color 0.15s; } .link-dialog-input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.15); } .link-dialog-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 24px; gap: 8px; } .link-dialog-actions-right { display: flex; gap: 8px; margin-left: auto; } .link-dialog-btn { padding: 8px 18px; border: none; border-radius: 6px; font-size: 13px; font-weight: 500; font-family: var(--font-family); cursor: pointer; transition: all 0.15s; } .link-dialog-btn-primary { background: var(--accent); color: white; } .link-dialog-btn-primary:hover:not(:disabled) { background: var(--accent-hover); } .link-dialog-btn-primary:disabled { opacity: 0.5; cursor: default; } .link-dialog-btn-secondary { background: #f1f3f4; color: var(--text-primary); } .link-dialog-btn-secondary:hover { background: #e0e2e3; } .link-dialog-btn-danger { background: transparent; color: var(--danger); } .link-dialog-btn-danger:hover { background: #fce8e6; } /* =================== Auth Page =================== */ .auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #f0faf4 0%, #e8f5e9 50%, #f8f9fa 100%); padding: 24px; } .auth-card { width: 100%; max-width: 400px; background: white; border-radius: 16px; padding: 40px 36px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04); } .auth-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; } .auth-logo h1 { font-size: 24px; font-weight: 700; color: #217346; letter-spacing: -0.5px; } .auth-title { font-size: 20px; font-weight: 600; color: var(--text-primary); margin-bottom: 24px; } .auth-form { display: flex; flex-direction: column; gap: 18px; } .auth-field { display: flex; flex-direction: column; gap: 6px; } .auth-field label { font-size: 13px; font-weight: 500; color: var(--text-secondary); } .auth-input { width: 100%; padding: 10px 14px; border: 1px solid #d0d5dd; border-radius: 8px; font-size: 14px; font-family: var(--font-family); color: var(--text-primary); outline: none; transition: border-color 0.2s, box-shadow 0.2s; background: #fafafa; } .auth-input:focus { border-color: #217346; box-shadow: 0 0 0 3px rgba(33, 115, 70, 0.12); background: white; } .auth-input::placeholder { color: #a0a0a0; } .auth-error { padding: 10px 14px; background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; color: #dc2626; font-size: 13px; line-height: 1.4; } .auth-submit { width: 100%; padding: 12px; border: none; border-radius: 8px; background: #217346; color: white; font-size: 15px; font-weight: 600; font-family: var(--font-family); cursor: pointer; transition: background 0.2s, transform 0.1s; margin-top: 4px; } .auth-submit:hover:not(:disabled) { background: #1a5c38; } .auth-submit:active:not(:disabled) { transform: scale(0.98); } .auth-submit:disabled { opacity: 0.6; cursor: default; } .auth-switch { text-align: center; margin-top: 24px; font-size: 13px; color: var(--text-secondary); } .auth-switch-btn { background: none; border: none; color: #217346; font-weight: 600; font-size: 13px; font-family: var(--font-family); cursor: pointer; text-decoration: underline; padding: 0; } .auth-switch-btn:hover { color: #1a5c38; } /* =================== Files page: owner column, public badge =================== */ .files-col-owner { font-size: 13px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .files-col-role { font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 4px; width: fit-content; white-space: nowrap; } .files-role-owner { color: #217346; background: #e8f5e9; } .files-role-edit { color: #1565c0; background: #e3f2fd; } .files-role-read { color: #e65100; background: #fff3e0; } .files-role-view { color: #757575; background: #f5f5f5; } .files-public-badge { display: inline-flex; align-items: center; color: #217346; margin-left: 4px; flex-shrink: 0; } /* =================== Spreadsheet topbar extras =================== */ .spreadsheet-readonly-badge { padding: 2px 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.15); color: rgba(255, 255, 255, 0.8); font-size: 11px; font-weight: 500; flex-shrink: 0; } .spreadsheet-share-btn { display: flex; align-items: center; gap: 5px; padding: 4px 12px; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 6px; background: rgba(255, 255, 255, 0.1); color: white; font-size: 12px; font-weight: 500; font-family: var(--font-family); cursor: pointer; transition: all 0.15s; flex-shrink: 0; } .spreadsheet-share-btn:hover { background: rgba(255, 255, 255, 0.2); border-color: rgba(255, 255, 255, 0.5); } /* =================== Cells loading indicator =================== */ .cells-loading-indicator { position: fixed; bottom: 16px; right: 16px; display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: 8px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); font-size: 12px; color: var(--text-secondary); z-index: 500; } .cells-loading-spinner { width: 16px; height: 16px; border: 2px solid var(--border-color); border-top-color: var(--accent); border-radius: 50%; animation: cells-loading-spin 0.7s linear infinite; } @keyframes cells-loading-spin { to { transform: rotate(360deg); } } /* =================== Share Dialog =================== */ .share-dialog-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); display: flex; align-items: center; justify-content: center; z-index: 1000; } .share-dialog { background: white; border-radius: 12px; padding: 24px; width: 480px; max-width: 90vw; max-height: 80vh; overflow-y: auto; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2); font-family: var(--font-family); } .share-dialog-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; } .share-dialog-header h3 { font-size: 18px; font-weight: 600; color: var(--text-primary); } .share-dialog-close { width: 28px; height: 28px; border: none; border-radius: 6px; background: transparent; color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.15s; } .share-dialog-close:hover { background: #f0f0f0; color: var(--text-primary); } .share-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; } .share-toggle-info { display: flex; flex-direction: column; gap: 2px; } .share-toggle-label { font-size: 14px; font-weight: 500; color: var(--text-primary); } .share-toggle-hint { font-size: 12px; color: var(--text-secondary); } .share-toggle-btn { position: relative; width: 44px; height: 24px; border: none; border-radius: 12px; background: #d0d5dd; cursor: pointer; transition: background 0.2s; flex-shrink: 0; padding: 0; } .share-toggle-btn.active { background: #217346; } .share-toggle-knob { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform 0.2s; } .share-toggle-btn.active .share-toggle-knob { transform: translateX(20px); } .share-separator { height: 1px; background: #e0e0e0; margin: 16px 0; } .share-grant-section h4 { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 10px; } .share-grant-row { display: flex; gap: 8px; } .share-search-wrapper { flex: 1; position: relative; min-width: 0; } .share-grant-input { width: 100%; padding: 8px 30px 8px 12px; border: 1px solid #d0d5dd; border-radius: 6px; font-size: 13px; font-family: var(--font-family); outline: none; transition: border-color 0.15s; } .share-grant-input:focus { border-color: #217346; } .share-search-chevron { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border: none; border-radius: 4px; background: transparent; color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: color 0.15s, transform 0.15s; } .share-search-chevron:hover { color: var(--text-primary); } .share-search-chevron.open svg { transform: rotate(180deg); } .share-search-dropdown { position: fixed; background: white; border: 1px solid #d0d5dd; border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16); z-index: 2000; max-height: 240px; overflow-y: auto; padding: 4px 0; } .share-search-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 12px; border: none; background: none; text-align: left; font-size: 13px; font-family: var(--font-family); color: var(--text-primary); cursor: pointer; transition: background 0.1s; } .share-search-item:hover, .share-search-item.highlighted { background: rgba(26, 115, 232, 0.08); } .share-search-item-avatar { width: 24px; height: 24px; border-radius: 50%; background: #e8eaed; color: var(--text-secondary); font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; } .share-search-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .share-grant-select { padding: 8px 10px; border: 1px solid #d0d5dd; border-radius: 6px; font-size: 13px; font-family: var(--font-family); background: white; cursor: pointer; outline: none; } /* =================== SearchableDropdown & SelectDropdown =================== */ .searchable-dropdown-wrapper, .select-dropdown-wrapper { position: relative; flex: 1; min-width: 0; } .searchable-dropdown-input { width: 100%; padding: 8px 30px 8px 12px; border: 1px solid #d0d5dd; border-radius: 6px; font-size: 13px; font-family: var(--font-family); outline: none; transition: border-color 0.15s; background: white; } .searchable-dropdown-wrapper:has(.searchable-dropdown-clear) .searchable-dropdown-input { padding-right: 56px; } .searchable-dropdown-input:focus { border-color: #217346; } .searchable-dropdown-clear { position: absolute; right: 22px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border: none; border-radius: 4px; background: transparent; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: color 0.15s; } .searchable-dropdown-clear:hover { color: var(--text-primary); } .searchable-dropdown-chevron { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border: none; border-radius: 4px; background: transparent; color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: color 0.15s, transform 0.15s; } .searchable-dropdown-chevron:hover { color: var(--text-primary); } .searchable-dropdown-chevron.open svg { transform: rotate(180deg); } .searchable-dropdown-list { position: fixed; background: white; border: 1px solid #d0d5dd; border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16); z-index: 2000; max-height: 240px; overflow-y: auto; padding: 4px 0; } .searchable-dropdown-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 12px; border: none; background: none; text-align: left; font-size: 13px; font-family: var(--font-family); color: var(--text-primary); cursor: pointer; transition: background 0.1s; } .searchable-dropdown-item:hover, .searchable-dropdown-item.highlighted { background: rgba(26, 115, 232, 0.08); } .select-dropdown-wrapper .searchable-dropdown-chevron { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); } .select-dropdown-trigger { width: 100%; padding: 8px 30px 8px 12px; border: 1px solid #d0d5dd; border-radius: 6px; font-size: 13px; font-family: var(--font-family); background: white; color: var(--text-primary); cursor: pointer; outline: none; text-align: left; transition: border-color 0.15s; } .select-dropdown-trigger:hover { border-color: #b0b5bb; } .select-dropdown-trigger:focus { border-color: #217346; } .select-dropdown-placeholder { color: var(--text-secondary); } .share-grant-select-wrap { flex: 0 0 auto; min-width: 140px; } .share-grant-btn { padding: 8px 16px; border: none; border-radius: 6px; background: #217346; color: white; font-size: 13px; font-weight: 500; font-family: var(--font-family); cursor: pointer; transition: background 0.15s; white-space: nowrap; } .share-grant-btn:hover:not(:disabled) { background: #1a5c38; } .share-grant-btn:disabled { opacity: 0.5; cursor: default; } .share-error { padding: 8px 12px; background: #fef2f2; border: 1px solid #fecaca; border-radius: 6px; color: #dc2626; font-size: 13px; margin-top: 10px; } .share-permissions-list h4 { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 10px; } .share-permission-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f0f0f0; } .share-permission-item:last-child { border-bottom: none; } .share-permission-user { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; } .share-permission-avatar { width: 28px; height: 28px; border-radius: 50%; background: #e8eaed; color: var(--text-secondary); font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; } .share-permission-username { font-size: 13px; font-weight: 500; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .share-permission-level { font-size: 12px; color: var(--text-secondary); flex-shrink: 0; } .share-permission-revoke { width: 28px; height: 28px; border: none; border-radius: 6px; background: transparent; color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.15s; flex-shrink: 0; } .share-permission-revoke:hover { background: #fce8e6; color: var(--danger); } .share-readonly-info { padding: 16px 0; color: var(--text-secondary); font-size: 14px; } /* =================== Comment Panel =================== */ .comment-panel { position: absolute; width: 320px; background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: 8px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15); display: flex; flex-direction: column; z-index: 1000; animation: comment-panel-in 0.15s ease-out; } @keyframes comment-panel-in { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: translateX(0); } } .comment-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border-color); flex-shrink: 0; } .comment-panel-title { font-size: 13px; font-weight: 600; color: var(--text-primary); } .comment-panel-close { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: none; background: transparent; border-radius: 4px; color: var(--text-secondary); cursor: pointer; } .comment-panel-close:hover { background: rgba(0, 0, 0, 0.06); color: var(--text-primary); } .comment-panel-body { flex: 1; overflow-y: auto; padding: 12px 16px; } .comment-empty { text-align: center; color: var(--text-secondary); font-size: 13px; padding: 20px 0; } .comment-item { margin-bottom: 12px; } .comment-item:last-child { margin-bottom: 0; } .comment-reply { margin-left: 28px; padding-left: 12px; border-left: 2px solid var(--border-color); } .comment-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; } .comment-avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: white; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; flex-shrink: 0; } .comment-meta { display: flex; flex-direction: column; flex: 1; min-width: 0; } .comment-author { font-size: 12px; font-weight: 600; color: var(--text-primary); line-height: 1.2; } .comment-date { font-size: 10px; color: var(--text-secondary); } .comment-actions { display: flex; gap: 2px; opacity: 0; transition: opacity 0.15s; } .comment-item:hover > .comment-header > .comment-actions { opacity: 1; } .comment-action-btn { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: none; background: transparent; border-radius: 4px; color: var(--text-secondary); cursor: pointer; } .comment-action-btn:hover { background: rgba(0, 0, 0, 0.06); color: var(--text-primary); } .comment-action-delete:hover { color: #d32f2f; } .comment-text { font-size: 13px; color: var(--text-primary); line-height: 1.5; white-space: pre-wrap; word-break: break-word; padding-left: 32px; } .comment-reply-btn { border: none; background: transparent; color: var(--accent); font-size: 12px; cursor: pointer; padding: 2px 0; margin-left: 32px; margin-top: 2px; } .comment-reply-btn:hover { text-decoration: underline; } .comment-replies { margin-top: 8px; } .comment-reply-area, .comment-edit-area { margin-top: 8px; padding-left: 32px; } .comment-textarea { width: 100%; border: 1px solid var(--border-color); border-radius: 6px; padding: 8px 10px; font-size: 13px; font-family: inherit; resize: vertical; outline: none; min-height: 40px; box-sizing: border-box; } .comment-textarea:focus { border-color: var(--accent); } .comment-edit-btns { display: flex; gap: 6px; margin-top: 6px; } .comment-btn { border: 1px solid var(--border-color); background: var(--bg-primary); border-radius: 4px; padding: 4px 12px; font-size: 12px; cursor: pointer; color: var(--text-primary); } .comment-btn:hover { background: var(--bg-secondary); } .comment-btn-primary { background: var(--accent); color: white; border-color: var(--accent); } .comment-btn-primary:hover { background: #1a6637; } .comment-btn-primary:disabled { opacity: 0.5; cursor: default; } .comment-panel-footer { padding: 12px 16px; border-top: 1px solid var(--border-color); flex-shrink: 0; } .comment-send-btn { margin-top: 6px; width: 100%; } /* Comment indicator on cells */ .cell-comment-indicator { position: absolute; top: 0; right: 0; width: 0; height: 0; border-left: 6px solid transparent; border-top: 6px solid #f57c00; pointer-events: none; z-index: 1; } .grid-cell.comment-highlight { background-color: #fff8e1 !important; }