site.css 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506
  1. :root {
  2. --control-bar-height: 44px;
  3. }
  4. /* html (not body) is the actual scrolling element on desktop, so the
  5. reserved space for the fixed control bar belongs on it: that's the
  6. ancestor position:sticky measures its offsets against. */
  7. html {
  8. padding-bottom: var(--control-bar-height);
  9. }
  10. body {
  11. font-family: 'Helvetica Neue', Verdana, Helvetica, Arial, sans-serif;
  12. max-width: 600px;
  13. margin: 0;
  14. -webkit-font-smoothing: antialiased;
  15. font-size: 1.125em;
  16. color: #333;
  17. line-height: 1.5em;
  18. }
  19. /* On narrow screens, contain scroll to the sheet area so position:fixed
  20. stays anchored to the viewport rather than the document bottom. */
  21. @media (max-width: 767px) {
  22. html, body {
  23. height: 100%;
  24. overflow: hidden;
  25. padding-bottom: 0; /* .sheet-container becomes the scrolling ancestor instead; see below */
  26. }
  27. #app {
  28. height: 100%;
  29. display: flex;
  30. flex-direction: column;
  31. }
  32. #main-layout {
  33. flex: 1;
  34. display: flex;
  35. flex-direction: column;
  36. min-height: 0;
  37. }
  38. .sheet-container {
  39. flex: 1;
  40. overflow: auto;
  41. min-height: 0;
  42. padding-bottom: var(--control-bar-height);
  43. }
  44. }
  45. h1, h2, h3 {
  46. color: #000;
  47. }
  48. h1 {
  49. font-size: 2.5em
  50. }
  51. h2 {
  52. font-size: 2em
  53. }
  54. h3 {
  55. font-size: 1.5em
  56. }
  57. a {
  58. text-decoration: none;
  59. color: #09f;
  60. }
  61. a:hover {
  62. text-decoration: underline;
  63. }
  64. #main-table {
  65. /*position: fixed;
  66. top: 0;
  67. left: 0;*/
  68. }
  69. table {
  70. border-collapse: separate;
  71. border-spacing: 0;
  72. border-top: 1px solid black;
  73. border-left: 1px solid black;
  74. }
  75. td, th {
  76. border-right: 1px solid black;
  77. border-bottom: 1px solid black;
  78. padding: 0;
  79. }
  80. /* Sticky column headers (top row) */
  81. #main-table tr:first-child th {
  82. position: sticky;
  83. top: 0;
  84. z-index: 1;
  85. background: white;
  86. }
  87. /* Sticky row headers (left column) */
  88. #main-table tr:not(:first-child) th {
  89. position: sticky;
  90. left: 0;
  91. z-index: 1;
  92. background: white;
  93. }
  94. /* Corner cell: sticky in both directions */
  95. #main-table tr:first-child th:first-child {
  96. left: 0;
  97. z-index: 2;
  98. }
  99. /* Totals row: pinned to the bottom of the viewport, just above the control bar.
  100. bottom:0 rests it flush against the scrolling ancestor's own reserved
  101. padding-bottom (html on desktop, .sheet-container on mobile) - deliberately
  102. not an explicit --control-bar-height offset here, so the space is only
  103. ever accounted for once. */
  104. #main-table .totals-row th,
  105. #main-table .totals-row td {
  106. position: sticky;
  107. bottom: 0;
  108. z-index: 1;
  109. background: #e8edf5;
  110. border-top: 2px solid #333;
  111. }
  112. /* Bottom-left corner: sticky in both directions, like the top-left corner cell */
  113. #main-table .totals-row th:first-child {
  114. z-index: 2;
  115. }
  116. .totals-row td {
  117. padding: 5px;
  118. text-align: right;
  119. font-weight: 600;
  120. }
  121. .totals-row .totals-error {
  122. color: #b00020;
  123. }
  124. /* Totals row header cell: click to cycle sum / average / both */
  125. #main-table .totals-row th.totals-toggle {
  126. cursor: pointer;
  127. }
  128. #main-table .totals-row th.totals-toggle:hover {
  129. background: #dde5f0;
  130. }
  131. /* "Both" mode: sum and average stacked in smaller font */
  132. .totals-row--both td {
  133. font-size: 0.75em;
  134. }
  135. .totals-row--both .totals-value {
  136. line-height: 1.3;
  137. }
  138. th {
  139. text-align: center;
  140. min-width: 40px;
  141. }
  142. td {
  143. text-align: right;
  144. position: relative;
  145. }
  146. td input.highlighted {
  147. background-color: lightblue;
  148. }
  149. td input {
  150. border: none;
  151. padding: 5px;
  152. width: 80px;
  153. }
  154. td input:hover {
  155. background-color: #ccc;
  156. }
  157. td input:focus {
  158. background-color: #ccf;
  159. }
  160. td input:not(:focus) {
  161. text-align: right;
  162. }
  163. /* ── Control bar ── */
  164. #control-bar {
  165. position: fixed;
  166. bottom: 0;
  167. left: 0;
  168. right: 0;
  169. height: var(--control-bar-height);
  170. display: flex;
  171. align-items: center;
  172. background: #f5f5f5;
  173. border-top: 1px solid #ccc;
  174. z-index: 999;
  175. }
  176. #bar-logo {
  177. height: var(--control-bar-height);
  178. width: 44px;
  179. flex-shrink: 0;
  180. display: flex;
  181. align-items: center;
  182. justify-content: center;
  183. border-right: 1px solid #ccc;
  184. }
  185. #bar-logo img {
  186. width: 100%;
  187. height: 100%;
  188. }
  189. .bar-btn {
  190. height: 100%;
  191. padding: 0 16px;
  192. border: none;
  193. border-right: 1px solid #ccc;
  194. background: none;
  195. cursor: pointer;
  196. font-size: 0.9em;
  197. color: #333;
  198. }
  199. .bar-btn:hover {
  200. background: #e8e8e8;
  201. }
  202. /* ── About modal ── */
  203. #about-modal-overlay {
  204. position: fixed;
  205. inset: 0;
  206. background: rgba(0, 0, 0, 0.45);
  207. z-index: 1000;
  208. display: flex;
  209. align-items: center;
  210. justify-content: center;
  211. padding: 16px;
  212. }
  213. #about-modal {
  214. background: white;
  215. border-radius: 8px;
  216. padding: 24px;
  217. max-width: 480px;
  218. width: 100%;
  219. max-height: 80vh;
  220. overflow-y: auto;
  221. box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  222. }
  223. #about-modal button {
  224. margin-top: 12px;
  225. padding: 8px 20px;
  226. border: 1px solid #ccc;
  227. border-radius: 4px;
  228. background: #f5f5f5;
  229. cursor: pointer;
  230. }
  231. #about-modal button:hover {
  232. background: #e0e0e0;
  233. }
  234. #active-table-name {
  235. padding: 0 12px;
  236. font-size: 0.85em;
  237. color: #555;
  238. white-space: nowrap;
  239. overflow: hidden;
  240. text-overflow: ellipsis;
  241. max-width: 140px;
  242. }
  243. /* ── Table modal (todo 11.1) ── */
  244. #table-modal-overlay {
  245. position: fixed;
  246. inset: 0;
  247. background: rgba(0, 0, 0, 0.45);
  248. z-index: 1000;
  249. display: flex;
  250. align-items: center;
  251. justify-content: center;
  252. padding: 16px;
  253. }
  254. #table-modal {
  255. background: white;
  256. border-radius: 8px;
  257. padding: 24px;
  258. max-width: 480px;
  259. width: 100%;
  260. max-height: 80vh;
  261. overflow-y: auto;
  262. box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  263. }
  264. .table-modal-tabs {
  265. display: flex;
  266. border-bottom: 1px solid #e0e0e0;
  267. margin-bottom: 12px;
  268. }
  269. .table-tab {
  270. padding: 8px 16px;
  271. border: none;
  272. background: none;
  273. cursor: pointer;
  274. font-size: 0.95em;
  275. color: #666;
  276. border-bottom: 2px solid transparent;
  277. }
  278. .table-tab--active {
  279. color: #333;
  280. border-bottom-color: #09f;
  281. font-weight: 600;
  282. }
  283. .table-modal-empty {
  284. color: #777;
  285. }
  286. .table-list {
  287. display: flex;
  288. flex-direction: column;
  289. gap: 4px;
  290. }
  291. .table-row {
  292. display: flex;
  293. align-items: center;
  294. justify-content: space-between;
  295. border: 1px solid #eee;
  296. border-radius: 6px;
  297. padding: 8px 10px;
  298. }
  299. .table-row--active {
  300. background: #eef6ff;
  301. border-color: #bcdcff;
  302. }
  303. .table-row-main {
  304. flex: 1;
  305. cursor: pointer;
  306. min-width: 0;
  307. }
  308. .table-row-name {
  309. font-weight: 500;
  310. overflow: hidden;
  311. text-overflow: ellipsis;
  312. white-space: nowrap;
  313. }
  314. .table-row-meta {
  315. font-size: 0.75em;
  316. color: #888;
  317. }
  318. .table-row-menu-wrap {
  319. position: relative;
  320. flex-shrink: 0;
  321. }
  322. .icon-btn {
  323. border: none;
  324. background: none;
  325. cursor: pointer;
  326. font-size: 1.1em;
  327. padding: 4px 8px;
  328. color: #555;
  329. }
  330. .icon-btn:hover {
  331. background: #eee;
  332. border-radius: 4px;
  333. }
  334. .table-row-menu {
  335. position: absolute;
  336. right: 0;
  337. top: 100%;
  338. background: white;
  339. border: 1px solid #ccc;
  340. border-radius: 6px;
  341. box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  342. display: flex;
  343. flex-direction: column;
  344. z-index: 1001;
  345. min-width: 100px;
  346. }
  347. .table-row-menu button {
  348. border: none;
  349. background: none;
  350. text-align: left;
  351. padding: 8px 12px;
  352. cursor: pointer;
  353. }
  354. .table-row-menu button:hover {
  355. background: #f0f0f0;
  356. }
  357. .table-row-edit {
  358. display: flex;
  359. align-items: center;
  360. gap: 4px;
  361. width: 100%;
  362. }
  363. .table-row-edit input {
  364. flex: 1;
  365. padding: 6px 8px;
  366. border: 1px solid #ccc;
  367. border-radius: 4px;
  368. }
  369. .table-modal-help p {
  370. margin: 0 0 12px;
  371. }
  372. .table-modal-close {
  373. margin-top: 16px;
  374. padding: 8px 20px;
  375. border: 1px solid #ccc;
  376. border-radius: 4px;
  377. background: #f5f5f5;
  378. cursor: pointer;
  379. }
  380. .table-modal-close:hover {
  381. background: #e0e0e0;
  382. }
  383. /* ── Delete confirmation modal ── */
  384. #table-delete-overlay {
  385. position: fixed;
  386. inset: 0;
  387. background: rgba(0, 0, 0, 0.55);
  388. z-index: 1100;
  389. display: flex;
  390. align-items: center;
  391. justify-content: center;
  392. padding: 16px;
  393. }
  394. #table-delete-modal {
  395. background: white;
  396. border-radius: 8px;
  397. padding: 20px;
  398. max-width: 360px;
  399. width: 100%;
  400. box-shadow: 0 4px 24px rgba(0,0,0,0.25);
  401. }
  402. #table-delete-modal button {
  403. margin-top: 12px;
  404. margin-right: 8px;
  405. padding: 8px 16px;
  406. border: 1px solid #ccc;
  407. border-radius: 4px;
  408. background: #f5f5f5;
  409. cursor: pointer;
  410. }
  411. #table-delete-modal button.danger {
  412. background: #d32f2f;
  413. color: white;
  414. border-color: #d32f2f;
  415. }
  416. #table-delete-modal button:hover {
  417. filter: brightness(0.95);
  418. }
  419. .smartborder {
  420. width: calc(100% + 2px);
  421. height: calc(100% + 2px);
  422. border: 3px solid blue;
  423. position: absolute;
  424. left: -4px;
  425. top: -4px;
  426. background: none;
  427. z-index: 999;
  428. /*pointer-events: none;*/
  429. }
  430. td input:not(:focus) + .smartborder {
  431. visibility: hidden;
  432. }
  433. .smartborder .button {
  434. --button-size: 20px;
  435. --half-button-size: 10px;
  436. /*pointer-events: all;/* TODO check this (what is "initial"?) */
  437. width: var(--button-size);
  438. height: var(--button-size);
  439. background-color: blue;
  440. color: white;
  441. border-radius: var(--half-button-size);
  442. position: absolute;
  443. }
  444. .extendrange.button {
  445. left: 100%;
  446. top: 100%;
  447. }
  448. .fillrange.button {
  449. top: 100%;
  450. left: calc(50% - var(--half-button-size));
  451. }
  452. .moverange.button {
  453. top: calc(50% - var(--half-button-size));
  454. left: calc(0px - var(--button-size));
  455. }
  456. .emptyrange.button {
  457. top: calc(0px - var(--button-size));
  458. left: calc(100% - var(--button-size) - 5px);
  459. }
  460. .deleterange.button {
  461. top: calc(0px - var(--button-size));
  462. left: 100%;
  463. }
  464. .copyrange.button {
  465. top: calc(0px - var(--button-size));
  466. left: 0;
  467. }